diff --git a/CHANGELOG_11.md b/CHANGELOG_11.md new file mode 100644 index 0000000000000000000000000000000000000000..2763d084ebaf38474bb4a6542b9a1cd8d48e29a8 --- /dev/null +++ b/CHANGELOG_11.md @@ -0,0 +1,74 @@ +# Oracle7 11.0 — changelog since 10.3.2 + +11.0 is 10.3.2 plus the 10.5 line: a head that holds back what it can't fully read, a judge that names the step it refused, the part +format, anyone's sealed test, the sleep cycle, and the six orbiters as files in the pack. No language model. + +## What's new + +- **Passage readings are held back when the sentence leaves out a question word.** They're shown, marked as held back, and never stated as + answers. +- **The judge names the step it refused.** When no shape passes, the reply says which word no step reads, and which kind of step is + missing (`step_address.py`, in the head). +- **Parts, version 1.** A part is declared data the format can check: table, formula, alias-set, reading-rule, sensor, example-set or + composite. It's hashed, signed by its author (Ed25519) and carries its own exam, which the format sets a minimum for. + `python oracle7.py part check|submit ` takes a part in, and it joins only by the same exam as any internal part. +- **Anyone's sealed test.** `python oracle7.py exam seal|run`: a question it fails becomes a typed hole. +- **The sleep cycle.** `sleep105.py` runs the roadmap's five steps (replay, consolidation, dreaming, forgetting, morning report) on a day's + ledger. +- **Six orbiters ship as files:** artist, chameleon, deepspace, sensors, trafficcop, vision. `python oracle7.py orbiters` lists them and + what each needs, `orbiters exam ` runs its exam from the pack, and an orbiter missing something says what, while the rest keeps + working. verify, the anchor and update all cover them. + +## Changes to checks + +- The flash score's threshold was relearned: 0.79 to 0.733. +- The flash score no longer depends on the hash seed. In 10.3.2, `program_score` could score the same program differently under + different seeds. +- The owner stage records a witness for the answer it gave. + +## Measured + +- **Gate, 5,128 questions, against 10.3.2:** 0 right answers lost, 0 new wrong, 0 new false yes. 2 false yes removed, 1 newly right. +- **Passage reader:** of 10.3.2's 4 wrong passage answers, the 3 whose sentence left out a question word are now held back, along with + 15 right guesses. 0 new wrong. 1 is left: Great Britain, where the relation is read backwards with every word covered. +- **Judge addresses:** on 400 KQA validation questions, 148 of 148 refusals named their step, and the gate saw 0 status changes. + +## The internal week (run once, published as measured) + +Seven simulated nights: each night is one batch, run back to back on box five, 4–5 Nov. Days were generated by `gen_sealed.py` from a +recorded internal seed (`1d25a74f…`, the sha256 of a fixed phrase and the pre-registration's hash). The anchored run waits on Ben's +signature. Days file sha256 `4dc8eebb…`. + +| | Night 1 | 2 | 3 | 4 | 5 | 6 | 7 | +|---|---|---|---|---|---|---|---| +| Turns | 408 | 408 | 408 | 408 | 408 | 408 | 408 | +| Holes | 272 | 268 | 264 | 285 | 273 | 284 | 277 | +| Filled | 0 | 0 | 0 | 2 | 0 | 0 | 0 | +| Parts admitted | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| New wrong | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +| False yes on controls | 1 | 2 | 1 | 0 | 3 | 0 | 3 | +| Reference (600), right / wrong | 260 / 21 | 260 / 21 | 260 / 21 | 260 / 21 | 260 / 21 | 260 / 21 | 260 / 21 | + +The reference was measured in a fresh process after every night. Night 0 was also 260 / 21. + +| Id | Hypothesis | Result | +|---|---|---| +| H1 | Reach rises | **Not met.** No part was admitted, so reach stayed at 260 of 600 | +| H2 | No new wrong | **Met.** 0 across seven nights | +| H3 | No new false yes | **Not met as written.** 10 false yes on 406 controls. No part changed the head, so all 10 are the 11.0 head's own | +| H4 | Planted bad parts refused | **Not tested in the week**, because none were planted. The part format's own suite refuses every planted bad part (below) | +| H5 | Rebuilt byte for byte | **Not run** | + +What this says: on generated questions, the sleep cycle found 2 fills in 1,923 holes, and neither passed its exam. The holes are +mostly the relate and compare classes, written up in `paper-four-limits/E2_STEP_PARTS.md`: what they need is a step, which the current +fills don't build. The 21 reference wrong answers haven't been traced yet. They're the first item for 11.1, along with the 10 false yes. + +## Hashes + +| | Merkle root | +|---|---| +| oracle7 (full) | `5985f38d66bcdedbdedb74db90432675a32ddce9dfe2d196b3282c40581d889b` | +| oracle7-slim | `e5393079284039405e58b8340d34ffaf6af958fe3448c8273fd6be277546624e` | + +The Solana anchor is Ben's signature, and it's added to RELEASE_HASHES.json when he signs. Until then the published roots above are +what `python oracle7.py verify` checks. diff --git a/RELEASE_HASHES.json b/RELEASE_HASHES.json index 2600c14f6d7e8a92f283cca548c58e26b68931ad..5fc4786db7ac83ff7e1367ec6bdd647ebdbc8f75 100644 --- a/RELEASE_HASHES.json +++ b/RELEASE_HASHES.json @@ -1,16 +1,16 @@ { "format": "oracle7-release-hashes/1", "release": "oracle7", - "version": "10.3.2", - "head": "oracle_release_runtime_w574", - "merkle_root": "414667ae5ed09f15fe0c86897ba533cd90d289a981c2f825418a4cabb9a454b3", + "version": "11.0", + "head": "oracle_release_runtime_w575", + "merkle_root": "5985f38d66bcdedbdedb74db90432675a32ddce9dfe2d196b3282c40581d889b", "parts": { "specialists/_cards": { "sha256": "619ae757757de886c389cf953924f090d0f71ecff02447171381287f9553a2cf", "files": 142 }, "specialists/_gate": { - "sha256": "7b50cd843be5a3a4f8bcbdea3f1958d7d44d24b25380c69f085aba19024cb47b", + "sha256": "bfb54b3ac42dddf09bc980e31d3c106e7f7f6c46fc086cb510175030b93a40e6", "files": 25 }, "specialists/_proved": { @@ -1514,12 +1514,12 @@ "files": 9 }, "core/admitted": { - "sha256": "6e2c6a8039fcc6af2efd8385b119cd45eade4d26115583601f2496d3a13a0d3c", - "files": 371 + "sha256": "c885d72ea1c68bff1a8d76cf33233ee7c4151868478712385a239fc5af932b8c", + "files": 375 }, "workbench": { - "sha256": "2a2e43779f8bc0916082d29669f6174a0a4fb0652164b1e7c50ab2bf88e11cc5", - "files": 238 + "sha256": "36c6fedfccae72694c6dbed4fa7c753c60bf6892a2a0f915921dd887b766bb55", + "files": 246 }, "core/wander-train": { "sha256": "e04d863053d78f488f6b1df944654ee51e01d433bbf78df31f295fa452de0437", @@ -1546,7 +1546,7 @@ "files": 4 }, "oracle7.py": { - "sha256": "1c05ef290e1afca4175057e809d3d7413085f9973e7000df1a92023d0d0eb88f", + "sha256": "27d852467a900dc2e957297e7ed780442f7bef80e1c89c63f89ca433ae04eb92", "files": 1 }, "PACK_MANIFEST.json": { @@ -1570,27 +1570,48 @@ "files": 1 }, "data/fable-content": { - "sha256": "947fbead08fc9adb45c0eed1f4e0db191929a66ad867a59229510d7e8e71847a", - "files": 25 + "sha256": "5841cfdd2eba8dbf827c93b9b18f1053478ff9227531b5fc77fcc50b3e9cf93c", + "files": 24 }, "data/variant": { "sha256": "ce54354b45bf0e54e40e2dff2eaac2591f93b3e07bbff4c55519f870d2695afc", "files": 1 + }, + "orbiters/artist": { + "sha256": "59d15d697bb154ff5b00b9a8a2b4367041ca74b8f112fab1aab50bb080fc84bd", + "files": 21 + }, + "orbiters/chameleon": { + "sha256": "97f7d486bfe981040be61fd20c16465c5c10fe420937904aab6816a8dedce4c6", + "files": 342 + }, + "orbiters/deepspace": { + "sha256": "ffbb3a946d770f1d58d66b10c860239c84c416a50947b3134b248a8248b090fb", + "files": 49 + }, + "orbiters/sensors": { + "sha256": "a11cbe46f5378d71c77dc0d589b122eac806a78f2853b62aa25c10a69883d935", + "files": 14 + }, + "orbiters/trafficcop": { + "sha256": "2cf57df21916f7fe557563c40a38bab881f296dd0c8631d729bbb971781da196", + "files": 19 + }, + "orbiters/vision": { + "sha256": "fe67d90a60cded0c29556808370a3c39848c8790c7704da7349d5065ffe52378", + "files": 29 } }, - "recipe": "workbench/verify.py (recipe v4): part hash = SHA-256 over every file under the part in byte-sorted relative POSIX path order (skipping __pycache__, state, local, *.pyc, *.zst) of path, NUL, the file's SHA-256; leaf = SHA-256('oracle7-part:' + name + ':' + hex); root = binary Merkle tree over leaves in name order, an odd last node carried up. Parts: specialists/, core/admitted, workbench, core/wander-train, core/relstore-routes (top-level .json), organs10/, oracle7.py, PACK_MANIFEST.json (each large store's SHA-256), and (v4) data/, data/relstore-tables (top-level non-.json not in the manifest), data/fable-content (outside self_loop, not in the manifest), data/variant.", + "recipe": "workbench/verify.py (recipe v5): part hash = SHA-256 over every file under the part in byte-sorted relative POSIX path order (skipping __pycache__, state, local, *.pyc, *.zst) of path, NUL, the file's SHA-256; leaf = SHA-256('oracle7-part:' + name + ':' + hex); root = binary Merkle tree over leaves in name order, an odd last node carried up. Parts: specialists/, core/admitted, workbench, core/wander-train, core/relstore-routes (top-level .json), organs10/, oracle7.py, PACK_MANIFEST.json (each large store's SHA-256), and (v4) data/, data/relstore-tables (top-level non-.json not in the manifest), data/fable-content (outside self_loop, not in the manifest), data/variant.", "anchor": { "chain": "solana-mainnet", "program": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr", - "memo": "Oracle7 release 10.3.2 full (w574): ember arlynx's #10 plurals and #11 binomial support, binomial questions reach the statistics specialist in chat; oracle7 merkle 414667ae5ed09f15fe0c86897ba533cd90d289a981c2f825418a4cabb9a454b3. Release test pre-registration v41, run once: 37 of 37 rows, all 9 bars (held-out bars re-measured on the spent v37c/v37d samples). Coverage stage, development: 361 right, 79 wrong of 1428 declines; at its threshold 0.79: 44 right of 46. Recipe: RELEASE_HASHES.json in the repository.", - "signature": "M68CHP4trHGytDSaHGCRABQZWGU972oUxC5fpEXuyShhcpiFRUqEGxbQA6rfSa7DhcPkoZcDPGJcsGRvJuAGimd", - "slot": 464323054, - "block_time_utc": "2026-11-02T02:13:17Z", - "explorer": "https://explorer.solana.com/tx/M68CHP4trHGytDSaHGCRABQZWGU972oUxC5fpEXuyShhcpiFRUqEGxbQA6rfSa7DhcPkoZcDPGJcsGRvJuAGimd" + "memo": "Oracle7 release 11.0 full (w575). oracle7 merkle 5985f38d66bcdedbdedb74db90432675a32ddce9dfe2d196b3282c40581d889b.", + "signature": null }, "supersedes": { - "merkle_root": "c507d7f285fd5b3ec3dae6be453072d30be0416124771b7737889eb64fcb2c96", - "anchor_signature": "2jTgoo4acCK4kecMvxbUtW8cUKZJtY6CzZZBhCBtanZgu16UVeNDZMQ4Xxm3wQbkCj9Ne8VW3stsuGYwWvfqk9SD", - "reason": "release 10.3.2: ember arlynx's #10 (canonical plurals) and #11 (binomial support, whole counts), binomial questions reach the statistics specialist in chat (CHANGELOG_1032.md); slim also carries 10.3's coverage work (CHANGELOG_103.md)" + "merkle_root": "414667ae5ed09f15fe0c86897ba533cd90d289a981c2f825418a4cabb9a454b3", + "anchor_signature": "M68CHP4trHGytDSaHGCRABQZWGU972oUxC5fpEXuyShhcpiFRUqEGxbQA6rfSa7DhcPkoZcDPGJcsGRvJuAGimd", + "reason": "release 10.3.2: ember arlynx's #10 and #11 and the binomial route (CHANGELOG_1032.md)" } } \ No newline at end of file diff --git a/oracle7.py b/oracle7.py index f50c0c1227e06019ad2f191d905c7f122ffc2da5..2b90f874941a0cc75b1923adc4389d088b44660d 100644 --- a/oracle7.py +++ b/oracle7.py @@ -135,7 +135,7 @@ def main(): except ImportError: cli = None if cli is not None and a and a[0] in cli.COMMANDS: - if a[0] not in ("help", "specialists", "card", "systems", "verify", "mine", "new", "example", "scan", "sensor-test", "history"): + if a[0] not in ("orbiters", "vision", "trafficcop", "deepspace", "chameleon", "artist", "help", "specialists", "card", "systems", "verify", "mine", "new", "example", "scan", "sensor-test", "history"): if a[0] == "mcp": # 10.2: stdout carries the MCP protocol, so setup reports on stderr import contextlib with contextlib.redirect_stdout(sys.stderr): diff --git a/orbiters/artist/LICENSE b/orbiters/artist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/orbiters/artist/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/orbiters/artist/README.md b/orbiters/artist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95a81620bc3d3a340fe676892b875bdca58bbdd3 --- /dev/null +++ b/orbiters/artist/README.md @@ -0,0 +1,110 @@ +--- +license: apache-2.0 +library_name: oracle7 +tags: +- oracle7 +- no-neural-network +- text-to-image +- compositional +--- + +> Text-to-image by citation of real COCO instances, self-verified; GenEval-style 50.9% held-out, no generative model. + +# Oracle7-Artist 2.0 (internal) + +**Status:** public release. Prometheus7 Research Institute, 2026-09-25. **Held-out complete: GenEval-style 50.9% (2,212 images, run once).** +**Frozen 2026-09-25 13:35 UTC** (box four `/opt/oracle7-artist/results/HELDOUT_FREEZE.txt`): +- code SHA-256 `000154e2ebf0403c300c98c12da0aa94a7e553e12e07acab12b74086f8acd6c7` (C-locale sorted `artist/*.py` + + `eval/*.py`, v0 copies excluded); +- library index SHA-256 `4b1d83af4ab12424822ce58129fd044283fa77d216bac789784c80f062187f4d` (2,673 sprites, 80 + classes). + +## What it is + +Text-to-image by citation, with no generative model and no learned weights. +1. **Parse.** A prompt is parsed into objects, counts, colours and spatial relations. +2. **Cite.** Every object is a real instance cut from COCO val2017, cited by image id and annotation id. +3. **Lay out.** The layout satisfies counts and relations by construction. +4. **Colour.** It cites a real instance already of the named colour when the library holds one. Otherwise it + recolours an instance, keeping its light and saturation structure. +5. **Verify.** Artist re-measures every clause from its own pixels. + +**The judge is independent of Artist** and shares no code with it. It is OWLv2 (base) queried with all 80 COCO class +names plus CLIP ViT-B/32 for colour, applying GenEval's task rules. It is an **approximation** of the official GenEval +scorer (Mask2Former + CLIP); numbers are "GenEval-style", not official GenEval. Its detection threshold (0.25) was set +by presence F1 on 250 real COCO photographs before library v1 existed. It was then fixed. + +## Protocol + +- **Development:** 120 templated prompts (seed 4242) covering the GenEval task families, excluding every official + prompt. Every library and renderer change was made here. +- **Held-out:** the 553 official GenEval prompts × seeds 0–3, rendered and judged **once**, seed-major. + `results/geneval_heldout.json` is rewritten after each seed and marked `final: true` at the end. + +## Development results (120 prompts, seed 0) + +| Version | Overall | Counting | Two objects | Position | Colours | Colour attribution | +|---|---|---|---|---|---|---| +| v0 (first 40 prompts, thr 0.30) | 39.2% | 75% | 37.5% | 33.3% | 50% | 0% | +| v1 (library filters, own-colour citation) | 45.5% | 68.0% | 58.3% | 52.6% | 48.4% | 0% | +| **v1b, frozen** (texture-keeping recolour, fragmented masks rejected) | **47.7%** | 68.0% | 58.3% | 52.6% | 45.2% | 14.3% | + +Artist's self-verification passes 95–100% of its own images in every task. **The gap between self-verification and the +judge is the finding:** the layout is right by construction, but many composited instances are not recognised as that +object by a detector trained on photographs. + +What changed from v0 to v1b, each change found by looking at dev renders: +- **Occlusion:** occluded instances are dropped (other boxes may cover at most 35% of the instance's box). +- **Legibility:** dark or flat cut-outs are dropped (median value < 0.18, or std < 0.04). +- **Fragmentation:** masks whose largest piece is under 80% of the mask are dropped. +- **Own colour:** a sprite's own colour is recorded only when unambiguous (red, orange, yellow, green, blue, white, + black; saturation ≥ 0.35). +- **Recolour:** it now keeps the object's own light and saturation ratios. The old recolour flattened objects into + blobs. + +## Held-out (official GenEval prompts): complete + +Run once on box four, 2026-09-25 13:35 to 22:33 UTC (32,275 s on 2 CPU cores, no GPU): the 553 official prompts × seeds +0–3 = 2,212 images, judged once. `results/geneval_heldout.json` (`final: true`, SHA-256 +`b792e7906e54171d31ca3e3e5134c6250d481c5e9e44af288dc98f0f4c0cda9e`). The code and library hashes are the frozen ones above. + +| Task | Images | Independent judge | Artist's own self-check | +|---|---|---|---| +| **Overall (GenEval-style)** | **2,212** | **50.9%** | | +| Single object | 320 | 80.6% | 100% | +| Two objects | 396 | 49.2% | 100% | +| Counting | 320 | 55.0% | 91.3% | +| Colours | 376 | 45.7% | 97.1% | +| Position | 400 | 56.0% | 100% | +| Colour attribution | 400 | 19.0% | 92.0% | + +584 of the 2,212 images needed a recoloured instance. Held-out (50.9%) is above the frozen dev figure (47.7%), so the dev +prompts did not overstate it. + +Published GenEval overall scores for generative models (official scorer): SD 1.5 ≈ 43%, SDXL ≈ 55%, SD3 ≈ 68–74%. Artist +uses no generative model and no learned weights, and every object in every image is a cited COCO instance. The judge is +an approximation of the official scorer, so this comparison is indicative only. + +## Failures, stated plainly + +- **Most dev failures are "missing":** the judge does not detect the composited object. Colour attribution is weakest + (14.3%). Two recoloured objects in one image compound the detector's difficulty. +- **Counting fails when an instance overlaps or is cropped** below the detector's confidence (8/25 dev). +- **Thin library classes:** hair drier 1, toaster 2, skis 3, frisbee 5, remote 5, knife 6. +- **Brown, purple and pink objects are always recoloured,** because photographed objects in these hues are read + unreliably (red apples read as pink or purple). +- **Judge calibration overlap:** 67 of the 250 calibration photographs are also cited by the frozen library. The + threshold was chosen on whole-photo detection before that library existed, so this does not favour Artist. It is + disclosed. +- **The judge is not the official GenEval scorer.** Treat comparisons with published GenEval numbers (SD 1.5 ≈ 43%, + SDXL ≈ 55%, SD3 ≈ 68–74%) as indicative only. + +## Reproduce (box four) + +``` +cd /opt/oracle7-artist +judge-venv/bin/python artist/build_library.py coco library +judge-venv/bin/python eval/calibrate_judge.py 250 +judge-venv/bin/python eval/eval_geneval.py dev 120 +judge-venv/bin/python eval/eval_geneval.py heldout +``` diff --git a/orbiters/artist/SHA256SUMS b/orbiters/artist/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..45d043b5a76f325f8b389f4287ae3c044ef380dd --- /dev/null +++ b/orbiters/artist/SHA256SUMS @@ -0,0 +1,17 @@ +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE +de12d1c2f7fb03a564be0ea27afe9e25dd34b9311e9798a367b20e1dee83bef7 README.md +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 artist/__init__.py +c6b4b4cafc386e83a175ca84e550d97c4130a541a310e1fb44ec912141212d84 artist/build_library.py +3a3a9ca37375672717977ebe8596f784e67c68dc0a67d774db8cecb47144b043 artist/build_library_v0.py +455dedbf77176e55d4dde827bbbd06330d15ca6d787ffbdf9b5161ca525cc0ce artist/core.py +6c1d936ea3b2d29a7def575d7a08f01939c70b329ae64292d4c1035c408dc1ab artist/core_v0.py +5b82207b1e7db899f37e2e30d2b12a818652a9b95aee5250d5363c4bc0a92639 eval/calibrate_judge.py +943b967f8689b5e2be049ba119e123541b3979c484f1e05556c3cd5c34bddf23 eval/eval_geneval.py +943b967f8689b5e2be049ba119e123541b3979c484f1e05556c3cd5c34bddf23 eval/eval_geneval.py.next +d9fb544dfc7991d94555106ae89c1cde19a94fe43c611f5081ce6917f9fdbcc0 eval/judge.py +9a10618bbda20d45842fe2515f9e56a7e893cad6d17d13c1b20a13f2814773ed results/HELDOUT_FREEZE.txt +cd5a4fb02f693d0f70806b78672628760604f62a67df4ad86290ddbc5e0c63f1 results/geneval_dev_v0_40.json +e772bba279ba67235e67bdf3d77b132b3e399adf59284fc31712f96ad1a35f56 results/geneval_dev_v1a_120.json +6aaefda454d12091116d89d41f8083f7fddbb0409552c1192dbfd2265084871c results/geneval_dev_v1b_120.json +b792e7906e54171d31ca3e3e5134c6250d481c5e9e44af288dc98f0f4c0cda9e results/geneval_heldout.json +af261174cfec930988a17df7f835df4adb1238b9b645646916693181281e40d3 results/judge_calibration.json diff --git a/orbiters/artist/artist/__init__.py b/orbiters/artist/artist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/orbiters/artist/artist/build_library.py b/orbiters/artist/artist/build_library.py new file mode 100644 index 0000000000000000000000000000000000000000..f9f2f3c594488bdbf6f63084eedb0f1e80d7e744 --- /dev/null +++ b/orbiters/artist/artist/build_library.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 +"""Build the Artist instance library from COCO val2017: for each of the 80 classes, the largest, least truncated, +least occluded, legible non-crowd instance masks, cut out as RGBA sprites. Each sprite cites its COCO image id and +annotation id, and records its OWN colour (Vision's HSV reading) so a colour prompt can cite a real instance of that +colour instead of recolouring one. +v1 (dev renders 2026-09-25): v0 kept occluded and dark cut-outs (a "dining table" that was a patch of tabletop under +bananas, a cat in shadow) and recoloured every coloured object (a glass cup became a flat yellow blob). +usage: build_library.py """ +import json +import os +import sys + +import numpy as np +from scipy import ndimage + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from artist.core import named_color # noqa: E402 +from PIL import Image, ImageDraw + +coco, out = sys.argv[1], sys.argv[2] +ann = json.load(open(os.path.join(coco, "annotations", "instances_val2017.json"))) +cats = {c["id"]: c["name"] for c in ann["categories"]} +imgs = {i["id"]: i for i in ann["images"]} +API_TO_OURS = {"mouse": "computer mouse", "keyboard": "computer keyboard"} +by = {} +boxes_of = {} +for a in ann["annotations"]: + boxes_of.setdefault(a["image_id"], []).append((a["id"], a["bbox"])) + + +def occlusion(a): + """fraction of this instance's box covered by the boxes of OTHER instances in the same photo""" + x, y, w, h = a["bbox"] + cov = np.zeros((max(1, int(h)), max(1, int(w))), bool) + for oid, (ox, oy, ow, oh) in boxes_of[a["image_id"]]: + if oid == a["id"]: + continue + x0, y0 = int(max(0, ox - x)), int(max(0, oy - y)) + x1, y1 = int(min(w, ox + ow - x)), int(min(h, oy + oh - y)) + if x1 > x0 and y1 > y0: + cov[y0:y1, x0:x1] = True + return cov.mean() + + +for a in ann["annotations"]: + if a["iscrowd"] or not isinstance(a["segmentation"], list): + continue + im = imgs[a["image_id"]] + x, y, w, h = a["bbox"] + if w * h < 3500 or x < 3 or y < 3 or x + w > im["width"] - 3 or y + h > im["height"] - 3: + continue # too small, or touching the frame (probably truncated) + solidity = a["area"] / (w * h) + if solidity < 0.25: + continue + name = API_TO_OURS.get(cats[a["category_id"]], cats[a["category_id"]]) + occ = occlusion(a) + by.setdefault(name, []).append((a["area"] * min(1.0, solidity * 1.5) * (1.0 - occ), a, occ)) +index = {} +os.makedirs(out, exist_ok=True) +for name, lst in sorted(by.items()): + lst.sort(key=lambda t: -t[0]) + clean = [t for t in lst if t[2] <= 0.35] + pool = clean if len(clean) >= 6 else lst # a class whose instances are always overlapped keeps its best + keep = [] + for _, a, occ in pool: + if len(keep) >= 60: + break + im = imgs[a["image_id"]] + src = Image.open(os.path.join(coco, "val2017", im["file_name"])).convert("RGB") + mask = Image.new("L", src.size, 0) + d = ImageDraw.Draw(mask) + for poly in a["segmentation"]: + if len(poly) >= 6: + d.polygon(poly, fill=255) + x, y, w, h = [int(round(v)) for v in a["bbox"]] + crop = src.crop((x, y, x + w, y + h)) + m = mask.crop((x, y, x + w, y + h)) + rgba = crop.copy() + rgba.putalpha(m) + mm = np.asarray(m) > 128 + lab, nlab = ndimage.label(mm) + if nlab > 1 and np.bincount(lab.ravel())[1:].max() < 0.8 * mm.sum(): + continue # fragmented mask (occluded into pieces): not one object + px = np.asarray(crop)[mm] + if len(px) < 200: + continue + v = px.max(axis=1) / 255.0 + if np.median(v) < 0.18 or v.std() < 0.04: + continue # too dark or too flat to read as the object + own = named_color(px.astype(np.float32)) + sat = np.median((px.max(axis=1) - px.min(axis=1)) / np.maximum(px.max(axis=1), 1)) + if own not in ("black", "white") and (sat < 0.35 or np.median(v) < 0.3): + own = None # muted or mixed: no colour claim, recolour when one is asked + if own in ("brown", "purple", "pink"): + own = None # read unreliably from photos (red apples/buses read pink/purple) + s = 320 / max(w, h) + if s < 1: + rgba = rgba.resize((max(1, int(w * s)), max(1, int(h * s))), Image.LANCZOS) + rel = os.path.join(name.replace(" ", "_"), "%d.png" % a["id"]) + os.makedirs(os.path.join(out, os.path.dirname(rel)), exist_ok=True) + rgba.save(os.path.join(out, rel)) + keep.append({"file": rel, "cite": {"coco_image_id": a["image_id"], "coco_annotation_id": a["id"]}, "area": a["area"], + "occlusion": round(float(occ), 3), "color": own}) + index[name] = keep +json.dump(index, open(os.path.join(out, "index.json"), "w"), indent=1) +print("classes %d, sprites %d; thinnest classes: %s" % (len(index), sum(len(v) for v in index.values()), + sorted(((len(v), k) for k, v in index.items()))[:6])) diff --git a/orbiters/artist/artist/build_library_v0.py b/orbiters/artist/artist/build_library_v0.py new file mode 100644 index 0000000000000000000000000000000000000000..f49ccc3df9977d2ed59ff38d5b23a3e3171035ac --- /dev/null +++ b/orbiters/artist/artist/build_library_v0.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +"""Build the Artist instance library from COCO val2017: for each of the 80 classes, the largest, least truncated, +non-crowd instance masks, cut out as RGBA sprites. Each sprite cites its COCO image id and annotation id. +usage: build_library.py """ +import json +import os +import sys + +import numpy as np +from PIL import Image, ImageDraw + +coco, out = sys.argv[1], sys.argv[2] +ann = json.load(open(os.path.join(coco, "annotations", "instances_val2017.json"))) +cats = {c["id"]: c["name"] for c in ann["categories"]} +imgs = {i["id"]: i for i in ann["images"]} +API_TO_OURS = {"mouse": "computer mouse", "keyboard": "computer keyboard"} +by = {} +for a in ann["annotations"]: + if a["iscrowd"] or not isinstance(a["segmentation"], list): + continue + im = imgs[a["image_id"]] + x, y, w, h = a["bbox"] + if w * h < 3500 or x < 3 or y < 3 or x + w > im["width"] - 3 or y + h > im["height"] - 3: + continue # too small, or touching the frame (probably truncated) + solidity = a["area"] / (w * h) + if solidity < 0.25: + continue + name = API_TO_OURS.get(cats[a["category_id"]], cats[a["category_id"]]) + by.setdefault(name, []).append((a["area"] * min(1.0, solidity * 1.5), a)) +index = {} +os.makedirs(out, exist_ok=True) +for name, lst in sorted(by.items()): + lst.sort(key=lambda t: -t[0]) + keep = [] + for _, a in lst[:24]: + im = imgs[a["image_id"]] + src = Image.open(os.path.join(coco, "val2017", im["file_name"])).convert("RGB") + mask = Image.new("L", src.size, 0) + d = ImageDraw.Draw(mask) + for poly in a["segmentation"]: + if len(poly) >= 6: + d.polygon(poly, fill=255) + x, y, w, h = [int(round(v)) for v in a["bbox"]] + crop = src.crop((x, y, x + w, y + h)) + m = mask.crop((x, y, x + w, y + h)) + rgba = crop.copy() + rgba.putalpha(m) + s = 320 / max(w, h) + if s < 1: + rgba = rgba.resize((max(1, int(w * s)), max(1, int(h * s))), Image.LANCZOS) + rel = os.path.join(name.replace(" ", "_"), "%d.png" % a["id"]) + os.makedirs(os.path.join(out, os.path.dirname(rel)), exist_ok=True) + rgba.save(os.path.join(out, rel)) + keep.append({"file": rel, "cite": {"coco_image_id": a["image_id"], "coco_annotation_id": a["id"]}, "area": a["area"]}) + index[name] = keep +json.dump(index, open(os.path.join(out, "index.json"), "w"), indent=1) +print("classes %d, sprites %d; thinnest classes: %s" % (len(index), sum(len(v) for v in index.values()), + sorted(((len(v), k) for k, v in index.items()))[:6])) diff --git a/orbiters/artist/artist/core.py b/orbiters/artist/artist/core.py new file mode 100644 index 0000000000000000000000000000000000000000..624e94f53bb540ac6651554306b79884e578153f --- /dev/null +++ b/orbiters/artist/artist/core.py @@ -0,0 +1,250 @@ +"""oracle7-artist: compositional image synthesis by CITED EXEMPLARS (no learned generator, no learned weights). + +prompt -> specification (objects, counts, colours, one spatial relation) parse() + -> real object instances cut from COCO val2017 with their masks Library (every sprite cites image/annotation) + -> layout that makes counts and relations true by construction layout() + -> recolouring that keeps each object's texture recolor() + -> render on a neutral ground; VERIFY each clause from the pixels render(), verify() +The verifier re-measures colour inside each placed object's mask and the geometry of the placed boxes; a clause it cannot +certify is reported, never hidden. The independent score comes from a separate judge (eval/judge.py), not from here. +""" +from __future__ import annotations + +import colorsys +import json +import os +import random +import re + +import numpy as np +from PIL import Image, ImageDraw, ImageFilter + +COCO = ["person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", + "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", + "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", + "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", + "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", + "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet", + "tv", "laptop", "computer mouse", "remote", "computer keyboard", "cell phone", "microwave", "oven", "toaster", + "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"] +COCO_API_NAME = {"computer mouse": "mouse", "computer keyboard": "keyboard"} # COCO annotation names +IRREGULAR = {"person": "people", "knife": "knives", "mouse": "mice", "sheep": "sheep", "skis": "skis", "scissors": "scissors", + "bus": "buses", "couch": "couches", "sandwich": "sandwiches", "toothbrush": "toothbrushes", "glass": "glasses", + "wine glass": "wine glasses", "bench": "benches", "tv": "tvs", "hair drier": "hair driers", "cell phone": "cell phones", + "potted plant": "potted plants", "dining table": "dining tables", "hot dog": "hot dogs", "teddy bear": "teddy bears"} +NUMS = {"two": 2, "three": 3, "four": 4, "five": 5} +COLORS = {"red": (0, .85, .80), "orange": (28, .90, .92), "yellow": (54, .90, .95), "green": (125, .75, .60), + "blue": (218, .80, .80), "purple": (282, .65, .62), "pink": (330, .45, .95), "brown": (25, .70, .40), + "black": (0, 0.0, 0.10), "white": (0, 0.0, 0.97)} +REL = {"left of": "left", "right of": "right", "above": "above", "below": "below"} +SIZE = 512 + + +def plural(name): + if name in IRREGULAR: + return IRREGULAR[name] + return name + ("es" if name.endswith(("s", "x", "ch", "sh")) else "s") + + +_NAMES = sorted(COCO, key=len, reverse=True) +_PLURALS = {plural(n): n for n in COCO} + + +def _object(phrase): + """'a purple wine glass' / 'three skis' -> {'class','count','color'}""" + p = phrase.strip().lower() + count = 1 + m = re.match(r"^(a|an|one|two|three|four|five)\s+(.*)$", p) + if m: + count = NUMS.get(m.group(1), 1) + p = m.group(2) + color = None + for c in COLORS: + if p.startswith(c + " "): + color, p = c, p[len(c) + 1:] + name = _PLURALS.get(p, p) + if name not in COCO: + for n in _NAMES: + if p.endswith(n) or p.endswith(plural(n)): + name = n + break + if name not in COCO: + raise ValueError("unknown object %r" % phrase) + return {"class": name, "count": count, "color": color} + + +def parse(prompt): + p = prompt.strip().lower() + p = re.sub(r"^a photo of\s+", "", p) + for rel in REL: + if " %s " % rel in p: + a, b = p.split(" %s " % rel, 1) + return {"objects": [_object(a), _object(b)], "relation": (0, REL[rel], 1)} + if " and " in p: + a, b = p.split(" and ", 1) + return {"objects": [_object(a), _object(b)], "relation": None} + return {"objects": [_object(p)], "relation": None} + + +class Library: + """real object instances from COCO val2017: the largest, least truncated masks per class, each with its citation""" + + def __init__(self, root): + self.root = root + self.index = json.load(open(os.path.join(root, "index.json"))) + + def pick(self, cls, rng, k=1, color=None): + """a real instance of the requested colour when the library holds one (cited as is, no recolour); + otherwise the best-ranked instances, to be recoloured""" + items = self.index[cls] + if color: + own = [it for it in items if it.get("color") == color] + if own: + top = own[:max(k, 8)] + return rng.sample(top, k) if len(top) >= k else [rng.choice(top) for _ in range(k)] + top = items[:max(k, 8)] + return rng.sample(top, k) if len(top) >= k else [rng.choice(top) for _ in range(k)] + + def load(self, item): + return Image.open(os.path.join(self.root, item["file"])).convert("RGBA") + + +def recolor(im, color): + """keep the object's luminance texture; move hue/saturation (or value, for black/white) to the named colour""" + a = np.asarray(im).astype(np.float32) / 255.0 + rgb, alpha = a[..., :3], a[..., 3:] + hsv = np.array(np.vectorize(colorsys.rgb_to_hsv)(rgb[..., 0], rgb[..., 1], rgb[..., 2])).transpose(1, 2, 0) + h, s, v = COLORS[color] + lum = hsv[..., 2] + lum_n = (lum - lum.min()) / (lum.max() - lum.min() + 1e-6) + if color == "black": + V = 0.04 + 0.22 * lum_n + S = hsv[..., 1] * 0.15 + H = hsv[..., 0] + elif color == "white": + V = 0.80 + 0.20 * lum_n + S = hsv[..., 1] * 0.08 + H = hsv[..., 0] + else: + # v1: keep the object's own light and saturation STRUCTURE (ratios to its median), move only hue and level. + # v0 forced one saturation and squeezed brightness into 55-100%, which flattened objects into blobs the + # judge's detector no longer recognised (dev color_attr 0/21) + m = alpha[..., 0] > 0.5 + med_v = float(np.median(lum[m])) if m.any() else 0.5 + med_s = float(np.median(hsv[..., 1][m])) if m.any() else 0.5 + V = np.clip(v * (lum / max(med_v, 0.05)) ** 0.8, 0, 1) + S = np.clip(s * (0.7 + 0.3 * hsv[..., 1] / max(med_s, 0.05)), 0, 1) + H = np.full_like(lum, h / 360.0) + out = np.array(np.vectorize(colorsys.hsv_to_rgb)(H, S, V)).transpose(1, 2, 0) + return Image.fromarray((np.concatenate([out, alpha], -1) * 255).astype(np.uint8), "RGBA") + + +def _ground(rng): + top = np.array([rng.randint(205, 235)] * 3, np.float32) + bot = np.array([rng.randint(150, 185)] * 3, np.float32) + t = np.linspace(0, 1, SIZE)[:, None, None] + g = top * (1 - t) + bot * t + g = np.repeat(g, SIZE, axis=1) + np.random.default_rng(rng.randint(0, 1 << 30)).normal(0, 2.0, (SIZE, SIZE, 3)) + return Image.fromarray(np.clip(g, 0, 255).astype(np.uint8), "RGB") + + +def layout(spec): + """boxes (x0, y0, x1, y1) per object instance, making counts and the relation true with clear margins""" + objs = spec["objects"] + rel = spec["relation"] + slots = [] + if rel: + _, r, _ = rel + A = (40, 150, 240, 360) if r in ("left",) else (272, 150, 472, 360) if r == "right" else \ + (146, 20, 366, 230) if r == "above" else (146, 282, 366, 492) + B = {"left": (272, 150, 472, 360), "right": (40, 150, 240, 360), "above": (146, 282, 366, 492), + "below": (146, 20, 366, 230)}[r] + return [[A], [B]] + if len(objs) == 2: + return [[(30, 120, 246, 392)], [(266, 120, 482, 392)]] + n = objs[0]["count"] + if n == 1: + return [[(96, 86, 416, 426)]] + cols = 2 if n == 4 else n + rows = 2 if n == 4 else 1 + w = (SIZE - 40) / cols + hgt = (SIZE - 80) / rows if rows > 1 else 300 + y0 = 40 if rows > 1 else (SIZE - hgt) / 2 + boxes = [] + for i in range(n): + r_, c_ = divmod(i, cols) + boxes.append((int(20 + c_ * w + 8), int(y0 + r_ * hgt + 8), int(20 + (c_ + 1) * w - 8), int(y0 + (r_ + 1) * hgt - 8))) + return [boxes] + + +def _fit(sprite, box): + x0, y0, x1, y1 = box + w, h = sprite.size + s = min((x1 - x0) / w, (y1 - y0) / h) + sp = sprite.resize((max(1, int(w * s)), max(1, int(h * s))), Image.LANCZOS) + return sp, (x0 + (x1 - x0 - sp.size[0]) // 2, y0 + (y1 - y0 - sp.size[1]) // 2) + + +def render(spec, lib, seed=0): + rng = random.Random(seed) + canvas = _ground(rng) + placed = [] + for obj, boxes in zip(spec["objects"], layout(spec)): + items = lib.pick(obj["class"], rng, len(boxes), obj["color"]) + for item, box in zip(items, boxes): + sp = lib.load(item) + if obj["color"] and item.get("color") != obj["color"]: + sp = recolor(sp, obj["color"]) + sp, (x, y) = _fit(sp, box) + shadow = Image.new("RGBA", sp.size, (0, 0, 0, 0)) + shadow.putalpha(sp.split()[3].point(lambda a: int(a * 0.25))) + canvas.paste(shadow.filter(ImageFilter.GaussianBlur(6)), (x + 6, y + 8), shadow.filter(ImageFilter.GaussianBlur(6))) + canvas.paste(sp, (x, y), sp) + placed.append({"class": obj["class"], "color": obj["color"], "box": (x, y, x + sp.size[0], y + sp.size[1]), + "alpha": np.asarray(sp.split()[3]) > 128, "cite": item["cite"], + "recoloured": bool(obj["color"]) and item.get("color") != obj["color"]}) + return canvas, placed + + +def named_color(rgb_pixels): + """nearest named colour of a set of pixels (Vision's HSV reading), for self-verification""" + if len(rgb_pixels) == 0: + return None + hsv = np.array([colorsys.rgb_to_hsv(*(p / 255.0)) for p in rgb_pixels[:: max(1, len(rgb_pixels) // 400)]]) + h, s, v = np.median(hsv[:, 0]), np.median(hsv[:, 1]), np.median(hsv[:, 2]) + if v < 0.22: + return "black" + if s < 0.18 and v > 0.7: + return "white" + best, bd = None, 9 + for name, (ch, cs, cv) in COLORS.items(): + if name in ("black", "white"): + continue + dh = min(abs(h * 360 - ch), 360 - abs(h * 360 - ch)) / 180 + d = dh * 2 + abs(s - cs) * 0.6 + abs(v - cv) * 0.8 + if d < bd: + best, bd = name, d + return best + + +def verify(spec, canvas, placed): + """re-measure every clause from the rendered pixels; returns (all_certified, [clause reports])""" + a = np.asarray(canvas) + rep = [] + for obj in spec["objects"]: + mine = [p for p in placed if p["class"] == obj["class"]] + rep.append({"clause": "%d %s" % (obj["count"], obj["class"]), "ok": len(mine) == obj["count"]}) + if obj["color"]: + for p in mine: + x0, y0, x1, y1 = p["box"] + px = a[y0:y1, x0:x1][p["alpha"]] + got = named_color(px) + rep.append({"clause": "%s %s" % (obj["color"], obj["class"]), "measured": got, "ok": got == obj["color"]}) + if spec["relation"]: + i, r, j = spec["relation"] + A = [p for p in placed if p["class"] == spec["objects"][i]["class"]][0]["box"] + B = [p for p in placed if p["class"] == spec["objects"][j]["class"]][-1]["box"] + ca, cb = ((A[0] + A[2]) / 2, (A[1] + A[3]) / 2), ((B[0] + B[2]) / 2, (B[1] + B[3]) / 2) + ok = {"left": ca[0] < cb[0], "right": ca[0] > cb[0], "above": ca[1] < cb[1], "below": ca[1] > cb[1]}[r] + rep.append({"clause": "%s %s %s" % (spec["objects"][i]["class"], r, spec["objects"][j]["class"]), "ok": ok}) + return all(r["ok"] for r in rep), rep diff --git a/orbiters/artist/artist/core_v0.py b/orbiters/artist/artist/core_v0.py new file mode 100644 index 0000000000000000000000000000000000000000..f47e28abf28f16529f801eafc593f03f0ab15269 --- /dev/null +++ b/orbiters/artist/artist/core_v0.py @@ -0,0 +1,236 @@ +"""oracle7-artist: compositional image synthesis by CITED EXEMPLARS (no learned generator, no learned weights). + +prompt -> specification (objects, counts, colours, one spatial relation) parse() + -> real object instances cut from COCO val2017 with their masks Library (every sprite cites image/annotation) + -> layout that makes counts and relations true by construction layout() + -> recolouring that keeps each object's texture recolor() + -> render on a neutral ground; VERIFY each clause from the pixels render(), verify() +The verifier re-measures colour inside each placed object's mask and the geometry of the placed boxes; a clause it cannot +certify is reported, never hidden. The independent score comes from a separate judge (eval/judge.py), not from here. +""" +from __future__ import annotations + +import colorsys +import json +import os +import random +import re + +import numpy as np +from PIL import Image, ImageDraw, ImageFilter + +COCO = ["person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", + "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", + "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", + "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", + "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", + "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet", + "tv", "laptop", "computer mouse", "remote", "computer keyboard", "cell phone", "microwave", "oven", "toaster", + "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"] +COCO_API_NAME = {"computer mouse": "mouse", "computer keyboard": "keyboard"} # COCO annotation names +IRREGULAR = {"person": "people", "knife": "knives", "mouse": "mice", "sheep": "sheep", "skis": "skis", "scissors": "scissors", + "bus": "buses", "couch": "couches", "sandwich": "sandwiches", "toothbrush": "toothbrushes", "glass": "glasses", + "wine glass": "wine glasses", "bench": "benches", "tv": "tvs", "hair drier": "hair driers", "cell phone": "cell phones", + "potted plant": "potted plants", "dining table": "dining tables", "hot dog": "hot dogs", "teddy bear": "teddy bears"} +NUMS = {"two": 2, "three": 3, "four": 4, "five": 5} +COLORS = {"red": (0, .85, .80), "orange": (28, .90, .92), "yellow": (54, .90, .95), "green": (125, .75, .60), + "blue": (218, .80, .80), "purple": (282, .65, .62), "pink": (330, .45, .95), "brown": (25, .70, .40), + "black": (0, 0.0, 0.10), "white": (0, 0.0, 0.97)} +REL = {"left of": "left", "right of": "right", "above": "above", "below": "below"} +SIZE = 512 + + +def plural(name): + if name in IRREGULAR: + return IRREGULAR[name] + return name + ("es" if name.endswith(("s", "x", "ch", "sh")) else "s") + + +_NAMES = sorted(COCO, key=len, reverse=True) +_PLURALS = {plural(n): n for n in COCO} + + +def _object(phrase): + """'a purple wine glass' / 'three skis' -> {'class','count','color'}""" + p = phrase.strip().lower() + count = 1 + m = re.match(r"^(a|an|one|two|three|four|five)\s+(.*)$", p) + if m: + count = NUMS.get(m.group(1), 1) + p = m.group(2) + color = None + for c in COLORS: + if p.startswith(c + " "): + color, p = c, p[len(c) + 1:] + name = _PLURALS.get(p, p) + if name not in COCO: + for n in _NAMES: + if p.endswith(n) or p.endswith(plural(n)): + name = n + break + if name not in COCO: + raise ValueError("unknown object %r" % phrase) + return {"class": name, "count": count, "color": color} + + +def parse(prompt): + p = prompt.strip().lower() + p = re.sub(r"^a photo of\s+", "", p) + for rel in REL: + if " %s " % rel in p: + a, b = p.split(" %s " % rel, 1) + return {"objects": [_object(a), _object(b)], "relation": (0, REL[rel], 1)} + if " and " in p: + a, b = p.split(" and ", 1) + return {"objects": [_object(a), _object(b)], "relation": None} + return {"objects": [_object(p)], "relation": None} + + +class Library: + """real object instances from COCO val2017: the largest, least truncated masks per class, each with its citation""" + + def __init__(self, root): + self.root = root + self.index = json.load(open(os.path.join(root, "index.json"))) + + def pick(self, cls, rng, k=1): + items = self.index[cls] + top = items[:max(k, 8)] + return rng.sample(top, k) if len(top) >= k else [rng.choice(top) for _ in range(k)] + + def load(self, item): + return Image.open(os.path.join(self.root, item["file"])).convert("RGBA") + + +def recolor(im, color): + """keep the object's luminance texture; move hue/saturation (or value, for black/white) to the named colour""" + a = np.asarray(im).astype(np.float32) / 255.0 + rgb, alpha = a[..., :3], a[..., 3:] + hsv = np.array(np.vectorize(colorsys.rgb_to_hsv)(rgb[..., 0], rgb[..., 1], rgb[..., 2])).transpose(1, 2, 0) + h, s, v = COLORS[color] + lum = hsv[..., 2] + lum_n = (lum - lum.min()) / (lum.max() - lum.min() + 1e-6) + if color == "black": + V = 0.04 + 0.22 * lum_n + S = hsv[..., 1] * 0.15 + H = hsv[..., 0] + elif color == "white": + V = 0.80 + 0.20 * lum_n + S = hsv[..., 1] * 0.08 + H = hsv[..., 0] + else: + V = np.clip(v * (0.55 + 0.45 * lum_n), 0, 1) + S = np.full_like(lum, s) + H = np.full_like(lum, h / 360.0) + out = np.array(np.vectorize(colorsys.hsv_to_rgb)(H, S, V)).transpose(1, 2, 0) + return Image.fromarray((np.concatenate([out, alpha], -1) * 255).astype(np.uint8), "RGBA") + + +def _ground(rng): + top = np.array([rng.randint(205, 235)] * 3, np.float32) + bot = np.array([rng.randint(150, 185)] * 3, np.float32) + t = np.linspace(0, 1, SIZE)[:, None, None] + g = top * (1 - t) + bot * t + g = np.repeat(g, SIZE, axis=1) + np.random.default_rng(rng.randint(0, 1 << 30)).normal(0, 2.0, (SIZE, SIZE, 3)) + return Image.fromarray(np.clip(g, 0, 255).astype(np.uint8), "RGB") + + +def layout(spec): + """boxes (x0, y0, x1, y1) per object instance, making counts and the relation true with clear margins""" + objs = spec["objects"] + rel = spec["relation"] + slots = [] + if rel: + _, r, _ = rel + A = (40, 150, 240, 360) if r in ("left",) else (272, 150, 472, 360) if r == "right" else \ + (146, 20, 366, 230) if r == "above" else (146, 282, 366, 492) + B = {"left": (272, 150, 472, 360), "right": (40, 150, 240, 360), "above": (146, 282, 366, 492), + "below": (146, 20, 366, 230)}[r] + return [[A], [B]] + if len(objs) == 2: + return [[(30, 120, 246, 392)], [(266, 120, 482, 392)]] + n = objs[0]["count"] + if n == 1: + return [[(96, 86, 416, 426)]] + cols = 2 if n == 4 else n + rows = 2 if n == 4 else 1 + w = (SIZE - 40) / cols + hgt = (SIZE - 80) / rows if rows > 1 else 300 + y0 = 40 if rows > 1 else (SIZE - hgt) / 2 + boxes = [] + for i in range(n): + r_, c_ = divmod(i, cols) + boxes.append((int(20 + c_ * w + 8), int(y0 + r_ * hgt + 8), int(20 + (c_ + 1) * w - 8), int(y0 + (r_ + 1) * hgt - 8))) + return [boxes] + + +def _fit(sprite, box): + x0, y0, x1, y1 = box + w, h = sprite.size + s = min((x1 - x0) / w, (y1 - y0) / h) + sp = sprite.resize((max(1, int(w * s)), max(1, int(h * s))), Image.LANCZOS) + return sp, (x0 + (x1 - x0 - sp.size[0]) // 2, y0 + (y1 - y0 - sp.size[1]) // 2) + + +def render(spec, lib, seed=0): + rng = random.Random(seed) + canvas = _ground(rng) + placed = [] + for obj, boxes in zip(spec["objects"], layout(spec)): + items = lib.pick(obj["class"], rng, len(boxes)) + for item, box in zip(items, boxes): + sp = lib.load(item) + if obj["color"]: + sp = recolor(sp, obj["color"]) + sp, (x, y) = _fit(sp, box) + shadow = Image.new("RGBA", sp.size, (0, 0, 0, 0)) + shadow.putalpha(sp.split()[3].point(lambda a: int(a * 0.25))) + canvas.paste(shadow.filter(ImageFilter.GaussianBlur(6)), (x + 6, y + 8), shadow.filter(ImageFilter.GaussianBlur(6))) + canvas.paste(sp, (x, y), sp) + placed.append({"class": obj["class"], "color": obj["color"], "box": (x, y, x + sp.size[0], y + sp.size[1]), + "alpha": np.asarray(sp.split()[3]) > 128, "cite": item["cite"]}) + return canvas, placed + + +def named_color(rgb_pixels): + """nearest named colour of a set of pixels (Vision's HSV reading), for self-verification""" + if len(rgb_pixels) == 0: + return None + hsv = np.array([colorsys.rgb_to_hsv(*(p / 255.0)) for p in rgb_pixels[:: max(1, len(rgb_pixels) // 400)]]) + h, s, v = np.median(hsv[:, 0]), np.median(hsv[:, 1]), np.median(hsv[:, 2]) + if v < 0.22: + return "black" + if s < 0.18 and v > 0.7: + return "white" + best, bd = None, 9 + for name, (ch, cs, cv) in COLORS.items(): + if name in ("black", "white"): + continue + dh = min(abs(h * 360 - ch), 360 - abs(h * 360 - ch)) / 180 + d = dh * 2 + abs(s - cs) * 0.6 + abs(v - cv) * 0.8 + if d < bd: + best, bd = name, d + return best + + +def verify(spec, canvas, placed): + """re-measure every clause from the rendered pixels; returns (all_certified, [clause reports])""" + a = np.asarray(canvas) + rep = [] + for obj in spec["objects"]: + mine = [p for p in placed if p["class"] == obj["class"]] + rep.append({"clause": "%d %s" % (obj["count"], obj["class"]), "ok": len(mine) == obj["count"]}) + if obj["color"]: + for p in mine: + x0, y0, x1, y1 = p["box"] + px = a[y0:y1, x0:x1][p["alpha"]] + got = named_color(px) + rep.append({"clause": "%s %s" % (obj["color"], obj["class"]), "measured": got, "ok": got == obj["color"]}) + if spec["relation"]: + i, r, j = spec["relation"] + A = [p for p in placed if p["class"] == spec["objects"][i]["class"]][0]["box"] + B = [p for p in placed if p["class"] == spec["objects"][j]["class"]][-1]["box"] + ca, cb = ((A[0] + A[2]) / 2, (A[1] + A[3]) / 2), ((B[0] + B[2]) / 2, (B[1] + B[3]) / 2) + ok = {"left": ca[0] < cb[0], "right": ca[0] > cb[0], "above": ca[1] < cb[1], "below": ca[1] > cb[1]}[r] + rep.append({"clause": "%s %s %s" % (spec["objects"][i]["class"], r, spec["objects"][j]["class"]), "ok": ok}) + return all(r["ok"] for r in rep), rep diff --git a/orbiters/artist/eval/calibrate_judge.py b/orbiters/artist/eval/calibrate_judge.py new file mode 100644 index 0000000000000000000000000000000000000000..33c4fd4bf5c98eaa4e9ae0cc3128d54e812f01be --- /dev/null +++ b/orbiters/artist/eval/calibrate_judge.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +"""Calibrate the judge's detection threshold on REAL photographs, independently of Artist: COCO val2017 images that the +Artist library does NOT use, ground-truth class presence from COCO annotations (non-crowd instances of area >= 3000 px). +The threshold with the best presence F1 is written to results/judge_calibration.json and then used unchanged.""" +import json +import os +import random +import sys + +HERE = os.path.dirname(os.path.abspath(__file__)) +ROOT = os.path.dirname(HERE) +sys.path.insert(0, ROOT) +sys.path.insert(0, HERE) +from PIL import Image # noqa: E402 + +import judge as J # noqa: E402 +from artist import core as A # noqa: E402 + +ann = json.load(open(os.path.join(ROOT, "coco", "annotations", "instances_val2017.json"))) +lib = json.load(open(os.path.join(ROOT, "library", "index.json"))) +used = {it["cite"]["coco_image_id"] for v in lib.values() for it in v} +cats = {c["id"]: {"mouse": "computer mouse", "keyboard": "computer keyboard"}.get(c["name"], c["name"]) for c in ann["categories"]} +gt = {} +for a in ann["annotations"]: + if not a["iscrowd"] and a["area"] >= 3000 and a["image_id"] not in used: + gt.setdefault(a["image_id"], set()).add(cats[a["category_id"]]) +imgs = {i["id"]: i["file_name"] for i in ann["images"]} +ids = sorted(gt) +random.Random(11).shuffle(ids) +ids = ids[: int(sys.argv[1]) if len(sys.argv) > 1 else 250] +J.DET_THR = 0.05 +judge = J.Judge(A.COCO) +scores = [] # (image, class, max score or 0, present?) +for n, i in enumerate(ids): + img = Image.open(os.path.join(ROOT, "coco", "val2017", imgs[i])).convert("RGB") + best = {} + for d in judge.detect(img): + best[d["class"]] = max(best.get(d["class"], 0), d["score"]) + for c in A.COCO: + scores.append((best.get(c, 0.0), c in gt[i])) + if (n + 1) % 50 == 0: + print(" %d images" % (n + 1), flush=True) +res = {} +for thr in (0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4): + tp = sum(1 for s, p in scores if s >= thr and p) + fp = sum(1 for s, p in scores if s >= thr and not p) + fn = sum(1 for s, p in scores if s < thr and p) + prec, rec = tp / max(1, tp + fp), tp / max(1, tp + fn) + res[str(thr)] = {"precision": round(prec, 3), "recall": round(rec, 3), "f1": round(2 * prec * rec / max(1e-9, prec + rec), 3)} + print("thr %.2f precision %.3f recall %.3f F1 %.3f" % (thr, prec, rec, res[str(thr)]["f1"])) +best = max(res, key=lambda k: res[k]["f1"]) +out = {"images": len(ids), "excluded_library_images": len(used), "by_threshold": res, "chosen_threshold": float(best)} +json.dump(out, open(os.path.join(ROOT, "results", "judge_calibration.json"), "w"), indent=1) +print("chosen threshold", best) diff --git a/orbiters/artist/eval/eval_geneval.py b/orbiters/artist/eval/eval_geneval.py new file mode 100644 index 0000000000000000000000000000000000000000..dceb18b6147d3971514961054ce50e6e92e150d0 --- /dev/null +++ b/orbiters/artist/eval/eval_geneval.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +"""oracle7-artist on GenEval-style prompts, scored by the independent judge (eval/judge.py). + +PROTOCOL + dev prompts GENERATED from GenEval's six templates with a fixed seed, excluding every exact GenEval prompt; + all Artist choices are made here + held-out the 553 official GenEval prompts (djghosh13/geneval prompts/evaluation_metadata.jsonl), 4 images each + (seeds 0-3), rendered and judged ONCE +Also recorded: Artist's own pixel verification per image, so its self-report can be compared with the judge. +Also run: the judge on real COCO images with known instance counts (a sanity check on the judge, not on Artist). +usage: eval_geneval.py dev|heldout [n_prompts]""" +import json +import os +import random +import sys +import time + +HERE = os.path.dirname(os.path.abspath(__file__)) +ROOT = os.path.dirname(HERE) +sys.path.insert(0, ROOT) +sys.path.insert(0, HERE) +from artist import core as A # noqa: E402 + +GEN = os.path.join(ROOT, "data", "geneval_prompts.jsonl") +NUMW = {2: "two", 3: "three", 4: "four"} + + +def article(w): + return "an" if w[0] in "aeiou" else "a" + + +def dev_prompts(n, official): + rng = random.Random(4242) + out = [] + while len(out) < n: + tag = rng.choice(["single_object", "two_object", "counting", "colors", "position", "color_attr"]) + a, b = rng.sample(A.COCO, 2) + c1, c2 = rng.sample(list(A.COLORS), 2) + if tag == "single_object": + p, inc = "a photo of %s %s" % (article(a), a), [{"class": a, "count": 1}] + elif tag == "two_object": + p, inc = "a photo of %s %s and %s %s" % (article(a), a, article(b), b), [{"class": a, "count": 1}, {"class": b, "count": 1}] + elif tag == "counting": + k = rng.choice([2, 3, 4]) + p, inc = "a photo of %s %s" % (NUMW[k], A.plural(a)), [{"class": a, "count": k}] + elif tag == "colors": + p, inc = "a photo of %s %s %s" % (article(c1), c1, a), [{"class": a, "count": 1, "color": c1}] + elif tag == "position": + rel = rng.choice(["left of", "right of", "above", "below"]) + p = "a photo of %s %s %s %s %s" % (article(a), a, rel, article(b), b) + inc = [{"class": a, "count": 1, "position": [rel, 1]}, {"class": b, "count": 1}] + else: + p = "a photo of %s %s %s and %s %s %s" % (article(c1), c1, a, article(c2), c2, b) + inc = [{"class": a, "count": 1, "color": c1}, {"class": b, "count": 1, "color": c2}] + if p not in official: + out.append({"tag": tag, "include": inc, "prompt": p}) + return out + + +def main(): + split = sys.argv[1] + n = int(sys.argv[2]) if len(sys.argv) > 2 else None + official = [json.loads(l) for l in open(GEN)] + rows = dev_prompts(n or 120, {r["prompt"] for r in official}) if split == "dev" else official[: n or None] + seeds = [0] if split == "dev" else [0, 1, 2, 3] + from judge import Judge + judge = Judge(A.COCO) + lib = A.Library(os.path.join(ROOT, "library")) + outdir = os.path.join(ROOT, "renders", split) + os.makedirs(outdir, exist_ok=True) + per_tag, log = {}, [] + t0 = time.time() + specs = [] + for r in rows: + try: + specs.append((A.parse(r["prompt"]), None)) + except ValueError as e: + specs.append((None, str(e))) + import judge as J + + def summary(done_seeds, final): + tags = {k: {"judge": round(v[0] / v[1], 4), "self_verified": round(v[2] / v[1], 4), "n_images": v[1]} + for k, v in per_tag.items()} + overall = sum(t["judge"] for t in tags.values()) / max(1, len(tags)) # GenEval = mean over the tasks + return {"split": split, "prompts": len(rows), "seeds": seeds, "seeds_done": done_seeds, "final": final, + "geneval_style_overall": round(overall, 4), "by_task": tags, + "recoloured_images": sum(1 for x in log if x.get("recoloured")), + "library": os.path.realpath(lib.root), "library_sprites": sum(len(v) for v in lib.index.values()), + "judge": "OWLv2 base (80 COCO queries, thr %.2f) + CLIP ViT-B/32 colour; approximation of official " + "GenEval" % J.DET_THR, + "seconds": round(time.time() - t0), "log": log} + + os.makedirs(os.path.join(ROOT, "results"), exist_ok=True) + out = os.path.join(ROOT, "results", "geneval_%s.json" % split) + for si, s in enumerate(seeds): # seed-major: every prompt once before any prompt twice + for i, (r, (spec, err)) in enumerate(zip(rows, specs)): + rec = False + if spec is None: + ok, info, selfok = False, {"reason": "parse: " + err}, False + else: + img, placed = A.render(spec, lib, seed=s) + selfok, rep = A.verify(spec, img, placed) + rec = any(p.get("recoloured") for p in placed) + img.save(os.path.join(outdir, "%03d_%d.png" % (i, s))) + ok, info = judge.score(img, r) + e = per_tag.setdefault(r["tag"], [0, 0, 0]) + e[0] += ok + e[1] += 1 + e[2] += selfok + log.append({"i": i, "seed": s, "tag": r["tag"], "prompt": r["prompt"], "judge_ok": ok, "self_verified": selfok, + "recoloured": rec, "reason": info.get("reason")}) + if (i + 1) % 20 == 0: + tot = sum(v[0] for v in per_tag.values()) / sum(v[1] for v in per_tag.values()) + print(" seed %d: %d/%d prompts judge acc %.3f (%.0fs)" % (s, i + 1, len(rows), tot, time.time() - t0), + flush=True) + json.dump(summary(seeds[: si + 1], si == len(seeds) - 1), open(out, "w"), indent=1) # partial after each seed + res = summary(seeds, True) + print(json.dumps({k: v for k, v in res.items() if k != "log"}, indent=1)) + json.dump(res, open(out, "w"), indent=1) + + +if __name__ == "__main__": + main() diff --git a/orbiters/artist/eval/eval_geneval.py.next b/orbiters/artist/eval/eval_geneval.py.next new file mode 100644 index 0000000000000000000000000000000000000000..dceb18b6147d3971514961054ce50e6e92e150d0 --- /dev/null +++ b/orbiters/artist/eval/eval_geneval.py.next @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +"""oracle7-artist on GenEval-style prompts, scored by the independent judge (eval/judge.py). + +PROTOCOL + dev prompts GENERATED from GenEval's six templates with a fixed seed, excluding every exact GenEval prompt; + all Artist choices are made here + held-out the 553 official GenEval prompts (djghosh13/geneval prompts/evaluation_metadata.jsonl), 4 images each + (seeds 0-3), rendered and judged ONCE +Also recorded: Artist's own pixel verification per image, so its self-report can be compared with the judge. +Also run: the judge on real COCO images with known instance counts (a sanity check on the judge, not on Artist). +usage: eval_geneval.py dev|heldout [n_prompts]""" +import json +import os +import random +import sys +import time + +HERE = os.path.dirname(os.path.abspath(__file__)) +ROOT = os.path.dirname(HERE) +sys.path.insert(0, ROOT) +sys.path.insert(0, HERE) +from artist import core as A # noqa: E402 + +GEN = os.path.join(ROOT, "data", "geneval_prompts.jsonl") +NUMW = {2: "two", 3: "three", 4: "four"} + + +def article(w): + return "an" if w[0] in "aeiou" else "a" + + +def dev_prompts(n, official): + rng = random.Random(4242) + out = [] + while len(out) < n: + tag = rng.choice(["single_object", "two_object", "counting", "colors", "position", "color_attr"]) + a, b = rng.sample(A.COCO, 2) + c1, c2 = rng.sample(list(A.COLORS), 2) + if tag == "single_object": + p, inc = "a photo of %s %s" % (article(a), a), [{"class": a, "count": 1}] + elif tag == "two_object": + p, inc = "a photo of %s %s and %s %s" % (article(a), a, article(b), b), [{"class": a, "count": 1}, {"class": b, "count": 1}] + elif tag == "counting": + k = rng.choice([2, 3, 4]) + p, inc = "a photo of %s %s" % (NUMW[k], A.plural(a)), [{"class": a, "count": k}] + elif tag == "colors": + p, inc = "a photo of %s %s %s" % (article(c1), c1, a), [{"class": a, "count": 1, "color": c1}] + elif tag == "position": + rel = rng.choice(["left of", "right of", "above", "below"]) + p = "a photo of %s %s %s %s %s" % (article(a), a, rel, article(b), b) + inc = [{"class": a, "count": 1, "position": [rel, 1]}, {"class": b, "count": 1}] + else: + p = "a photo of %s %s %s and %s %s %s" % (article(c1), c1, a, article(c2), c2, b) + inc = [{"class": a, "count": 1, "color": c1}, {"class": b, "count": 1, "color": c2}] + if p not in official: + out.append({"tag": tag, "include": inc, "prompt": p}) + return out + + +def main(): + split = sys.argv[1] + n = int(sys.argv[2]) if len(sys.argv) > 2 else None + official = [json.loads(l) for l in open(GEN)] + rows = dev_prompts(n or 120, {r["prompt"] for r in official}) if split == "dev" else official[: n or None] + seeds = [0] if split == "dev" else [0, 1, 2, 3] + from judge import Judge + judge = Judge(A.COCO) + lib = A.Library(os.path.join(ROOT, "library")) + outdir = os.path.join(ROOT, "renders", split) + os.makedirs(outdir, exist_ok=True) + per_tag, log = {}, [] + t0 = time.time() + specs = [] + for r in rows: + try: + specs.append((A.parse(r["prompt"]), None)) + except ValueError as e: + specs.append((None, str(e))) + import judge as J + + def summary(done_seeds, final): + tags = {k: {"judge": round(v[0] / v[1], 4), "self_verified": round(v[2] / v[1], 4), "n_images": v[1]} + for k, v in per_tag.items()} + overall = sum(t["judge"] for t in tags.values()) / max(1, len(tags)) # GenEval = mean over the tasks + return {"split": split, "prompts": len(rows), "seeds": seeds, "seeds_done": done_seeds, "final": final, + "geneval_style_overall": round(overall, 4), "by_task": tags, + "recoloured_images": sum(1 for x in log if x.get("recoloured")), + "library": os.path.realpath(lib.root), "library_sprites": sum(len(v) for v in lib.index.values()), + "judge": "OWLv2 base (80 COCO queries, thr %.2f) + CLIP ViT-B/32 colour; approximation of official " + "GenEval" % J.DET_THR, + "seconds": round(time.time() - t0), "log": log} + + os.makedirs(os.path.join(ROOT, "results"), exist_ok=True) + out = os.path.join(ROOT, "results", "geneval_%s.json" % split) + for si, s in enumerate(seeds): # seed-major: every prompt once before any prompt twice + for i, (r, (spec, err)) in enumerate(zip(rows, specs)): + rec = False + if spec is None: + ok, info, selfok = False, {"reason": "parse: " + err}, False + else: + img, placed = A.render(spec, lib, seed=s) + selfok, rep = A.verify(spec, img, placed) + rec = any(p.get("recoloured") for p in placed) + img.save(os.path.join(outdir, "%03d_%d.png" % (i, s))) + ok, info = judge.score(img, r) + e = per_tag.setdefault(r["tag"], [0, 0, 0]) + e[0] += ok + e[1] += 1 + e[2] += selfok + log.append({"i": i, "seed": s, "tag": r["tag"], "prompt": r["prompt"], "judge_ok": ok, "self_verified": selfok, + "recoloured": rec, "reason": info.get("reason")}) + if (i + 1) % 20 == 0: + tot = sum(v[0] for v in per_tag.values()) / sum(v[1] for v in per_tag.values()) + print(" seed %d: %d/%d prompts judge acc %.3f (%.0fs)" % (s, i + 1, len(rows), tot, time.time() - t0), + flush=True) + json.dump(summary(seeds[: si + 1], si == len(seeds) - 1), open(out, "w"), indent=1) # partial after each seed + res = summary(seeds, True) + print(json.dumps({k: v for k, v in res.items() if k != "log"}, indent=1)) + json.dump(res, open(out, "w"), indent=1) + + +if __name__ == "__main__": + main() diff --git a/orbiters/artist/eval/judge.py b/orbiters/artist/eval/judge.py new file mode 100644 index 0000000000000000000000000000000000000000..4197ffdf68ed55a3416962c72e164853bf099baf --- /dev/null +++ b/orbiters/artist/eval/judge.py @@ -0,0 +1,94 @@ +"""Independent judge for GenEval-style prompts (an APPROXIMATION of the official GenEval scorer, which uses +Mask2Former + CLIP): OWLv2 open-vocabulary detection queried with ALL 80 COCO class names (each box takes its best class, +so it behaves as a closed-set detector), CLIP ViT-B/32 for object colour, and GenEval's task rules: + single_object / two_object every required class detected + counting exactly N detections of the class + colors / color_attr required classes detected, and CLIP names the right colour on each (largest) detection + position both detected and the centre of A lies left/right/above/below B by > 10% of the image +Nothing from Artist is shared with the judge: it sees only the rendered image and the prompt's metadata.""" +from __future__ import annotations + +import numpy as np +import torch +from PIL import Image +from transformers import CLIPModel, CLIPProcessor, Owlv2ForObjectDetection, Owlv2Processor + +COLORS = ["red", "orange", "yellow", "green", "blue", "purple", "pink", "brown", "black", "white"] +DET_THR = 0.25 # calibrate_judge.py: best presence F1 on 250 real COCO photos (0.543; 0.30 ties), fixed thereafter +NMS_IOU = 0.5 +POS_MARGIN = 0.10 + + +class Judge: + def __init__(self, classes): + torch.set_num_threads(2) + self.classes = classes + self.dp = Owlv2Processor.from_pretrained("google/owlv2-base-patch16-ensemble") + self.dm = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16-ensemble").eval() + self.cp = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32") + self.cm = CLIPModel.from_pretrained("openai/clip-vit-base-patch32").eval() + self.queries = ["a photo of a %s" % c for c in classes] + + @torch.no_grad() + def detect(self, img): + inp = self.dp(text=[self.queries], images=img, return_tensors="pt") + out = self.dm(**inp) + W, H = img.size + side = max(W, H) # OWLv2 pads to a square: boxes are relative to the padded side + pp = getattr(self.dp, "post_process_grounded_object_detection", None) or self.dp.post_process_object_detection + res = pp(outputs=out, threshold=DET_THR, target_sizes=torch.tensor([[side, side]]))[0] + dets = [{"class": self.classes[int(l)], "score": float(s), "box": [float(v) for v in b]} + for s, l, b in zip(res["scores"], res["labels"], res["boxes"])] + dets.sort(key=lambda d: -d["score"]) + keep = [] + for d in dets: # class-aware NMS + if all(k["class"] != d["class"] or _iou(k["box"], d["box"]) < NMS_IOU for k in keep): + keep.append(d) + return keep + + @torch.no_grad() + def color(self, img, box, cls): + x0, y0, x1, y1 = [int(v) for v in box] + crop = img.crop((max(0, x0), max(0, y0), max(x0 + 1, x1), max(y0 + 1, y1))) + texts = ["a photo of a %s %s" % (c, cls) for c in COLORS] + inp = self.cp(text=texts, images=crop, return_tensors="pt", padding=True) + return COLORS[int(self.cm(**inp).logits_per_image[0].argmax())] + + def score(self, img, meta): + dets = self.detect(img) + W, H = img.size + need = meta["include"] + found = [] + for req in need: + mine = [d for d in dets if d["class"] == req["class"]] + n = req.get("count", 1) + if meta["tag"] == "counting": + if len(mine) != n: + return False, {"reason": "count %d != %d" % (len(mine), n), "dets": dets} + elif len(mine) < 1: + return False, {"reason": "missing %s" % req["class"], "dets": dets} + if req.get("color"): + big = max(mine, key=lambda d: (d["box"][2] - d["box"][0]) * (d["box"][3] - d["box"][1])) + got = self.color(img, big["box"], req["class"]) + if got != req["color"]: + return False, {"reason": "colour %s != %s" % (got, req["color"]), "dets": dets} + found.append(mine) + for k, req in enumerate(need): + if req.get("position"): + rel, j = req["position"] + a = max(found[k], key=lambda d: d["score"])["box"] + b = max(found[j], key=lambda d: d["score"])["box"] + ca, cb = ((a[0] + a[2]) / 2, (a[1] + a[3]) / 2), ((b[0] + b[2]) / 2, (b[1] + b[3]) / 2) + ok = {"left of": ca[0] < cb[0] - POS_MARGIN * W, "right of": ca[0] > cb[0] + POS_MARGIN * W, + "above": ca[1] < cb[1] - POS_MARGIN * H, "below": ca[1] > cb[1] + POS_MARGIN * H}[rel] + if not ok: + return False, {"reason": "relation %s failed" % rel, "dets": dets} + return True, {"dets": dets} + + +def _iou(a, b): + ix = max(0, min(a[2], b[2]) - max(a[0], b[0])) + iy = max(0, min(a[3], b[3]) - max(a[1], b[1])) + inter = ix * iy + ua = (a[2] - a[0]) * (a[3] - a[1]) + (b[2] - b[0]) * (b[3] - b[1]) - inter + return inter / ua if ua > 0 else 0.0 diff --git a/orbiters/artist/exam_pack.py b/orbiters/artist/exam_pack.py new file mode 100644 index 0000000000000000000000000000000000000000..0c8a93c77f3ab449b9de64663f813beb6b560e39 --- /dev/null +++ b/orbiters/artist/exam_pack.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +"""artist pack exam: a small sprite library drawn here, since the cited COCO sprites are in the full pack only. Every clause is measured back +from the pixels by verify(), a wrong layout must fail it, and every placed sprite carries a citation.""" +import json +import os +import sys +import tempfile +from pathlib import Path + +from PIL import Image, ImageDraw + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from artist import core as A # noqa: E402 + +root = tempfile.mkdtemp() +index = {} +for cls, draw in (("apple", lambda d: d.ellipse((30, 30, 226, 226), fill=(200, 60, 50, 255))), ("cup", lambda d: d.rectangle((30, 30, 226, 226), fill=(70, 110, 200, 255)))): + im = Image.new("RGBA", (256, 256), (0, 0, 0, 0)) + draw(ImageDraw.Draw(im)) + f = cls + ".png" + im.save(os.path.join(root, f)) + index[cls] = [{"file": f, "cite": "drawn by this exam", "color": None}] +json.dump(index, open(os.path.join(root, "index.json"), "w")) +lib = A.Library(root) +prompts = ["a photo of a red apple", "a photo of a blue cup", "a photo of two apples", "a photo of a red apple and a blue cup", "a photo of an apple left of a cup", "a photo of an apple above a cup"] +good = cited = 0 +for p in prompts: + spec = A.parse(p) + canvas, placed = A.render(spec, lib, 0) + ok, _rep = A.verify(spec, canvas, placed) + good += ok + cited += all(x["cite"] for x in placed) +spec = A.parse("a photo of an apple left of a cup") +canvas, placed = A.render(spec, lib, 0) +placed = list(reversed(placed)) +swap = [dict(placed[0], **{"class": "apple"}), dict(placed[1], **{"class": "cup"})] +swap[0]["box"], swap[1]["box"] = placed[1]["box"], placed[0]["box"] +swap[0]["box"], swap[1]["box"] = swap[1]["box"], swap[0]["box"] +mutant_caught = not A.verify(spec, canvas, swap)[0] +print(json.dumps({"passed": good == len(prompts) and cited == len(prompts) and mutant_caught, "summary": "%d of %d prompts certified from pixels, all cited: %s, wrong layout refused: %s" % (good, len(prompts), cited == len(prompts), mutant_caught)})) diff --git a/orbiters/artist/night.py b/orbiters/artist/night.py new file mode 100644 index 0000000000000000000000000000000000000000..2a5305803d9e2201d456ce08a70a0f6cd80fcde7 --- /dev/null +++ b/orbiters/artist/night.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +"""night for artist and chameleon - each failure in the orbiter's own record becomes a typed hole in the orbiters' one format, ranked by what it costs. What fills a hole needs a +judge or a browser that isn't in the pack, so this night reports; it builds nothing. usage: python night.py""" +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +holes = [] +if HERE.name == "artist": + d = json.load(open(HERE / "results" / "geneval_heldout.json")) + for task, r in d["by_task"].items(): + lost = r["n_images"] * (1 - r["judge"]) + gap = r["self_verified"] - r["judge"] + holes.append({"origin": "artist", "kind": "not_recognised" if gap > .2 else "failed_check", "want": "compositing an outside judge recognises" if gap > .2 else "sprites for this kind", "givens": {"task": task, "judge": r["judge"], "self_verified": r["self_verified"]}, "cost": round(lost)}) +else: + d = json.load(open(HERE / "results" / "release-panel-current-20260921b.json")) + for t in d["targets"]: + st = [a.get("status") for a in t.get("attempts", [])] + if st and st[-1] != "COMPLETE": + holes.append({"origin": "chameleon", "kind": "blocked", "want": "an operator or a contract for this target", "givens": {"id": t["id"], "family": t.get("family"), "split": t.get("split"), "status": st[-1]}, "cost": 1}) +holes.sort(key=lambda h: -h["cost"]) +print(json.dumps({"holes": len(holes), "top": holes[:4]}, indent=1)) diff --git a/orbiters/artist/orbiter.json b/orbiters/artist/orbiter.json new file mode 100644 index 0000000000000000000000000000000000000000..b394536a42148f76ead662581d63b1a718bdb00e --- /dev/null +++ b/orbiters/artist/orbiter.json @@ -0,0 +1,10 @@ +{ + "name": "artist", + "good_for": "Makes images by citation: real sprites, placed to the prompt, each clause checked from the pixels.", + "python": [ + "numpy", + "PIL" + ], + "programs": [], + "exam": "exam_pack.py" +} \ No newline at end of file diff --git a/orbiters/artist/results/HELDOUT_FREEZE.txt b/orbiters/artist/results/HELDOUT_FREEZE.txt new file mode 100644 index 0000000000000000000000000000000000000000..0bcf9045bf9132c61a30e4b151d0ffc7c65e96d2 --- /dev/null +++ b/orbiters/artist/results/HELDOUT_FREEZE.txt @@ -0,0 +1,3 @@ +code_sha256 000154e2ebf0403c300c98c12da0aa94a7e553e12e07acab12b74086f8acd6c7 +library_index_sha256 4b1d83af4ab12424822ce58129fd044283fa77d216bac789784c80f062187f4d +frozen 2026-09-25T13:35:12Z diff --git a/orbiters/artist/results/geneval_dev_v0_40.json b/orbiters/artist/results/geneval_dev_v0_40.json new file mode 100644 index 0000000000000000000000000000000000000000..26b879432b2164e5081241b867adee1294697e32 --- /dev/null +++ b/orbiters/artist/results/geneval_dev_v0_40.json @@ -0,0 +1,399 @@ +{ + "split": "dev", + "prompts": 40, + "seeds": [ + 0 + ], + "geneval_style_overall": 0.3917, + "by_task": { + "colors": { + "judge": 0.5, + "self_verified": 0.9167, + "n_images": 12 + }, + "position": { + "judge": 0.3333, + "self_verified": 1.0, + "n_images": 6 + }, + "two_object": { + "judge": 0.375, + "self_verified": 1.0, + "n_images": 8 + }, + "color_attr": { + "judge": 0.0, + "self_verified": 1.0, + "n_images": 6 + }, + "counting": { + "judge": 0.75, + "self_verified": 1.0, + "n_images": 8 + } + }, + "judge": "OWLv2 base (80 COCO queries, thr 0.30) + CLIP ViT-B/32 colour; approximation of official GenEval", + "seconds": 1045, + "log": [ + { + "i": 0, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow cup", + "judge_ok": false, + "self_verified": true, + "reason": "missing cup" + }, + { + "i": 1, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow motorcycle", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 2, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dining table right of a cat", + "judge_ok": false, + "self_verified": true, + "reason": "missing dining table" + }, + { + "i": 3, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a cat", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 4, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown refrigerator and a red frisbee", + "judge_ok": false, + "self_verified": true, + "reason": "missing frisbee" + }, + { + "i": 5, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four knives", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 6, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three bowls", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 7, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple bottle and a black bear", + "judge_ok": false, + "self_verified": true, + "reason": "missing bottle" + }, + { + "i": 8, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange baseball bat", + "judge_ok": false, + "self_verified": true, + "reason": "missing baseball bat" + }, + { + "i": 9, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three bears", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 10, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four fire hydrants", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 11, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown dining table", + "judge_ok": false, + "self_verified": true, + "reason": "missing dining table" + }, + { + "i": 12, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich right of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 13, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green scissors", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 14, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green donut and a pink tv", + "judge_ok": false, + "self_verified": true, + "reason": "missing donut" + }, + { + "i": 15, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich below a bird", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 16, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four surfboards", + "judge_ok": false, + "self_verified": true, + "reason": "count 0 != 4" + }, + { + "i": 17, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a motorcycle and a giraffe", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 18, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green dog", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 19, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three sheep", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 20, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue hair drier", + "judge_ok": false, + "self_verified": true, + "reason": "missing hair drier" + }, + { + "i": 21, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bowl and a parking meter", + "judge_ok": false, + "self_verified": true, + "reason": "missing bowl" + }, + { + "i": 22, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a traffic light and a cow", + "judge_ok": false, + "self_verified": true, + "reason": "missing cow" + }, + { + "i": 23, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow umbrella", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 24, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator below a chair", + "judge_ok": false, + "self_verified": true, + "reason": "missing chair" + }, + { + "i": 25, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink truck", + "judge_ok": false, + "self_verified": true, + "reason": "missing truck" + }, + { + "i": 26, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a sports ball and a dog", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 27, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a dog and a sheep", + "judge_ok": false, + "self_verified": true, + "reason": "missing sheep" + }, + { + "i": 28, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown suitcase and an orange bowl", + "judge_ok": false, + "self_verified": true, + "reason": "missing suitcase" + }, + { + "i": 29, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange horse", + "judge_ok": true, + "self_verified": false, + "reason": null + }, + { + "i": 30, + "seed": 0, + "tag": "position", + "prompt": "a photo of a person left of a cup", + "judge_ok": false, + "self_verified": true, + "reason": "missing person" + }, + { + "i": 31, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black broccoli", + "judge_ok": false, + "self_verified": true, + "reason": "missing broccoli" + }, + { + "i": 32, + "seed": 0, + "tag": "position", + "prompt": "a photo of a truck below a book", + "judge_ok": false, + "self_verified": true, + "reason": "missing book" + }, + { + "i": 33, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three computer mouses", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 34, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown cat and a white clock", + "judge_ok": false, + "self_verified": true, + "reason": "missing cat" + }, + { + "i": 35, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an apple and a chair", + "judge_ok": false, + "self_verified": true, + "reason": "missing apple" + }, + { + "i": 36, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two tvs", + "judge_ok": false, + "self_verified": true, + "reason": "count 1 != 2" + }, + { + "i": 37, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a baseball bat", + "judge_ok": false, + "self_verified": true, + "reason": "missing baseball bat" + }, + { + "i": 38, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue motorcycle", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 39, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow sandwich and a blue cat", + "judge_ok": false, + "self_verified": true, + "reason": "missing sandwich" + } + ] +} \ No newline at end of file diff --git a/orbiters/artist/results/geneval_dev_v1a_120.json b/orbiters/artist/results/geneval_dev_v1a_120.json new file mode 100644 index 0000000000000000000000000000000000000000..722d0903e28e3d3715c203eb8e9837f5e8718d57 --- /dev/null +++ b/orbiters/artist/results/geneval_dev_v1a_120.json @@ -0,0 +1,1119 @@ +{ + "split": "dev", + "prompts": 120, + "seeds": [ + 0 + ], + "geneval_style_overall": 0.4547, + "by_task": { + "colors": { + "judge": 0.4839, + "self_verified": 0.9677, + "n_images": 31 + }, + "position": { + "judge": 0.5263, + "self_verified": 1.0, + "n_images": 19 + }, + "two_object": { + "judge": 0.5833, + "self_verified": 1.0, + "n_images": 24 + }, + "color_attr": { + "judge": 0.0, + "self_verified": 0.9524, + "n_images": 21 + }, + "counting": { + "judge": 0.68, + "self_verified": 1.0, + "n_images": 25 + } + }, + "judge": "OWLv2 base (80 COCO queries, thr 0.30) + CLIP ViT-B/32 colour; approximation of official GenEval", + "seconds": 2785, + "log": [ + { + "i": 0, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow cup", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 1, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow motorcycle", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 2, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dining table right of a cat", + "judge_ok": false, + "self_verified": true, + "reason": "missing dining table" + }, + { + "i": 3, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a cat", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 4, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown refrigerator and a red frisbee", + "judge_ok": false, + "self_verified": true, + "reason": "missing frisbee" + }, + { + "i": 5, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four knives", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 6, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three bowls", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 7, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple bottle and a black bear", + "judge_ok": false, + "self_verified": true, + "reason": "missing bottle" + }, + { + "i": 8, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange baseball bat", + "judge_ok": false, + "self_verified": true, + "reason": "colour brown != orange" + }, + { + "i": 9, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three bears", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 10, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four fire hydrants", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 11, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown dining table", + "judge_ok": false, + "self_verified": true, + "reason": "missing dining table" + }, + { + "i": 12, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich right of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 13, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green scissors", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 14, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green donut and a pink tv", + "judge_ok": false, + "self_verified": true, + "reason": "missing donut" + }, + { + "i": 15, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich below a bird", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 16, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four surfboards", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 17, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a motorcycle and a giraffe", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 18, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green dog", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 19, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three sheep", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 20, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue hair drier", + "judge_ok": false, + "self_verified": true, + "reason": "missing hair drier" + }, + { + "i": 21, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bowl and a parking meter", + "judge_ok": false, + "self_verified": true, + "reason": "missing parking meter" + }, + { + "i": 22, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a traffic light and a cow", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 23, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow umbrella", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 24, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator below a chair", + "judge_ok": false, + "self_verified": true, + "reason": "missing chair" + }, + { + "i": 25, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink truck", + "judge_ok": false, + "self_verified": true, + "reason": "missing truck" + }, + { + "i": 26, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a sports ball and a dog", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 27, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a dog and a sheep", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 28, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown suitcase and an orange bowl", + "judge_ok": false, + "self_verified": true, + "reason": "missing bowl" + }, + { + "i": 29, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange horse", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 30, + "seed": 0, + "tag": "position", + "prompt": "a photo of a person left of a cup", + "judge_ok": false, + "self_verified": true, + "reason": "missing person" + }, + { + "i": 31, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black broccoli", + "judge_ok": false, + "self_verified": true, + "reason": "missing broccoli" + }, + { + "i": 32, + "seed": 0, + "tag": "position", + "prompt": "a photo of a truck below a book", + "judge_ok": false, + "self_verified": true, + "reason": "missing book" + }, + { + "i": 33, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three computer mouses", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 34, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown cat and a white clock", + "judge_ok": false, + "self_verified": true, + "reason": "missing cat" + }, + { + "i": 35, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an apple and a chair", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 36, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two tvs", + "judge_ok": false, + "self_verified": true, + "reason": "count 1 != 2" + }, + { + "i": 37, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a baseball bat", + "judge_ok": false, + "self_verified": true, + "reason": "missing baseball bat" + }, + { + "i": 38, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue motorcycle", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 39, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow sandwich and a blue cat", + "judge_ok": false, + "self_verified": true, + "reason": "colour green != yellow" + }, + { + "i": 40, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dog left of a refrigerator", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 41, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a cell phone", + "judge_ok": false, + "self_verified": true, + "reason": "missing baseball bat" + }, + { + "i": 42, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown fire hydrant and a white cell phone", + "judge_ok": false, + "self_verified": true, + "reason": "missing cell phone" + }, + { + "i": 43, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown suitcase", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 44, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black tennis racket", + "judge_ok": false, + "self_verified": false, + "reason": "missing tennis racket" + }, + { + "i": 45, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bench right of a snowboard", + "judge_ok": false, + "self_verified": true, + "reason": "missing bench" + }, + { + "i": 46, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple bowl and a white tie", + "judge_ok": false, + "self_verified": true, + "reason": "missing bowl" + }, + { + "i": 47, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple toilet", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 48, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red spoon", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 49, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a spoon", + "judge_ok": false, + "self_verified": true, + "reason": "missing spoon" + }, + { + "i": 50, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a potted plant and a bird", + "judge_ok": false, + "self_verified": true, + "reason": "missing potted plant" + }, + { + "i": 51, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four beds", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 52, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange cake and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "reason": "missing cake" + }, + { + "i": 53, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown fire hydrant and a pink bear", + "judge_ok": false, + "self_verified": true, + "reason": "missing bear" + }, + { + "i": 54, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white computer mouse and a red sports ball", + "judge_ok": false, + "self_verified": true, + "reason": "missing sports ball" + }, + { + "i": 55, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three scissors", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 56, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a chair", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 57, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange cat", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 58, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two bottles", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 59, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange microwave and a red chair", + "judge_ok": false, + "self_verified": true, + "reason": "colour brown != orange" + }, + { + "i": 60, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white person", + "judge_ok": false, + "self_verified": true, + "reason": "colour green != white" + }, + { + "i": 61, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green tie", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 62, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red boat", + "judge_ok": false, + "self_verified": true, + "reason": "missing boat" + }, + { + "i": 63, + "seed": 0, + "tag": "position", + "prompt": "a photo of a fire hydrant below a baseball glove", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 64, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two baseball bats", + "judge_ok": false, + "self_verified": true, + "reason": "count 0 != 2" + }, + { + "i": 65, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bowl left of a hot dog", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 66, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four fire hydrants", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 67, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black car and a purple couch", + "judge_ok": false, + "self_verified": true, + "reason": "colour brown != black" + }, + { + "i": 68, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three cats", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 69, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink fork", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 70, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white potted plant and a black banana", + "judge_ok": false, + "self_verified": false, + "reason": "missing potted plant" + }, + { + "i": 71, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange person and a white clock", + "judge_ok": false, + "self_verified": true, + "reason": "missing person" + }, + { + "i": 72, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two suitcases", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 73, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bench and a chair", + "judge_ok": false, + "self_verified": true, + "reason": "missing bench" + }, + { + "i": 74, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green person", + "judge_ok": false, + "self_verified": true, + "reason": "missing person" + }, + { + "i": 75, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bus and a surfboard", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 76, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a chair and a surfboard", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 77, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue train", + "judge_ok": false, + "self_verified": true, + "reason": "colour yellow != blue" + }, + { + "i": 78, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four birds", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 79, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bed above a car", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 80, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown computer keyboard and a red cake", + "judge_ok": false, + "self_verified": true, + "reason": "missing cake" + }, + { + "i": 81, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two benches", + "judge_ok": false, + "self_verified": true, + "reason": "count 0 != 2" + }, + { + "i": 82, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two refrigerators", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 83, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a boat and a giraffe", + "judge_ok": false, + "self_verified": true, + "reason": "missing boat" + }, + { + "i": 84, + "seed": 0, + "tag": "position", + "prompt": "a photo of a book below a kite", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 85, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green scissors", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 86, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four toothbrushes", + "judge_ok": false, + "self_verified": true, + "reason": "count 3 != 4" + }, + { + "i": 87, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink book", + "judge_ok": false, + "self_verified": true, + "reason": "colour purple != pink" + }, + { + "i": 88, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange hair drier and a red baseball bat", + "judge_ok": false, + "self_verified": true, + "reason": "missing hair drier" + }, + { + "i": 89, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cat left of a clock", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 90, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black parking meter", + "judge_ok": false, + "self_verified": true, + "reason": "colour brown != black" + }, + { + "i": 91, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red person", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 92, + "seed": 0, + "tag": "position", + "prompt": "a photo of a person below a handbag", + "judge_ok": false, + "self_verified": true, + "reason": "missing person" + }, + { + "i": 93, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four cakes", + "judge_ok": false, + "self_verified": true, + "reason": "count 2 != 4" + }, + { + "i": 94, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two tvs", + "judge_ok": false, + "self_verified": true, + "reason": "count 1 != 2" + }, + { + "i": 95, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a vase and an apple", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 96, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow skis", + "judge_ok": false, + "self_verified": true, + "reason": "missing skis" + }, + { + "i": 97, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow truck and a purple sheep", + "judge_ok": false, + "self_verified": true, + "reason": "missing sheep" + }, + { + "i": 98, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a traffic light and an oven", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 99, + "seed": 0, + "tag": "position", + "prompt": "a photo of a clock left of a snowboard", + "judge_ok": false, + "self_verified": true, + "reason": "missing snowboard" + }, + { + "i": 100, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a giraffe", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 101, + "seed": 0, + "tag": "position", + "prompt": "a photo of a motorcycle left of a traffic light", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 102, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hair drier right of a car", + "judge_ok": false, + "self_verified": true, + "reason": "missing hair drier" + }, + { + "i": 103, + "seed": 0, + "tag": "position", + "prompt": "a photo of a broccoli right of a vase", + "judge_ok": false, + "self_verified": true, + "reason": "missing broccoli" + }, + { + "i": 104, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a chair and a suitcase", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 105, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white surfboard", + "judge_ok": false, + "self_verified": true, + "reason": "missing surfboard" + }, + { + "i": 106, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black parking meter", + "judge_ok": false, + "self_verified": true, + "reason": "colour brown != black" + }, + { + "i": 107, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown cell phone", + "judge_ok": false, + "self_verified": true, + "reason": "missing cell phone" + }, + { + "i": 108, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a backpack and a truck", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 109, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator left of a computer mouse", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 110, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an apple and a dining table", + "judge_ok": false, + "self_verified": true, + "reason": "missing dining table" + }, + { + "i": 111, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a cat and a handbag", + "judge_ok": false, + "self_verified": true, + "reason": "missing handbag" + }, + { + "i": 112, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two elephants", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 113, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a snowboard and a cell phone", + "judge_ok": false, + "self_verified": true, + "reason": "missing snowboard" + }, + { + "i": 114, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four backpacks", + "judge_ok": false, + "self_verified": true, + "reason": "count 3 != 4" + }, + { + "i": 115, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple apple and a red tie", + "judge_ok": false, + "self_verified": true, + "reason": "missing apple" + }, + { + "i": 116, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three vases", + "judge_ok": false, + "self_verified": true, + "reason": "count 4 != 3" + }, + { + "i": 117, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green hair drier and a purple stop sign", + "judge_ok": false, + "self_verified": true, + "reason": "missing hair drier" + }, + { + "i": 118, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three couches", + "judge_ok": true, + "self_verified": true, + "reason": null + }, + { + "i": 119, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red tv and a pink hair drier", + "judge_ok": false, + "self_verified": true, + "reason": "missing tv" + } + ] +} \ No newline at end of file diff --git a/orbiters/artist/results/geneval_dev_v1b_120.json b/orbiters/artist/results/geneval_dev_v1b_120.json new file mode 100644 index 0000000000000000000000000000000000000000..2436e1e8194d722766b91799b96626ca1b95a387 --- /dev/null +++ b/orbiters/artist/results/geneval_dev_v1b_120.json @@ -0,0 +1,1246 @@ +{ + "split": "dev", + "prompts": 120, + "seeds": [ + 0 + ], + "seeds_done": [ + 0 + ], + "final": true, + "geneval_style_overall": 0.4768, + "by_task": { + "colors": { + "judge": 0.4516, + "self_verified": 0.9677, + "n_images": 31 + }, + "position": { + "judge": 0.5263, + "self_verified": 1.0, + "n_images": 19 + }, + "two_object": { + "judge": 0.5833, + "self_verified": 1.0, + "n_images": 24 + }, + "color_attr": { + "judge": 0.1429, + "self_verified": 0.9524, + "n_images": 21 + }, + "counting": { + "judge": 0.68, + "self_verified": 1.0, + "n_images": 25 + } + }, + "recoloured_images": 38, + "library": "/opt/oracle7-artist/library", + "library_sprites": 2673, + "judge": "OWLv2 base (80 COCO queries, thr 0.25) + CLIP ViT-B/32 colour; approximation of official GenEval", + "seconds": 3009, + "log": [ + { + "i": 0, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow cup", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 1, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 2, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dining table right of a cat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 3, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 4, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown refrigerator and a red frisbee", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != red" + }, + { + "i": 5, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four knives", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 6, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three bowls", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 7, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple bottle and a black bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 8, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != orange" + }, + { + "i": 9, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 10, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 11, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 12, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich right of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 13, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 14, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green donut and a pink tv", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 15, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich below a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 16, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four surfboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 17, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a motorcycle and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 18, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green dog", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 19, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 20, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 21, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bowl and a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 22, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a traffic light and a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 23, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 24, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator below a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 25, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink truck", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 26, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a sports ball and a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 27, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a dog and a sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 28, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown suitcase and an orange bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour yellow != orange" + }, + { + "i": 29, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange horse", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 30, + "seed": 0, + "tag": "position", + "prompt": "a photo of a person left of a cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 31, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 32, + "seed": 0, + "tag": "position", + "prompt": "a photo of a truck below a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 33, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three computer mouses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 34, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown cat and a white clock", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 35, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an apple and a chair", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 36, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two tvs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 37, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 38, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 39, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow sandwich and a blue cat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour green != yellow" + }, + { + "i": 40, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dog left of a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 41, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 42, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown fire hydrant and a white cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 43, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 44, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black tennis racket", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing tennis racket" + }, + { + "i": 45, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bench right of a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 46, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple bowl and a white tie", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 47, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 48, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red spoon", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 49, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 50, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a potted plant and a bird", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 51, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four beds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 52, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange cake and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cake" + }, + { + "i": 53, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown fire hydrant and a pink bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bear" + }, + { + "i": 54, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white computer mouse and a red sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sports ball" + }, + { + "i": 55, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 56, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a chair", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 57, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange cat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cat" + }, + { + "i": 58, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two bottles", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 59, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange microwave and a red chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 60, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 61, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 62, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red boat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing boat" + }, + { + "i": 63, + "seed": 0, + "tag": "position", + "prompt": "a photo of a fire hydrant below a baseball glove", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 64, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two baseball bats", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 65, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bowl left of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 66, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 67, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black car and a purple couch", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 68, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three cats", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 69, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink fork", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 70, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white potted plant and a black banana", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 71, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange person and a white clock", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 72, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two suitcases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 73, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bench and a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 74, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 75, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bus and a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 76, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a chair and a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 77, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue train", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != blue" + }, + { + "i": 78, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four birds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 79, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bed above a car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 80, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown computer keyboard and a red cake", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cake" + }, + { + "i": 81, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two benches", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 82, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two refrigerators", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 83, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a boat and a giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing boat" + }, + { + "i": 84, + "seed": 0, + "tag": "position", + "prompt": "a photo of a book below a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 85, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 86, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four toothbrushes", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 87, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink book", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing book" + }, + { + "i": 88, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange hair drier and a red baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 89, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cat left of a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 90, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != black" + }, + { + "i": 91, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red person", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing person" + }, + { + "i": 92, + "seed": 0, + "tag": "position", + "prompt": "a photo of a person below a handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 93, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four cakes", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 94, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two tvs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 95, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a vase and an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 96, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 97, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow truck and a purple sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 98, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a traffic light and an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 99, + "seed": 0, + "tag": "position", + "prompt": "a photo of a clock left of a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 100, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 101, + "seed": 0, + "tag": "position", + "prompt": "a photo of a motorcycle left of a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 102, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hair drier right of a car", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 103, + "seed": 0, + "tag": "position", + "prompt": "a photo of a broccoli right of a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 104, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a chair and a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 105, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white surfboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing surfboard" + }, + { + "i": 106, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != black" + }, + { + "i": 107, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 108, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a backpack and a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 109, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator left of a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 110, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an apple and a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 111, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a cat and a handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 112, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two elephants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 113, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a snowboard and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 114, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four backpacks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 115, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple apple and a red tie", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 116, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three vases", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 3" + }, + { + "i": 117, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green hair drier and a purple stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 118, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three couches", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 119, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red tv and a pink hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv" + } + ] +} \ No newline at end of file diff --git a/orbiters/artist/results/geneval_heldout.json b/orbiters/artist/results/geneval_heldout.json new file mode 100644 index 0000000000000000000000000000000000000000..e77e3e60debbed49ef83b7a54668ebaf459db1c8 --- /dev/null +++ b/orbiters/artist/results/geneval_heldout.json @@ -0,0 +1,22177 @@ +{ + "split": "heldout", + "prompts": 553, + "seeds": [ + 0, + 1, + 2, + 3 + ], + "seeds_done": [ + 0, + 1, + 2, + 3 + ], + "final": true, + "geneval_style_overall": 0.5094, + "by_task": { + "single_object": { + "judge": 0.8063, + "self_verified": 1.0, + "n_images": 320 + }, + "two_object": { + "judge": 0.4924, + "self_verified": 1.0, + "n_images": 396 + }, + "counting": { + "judge": 0.55, + "self_verified": 0.9125, + "n_images": 320 + }, + "colors": { + "judge": 0.4574, + "self_verified": 0.9707, + "n_images": 376 + }, + "position": { + "judge": 0.56, + "self_verified": 1.0, + "n_images": 400 + }, + "color_attr": { + "judge": 0.19, + "self_verified": 0.92, + "n_images": 400 + } + }, + "recoloured_images": 584, + "library": "/opt/oracle7-artist/library", + "library_sprites": 2673, + "judge": "OWLv2 base (80 COCO queries, thr 0.25) + CLIP ViT-B/32 colour; approximation of official GenEval", + "seconds": 32275, + "log": [ + { + "i": 0, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 1, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 2, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 3, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 4, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 5, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 6, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 7, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 8, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 9, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cup" + }, + { + "i": 10, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 11, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 12, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 13, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 14, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 15, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a spoon", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 16, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 17, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 18, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 19, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 20, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 21, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 22, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 23, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 24, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 25, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 26, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 27, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 28, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 29, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 30, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 31, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 32, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 33, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 34, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 35, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a chair", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 36, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv" + }, + { + "i": 37, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 38, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 39, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 40, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 41, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 42, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a frisbee", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 43, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 44, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 45, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 46, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 47, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 48, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of an orange", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing orange" + }, + { + "i": 49, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 50, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 51, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 52, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 53, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 54, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 55, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 56, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 57, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 58, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 59, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 60, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 61, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 62, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 63, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a donut", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 64, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 65, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a baseball glove", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 66, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 67, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 68, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a cake", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 69, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 70, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 71, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 72, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 73, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 74, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 75, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 76, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 77, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a sports ball", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 78, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 79, + "seed": 0, + "tag": "single_object", + "prompt": "a photo of a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 80, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bench and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 81, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 82, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a toaster and an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 83, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a broccoli and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 84, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 85, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a fork and a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 86, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a hair drier and a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cake" + }, + { + "i": 87, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a horse and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 88, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a horse and a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 89, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 90, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a cake and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 91, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a hair drier and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 92, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 93, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a couch and a wine glass", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing wine glass" + }, + { + "i": 94, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a frisbee and a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 95, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a book and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 96, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a dining table and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 97, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a frisbee and a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 98, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a couch and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 99, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a toilet and a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 100, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bottle and a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 101, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a potted plant and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 102, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a skateboard and a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 103, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a broccoli and a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 104, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a zebra and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 105, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an oven and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 106, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 107, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a vase and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 108, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a skateboard and a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 109, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a pizza and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 110, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bowl and a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 111, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bird", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tennis racket" + }, + { + "i": 112, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a wine glass and a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 113, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a fork and a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 114, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 115, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a laptop and a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 116, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 117, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a microwave and a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 118, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a person and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 119, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a frisbee and a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 120, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a parking meter and a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 121, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 122, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 123, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a tennis racket", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tennis racket" + }, + { + "i": 124, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 125, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a pizza and a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 126, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a giraffe and a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 127, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 128, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 129, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a chair and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 130, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tv and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv" + }, + { + "i": 131, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a surfboard and a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 132, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 133, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 134, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a scissors and a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 135, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a person and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 136, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a cow and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 137, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a handbag and a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 138, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a chair and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 139, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 140, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a book and a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 141, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a horse and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 142, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bench and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 143, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a traffic light and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 144, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a sports ball and a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cow" + }, + { + "i": 145, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 146, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tv and a bicycle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv" + }, + { + "i": 147, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bench and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 148, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 149, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a person and an apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 150, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a sink and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 151, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 152, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a knife and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 153, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a wine glass and a handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 154, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bowl and a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 155, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a frisbee and an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 156, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 157, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a stop sign and a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 158, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a potted plant and a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 159, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tv and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv" + }, + { + "i": 160, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a tie and a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 161, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a potted plant and a donut", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 162, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a person and a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 163, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a couch and a snowboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 164, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a fork and a baseball glove", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 165, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of an apple and a toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 166, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a bus and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 167, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a person and a stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 168, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a carrot and a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 169, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 170, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 171, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a baseball glove and a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 172, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a microwave and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 173, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a cake and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 174, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a car and a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 175, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a suitcase and a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 176, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a person and a traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 177, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a cell phone and a horse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cell phone" + }, + { + "i": 178, + "seed": 0, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 179, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two clocks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 180, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two backpacks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 181, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 4" + }, + { + "i": 182, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 183, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three sports balls", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 184, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 185, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two ties", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 186, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 187, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two toothbrushs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two toothbrushs'" + }, + { + "i": 188, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three persons", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three persons'" + }, + { + "i": 189, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three tennis rackets", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 190, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four bowls", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 191, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four vases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 192, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three cups", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 193, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 194, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 195, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two ovens", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 2" + }, + { + "i": 196, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two toilets", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 197, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two bicycles", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 198, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two trains", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 199, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three oranges", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 3" + }, + { + "i": 200, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 201, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 3" + }, + { + "i": 202, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 203, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 204, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four dogs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 205, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three apples", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 206, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two sheeps", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sheeps'" + }, + { + "i": 207, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three hot dogs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 208, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 209, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three kites", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 210, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 6 != 4" + }, + { + "i": 211, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three cell phones", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 212, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four baseball gloves", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 213, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 214, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two beds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 215, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two tv remotes", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 216, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 217, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three books", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 218, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 219, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two vases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 220, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four donuts", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 221, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four chairs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 222, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three baseball bats", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 3" + }, + { + "i": 223, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four stop signs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 224, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 225, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three refrigerators", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 226, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 227, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 228, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four tvs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 229, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 230, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four broccolis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 13 != 4" + }, + { + "i": 231, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 232, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two trucks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 233, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two carrots", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 49 != 2" + }, + { + "i": 234, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two sandwichs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sandwichs'" + }, + { + "i": 235, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four traffic lights", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 4" + }, + { + "i": 236, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four clocks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 237, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two cars", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 238, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two bananas", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 36 != 2" + }, + { + "i": 239, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 240, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 241, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four knifes", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four knifes'" + }, + { + "i": 242, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three suitcases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 243, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 244, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two teddy bears", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 2" + }, + { + "i": 245, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four skateboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 246, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four hot dogs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 247, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three birds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 248, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four boats", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 249, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four microwaves", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 250, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two hair driers", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 251, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three laptops", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 252, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three cows", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 253, + "seed": 0, + "tag": "counting", + "prompt": "a photo of two parking meters", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 254, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four benchs'" + }, + { + "i": 255, + "seed": 0, + "tag": "counting", + "prompt": "a photo of three benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three benchs'" + }, + { + "i": 256, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 257, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four books", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 5 != 4" + }, + { + "i": 258, + "seed": 0, + "tag": "counting", + "prompt": "a photo of four buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 259, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue fire hydrant", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour pink != blue" + }, + { + "i": 260, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink car", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing car" + }, + { + "i": 261, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple cup", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cup" + }, + { + "i": 262, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 263, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow boat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing boat" + }, + { + "i": 264, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 265, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 266, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 267, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 268, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 269, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 270, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 271, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 272, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 273, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 274, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 275, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 276, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 277, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange orange", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != orange" + }, + { + "i": 278, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 279, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 280, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 281, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 282, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 283, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 284, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown chair", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 285, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 286, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 287, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 288, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 289, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 290, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green couch", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 291, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 292, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange tv", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv" + }, + { + "i": 293, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing scissors" + }, + { + "i": 294, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 295, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green surfboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 296, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 297, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 298, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 299, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 300, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 301, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 302, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow train", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing train" + }, + { + "i": 303, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 304, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 305, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour red != brown" + }, + { + "i": 306, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour white != black" + }, + { + "i": 307, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 308, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 309, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 310, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 311, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 312, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != blue" + }, + { + "i": 313, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 314, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 315, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a purple scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 316, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 317, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 318, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 319, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a brown orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 320, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green clock", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 321, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 322, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow oven", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 323, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != green" + }, + { + "i": 324, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 325, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 326, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 327, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 328, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 329, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 330, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 331, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 332, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 333, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing scissors" + }, + { + "i": 334, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour pink != red" + }, + { + "i": 335, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a white orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 336, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 337, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 338, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 339, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 340, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black vase", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour pink != black" + }, + { + "i": 341, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a black backpack", + "judge_ok": true, + "self_verified": false, + "recoloured": false, + "reason": null + }, + { + "i": 342, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 343, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 344, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 345, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a green bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 346, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 347, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 348, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a pink parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 349, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 350, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a yellow broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != yellow" + }, + { + "i": 351, + "seed": 0, + "tag": "colors", + "prompt": "a photo of an orange computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 352, + "seed": 0, + "tag": "colors", + "prompt": "a photo of a red cake", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cake" + }, + { + "i": 353, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dog right of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 354, + "seed": 0, + "tag": "position", + "prompt": "a photo of a wine glass above a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 355, + "seed": 0, + "tag": "position", + "prompt": "a photo of a couch below a cup", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 356, + "seed": 0, + "tag": "position", + "prompt": "a photo of a laptop left of a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cow" + }, + { + "i": 357, + "seed": 0, + "tag": "position", + "prompt": "a photo of a fork above a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 358, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tie right of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 359, + "seed": 0, + "tag": "position", + "prompt": "a photo of a stop sign above a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 360, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bird below a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 361, + "seed": 0, + "tag": "position", + "prompt": "a photo of an apple above a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 362, + "seed": 0, + "tag": "position", + "prompt": "a photo of a train above a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 363, + "seed": 0, + "tag": "position", + "prompt": "a photo of a truck left of a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 364, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tv remote below a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cow" + }, + { + "i": 365, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bottle right of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 366, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dog above a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 367, + "seed": 0, + "tag": "position", + "prompt": "a photo of a skateboard above a person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 368, + "seed": 0, + "tag": "position", + "prompt": "a photo of a baseball glove below an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 369, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dining table right of an oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 370, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hot dog left of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 371, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bus below a toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 372, + "seed": 0, + "tag": "position", + "prompt": "a photo of a backpack right of a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 373, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cake below a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 374, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dog right of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 375, + "seed": 0, + "tag": "position", + "prompt": "a photo of a suitcase right of a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 376, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bear above a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 377, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tv remote left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 378, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sports ball left of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 379, + "seed": 0, + "tag": "position", + "prompt": "a photo of a train right of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 380, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hair drier below an elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 381, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tennis racket right of a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 382, + "seed": 0, + "tag": "position", + "prompt": "a photo of a wine glass right of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 383, + "seed": 0, + "tag": "position", + "prompt": "a photo of a computer mouse left of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 384, + "seed": 0, + "tag": "position", + "prompt": "a photo of a carrot left of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 385, + "seed": 0, + "tag": "position", + "prompt": "a photo of a kite above a toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 386, + "seed": 0, + "tag": "position", + "prompt": "a photo of a toaster below a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 387, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cat below a baseball glove", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 388, + "seed": 0, + "tag": "position", + "prompt": "a photo of a skis right of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 389, + "seed": 0, + "tag": "position", + "prompt": "a photo of a stop sign above a chair", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 390, + "seed": 0, + "tag": "position", + "prompt": "a photo of a stop sign above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 391, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hot dog right of a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 392, + "seed": 0, + "tag": "position", + "prompt": "a photo of a pizza below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 393, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hair drier left of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 394, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cow left of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 395, + "seed": 0, + "tag": "position", + "prompt": "a photo of a suitcase above a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 396, + "seed": 0, + "tag": "position", + "prompt": "a photo of a book above a laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 397, + "seed": 0, + "tag": "position", + "prompt": "a photo of a toothbrush below a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 398, + "seed": 0, + "tag": "position", + "prompt": "a photo of a toilet left of a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 399, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tie above a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 400, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bird left of a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 401, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bed right of a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 402, + "seed": 0, + "tag": "position", + "prompt": "a photo of an elephant below a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 403, + "seed": 0, + "tag": "position", + "prompt": "a photo of a frisbee right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 404, + "seed": 0, + "tag": "position", + "prompt": "a photo of a vase above a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 405, + "seed": 0, + "tag": "position", + "prompt": "a photo of a zebra left of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 406, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bench left of a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bench" + }, + { + "i": 407, + "seed": 0, + "tag": "position", + "prompt": "a photo of a donut right of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 408, + "seed": 0, + "tag": "position", + "prompt": "a photo of a frisbee below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 409, + "seed": 0, + "tag": "position", + "prompt": "a photo of a computer keyboard above a snowboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 410, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tv below a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cow" + }, + { + "i": 411, + "seed": 0, + "tag": "position", + "prompt": "a photo of an elephant below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 412, + "seed": 0, + "tag": "position", + "prompt": "a photo of a suitcase left of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 413, + "seed": 0, + "tag": "position", + "prompt": "a photo of a train below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 414, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cat below a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 415, + "seed": 0, + "tag": "position", + "prompt": "a photo of a backpack below a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cake" + }, + { + "i": 416, + "seed": 0, + "tag": "position", + "prompt": "a photo of a sandwich below a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 417, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bicycle above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 418, + "seed": 0, + "tag": "position", + "prompt": "a photo of a knife right of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 419, + "seed": 0, + "tag": "position", + "prompt": "a photo of a hot dog above a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 420, + "seed": 0, + "tag": "position", + "prompt": "a photo of a zebra right of a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 421, + "seed": 0, + "tag": "position", + "prompt": "a photo of a chair left of a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 422, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cow below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 423, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cup left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cup" + }, + { + "i": 424, + "seed": 0, + "tag": "position", + "prompt": "a photo of a zebra below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 425, + "seed": 0, + "tag": "position", + "prompt": "a photo of a zebra below a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 426, + "seed": 0, + "tag": "position", + "prompt": "a photo of a laptop below a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 427, + "seed": 0, + "tag": "position", + "prompt": "a photo of a truck left of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 428, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 429, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tv above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 430, + "seed": 0, + "tag": "position", + "prompt": "a photo of a baseball glove right of a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 431, + "seed": 0, + "tag": "position", + "prompt": "a photo of a refrigerator below a scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 432, + "seed": 0, + "tag": "position", + "prompt": "a photo of a dining table above a suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 433, + "seed": 0, + "tag": "position", + "prompt": "a photo of a parking meter above a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 434, + "seed": 0, + "tag": "position", + "prompt": "a photo of a frisbee above a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 435, + "seed": 0, + "tag": "position", + "prompt": "a photo of a pizza right of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 436, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bus above a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 437, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cell phone left of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 438, + "seed": 0, + "tag": "position", + "prompt": "a photo of a horse right of a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 439, + "seed": 0, + "tag": "position", + "prompt": "a photo of a broccoli above a bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 440, + "seed": 0, + "tag": "position", + "prompt": "a photo of a vase right of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 441, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bear above a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 442, + "seed": 0, + "tag": "position", + "prompt": "a photo of a zebra right of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 443, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cow right of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 444, + "seed": 0, + "tag": "position", + "prompt": "a photo of a bed right of a frisbee", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing frisbee" + }, + { + "i": 445, + "seed": 0, + "tag": "position", + "prompt": "a photo of a tie right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 446, + "seed": 0, + "tag": "position", + "prompt": "a photo of a laptop right of a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 447, + "seed": 0, + "tag": "position", + "prompt": "a photo of a cell phone right of a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cell phone" + }, + { + "i": 448, + "seed": 0, + "tag": "position", + "prompt": "a photo of a couch below a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 449, + "seed": 0, + "tag": "position", + "prompt": "a photo of a clock below a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 450, + "seed": 0, + "tag": "position", + "prompt": "a photo of a couch below a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 451, + "seed": 0, + "tag": "position", + "prompt": "a photo of a donut below a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 452, + "seed": 0, + "tag": "position", + "prompt": "a photo of a couch left of a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 453, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple wine glass and a black apple", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing apple" + }, + { + "i": 454, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green bus and a purple microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 455, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green skis and a brown airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 456, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow computer keyboard and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sink" + }, + { + "i": 457, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a pink oven and a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 458, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple parking meter and a red laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 459, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow skateboard and an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 460, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red skis and a brown tie", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 461, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a pink skateboard and a black train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 462, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a purple bed", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 463, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple elephant and a brown sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sports ball" + }, + { + "i": 464, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple dog and a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 465, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white dining table and a red car", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 466, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue cell phone and a green apple", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 467, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red car and an orange potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 468, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown carrot and a white potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 469, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black kite and a green bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != black" + }, + { + "i": 470, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue laptop and a brown bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != blue" + }, + { + "i": 471, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green teddy bear and a brown kite", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 472, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow stop sign and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 473, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange snowboard and a green cat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing snowboard" + }, + { + "i": 474, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange truck and a pink sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sink" + }, + { + "i": 475, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown hot dog and a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 476, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green couch and an orange umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 477, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown bed and a pink cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 478, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black broccoli and a yellow cake", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 479, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red train and a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 480, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple tennis racket and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 481, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue vase and a black banana", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 482, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue clock and a white cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cup" + }, + { + "i": 483, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a blue couch", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 484, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a red giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 485, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a pink tv remote and a blue airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 486, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a pink handbag and a black scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 487, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown car and a pink hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 488, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black bus and a brown cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != black" + }, + { + "i": 489, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple sheep and a pink banana", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing banana" + }, + { + "i": 490, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue handbag and a white cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 491, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white pizza and a green umbrella", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing pizza" + }, + { + "i": 492, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white tie and a purple skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 493, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow sports ball and a green boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 494, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white wine glass and a brown giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 495, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow bowl and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bowl" + }, + { + "i": 496, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange microwave and a black spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing spoon" + }, + { + "i": 497, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange skateboard and a pink bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 498, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue toilet and a white suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing suitcase" + }, + { + "i": 499, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white boat and an orange hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour red != orange" + }, + { + "i": 500, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow dining table and a pink dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 501, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red cake and a purple chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cake" + }, + { + "i": 502, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue tie and a pink dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 503, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue cow and a black computer keyboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 504, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow pizza and a green oven", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 505, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red laptop and a brown car", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing car" + }, + { + "i": 506, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a blue scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 507, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green surfboard and an orange oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 508, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow parking meter and a pink refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 509, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown computer mouse and a purple bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bottle" + }, + { + "i": 510, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a green cow", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cow" + }, + { + "i": 511, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red giraffe and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 512, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown oven and a purple train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 513, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue baseball bat and a pink book", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing baseball bat" + }, + { + "i": 514, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green cup and a yellow bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 515, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow suitcase and a brown bus", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != brown" + }, + { + "i": 516, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange motorcycle and a pink donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 517, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange giraffe and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != orange" + }, + { + "i": 518, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a green carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 519, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black bottle and a white refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 520, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white dog and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 521, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a red car", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 522, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red stop sign and a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 523, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow car and an orange toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing toothbrush" + }, + { + "i": 524, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black potted plant and a yellow toilet", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != black" + }, + { + "i": 525, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown dining table and a white suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 526, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange donut and a yellow stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour red != orange" + }, + { + "i": 527, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green suitcase and a blue boat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing boat" + }, + { + "i": 528, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange tennis racket and a yellow sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 529, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a red chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 530, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple suitcase and an orange pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour red != orange" + }, + { + "i": 531, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white bottle and a blue sheep", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bottle" + }, + { + "i": 532, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a purple backpack and a white umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != white" + }, + { + "i": 533, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange potted plant and a black spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing spoon" + }, + { + "i": 534, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green tennis racket and a black dog", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 535, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow handbag and a blue refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 536, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a pink broccoli and a red sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing broccoli" + }, + { + "i": 537, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red bowl and a pink sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bowl" + }, + { + "i": 538, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white toilet and a red apple", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 539, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a pink dining table and a black sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 540, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a black car and a green parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 541, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow bird and a black motorcycle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != black" + }, + { + "i": 542, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown giraffe and a white stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing stop sign" + }, + { + "i": 543, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a white banana and a black elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour white != black" + }, + { + "i": 544, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange cow and a purple sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sandwich" + }, + { + "i": 545, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red clock and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 546, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a brown knife and a blue donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 547, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red cup and a pink handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour yellow != red" + }, + { + "i": 548, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a yellow bicycle and a red motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 549, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a red orange and a purple broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 550, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of an orange traffic light and a white toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 551, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a green cup and a red pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cup" + }, + { + "i": 552, + "seed": 0, + "tag": "color_attr", + "prompt": "a photo of a blue pizza and a yellow baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 0, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 1, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 2, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 3, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 4, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 5, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 6, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 7, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 8, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 9, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a cup", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 10, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 11, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 12, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 13, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 14, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 15, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a spoon", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 16, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 17, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 18, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 19, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 20, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a book", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 21, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 22, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 23, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 24, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 25, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 26, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 27, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 28, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 29, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 30, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 31, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 32, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 33, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 34, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 35, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a chair", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 36, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv" + }, + { + "i": 37, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 38, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 39, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 40, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a handbag", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 41, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 42, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a frisbee", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 43, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 44, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 45, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 46, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 47, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 48, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 49, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a person", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 50, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 51, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 52, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 53, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 54, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 55, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 56, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 57, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 58, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 59, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 60, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 61, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 62, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 63, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a donut", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 64, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 65, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 66, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 67, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 68, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a cake", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 69, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 70, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 71, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 72, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 73, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 74, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 75, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 76, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 77, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 78, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 79, + "seed": 1, + "tag": "single_object", + "prompt": "a photo of a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 80, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bench and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 81, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 82, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a toaster and an oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing oven" + }, + { + "i": 83, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a broccoli and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 84, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a wine glass", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing wine glass" + }, + { + "i": 85, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a fork and a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 86, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a hair drier and a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 87, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a horse and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 88, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a horse and a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 89, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 90, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a cake and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 91, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a hair drier and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 92, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a knife and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 93, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a couch and a wine glass", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 94, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a frisbee and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 95, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a book and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 96, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a dining table and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 97, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a frisbee and a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 98, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a couch and a horse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 99, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a toilet and a computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toilet" + }, + { + "i": 100, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bottle and a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 101, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a potted plant and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 102, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a skateboard and a cake", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 103, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a broccoli and a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 104, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a zebra and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 105, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of an oven and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 106, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 107, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a vase and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 108, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a skateboard and a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 109, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a pizza and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 110, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bowl and a pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 111, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bird", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tennis racket" + }, + { + "i": 112, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a wine glass and a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 113, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a fork and a book", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 114, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a scissors and a bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 115, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a laptop and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing carrot" + }, + { + "i": 116, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a stop sign and a bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 117, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a microwave and a truck", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing truck" + }, + { + "i": 118, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a person and a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 119, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a frisbee and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing frisbee" + }, + { + "i": 120, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a parking meter and a teddy bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 121, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 122, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a stop sign and a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 123, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a tennis racket", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tennis racket" + }, + { + "i": 124, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a scissors and a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 125, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a pizza and a book", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 126, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a giraffe and a computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing computer mouse" + }, + { + "i": 127, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a stop sign and a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 128, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 129, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a chair and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 130, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tv and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing carrot" + }, + { + "i": 131, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a surfboard and a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 132, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 133, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 134, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a scissors and a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 135, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a person and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 136, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a cow and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 137, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a handbag and a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 138, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a chair and a laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 139, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 140, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a book and a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 141, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a horse and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 142, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bench and a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 143, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a traffic light and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 144, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a sports ball and a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 145, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 146, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tv and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 147, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bench and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 148, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 149, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a person and an apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing apple" + }, + { + "i": 150, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a sink and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 151, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a stop sign and a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 152, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a knife and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 153, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a wine glass and a handbag", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 154, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bowl and a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 155, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a frisbee and an apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing apple" + }, + { + "i": 156, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing computer keyboard" + }, + { + "i": 157, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a stop sign and a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 158, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a potted plant and a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 159, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tv and a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 160, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a tie and a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 161, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a potted plant and a donut", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 162, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a person and a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 163, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a couch and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 164, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a fork and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 165, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of an apple and a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 166, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a bus and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 167, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a person and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 168, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a carrot and a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 169, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 170, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 171, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a baseball glove and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 172, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a microwave and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 173, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a cake and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 174, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a car and a computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing computer mouse" + }, + { + "i": 175, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a suitcase and a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 176, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a person and a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 177, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a cell phone and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 178, + "seed": 1, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 179, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two clocks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 180, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two backpacks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 181, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 182, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 183, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three sports balls", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 184, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 185, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two ties", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 186, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 187, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two toothbrushs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two toothbrushs'" + }, + { + "i": 188, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three persons", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three persons'" + }, + { + "i": 189, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three tennis rackets", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 190, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four bowls", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 191, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four vases", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 5 != 4" + }, + { + "i": 192, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three cups", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 193, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 194, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 195, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two ovens", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 196, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two toilets", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 5 != 2" + }, + { + "i": 197, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two bicycles", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 198, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two trains", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 199, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three oranges", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 200, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 201, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three handbags", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 202, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 203, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 204, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four dogs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 205, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 206, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two sheeps", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sheeps'" + }, + { + "i": 207, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three hot dogs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 3" + }, + { + "i": 208, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 209, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three kites", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 210, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 4" + }, + { + "i": 211, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three cell phones", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 212, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four baseball gloves", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 4" + }, + { + "i": 213, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 214, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two beds", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 2" + }, + { + "i": 215, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two tv remotes", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 216, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 217, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three books", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 218, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 219, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two vases", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 220, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four donuts", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 5 != 4" + }, + { + "i": 221, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four chairs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 4" + }, + { + "i": 222, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three baseball bats", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 223, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four stop signs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 224, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 225, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three refrigerators", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 226, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 227, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 228, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four tvs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 229, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 230, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four broccolis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 17 != 4" + }, + { + "i": 231, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 232, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 233, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two carrots", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 234, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two sandwichs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sandwichs'" + }, + { + "i": 235, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four traffic lights", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 6 != 4" + }, + { + "i": 236, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four clocks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 5 != 4" + }, + { + "i": 237, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two cars", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 238, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two bananas", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 39 != 2" + }, + { + "i": 239, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 240, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 241, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four knifes", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four knifes'" + }, + { + "i": 242, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three suitcases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 243, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 244, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two teddy bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 245, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four skateboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 246, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four hot dogs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 4" + }, + { + "i": 247, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three birds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 248, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four boats", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 249, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four microwaves", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 250, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two hair driers", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 251, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three laptops", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 252, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three cows", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 3" + }, + { + "i": 253, + "seed": 1, + "tag": "counting", + "prompt": "a photo of two parking meters", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 254, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four benchs'" + }, + { + "i": 255, + "seed": 1, + "tag": "counting", + "prompt": "a photo of three benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three benchs'" + }, + { + "i": 256, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 257, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four books", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 258, + "seed": 1, + "tag": "counting", + "prompt": "a photo of four buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 259, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue fire hydrant", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour pink != blue" + }, + { + "i": 260, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a pink car", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 261, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple cup", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 262, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 263, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow boat", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 264, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 265, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 266, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 267, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 268, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 269, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 270, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 271, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 272, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green microwave", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing microwave" + }, + { + "i": 273, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 274, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 275, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 276, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 277, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange orange", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != orange" + }, + { + "i": 278, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black donut", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing donut" + }, + { + "i": 279, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour pink != red" + }, + { + "i": 280, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 281, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a pink skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 282, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 283, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 284, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown chair", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 285, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 286, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 287, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 288, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 289, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 290, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green couch", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing couch" + }, + { + "i": 291, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 292, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange tv", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 293, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing scissors" + }, + { + "i": 294, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a pink cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 295, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green surfboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 296, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 297, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 298, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 299, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 300, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 301, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing backpack" + }, + { + "i": 302, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow train", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing train" + }, + { + "i": 303, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a pink potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 304, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 305, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 306, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black train", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 307, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 308, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 309, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 310, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 311, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != green" + }, + { + "i": 312, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != blue" + }, + { + "i": 313, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 314, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 315, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a purple scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 316, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 317, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 318, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 319, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a brown orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 320, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green clock", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 321, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 322, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow oven", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 323, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != green" + }, + { + "i": 324, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black teddy bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing teddy bear" + }, + { + "i": 325, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 326, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 327, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 328, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 329, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 330, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 331, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 332, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 333, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing scissors" + }, + { + "i": 334, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour pink != red" + }, + { + "i": 335, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a white orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 336, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 337, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 338, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 339, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a pink stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 340, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black vase", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour pink != black" + }, + { + "i": 341, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a black backpack", + "judge_ok": true, + "self_verified": false, + "recoloured": false, + "reason": null + }, + { + "i": 342, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 343, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 344, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 345, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a green bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 346, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 347, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 348, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a pink parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 349, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 350, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a yellow broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != yellow" + }, + { + "i": 351, + "seed": 1, + "tag": "colors", + "prompt": "a photo of an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer mouse" + }, + { + "i": 352, + "seed": 1, + "tag": "colors", + "prompt": "a photo of a red cake", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 353, + "seed": 1, + "tag": "position", + "prompt": "a photo of a dog right of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 354, + "seed": 1, + "tag": "position", + "prompt": "a photo of a wine glass above a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 355, + "seed": 1, + "tag": "position", + "prompt": "a photo of a couch below a cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 356, + "seed": 1, + "tag": "position", + "prompt": "a photo of a laptop left of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 357, + "seed": 1, + "tag": "position", + "prompt": "a photo of a fork above a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 358, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tie right of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 359, + "seed": 1, + "tag": "position", + "prompt": "a photo of a stop sign above a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 360, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bird below a skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 361, + "seed": 1, + "tag": "position", + "prompt": "a photo of an apple above a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 362, + "seed": 1, + "tag": "position", + "prompt": "a photo of a train above a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing train" + }, + { + "i": 363, + "seed": 1, + "tag": "position", + "prompt": "a photo of a truck left of a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 364, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tv remote below a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 365, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bottle right of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 366, + "seed": 1, + "tag": "position", + "prompt": "a photo of a dog above a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 367, + "seed": 1, + "tag": "position", + "prompt": "a photo of a skateboard above a person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 368, + "seed": 1, + "tag": "position", + "prompt": "a photo of a baseball glove below an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 369, + "seed": 1, + "tag": "position", + "prompt": "a photo of a dining table right of an oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing oven" + }, + { + "i": 370, + "seed": 1, + "tag": "position", + "prompt": "a photo of a hot dog left of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 371, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bus below a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 372, + "seed": 1, + "tag": "position", + "prompt": "a photo of a backpack right of a sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 373, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cake below a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 374, + "seed": 1, + "tag": "position", + "prompt": "a photo of a dog right of a tie", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tie" + }, + { + "i": 375, + "seed": 1, + "tag": "position", + "prompt": "a photo of a suitcase right of a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing suitcase" + }, + { + "i": 376, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bear above a clock", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bear" + }, + { + "i": 377, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tv remote left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 378, + "seed": 1, + "tag": "position", + "prompt": "a photo of a sports ball left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 379, + "seed": 1, + "tag": "position", + "prompt": "a photo of a train right of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 380, + "seed": 1, + "tag": "position", + "prompt": "a photo of a hair drier below an elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 381, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tennis racket right of a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 382, + "seed": 1, + "tag": "position", + "prompt": "a photo of a wine glass right of a hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hot dog" + }, + { + "i": 383, + "seed": 1, + "tag": "position", + "prompt": "a photo of a computer mouse left of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 384, + "seed": 1, + "tag": "position", + "prompt": "a photo of a carrot left of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 385, + "seed": 1, + "tag": "position", + "prompt": "a photo of a kite above a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 386, + "seed": 1, + "tag": "position", + "prompt": "a photo of a toaster below a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 387, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cat below a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 388, + "seed": 1, + "tag": "position", + "prompt": "a photo of a skis right of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 389, + "seed": 1, + "tag": "position", + "prompt": "a photo of a stop sign above a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 390, + "seed": 1, + "tag": "position", + "prompt": "a photo of a stop sign above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 391, + "seed": 1, + "tag": "position", + "prompt": "a photo of a hot dog right of a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hot dog" + }, + { + "i": 392, + "seed": 1, + "tag": "position", + "prompt": "a photo of a pizza below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 393, + "seed": 1, + "tag": "position", + "prompt": "a photo of a hair drier left of a toilet", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 394, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cow left of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 395, + "seed": 1, + "tag": "position", + "prompt": "a photo of a suitcase above a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 396, + "seed": 1, + "tag": "position", + "prompt": "a photo of a book above a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 397, + "seed": 1, + "tag": "position", + "prompt": "a photo of a toothbrush below a pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 398, + "seed": 1, + "tag": "position", + "prompt": "a photo of a toilet left of a kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toilet" + }, + { + "i": 399, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tie above a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 400, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bird left of a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 401, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bed right of a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 402, + "seed": 1, + "tag": "position", + "prompt": "a photo of an elephant below a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 403, + "seed": 1, + "tag": "position", + "prompt": "a photo of a frisbee right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 404, + "seed": 1, + "tag": "position", + "prompt": "a photo of a vase above a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 405, + "seed": 1, + "tag": "position", + "prompt": "a photo of a zebra left of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 406, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bench left of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 407, + "seed": 1, + "tag": "position", + "prompt": "a photo of a donut right of a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing donut" + }, + { + "i": 408, + "seed": 1, + "tag": "position", + "prompt": "a photo of a frisbee below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 409, + "seed": 1, + "tag": "position", + "prompt": "a photo of a computer keyboard above a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 410, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tv below a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 411, + "seed": 1, + "tag": "position", + "prompt": "a photo of an elephant below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 412, + "seed": 1, + "tag": "position", + "prompt": "a photo of a suitcase left of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 413, + "seed": 1, + "tag": "position", + "prompt": "a photo of a train below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 414, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cat below a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 415, + "seed": 1, + "tag": "position", + "prompt": "a photo of a backpack below a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 416, + "seed": 1, + "tag": "position", + "prompt": "a photo of a sandwich below a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 417, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bicycle above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 418, + "seed": 1, + "tag": "position", + "prompt": "a photo of a knife right of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 419, + "seed": 1, + "tag": "position", + "prompt": "a photo of a hot dog above a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 420, + "seed": 1, + "tag": "position", + "prompt": "a photo of a zebra right of a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 421, + "seed": 1, + "tag": "position", + "prompt": "a photo of a chair left of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 422, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cow below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 423, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cup left of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 424, + "seed": 1, + "tag": "position", + "prompt": "a photo of a zebra below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 425, + "seed": 1, + "tag": "position", + "prompt": "a photo of a zebra below a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 426, + "seed": 1, + "tag": "position", + "prompt": "a photo of a laptop below a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 427, + "seed": 1, + "tag": "position", + "prompt": "a photo of a truck left of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 428, + "seed": 1, + "tag": "position", + "prompt": "a photo of a refrigerator above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 429, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tv above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 430, + "seed": 1, + "tag": "position", + "prompt": "a photo of a baseball glove right of a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 431, + "seed": 1, + "tag": "position", + "prompt": "a photo of a refrigerator below a scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 432, + "seed": 1, + "tag": "position", + "prompt": "a photo of a dining table above a suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 433, + "seed": 1, + "tag": "position", + "prompt": "a photo of a parking meter above a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 434, + "seed": 1, + "tag": "position", + "prompt": "a photo of a frisbee above a truck", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing truck" + }, + { + "i": 435, + "seed": 1, + "tag": "position", + "prompt": "a photo of a pizza right of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 436, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bus above a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 437, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cell phone left of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 438, + "seed": 1, + "tag": "position", + "prompt": "a photo of a horse right of a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 439, + "seed": 1, + "tag": "position", + "prompt": "a photo of a broccoli above a bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 440, + "seed": 1, + "tag": "position", + "prompt": "a photo of a vase right of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 441, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bear above a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 442, + "seed": 1, + "tag": "position", + "prompt": "a photo of a zebra right of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 443, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cow right of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 444, + "seed": 1, + "tag": "position", + "prompt": "a photo of a bed right of a frisbee", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 445, + "seed": 1, + "tag": "position", + "prompt": "a photo of a tie right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 446, + "seed": 1, + "tag": "position", + "prompt": "a photo of a laptop right of a tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing laptop" + }, + { + "i": 447, + "seed": 1, + "tag": "position", + "prompt": "a photo of a cell phone right of a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 448, + "seed": 1, + "tag": "position", + "prompt": "a photo of a couch below a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 449, + "seed": 1, + "tag": "position", + "prompt": "a photo of a clock below a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 450, + "seed": 1, + "tag": "position", + "prompt": "a photo of a couch below a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 451, + "seed": 1, + "tag": "position", + "prompt": "a photo of a donut below a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 452, + "seed": 1, + "tag": "position", + "prompt": "a photo of a couch left of a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 453, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple wine glass and a black apple", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing apple" + }, + { + "i": 454, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green bus and a purple microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 455, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green skis and a brown airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 456, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow computer keyboard and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sink" + }, + { + "i": 457, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a pink oven and a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 458, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple parking meter and a red laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 459, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow skateboard and an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 460, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red skis and a brown tie", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 461, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a pink skateboard and a black train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 462, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a purple bed", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 463, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple elephant and a brown sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sports ball" + }, + { + "i": 464, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple dog and a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 465, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white dining table and a red car", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 466, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue cell phone and a green apple", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 467, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red car and an orange potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 468, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown carrot and a white potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 469, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a black kite and a green bear", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing kite" + }, + { + "i": 470, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue laptop and a brown bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != blue" + }, + { + "i": 471, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green teddy bear and a brown kite", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing teddy bear" + }, + { + "i": 472, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow stop sign and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 473, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange snowboard and a green cat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing snowboard" + }, + { + "i": 474, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange truck and a pink sink", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 475, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown hot dog and a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 476, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green couch and an orange umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing couch" + }, + { + "i": 477, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown bed and a pink cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 478, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a black broccoli and a yellow cake", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 479, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red train and a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 480, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple tennis racket and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 481, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue vase and a black banana", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 482, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue clock and a white cup", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 483, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a blue couch", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing couch" + }, + { + "i": 484, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a red giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 485, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a pink tv remote and a blue airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 486, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a pink handbag and a black scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour green != black" + }, + { + "i": 487, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown car and a pink hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 488, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a black bus and a brown cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != black" + }, + { + "i": 489, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple sheep and a pink banana", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sheep" + }, + { + "i": 490, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue handbag and a white cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cell phone" + }, + { + "i": 491, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white pizza and a green umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing pizza" + }, + { + "i": 492, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white tie and a purple skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 493, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow sports ball and a green boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 494, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white wine glass and a brown giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 495, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow bowl and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bowl" + }, + { + "i": 496, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange microwave and a black spoon", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing spoon" + }, + { + "i": 497, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange skateboard and a pink bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 498, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue toilet and a white suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 499, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white boat and an orange hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour red != orange" + }, + { + "i": 500, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow dining table and a pink dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 501, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red cake and a purple chair", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 502, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue tie and a pink dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 503, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue cow and a black computer keyboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 504, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow pizza and a green oven", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 505, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red laptop and a brown car", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 506, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a blue scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour purple != blue" + }, + { + "i": 507, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green surfboard and an orange oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 508, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow parking meter and a pink refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 509, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown computer mouse and a purple bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bottle" + }, + { + "i": 510, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a green cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 511, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red giraffe and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing giraffe" + }, + { + "i": 512, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown oven and a purple train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != brown" + }, + { + "i": 513, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue baseball bat and a pink book", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing baseball bat" + }, + { + "i": 514, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green cup and a yellow bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 515, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow suitcase and a brown bus", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 516, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange motorcycle and a pink donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 517, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange giraffe and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != orange" + }, + { + "i": 518, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a green carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 519, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a black bottle and a white refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 520, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white dog and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 521, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a red car", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 522, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red stop sign and a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 523, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow car and an orange toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing toothbrush" + }, + { + "i": 524, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a black potted plant and a yellow toilet", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 525, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown dining table and a white suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 526, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange donut and a yellow stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 527, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green suitcase and a blue boat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing boat" + }, + { + "i": 528, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange tennis racket and a yellow sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 529, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a red chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 530, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple suitcase and an orange pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour white != orange" + }, + { + "i": 531, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white bottle and a blue sheep", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bottle" + }, + { + "i": 532, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a purple backpack and a white umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing backpack" + }, + { + "i": 533, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange potted plant and a black spoon", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing spoon" + }, + { + "i": 534, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green tennis racket and a black dog", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 535, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow handbag and a blue refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 536, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a pink broccoli and a red sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing broccoli" + }, + { + "i": 537, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red bowl and a pink sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour pink != red" + }, + { + "i": 538, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white toilet and a red apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 539, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a pink dining table and a black sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 540, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a black car and a green parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != black" + }, + { + "i": 541, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow bird and a black motorcycle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != black" + }, + { + "i": 542, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown giraffe and a white stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing stop sign" + }, + { + "i": 543, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a white banana and a black elephant", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour green != black" + }, + { + "i": 544, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange cow and a purple sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 545, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red clock and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 546, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a brown knife and a blue donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 547, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red cup and a pink handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour yellow != red" + }, + { + "i": 548, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a yellow bicycle and a red motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 549, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a red orange and a purple broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 550, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of an orange traffic light and a white toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 551, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a green cup and a red pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 552, + "seed": 1, + "tag": "color_attr", + "prompt": "a photo of a blue pizza and a yellow baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 0, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 1, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 2, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 3, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 4, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 5, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 6, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 7, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 8, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 9, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a cup", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 10, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 11, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 12, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 13, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 14, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 15, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a spoon", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 16, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 17, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 18, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 19, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 20, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a book", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 21, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 22, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 23, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 24, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 25, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 26, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 27, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 28, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 29, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 30, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 31, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 32, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 33, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 34, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 35, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a chair", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 36, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 37, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 38, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 39, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 40, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a handbag", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 41, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 42, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a frisbee", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 43, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 44, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 45, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 46, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 47, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 48, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 49, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a person", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 50, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 51, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 52, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 53, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 54, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 55, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 56, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 57, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 58, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 59, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 60, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 61, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 62, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 63, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a donut", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 64, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 65, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 66, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 67, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 68, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a cake", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 69, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 70, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 71, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 72, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 73, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 74, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 75, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 76, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 77, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 78, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 79, + "seed": 2, + "tag": "single_object", + "prompt": "a photo of a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 80, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bench and a sports ball", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 81, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 82, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a toaster and an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 83, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a broccoli and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 84, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 85, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a fork and a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 86, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a hair drier and a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 87, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a horse and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 88, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a horse and a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 89, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 90, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a cake and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 91, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a hair drier and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 92, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a knife and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 93, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a couch and a wine glass", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 94, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a frisbee and a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 95, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a book and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 96, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a dining table and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 97, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a frisbee and a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 98, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a couch and a horse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 99, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a toilet and a computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toilet" + }, + { + "i": 100, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bottle and a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 101, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a potted plant and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 102, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a skateboard and a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 103, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a broccoli and a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 104, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a zebra and a bed", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bed" + }, + { + "i": 105, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of an oven and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 106, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 107, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a vase and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 108, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a skateboard and a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 109, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a pizza and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 110, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bowl and a pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 111, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bird", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tennis racket" + }, + { + "i": 112, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a wine glass and a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 113, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a fork and a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 114, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a scissors and a bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 115, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a laptop and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing laptop" + }, + { + "i": 116, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a stop sign and a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 117, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a microwave and a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 118, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a person and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 119, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a frisbee and a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 120, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a parking meter and a teddy bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 121, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 122, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a stop sign and a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 123, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 124, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a scissors and a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 125, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a pizza and a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 126, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a giraffe and a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 127, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a stop sign and a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 128, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 129, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a chair and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 130, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tv and a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 131, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a surfboard and a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 132, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 133, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 134, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a scissors and a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 135, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a person and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 136, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a cow and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 137, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a handbag and a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 138, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a chair and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 139, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 140, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a book and a baseball bat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 141, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a horse and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 142, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bench and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 143, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a traffic light and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 144, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a sports ball and a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 145, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 146, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tv and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 147, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bench and a snowboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 148, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 149, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a person and an apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 150, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a sink and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sink" + }, + { + "i": 151, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a stop sign and a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 152, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a knife and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 153, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a wine glass and a handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 154, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bowl and a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bowl" + }, + { + "i": 155, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a frisbee and an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 156, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 157, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a stop sign and a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 158, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a potted plant and a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 159, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tv and a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 160, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a tie and a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 161, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a potted plant and a donut", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 162, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a person and a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 163, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a couch and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 164, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a fork and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 165, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of an apple and a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 166, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a bus and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 167, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a person and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 168, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a carrot and a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 169, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 170, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 171, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a baseball glove and a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 172, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a microwave and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 173, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a cake and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 174, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a car and a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 175, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a suitcase and a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 176, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a person and a traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 177, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a cell phone and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 178, + "seed": 2, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 179, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two clocks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 180, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two backpacks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 181, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 182, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 183, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three sports balls", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 3" + }, + { + "i": 184, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 185, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two ties", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 186, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 187, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two toothbrushs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two toothbrushs'" + }, + { + "i": 188, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three persons", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three persons'" + }, + { + "i": 189, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three tennis rackets", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 190, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four bowls", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 191, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four vases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 192, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three cups", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 193, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 194, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 195, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two ovens", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 196, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two toilets", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 197, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two bicycles", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 198, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two trains", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 199, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three oranges", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 13 != 3" + }, + { + "i": 200, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 201, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 202, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 203, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 204, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four dogs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 205, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 206, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two sheeps", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sheeps'" + }, + { + "i": 207, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three hot dogs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 208, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 209, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three kites", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 210, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 211, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three cell phones", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 212, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four baseball gloves", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 4" + }, + { + "i": 213, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 214, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two beds", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 2" + }, + { + "i": 215, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two tv remotes", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 216, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 217, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three books", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 18 != 3" + }, + { + "i": 218, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 219, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two vases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 220, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four donuts", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 5 != 4" + }, + { + "i": 221, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four chairs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 4" + }, + { + "i": 222, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three baseball bats", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 3" + }, + { + "i": 223, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four stop signs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 224, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 225, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three refrigerators", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 226, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 227, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 228, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four tvs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 229, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 230, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four broccolis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 23 != 4" + }, + { + "i": 231, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 232, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 233, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two carrots", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 63 != 2" + }, + { + "i": 234, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two sandwichs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sandwichs'" + }, + { + "i": 235, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four traffic lights", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 236, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four clocks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 237, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two cars", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 238, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two bananas", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 239, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 240, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 241, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four knifes", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four knifes'" + }, + { + "i": 242, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three suitcases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 243, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 244, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two teddy bears", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 2" + }, + { + "i": 245, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four skateboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 246, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four hot dogs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 247, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three birds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 248, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four boats", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 249, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four microwaves", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 250, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two hair driers", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 251, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three laptops", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 252, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three cows", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 253, + "seed": 2, + "tag": "counting", + "prompt": "a photo of two parking meters", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 254, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four benchs'" + }, + { + "i": 255, + "seed": 2, + "tag": "counting", + "prompt": "a photo of three benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three benchs'" + }, + { + "i": 256, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 257, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four books", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 15 != 4" + }, + { + "i": 258, + "seed": 2, + "tag": "counting", + "prompt": "a photo of four buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 259, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue fire hydrant", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour pink != blue" + }, + { + "i": 260, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a pink car", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 261, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple cup", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 262, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 263, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow boat", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 264, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 265, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 266, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 267, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 268, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 269, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 270, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 271, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 272, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green microwave", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing microwave" + }, + { + "i": 273, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 274, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 275, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 276, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 277, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange orange", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != orange" + }, + { + "i": 278, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black donut", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing donut" + }, + { + "i": 279, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 280, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 281, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a pink skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 282, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 283, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 284, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown chair", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 285, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 286, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 287, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 288, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 289, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 290, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green couch", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing couch" + }, + { + "i": 291, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 292, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange tv", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv" + }, + { + "i": 293, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing scissors" + }, + { + "i": 294, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a pink cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 295, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green surfboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 296, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 297, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 298, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 299, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 300, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 301, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing backpack" + }, + { + "i": 302, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow train", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing train" + }, + { + "i": 303, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a pink potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 304, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 305, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 306, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black train", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 307, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 308, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 309, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 310, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 311, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 312, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != blue" + }, + { + "i": 313, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 314, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 315, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a purple scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 316, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 317, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 318, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 319, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a brown orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 320, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green clock", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 321, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 322, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow oven", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 323, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != green" + }, + { + "i": 324, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black teddy bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing teddy bear" + }, + { + "i": 325, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 326, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 327, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 328, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 329, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 330, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 331, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 332, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 333, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing scissors" + }, + { + "i": 334, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour pink != red" + }, + { + "i": 335, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a white orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 336, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 337, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 338, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 339, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a pink stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 340, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black vase", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour pink != black" + }, + { + "i": 341, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a black backpack", + "judge_ok": true, + "self_verified": false, + "recoloured": false, + "reason": null + }, + { + "i": 342, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 343, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 344, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 345, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a green bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 346, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 347, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 348, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a pink parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 349, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 350, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a yellow broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != yellow" + }, + { + "i": 351, + "seed": 2, + "tag": "colors", + "prompt": "a photo of an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer mouse" + }, + { + "i": 352, + "seed": 2, + "tag": "colors", + "prompt": "a photo of a red cake", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 353, + "seed": 2, + "tag": "position", + "prompt": "a photo of a dog right of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 354, + "seed": 2, + "tag": "position", + "prompt": "a photo of a wine glass above a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 355, + "seed": 2, + "tag": "position", + "prompt": "a photo of a couch below a cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 356, + "seed": 2, + "tag": "position", + "prompt": "a photo of a laptop left of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 357, + "seed": 2, + "tag": "position", + "prompt": "a photo of a fork above a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 358, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tie right of a baseball bat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 359, + "seed": 2, + "tag": "position", + "prompt": "a photo of a stop sign above a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 360, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bird below a skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 361, + "seed": 2, + "tag": "position", + "prompt": "a photo of an apple above a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 362, + "seed": 2, + "tag": "position", + "prompt": "a photo of a train above a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 363, + "seed": 2, + "tag": "position", + "prompt": "a photo of a truck left of a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 364, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tv remote below a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 365, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bottle right of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 366, + "seed": 2, + "tag": "position", + "prompt": "a photo of a dog above a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 367, + "seed": 2, + "tag": "position", + "prompt": "a photo of a skateboard above a person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 368, + "seed": 2, + "tag": "position", + "prompt": "a photo of a baseball glove below an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 369, + "seed": 2, + "tag": "position", + "prompt": "a photo of a dining table right of an oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 370, + "seed": 2, + "tag": "position", + "prompt": "a photo of a hot dog left of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 371, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bus below a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 372, + "seed": 2, + "tag": "position", + "prompt": "a photo of a backpack right of a sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 373, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cake below a baseball bat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 374, + "seed": 2, + "tag": "position", + "prompt": "a photo of a dog right of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 375, + "seed": 2, + "tag": "position", + "prompt": "a photo of a suitcase right of a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing suitcase" + }, + { + "i": 376, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bear above a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 377, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tv remote left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 378, + "seed": 2, + "tag": "position", + "prompt": "a photo of a sports ball left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 379, + "seed": 2, + "tag": "position", + "prompt": "a photo of a train right of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 380, + "seed": 2, + "tag": "position", + "prompt": "a photo of a hair drier below an elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 381, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tennis racket right of a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 382, + "seed": 2, + "tag": "position", + "prompt": "a photo of a wine glass right of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 383, + "seed": 2, + "tag": "position", + "prompt": "a photo of a computer mouse left of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 384, + "seed": 2, + "tag": "position", + "prompt": "a photo of a carrot left of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 385, + "seed": 2, + "tag": "position", + "prompt": "a photo of a kite above a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 386, + "seed": 2, + "tag": "position", + "prompt": "a photo of a toaster below a traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing traffic light" + }, + { + "i": 387, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cat below a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 388, + "seed": 2, + "tag": "position", + "prompt": "a photo of a skis right of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 389, + "seed": 2, + "tag": "position", + "prompt": "a photo of a stop sign above a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 390, + "seed": 2, + "tag": "position", + "prompt": "a photo of a stop sign above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 391, + "seed": 2, + "tag": "position", + "prompt": "a photo of a hot dog right of a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hot dog" + }, + { + "i": 392, + "seed": 2, + "tag": "position", + "prompt": "a photo of a pizza below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 393, + "seed": 2, + "tag": "position", + "prompt": "a photo of a hair drier left of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 394, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cow left of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 395, + "seed": 2, + "tag": "position", + "prompt": "a photo of a suitcase above a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 396, + "seed": 2, + "tag": "position", + "prompt": "a photo of a book above a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 397, + "seed": 2, + "tag": "position", + "prompt": "a photo of a toothbrush below a pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toothbrush" + }, + { + "i": 398, + "seed": 2, + "tag": "position", + "prompt": "a photo of a toilet left of a kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toilet" + }, + { + "i": 399, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tie above a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 400, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bird left of a couch", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 401, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bed right of a sports ball", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 402, + "seed": 2, + "tag": "position", + "prompt": "a photo of an elephant below a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 403, + "seed": 2, + "tag": "position", + "prompt": "a photo of a frisbee right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 404, + "seed": 2, + "tag": "position", + "prompt": "a photo of a vase above a fire hydrant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fire hydrant" + }, + { + "i": 405, + "seed": 2, + "tag": "position", + "prompt": "a photo of a zebra left of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 406, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bench left of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 407, + "seed": 2, + "tag": "position", + "prompt": "a photo of a donut right of a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing donut" + }, + { + "i": 408, + "seed": 2, + "tag": "position", + "prompt": "a photo of a frisbee below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 409, + "seed": 2, + "tag": "position", + "prompt": "a photo of a computer keyboard above a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 410, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tv below a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 411, + "seed": 2, + "tag": "position", + "prompt": "a photo of an elephant below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 412, + "seed": 2, + "tag": "position", + "prompt": "a photo of a suitcase left of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 413, + "seed": 2, + "tag": "position", + "prompt": "a photo of a train below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 414, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cat below a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 415, + "seed": 2, + "tag": "position", + "prompt": "a photo of a backpack below a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 416, + "seed": 2, + "tag": "position", + "prompt": "a photo of a sandwich below a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 417, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bicycle above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 418, + "seed": 2, + "tag": "position", + "prompt": "a photo of a knife right of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 419, + "seed": 2, + "tag": "position", + "prompt": "a photo of a hot dog above a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 420, + "seed": 2, + "tag": "position", + "prompt": "a photo of a zebra right of a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 421, + "seed": 2, + "tag": "position", + "prompt": "a photo of a chair left of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 422, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cow below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 423, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cup left of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 424, + "seed": 2, + "tag": "position", + "prompt": "a photo of a zebra below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 425, + "seed": 2, + "tag": "position", + "prompt": "a photo of a zebra below a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 426, + "seed": 2, + "tag": "position", + "prompt": "a photo of a laptop below a sports ball", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 427, + "seed": 2, + "tag": "position", + "prompt": "a photo of a truck left of a baseball bat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 428, + "seed": 2, + "tag": "position", + "prompt": "a photo of a refrigerator above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 429, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tv above a baseball bat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 430, + "seed": 2, + "tag": "position", + "prompt": "a photo of a baseball glove right of a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 431, + "seed": 2, + "tag": "position", + "prompt": "a photo of a refrigerator below a scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 432, + "seed": 2, + "tag": "position", + "prompt": "a photo of a dining table above a suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 433, + "seed": 2, + "tag": "position", + "prompt": "a photo of a parking meter above a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 434, + "seed": 2, + "tag": "position", + "prompt": "a photo of a frisbee above a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 435, + "seed": 2, + "tag": "position", + "prompt": "a photo of a pizza right of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 436, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bus above a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 437, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cell phone left of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 438, + "seed": 2, + "tag": "position", + "prompt": "a photo of a horse right of a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 439, + "seed": 2, + "tag": "position", + "prompt": "a photo of a broccoli above a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 440, + "seed": 2, + "tag": "position", + "prompt": "a photo of a vase right of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 441, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bear above a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 442, + "seed": 2, + "tag": "position", + "prompt": "a photo of a zebra right of a bed", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bed" + }, + { + "i": 443, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cow right of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 444, + "seed": 2, + "tag": "position", + "prompt": "a photo of a bed right of a frisbee", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing frisbee" + }, + { + "i": 445, + "seed": 2, + "tag": "position", + "prompt": "a photo of a tie right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 446, + "seed": 2, + "tag": "position", + "prompt": "a photo of a laptop right of a tv", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing laptop" + }, + { + "i": 447, + "seed": 2, + "tag": "position", + "prompt": "a photo of a cell phone right of a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 448, + "seed": 2, + "tag": "position", + "prompt": "a photo of a couch below a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 449, + "seed": 2, + "tag": "position", + "prompt": "a photo of a clock below a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 450, + "seed": 2, + "tag": "position", + "prompt": "a photo of a couch below a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 451, + "seed": 2, + "tag": "position", + "prompt": "a photo of a donut below a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 452, + "seed": 2, + "tag": "position", + "prompt": "a photo of a couch left of a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 453, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple wine glass and a black apple", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing apple" + }, + { + "i": 454, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green bus and a purple microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 455, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green skis and a brown airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 456, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow computer keyboard and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sink" + }, + { + "i": 457, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a pink oven and a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 458, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple parking meter and a red laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 459, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow skateboard and an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 460, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red skis and a brown tie", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 461, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a pink skateboard and a black train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 462, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a purple bed", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 463, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple elephant and a brown sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sports ball" + }, + { + "i": 464, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple dog and a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 465, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white dining table and a red car", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 466, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue cell phone and a green apple", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 467, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red car and an orange potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 468, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown carrot and a white potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 469, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a black kite and a green bear", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing kite" + }, + { + "i": 470, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue laptop and a brown bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != blue" + }, + { + "i": 471, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green teddy bear and a brown kite", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing teddy bear" + }, + { + "i": 472, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow stop sign and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 473, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange snowboard and a green cat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing snowboard" + }, + { + "i": 474, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange truck and a pink sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sink" + }, + { + "i": 475, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown hot dog and a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 476, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green couch and an orange umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing couch" + }, + { + "i": 477, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown bed and a pink cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 478, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a black broccoli and a yellow cake", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 479, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red train and a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 480, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple tennis racket and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 481, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue vase and a black banana", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 482, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue clock and a white cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cup" + }, + { + "i": 483, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a blue couch", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 484, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a red giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 485, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a pink tv remote and a blue airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 486, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a pink handbag and a black scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour green != black" + }, + { + "i": 487, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown car and a pink hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 488, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a black bus and a brown cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != black" + }, + { + "i": 489, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple sheep and a pink banana", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sheep" + }, + { + "i": 490, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue handbag and a white cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 491, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white pizza and a green umbrella", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing pizza" + }, + { + "i": 492, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white tie and a purple skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 493, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow sports ball and a green boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 494, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white wine glass and a brown giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 495, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow bowl and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bowl" + }, + { + "i": 496, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange microwave and a black spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing spoon" + }, + { + "i": 497, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange skateboard and a pink bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skateboard" + }, + { + "i": 498, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue toilet and a white suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing suitcase" + }, + { + "i": 499, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white boat and an orange hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour red != orange" + }, + { + "i": 500, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow dining table and a pink dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 501, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red cake and a purple chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 502, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue tie and a pink dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 503, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue cow and a black computer keyboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 504, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow pizza and a green oven", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 505, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red laptop and a brown car", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != brown" + }, + { + "i": 506, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a blue scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 507, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green surfboard and an orange oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 508, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow parking meter and a pink refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 509, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown computer mouse and a purple bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer mouse" + }, + { + "i": 510, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a green cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 511, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red giraffe and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing giraffe" + }, + { + "i": 512, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown oven and a purple train", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 513, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue baseball bat and a pink book", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing baseball bat" + }, + { + "i": 514, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green cup and a yellow bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 515, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow suitcase and a brown bus", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 516, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange motorcycle and a pink donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 517, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange giraffe and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != orange" + }, + { + "i": 518, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a green carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 519, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a black bottle and a white refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 520, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white dog and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 521, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a red car", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 522, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red stop sign and a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 523, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow car and an orange toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing toothbrush" + }, + { + "i": 524, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a black potted plant and a yellow toilet", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 525, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown dining table and a white suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 526, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange donut and a yellow stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 527, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green suitcase and a blue boat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing boat" + }, + { + "i": 528, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange tennis racket and a yellow sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 529, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a red chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 530, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple suitcase and an orange pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing suitcase" + }, + { + "i": 531, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white bottle and a blue sheep", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bottle" + }, + { + "i": 532, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a purple backpack and a white umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing backpack" + }, + { + "i": 533, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange potted plant and a black spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 534, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green tennis racket and a black dog", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 535, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow handbag and a blue refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 536, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a pink broccoli and a red sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing broccoli" + }, + { + "i": 537, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red bowl and a pink sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour pink != red" + }, + { + "i": 538, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white toilet and a red apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 539, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a pink dining table and a black sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 540, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a black car and a green parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour blue != black" + }, + { + "i": 541, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow bird and a black motorcycle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != black" + }, + { + "i": 542, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown giraffe and a white stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing stop sign" + }, + { + "i": 543, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a white banana and a black elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour white != black" + }, + { + "i": 544, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange cow and a purple sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 545, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red clock and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 546, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a brown knife and a blue donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 547, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red cup and a pink handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour yellow != red" + }, + { + "i": 548, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a yellow bicycle and a red motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 549, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a red orange and a purple broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 550, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of an orange traffic light and a white toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 551, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a green cup and a red pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 552, + "seed": 2, + "tag": "color_attr", + "prompt": "a photo of a blue pizza and a yellow baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 0, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 1, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 2, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 3, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 4, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a carrot", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 5, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 6, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a fork", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 7, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 8, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing refrigerator" + }, + { + "i": 9, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a cup", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 10, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 11, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 12, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 13, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 14, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 15, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 16, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 17, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 18, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 19, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a traffic light", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 20, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 21, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 22, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 23, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 24, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a toaster", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 25, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 26, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 27, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 28, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 29, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 30, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 31, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 32, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a baseball bat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 33, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 34, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 35, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 36, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 37, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 38, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 39, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 40, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 41, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 42, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a frisbee", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 43, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 44, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bottle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 45, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 46, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 47, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of an oven", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 48, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 49, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 50, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 51, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a vase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 52, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 53, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 54, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 55, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 56, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 57, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a sheep", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 58, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 59, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 60, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 61, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 62, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 63, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a donut", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 64, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 65, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 66, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 67, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 68, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a cake", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 69, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 70, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of an apple", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 71, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 72, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 73, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 74, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a hot dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 75, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a truck", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 76, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 77, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a sports ball", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 78, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 79, + "seed": 3, + "tag": "single_object", + "prompt": "a photo of a kite", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 80, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bench and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 81, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 82, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a toaster and an oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 83, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a broccoli and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 84, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 85, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a fork and a knife", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing knife" + }, + { + "i": 86, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a hair drier and a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 87, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a horse and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 88, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a horse and a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 89, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing carrot" + }, + { + "i": 90, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a cake and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 91, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a hair drier and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 92, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a knife and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 93, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a couch and a wine glass", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 94, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a frisbee and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 95, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a book and a laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 96, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a dining table and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 97, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a frisbee and a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 98, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a couch and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 99, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a toilet and a computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 100, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bottle and a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 101, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a potted plant and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 102, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a skateboard and a cake", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 103, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a broccoli and a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 104, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a zebra and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 105, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of an oven and a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 106, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 107, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a vase and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 108, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a skateboard and a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 109, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a pizza and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 110, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bowl and a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 111, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 112, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a wine glass and a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 113, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a fork and a book", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 114, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a scissors and a bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 115, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a laptop and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing carrot" + }, + { + "i": 116, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a stop sign and a bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 117, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a microwave and a truck", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing truck" + }, + { + "i": 118, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a person and a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 119, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a frisbee and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing frisbee" + }, + { + "i": 120, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a parking meter and a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 121, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tennis racket and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 122, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a stop sign and a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 123, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 124, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a scissors and a sandwich", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 125, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a pizza and a book", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 126, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a giraffe and a computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing computer mouse" + }, + { + "i": 127, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a stop sign and a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 128, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 129, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a chair and a bench", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 130, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tv and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing carrot" + }, + { + "i": 131, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a surfboard and a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 132, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 133, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 134, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a scissors and a bird", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 135, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a person and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 136, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a cow and a horse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cow" + }, + { + "i": 137, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a handbag and a refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing handbag" + }, + { + "i": 138, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a chair and a laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 139, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 140, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a book and a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 141, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a horse and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 142, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bench and a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 143, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a traffic light and a backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing traffic light" + }, + { + "i": 144, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a sports ball and a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 145, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a computer mouse and a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 146, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tv and a bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 147, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bench and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 148, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a toothbrush and a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 149, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a person and an apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 150, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a sink and a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 151, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a stop sign and a dog", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 152, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a knife and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 153, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a wine glass and a handbag", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 154, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bowl and a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 155, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a frisbee and an apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing apple" + }, + { + "i": 156, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a computer keyboard and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cell phone" + }, + { + "i": 157, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a stop sign and a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 158, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a potted plant and a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 159, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tv and a cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cell phone" + }, + { + "i": 160, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a tie and a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tie" + }, + { + "i": 161, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a potted plant and a donut", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 162, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a person and a sink", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 163, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a couch and a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 164, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a fork and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 165, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of an apple and a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 166, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a bus and a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 167, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a person and a stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 168, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a carrot and a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 169, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 170, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a fire hydrant and a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 171, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a baseball glove and a carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 172, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a microwave and a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 173, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a cake and a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 174, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a car and a computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing computer mouse" + }, + { + "i": 175, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a suitcase and a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 176, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a person and a traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 177, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a cell phone and a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 178, + "seed": 3, + "tag": "two_object", + "prompt": "a photo of a baseball bat and a giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 179, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two clocks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 180, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two backpacks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 181, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 4" + }, + { + "i": 182, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 183, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three sports balls", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 184, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 185, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two ties", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 186, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 187, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two toothbrushs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two toothbrushs'" + }, + { + "i": 188, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three persons", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three persons'" + }, + { + "i": 189, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three tennis rackets", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 190, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four bowls", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 191, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four vases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 192, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three cups", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 193, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 194, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three sinks", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 195, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two ovens", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 2" + }, + { + "i": 196, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two toilets", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 197, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two bicycles", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 198, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two trains", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 199, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three oranges", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 3" + }, + { + "i": 200, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 201, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three handbags", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 3" + }, + { + "i": 202, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 3" + }, + { + "i": 203, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two snowboards", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 1 != 2" + }, + { + "i": 204, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four dogs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 205, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 3" + }, + { + "i": 206, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two sheeps", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sheeps'" + }, + { + "i": 207, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three hot dogs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 4 != 3" + }, + { + "i": 208, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 209, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three kites", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 210, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four apples", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 4" + }, + { + "i": 211, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three cell phones", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 212, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four baseball gloves", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 4" + }, + { + "i": 213, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three computer keyboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 214, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two beds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 215, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two tv remotes", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 216, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 217, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three books", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 3" + }, + { + "i": 218, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 219, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two vases", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 3 != 2" + }, + { + "i": 220, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four donuts", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 221, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four chairs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 222, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three baseball bats", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 223, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four stop signs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 224, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 225, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three refrigerators", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 3" + }, + { + "i": 226, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two fire hydrants", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 227, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three giraffes", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 228, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four tvs", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 229, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 230, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four broccolis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 9 != 4" + }, + { + "i": 231, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 232, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two trucks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 233, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two carrots", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 10 != 2" + }, + { + "i": 234, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two sandwichs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'two sandwichs'" + }, + { + "i": 235, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four traffic lights", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 7 != 4" + }, + { + "i": 236, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four clocks", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 237, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two cars", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 238, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two bananas", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 29 != 2" + }, + { + "i": 239, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two wine glasses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 240, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three pizzas", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 241, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four knifes", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four knifes'" + }, + { + "i": 242, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three suitcases", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 243, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four zebras", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 244, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two teddy bears", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 245, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four skateboards", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 246, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four hot dogs", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 2 != 4" + }, + { + "i": 247, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three birds", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 248, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four boats", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 249, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four microwaves", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 250, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two hair driers", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 0 != 2" + }, + { + "i": 251, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three laptops", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 252, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three cows", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 253, + "seed": 3, + "tag": "counting", + "prompt": "a photo of two parking meters", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 254, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'four benchs'" + }, + { + "i": 255, + "seed": 3, + "tag": "counting", + "prompt": "a photo of three benchs", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "parse: unknown object 'three benchs'" + }, + { + "i": 256, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four frisbees", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 257, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four books", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "count 8 != 4" + }, + { + "i": 258, + "seed": 3, + "tag": "counting", + "prompt": "a photo of four buses", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 259, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 260, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a pink car", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 261, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple cup", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 262, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 263, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow boat", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 264, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing umbrella" + }, + { + "i": 265, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 266, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 267, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 268, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 269, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hair drier" + }, + { + "i": 270, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != white" + }, + { + "i": 271, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 272, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 273, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red zebra", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 274, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 275, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow tv remote", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 276, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 277, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange orange", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != orange" + }, + { + "i": 278, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 279, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour pink != red" + }, + { + "i": 280, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 281, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a pink skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 282, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 283, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 284, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 285, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 286, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 287, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 288, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 289, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 290, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green couch", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 291, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 292, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange tv", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv" + }, + { + "i": 293, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 294, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a pink cell phone", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 295, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green surfboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 296, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 297, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black bicycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 298, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 299, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 300, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 301, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing backpack" + }, + { + "i": 302, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow train", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing train" + }, + { + "i": 303, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a pink potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 304, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 305, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != brown" + }, + { + "i": 306, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 307, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 308, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 309, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 310, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 311, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 312, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 313, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 314, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black tv remote", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 315, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a purple scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 316, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 317, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing toaster" + }, + { + "i": 318, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 319, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a brown orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 320, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green clock", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 321, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white sheep", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour green != white" + }, + { + "i": 322, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow oven", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 323, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 324, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black teddy bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing teddy bear" + }, + { + "i": 325, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 326, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 327, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red scissors", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 328, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 329, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black skis", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 330, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 331, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing refrigerator" + }, + { + "i": 332, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != white" + }, + { + "i": 333, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing scissors" + }, + { + "i": 334, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour pink != red" + }, + { + "i": 335, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a white orange", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing orange" + }, + { + "i": 336, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 337, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 338, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 339, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a pink stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 340, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 341, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a black backpack", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 342, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red car", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 343, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green computer mouse", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 344, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red backpack", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 345, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a green bus", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 346, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing toaster" + }, + { + "i": 347, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 348, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a pink parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 349, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 350, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a yellow broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 351, + "seed": 3, + "tag": "colors", + "prompt": "a photo of an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer mouse" + }, + { + "i": 352, + "seed": 3, + "tag": "colors", + "prompt": "a photo of a red cake", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cake" + }, + { + "i": 353, + "seed": 3, + "tag": "position", + "prompt": "a photo of a dog right of a teddy bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 354, + "seed": 3, + "tag": "position", + "prompt": "a photo of a wine glass above a kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing wine glass" + }, + { + "i": 355, + "seed": 3, + "tag": "position", + "prompt": "a photo of a couch below a cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cup" + }, + { + "i": 356, + "seed": 3, + "tag": "position", + "prompt": "a photo of a laptop left of a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 357, + "seed": 3, + "tag": "position", + "prompt": "a photo of a fork above a hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 358, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tie right of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 359, + "seed": 3, + "tag": "position", + "prompt": "a photo of a stop sign above a fork", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing fork" + }, + { + "i": 360, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bird below a skateboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 361, + "seed": 3, + "tag": "position", + "prompt": "a photo of an apple above a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 362, + "seed": 3, + "tag": "position", + "prompt": "a photo of a train above a potted plant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 363, + "seed": 3, + "tag": "position", + "prompt": "a photo of a truck left of a refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 364, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tv remote below a cow", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 365, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bottle right of a train", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 366, + "seed": 3, + "tag": "position", + "prompt": "a photo of a dog above a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 367, + "seed": 3, + "tag": "position", + "prompt": "a photo of a skateboard above a person", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing person" + }, + { + "i": 368, + "seed": 3, + "tag": "position", + "prompt": "a photo of a baseball glove below an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 369, + "seed": 3, + "tag": "position", + "prompt": "a photo of a dining table right of an oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing oven" + }, + { + "i": 370, + "seed": 3, + "tag": "position", + "prompt": "a photo of a hot dog left of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 371, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bus below a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 372, + "seed": 3, + "tag": "position", + "prompt": "a photo of a backpack right of a sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 373, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cake below a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 374, + "seed": 3, + "tag": "position", + "prompt": "a photo of a dog right of a tie", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 375, + "seed": 3, + "tag": "position", + "prompt": "a photo of a suitcase right of a boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing boat" + }, + { + "i": 376, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bear above a clock", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 377, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tv remote left of an umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing tv remote" + }, + { + "i": 378, + "seed": 3, + "tag": "position", + "prompt": "a photo of a sports ball left of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 379, + "seed": 3, + "tag": "position", + "prompt": "a photo of a train right of a dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 380, + "seed": 3, + "tag": "position", + "prompt": "a photo of a hair drier below an elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hair drier" + }, + { + "i": 381, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tennis racket right of a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 382, + "seed": 3, + "tag": "position", + "prompt": "a photo of a wine glass right of a hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing hot dog" + }, + { + "i": 383, + "seed": 3, + "tag": "position", + "prompt": "a photo of a computer mouse left of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 384, + "seed": 3, + "tag": "position", + "prompt": "a photo of a carrot left of an orange", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 385, + "seed": 3, + "tag": "position", + "prompt": "a photo of a kite above a toothbrush", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 386, + "seed": 3, + "tag": "position", + "prompt": "a photo of a toaster below a traffic light", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 387, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cat below a baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 388, + "seed": 3, + "tag": "position", + "prompt": "a photo of a skis right of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 389, + "seed": 3, + "tag": "position", + "prompt": "a photo of a stop sign above a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 390, + "seed": 3, + "tag": "position", + "prompt": "a photo of a stop sign above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 391, + "seed": 3, + "tag": "position", + "prompt": "a photo of a hot dog right of a skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skateboard" + }, + { + "i": 392, + "seed": 3, + "tag": "position", + "prompt": "a photo of a pizza below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 393, + "seed": 3, + "tag": "position", + "prompt": "a photo of a hair drier left of a toilet", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 394, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cow left of a stop sign", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 395, + "seed": 3, + "tag": "position", + "prompt": "a photo of a suitcase above a skis", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing skis" + }, + { + "i": 396, + "seed": 3, + "tag": "position", + "prompt": "a photo of a book above a laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing book" + }, + { + "i": 397, + "seed": 3, + "tag": "position", + "prompt": "a photo of a toothbrush below a pizza", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 398, + "seed": 3, + "tag": "position", + "prompt": "a photo of a toilet left of a kite", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing kite" + }, + { + "i": 399, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tie above a sink", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 400, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bird left of a couch", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing couch" + }, + { + "i": 401, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bed right of a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 402, + "seed": 3, + "tag": "position", + "prompt": "a photo of an elephant below a surfboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 403, + "seed": 3, + "tag": "position", + "prompt": "a photo of a frisbee right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 404, + "seed": 3, + "tag": "position", + "prompt": "a photo of a vase above a fire hydrant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 405, + "seed": 3, + "tag": "position", + "prompt": "a photo of a zebra left of an elephant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 406, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bench left of a bear", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 407, + "seed": 3, + "tag": "position", + "prompt": "a photo of a donut right of a bench", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 408, + "seed": 3, + "tag": "position", + "prompt": "a photo of a frisbee below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 409, + "seed": 3, + "tag": "position", + "prompt": "a photo of a computer keyboard above a snowboard", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing snowboard" + }, + { + "i": 410, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tv below a cow", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 411, + "seed": 3, + "tag": "position", + "prompt": "a photo of an elephant below a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 412, + "seed": 3, + "tag": "position", + "prompt": "a photo of a suitcase left of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 413, + "seed": 3, + "tag": "position", + "prompt": "a photo of a train below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 414, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cat below a backpack", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 415, + "seed": 3, + "tag": "position", + "prompt": "a photo of a backpack below a cake", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing backpack" + }, + { + "i": 416, + "seed": 3, + "tag": "position", + "prompt": "a photo of a sandwich below a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 417, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bicycle above a parking meter", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 418, + "seed": 3, + "tag": "position", + "prompt": "a photo of a knife right of a suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 419, + "seed": 3, + "tag": "position", + "prompt": "a photo of a hot dog above a knife", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 420, + "seed": 3, + "tag": "position", + "prompt": "a photo of a zebra right of a parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing parking meter" + }, + { + "i": 421, + "seed": 3, + "tag": "position", + "prompt": "a photo of a chair left of a zebra", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 422, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cow below an airplane", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 423, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cup left of an umbrella", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 424, + "seed": 3, + "tag": "position", + "prompt": "a photo of a zebra below a computer keyboard", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 425, + "seed": 3, + "tag": "position", + "prompt": "a photo of a zebra below a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 426, + "seed": 3, + "tag": "position", + "prompt": "a photo of a laptop below a sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing sports ball" + }, + { + "i": 427, + "seed": 3, + "tag": "position", + "prompt": "a photo of a truck left of a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 428, + "seed": 3, + "tag": "position", + "prompt": "a photo of a refrigerator above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 429, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tv above a baseball bat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball bat" + }, + { + "i": 430, + "seed": 3, + "tag": "position", + "prompt": "a photo of a baseball glove right of a bear", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing baseball glove" + }, + { + "i": 431, + "seed": 3, + "tag": "position", + "prompt": "a photo of a refrigerator below a scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing scissors" + }, + { + "i": 432, + "seed": 3, + "tag": "position", + "prompt": "a photo of a dining table above a suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 433, + "seed": 3, + "tag": "position", + "prompt": "a photo of a parking meter above a broccoli", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 434, + "seed": 3, + "tag": "position", + "prompt": "a photo of a frisbee above a truck", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing truck" + }, + { + "i": 435, + "seed": 3, + "tag": "position", + "prompt": "a photo of a pizza right of a banana", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 436, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bus above a boat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 437, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cell phone left of a tennis racket", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 438, + "seed": 3, + "tag": "position", + "prompt": "a photo of a horse right of a broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 439, + "seed": 3, + "tag": "position", + "prompt": "a photo of a broccoli above a bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bottle" + }, + { + "i": 440, + "seed": 3, + "tag": "position", + "prompt": "a photo of a vase right of a horse", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 441, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bear above a spoon", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing spoon" + }, + { + "i": 442, + "seed": 3, + "tag": "position", + "prompt": "a photo of a zebra right of a bed", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 443, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cow right of a laptop", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 444, + "seed": 3, + "tag": "position", + "prompt": "a photo of a bed right of a frisbee", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing bed" + }, + { + "i": 445, + "seed": 3, + "tag": "position", + "prompt": "a photo of a tie right of a motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 446, + "seed": 3, + "tag": "position", + "prompt": "a photo of a laptop right of a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 447, + "seed": 3, + "tag": "position", + "prompt": "a photo of a cell phone right of a chair", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing chair" + }, + { + "i": 448, + "seed": 3, + "tag": "position", + "prompt": "a photo of a couch below a potted plant", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 449, + "seed": 3, + "tag": "position", + "prompt": "a photo of a clock below a tv", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 450, + "seed": 3, + "tag": "position", + "prompt": "a photo of a couch below a vase", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 451, + "seed": 3, + "tag": "position", + "prompt": "a photo of a donut below a cat", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 452, + "seed": 3, + "tag": "position", + "prompt": "a photo of a couch left of a toaster", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing toaster" + }, + { + "i": 453, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple wine glass and a black apple", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing apple" + }, + { + "i": 454, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green bus and a purple microwave", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 455, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green skis and a brown airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 456, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow computer keyboard and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer keyboard" + }, + { + "i": 457, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a pink oven and a green motorcycle", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 458, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple parking meter and a red laptop", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 459, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow skateboard and an orange computer mouse", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer mouse" + }, + { + "i": 460, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red skis and a brown tie", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing skis" + }, + { + "i": 461, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a pink skateboard and a black train", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 462, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a purple bed", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 463, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple elephant and a brown sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sports ball" + }, + { + "i": 464, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple dog and a black dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 465, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white dining table and a red car", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing dining table" + }, + { + "i": 466, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue cell phone and a green apple", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 467, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red car and an orange potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 468, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown carrot and a white potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing carrot" + }, + { + "i": 469, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a black kite and a green bear", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 470, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue laptop and a brown bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 471, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green teddy bear and a brown kite", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 472, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow stop sign and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 473, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange snowboard and a green cat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing snowboard" + }, + { + "i": 474, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange truck and a pink sink", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 475, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown hot dog and a purple pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing hot dog" + }, + { + "i": 476, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green couch and an orange umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing umbrella" + }, + { + "i": 477, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown bed and a pink cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bed" + }, + { + "i": 478, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a black broccoli and a yellow cake", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing broccoli" + }, + { + "i": 479, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red train and a purple bear", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 480, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple tennis racket and a black sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tennis racket" + }, + { + "i": 481, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue vase and a black banana", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "missing vase" + }, + { + "i": 482, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue clock and a white cup", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing cup" + }, + { + "i": 483, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a blue couch", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing couch" + }, + { + "i": 484, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white handbag and a red giraffe", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 485, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a pink tv remote and a blue airplane", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tv remote" + }, + { + "i": 486, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a pink handbag and a black scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 487, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown car and a pink hair drier", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour orange != brown" + }, + { + "i": 488, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a black bus and a brown cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour green != black" + }, + { + "i": 489, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple sheep and a pink banana", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 490, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue handbag and a white cell phone", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 491, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white pizza and a green umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing pizza" + }, + { + "i": 492, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white tie and a purple skateboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 493, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow sports ball and a green boat", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing boat" + }, + { + "i": 494, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white wine glass and a brown giraffe", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 495, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow bowl and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing baseball glove" + }, + { + "i": 496, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange microwave and a black spoon", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing microwave" + }, + { + "i": 497, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange skateboard and a pink bowl", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bowl" + }, + { + "i": 498, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue toilet and a white suitcase", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 499, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white boat and an orange hot dog", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour red != white" + }, + { + "i": 500, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow dining table and a pink dog", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 501, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red cake and a purple chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cake" + }, + { + "i": 502, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue tie and a pink dining table", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing tie" + }, + { + "i": 503, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue cow and a black computer keyboard", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer keyboard" + }, + { + "i": 504, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow pizza and a green oven", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 505, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red laptop and a brown car", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing car" + }, + { + "i": 506, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a blue scissors", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing scissors" + }, + { + "i": 507, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green surfboard and an orange oven", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 508, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow parking meter and a pink refrigerator", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 509, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown computer mouse and a purple bottle", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing computer mouse" + }, + { + "i": 510, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red umbrella and a green cow", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 511, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red giraffe and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour brown != black" + }, + { + "i": 512, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown oven and a purple train", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing oven" + }, + { + "i": 513, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue baseball bat and a pink book", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing baseball bat" + }, + { + "i": 514, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green cup and a yellow bowl", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 515, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow suitcase and a brown bus", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 516, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange motorcycle and a pink donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 517, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange giraffe and a white baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour green != orange" + }, + { + "i": 518, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a green carrot", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 519, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a black bottle and a white refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour blue != black" + }, + { + "i": 520, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white dog and a blue potted plant", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != white" + }, + { + "i": 521, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange handbag and a red car", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 522, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red stop sign and a blue book", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour brown != red" + }, + { + "i": 523, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow car and an orange toothbrush", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing toothbrush" + }, + { + "i": 524, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a black potted plant and a yellow toilet", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "missing potted plant" + }, + { + "i": 525, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown dining table and a white suitcase", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 526, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange donut and a yellow stop sign", + "judge_ok": true, + "self_verified": false, + "recoloured": true, + "reason": null + }, + { + "i": 527, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green suitcase and a blue boat", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing boat" + }, + { + "i": 528, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange tennis racket and a yellow sports ball", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour green != yellow" + }, + { + "i": 529, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple computer keyboard and a red chair", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing chair" + }, + { + "i": 530, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple suitcase and an orange pizza", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "colour white != orange" + }, + { + "i": 531, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white bottle and a blue sheep", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bottle" + }, + { + "i": 532, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a purple backpack and a white umbrella", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing backpack" + }, + { + "i": 533, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange potted plant and a black spoon", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing potted plant" + }, + { + "i": 534, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green tennis racket and a black dog", + "judge_ok": false, + "self_verified": false, + "recoloured": false, + "reason": "colour yellow != green" + }, + { + "i": 535, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow handbag and a blue refrigerator", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing handbag" + }, + { + "i": 536, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a pink broccoli and a red sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing broccoli" + }, + { + "i": 537, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red bowl and a pink sink", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing bowl" + }, + { + "i": 538, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white toilet and a red apple", + "judge_ok": false, + "self_verified": true, + "recoloured": false, + "reason": "colour white != red" + }, + { + "i": 539, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a pink dining table and a black sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing dining table" + }, + { + "i": 540, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a black car and a green parking meter", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing parking meter" + }, + { + "i": 541, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow bird and a black motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": false, + "reason": null + }, + { + "i": 542, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown giraffe and a white stop sign", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing stop sign" + }, + { + "i": 543, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a white banana and a black elephant", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing banana" + }, + { + "i": 544, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange cow and a purple sandwich", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing sandwich" + }, + { + "i": 545, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red clock and a black cell phone", + "judge_ok": false, + "self_verified": false, + "recoloured": true, + "reason": "missing clock" + }, + { + "i": 546, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a brown knife and a blue donut", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 547, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red cup and a pink handbag", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing cup" + }, + { + "i": 548, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a yellow bicycle and a red motorcycle", + "judge_ok": true, + "self_verified": true, + "recoloured": true, + "reason": null + }, + { + "i": 549, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a red orange and a purple broccoli", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "colour white != red" + }, + { + "i": 550, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of an orange traffic light and a white toilet", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing traffic light" + }, + { + "i": 551, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a green cup and a red pizza", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + }, + { + "i": 552, + "seed": 3, + "tag": "color_attr", + "prompt": "a photo of a blue pizza and a yellow baseball glove", + "judge_ok": false, + "self_verified": true, + "recoloured": true, + "reason": "missing pizza" + } + ] +} \ No newline at end of file diff --git a/orbiters/artist/results/judge_calibration.json b/orbiters/artist/results/judge_calibration.json new file mode 100644 index 0000000000000000000000000000000000000000..62bcd3fea7155b7daa119d25b0b3e4b082978b22 --- /dev/null +++ b/orbiters/artist/results/judge_calibration.json @@ -0,0 +1,42 @@ +{ + "images": 250, + "excluded_library_images": 1478, + "by_threshold": { + "0.1": { + "precision": 0.299, + "recall": 0.967, + "f1": 0.457 + }, + "0.15": { + "precision": 0.366, + "recall": 0.882, + "f1": 0.517 + }, + "0.2": { + "precision": 0.415, + "recall": 0.752, + "f1": 0.535 + }, + "0.25": { + "precision": 0.46, + "recall": 0.661, + "f1": 0.543 + }, + "0.3": { + "precision": 0.508, + "recall": 0.583, + "f1": 0.543 + }, + "0.35": { + "precision": 0.544, + "recall": 0.51, + "f1": 0.527 + }, + "0.4": { + "precision": 0.582, + "recall": 0.459, + "f1": 0.514 + } + }, + "chosen_threshold": 0.25 +} \ No newline at end of file diff --git a/orbiters/chameleon/LICENSE b/orbiters/chameleon/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/orbiters/chameleon/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/orbiters/chameleon/README.md b/orbiters/chameleon/README.md new file mode 100644 index 0000000000000000000000000000000000000000..349bc457a31dbf079189926c042c77e7a71e0b4e --- /dev/null +++ b/orbiters/chameleon/README.md @@ -0,0 +1,95 @@ +--- +license: apache-2.0 +library_name: oracle7 +tags: +- oracle7 +- no-neural-network +- web +- verification +--- + +> Website and repository reconstruction with contracts checked in a browser; 0 false completions. + +# Oracle7-Chameleon 2.0 (internal) + +**Status:** public release. Prometheus7 Research Institute, 2026-09-25. +**Source digest** (SHA-256 over path + bytes of every .py/.mjs/.js/.ts file under `packages/`, `scripts/` and +`apps/api` in the project-chameleon working tree, 348 files; node_modules, dist and caches excluded): +`cb48b3e527b490b8f1d70071042914dc39b08f58eae45cb96bc11d6c71992822`. The working tree is ahead of its last commit +(`cac9772`); the digest identifies the code that produced the evidence below. +**Release digest (2026-10-13):** `823787a94793d1d1fef99600339834e512b9be8a9fb1faae54b0011adb9262d5`, recipe: for each of the +same 348 files in byte-sorted repo-relative path order, SHA-256 update with the UTF-8 path and then the file bytes (no +separators). The exact recipe of the 2026-09-25 digest above was not recorded and could not be reproduced; no covered file +has a modification time after 2026-09-25 12:00 UTC, so the code is the code that produced the evidence. `SHA256SUMS` in +the repository lists every file. + +## What it is + +Chameleon is a website and component reconstruction engine run as an Oracle7 specialist. +- Its stores are captures and receipts. +- Its operators are MetaFold repair operations. Each operation acts only when its admissibility preconditions hold. +- A clone counts as COMPLETE only when contracts declared before execution pass in a supervised browser. +- The delivered package is re-verified by an independent audit. + +trafficcop is vendored in as the decision service. It chooses repair operators and triages captures, and runs in +shadow mode for captures. + +## Results + +### Repository reconstruction, release panel (`results/release-panel-current-20260921b.json`) + +| | Count | +|---|---| +| Registered targets / families | 10 / 7 | +| Complete on first pass (no repair) | 3 | +| Complete at latest attempt (development repair allowed) | 7 | +| **Held-out targets complete on first pass** | **1 / 4 (25%)** | +| False completions (COMPLETE with a failing contract or failed audit) | **0** | +| Release gate (24 targets across 6 families) | **NOT ESTABLISHED** | + +The four held-out targets: + +| Target | Outcome | Stage reached | +|---|---|---| +| robinparisi/tingle (modal) | **COMPLETE** | Fresh acquisition, then button-close, Escape-close and footer-cancel contracts all PASS; independent audit of all three 13-file packages PASS | +| autocomplete | Stopped honestly | Before behaviour, at `REPOSITORY_PACKAGE_ENTRY_OR_LICENSE_MISSING` | +| validator | Stopped honestly | Before behaviour, at `REPOSITORY_LICENSE_FILE_REQUIRED_FOR_PACKAGE` | +| Pickr (colour picker) | Behaviour verification FAILED | `COUNT_ASSERTION_FAILED:0`. The failure was reported, and no repair was counted toward the held-out score | + +Evidence: `results/metafold-tingle-heldout-first-pass-20260921.json` and its audit. + +### Website quality (clone catalogue: 1,493 captures) + +Current state: 33 approved, 31 needs_repair, 1,429 needs_review. + +Website quality is scored by the same sealed 60-site blind panel as trafficcop (see the trafficcop card). Chameleon's +figure from that panel is the **clone approval rate**: the fraction of the 60 random needs_review captures that Ben +scores 4 (ship as is), with the mean score alongside. **Reviewer check (2026-10-13):** the project's owner looked through all 60 sampled sites and judged them good. This is a stated overall judgement, not the pre-registered blind 0–4 score per site, so no panel number is claimed and the scored panel stays open. + +## Failures, stated plainly + +- **The release gate is not met.** It needs 24 targets across 6 families; 10 targets across 7 families are registered. + A 1/4 held-out first-pass rate is an inventory, not a generalisation estimate. +- **Held-out targets were chosen by the evaluator,** who read their documentation to write contracts. That is source- + informed testing, not externally blinded evaluation. +- **Two of the three held-out non-completions stopped at licence and packaging admission,** before any behaviour was + tested. They measure acquisition breadth, not reconstruction ability. +- **One held-out target (Pickr) failed behaviour verification.** The cause, missing initialisation versus an + unsupported transformation, has not been established. +- **Recording trafficcop advice in the durable MetaFold engine is not done.** That work is owned by Codex in + project-chameleon and logged in `docs/progress.md`. + +## What the evidence supports + +The completion discipline holds: no COMPLETE has ever been issued with a failing contract or a failed audit, and every +stop names the stage and the reason. Reconstruction breadth is early. + +## Reproduce + +In project-chameleon: `scripts/clone_benchmark.mjs` and the release-panel audit (see `docs/BROAD_RECONSTRUCTION_EVALUATION.md`, +`docs/TINGLE_TRANSFER_FREEZE.md`). + + +## Files not included + +18 deployment and demo scripts for the builders' own servers are not in this repository (they name private hosts). None is part of the method or of the evaluation that produced the numbers above. SHA-256 of the sorted list of their paths: `059eff217257a94a4435f9ca13d9e6da513a47b786067cf09056b6bcd472a1c1`. diff --git a/orbiters/chameleon/SHA256SUMS b/orbiters/chameleon/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..7bdebfa00aca403478f21890011153a21b17a0cc --- /dev/null +++ b/orbiters/chameleon/SHA256SUMS @@ -0,0 +1,336 @@ +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE +df694df853decf70683407063d71cbde0a19708c80180467140aac27a1a8732d README.md +861247926c110b14f82b9dfad7dbd84f588aed681289172e0aa927b112bfdc3c apps/api/chameleon_api/__init__.py +47dd7b492ba774d015e75b83a9cbf6fa0331f0e0036726fb4d1502152b4a6bff apps/api/chameleon_api/app.py +d3c76ff098df015169abaa3dfc210b8c89008401fd9f77f12d62f4fc240485a0 apps/api/chameleon_api/fixture.py +0a695acd7a8e05203aa57da18ec29b7265b251dd6beb1fe08d347a974761b695 packages/adapters/chameleon_adapters/__init__.py +038b888d3fe9f579e65baca79c54c7691b57e8752344163b0244c586f346842a packages/adapters/chameleon_adapters/hotel_fixture.py +d562bd2b2180b3b7c72198561508d66d59d7716ccac56701af1930bcf3223f27 packages/cli/ditto_reconstruction.py +21bd665a624353eaae26804f3476e5ff00e9e8988a840ecba0985ada0a114af8 packages/cli/src/chameleon_cli/__init__.py +130acafaef8483625c857235eb995dace14121a5ba10eec2c7464c9f045153a7 packages/cli/src/chameleon_cli/__main__.py +dddc4ff7ff3ec32af4a3248b3452798824a2b4d823bdb38e9b30a3c13f4c7fdd packages/cli/src/chameleon_cli/client.py +91b6448f770becf449ad3387cc71d0b0b339ba46965d11eedba7e7a2045dbea4 packages/cli/src/chameleon_cli/main.py +30df6ff641ea85abb0e72dbc304cde0bce13cd80ba0153b717875721226ad1c7 packages/core/chameleon_core/__init__.py +ff143524857403c50a0f9b9d263368175e867ecbe7d418a19c57af1f0d4adc57 packages/core/chameleon_core/adaptation_contracts.py +5e027c997487e4a79866244b3ddf481f5301fe32843eff396f1339186140241e packages/core/chameleon_core/adaptation_service.py +fc2f956ff80e29f10c69652eee05a5b7cf00ab7a7ff20b70c6650a57d9176bb3 packages/core/chameleon_core/application_saves.py +8fd6a3431ca009468741345192d2aff4efb0573dff9d9d787080d6f8237cb6dc packages/core/chameleon_core/behavior_records.py +9599309fb5ea94d9991a03ec5970000235abe17fcfac766e6bbadfd1d94bdd54 packages/core/chameleon_core/browser_contract.py +0eb2e35d97fae5a9daa438fd60d6dcd50fb2b7b3312d0a0335c224c0035264b8 packages/core/chameleon_core/build_plan.py +1243256f02cbc39070cca0205200592889991c6947539eaa144f24494a912a64 packages/core/chameleon_core/bundle_preview.py +c6997a67cd5aa25ca0d7d8014e7f8c4f32dc3ce8f5f2855ee3ff3d0319e275d2 packages/core/chameleon_core/config.py +9d5a16d85dd4e1a5ba8702c14f9b68278f076af49849b279195424e308d463fd packages/core/chameleon_core/contracts.py +f9cff81a7ab2383eba74fcfda873c753283ed2785df1124839a7b6f8b2ee622d packages/core/chameleon_core/control_overlay.py +1669ec71dbba791f47a2cf60760478f97ff2948aefb2f0245da1bcb101e4ffa8 packages/core/chameleon_core/counterpart_bundles.py +b55e21bf0d4c1a7aafe51cb069407ba973c050c361eea88435fbdd93ff56f095 packages/core/chameleon_core/counterparts.py +22cf7b99d3c0ac4d1d62f8ce0a0acf1aa70075ea11e81fbf4a7bd59490151526 packages/core/chameleon_core/curated_app.py +f6bdf92631c603dddf052d80a4cfccb24934301fa7c7766ab45d2373ee19fe5b packages/core/chameleon_core/db.py +4702ce54f642131c556eecc2e8db75b14647f1e1ed4d49a11ad39de00e2db9b5 packages/core/chameleon_core/declared_dependencies.py +4415ad9a098a7d5596728c002aa56a0fdaafa523a769ecc83d44a3ab914c322d packages/core/chameleon_core/define_overlay.py +68afe000659a751e20e909825202788e72443328fff8ff2c405ab0c5fe688cac packages/core/chameleon_core/dependency_plan.py +dff5f01a1f02a685571950ffa22f2d4bef4f5fc1ddcea986cca51edc6f77c0a6 packages/core/chameleon_core/entry_capture.py +1688c90692d8200ee54e10a5a34e136243f068135153f06cb1463031cd1405dd packages/core/chameleon_core/entry_inventory.py +07ce1cfbd1a5cc05fcc16d7b1c821cf37db6b3a2c0bacc81ad501be9a63bcbb3 packages/core/chameleon_core/fetch_worker.py +23ec95e653b889eb465106286037a602c65e874846f4cb2c934b9ed1d6ae124a packages/core/chameleon_core/form_engine.py +1181463526070244e247a1575f785d9b4a715ce44e1b298e764f5bbafdbf009e packages/core/chameleon_core/image_sources.py +d5c69f21d81cd646523fe223b87b87b2202acda0b39ca24d20477a46ea1b5268 packages/core/chameleon_core/inert_svg.py +17ba9637dd878e1d06c81d48f24617135a872a22b382e3f2bc7f075ec0dcbc88 packages/core/chameleon_core/intake.py +e069a2949f8be02551d138268e8f0311035975e0c33bf024c59fd856b771aafb packages/core/chameleon_core/interaction_replay.py +1f815061c222f1c48c65384aa2435e769021f3c8ab1f4eb39f92e48debf9e241 packages/core/chameleon_core/interfaces.py +04dcd35b4b10f668885211977bc3557abb7ac9b0cfc6ecad455551c3569924b8 packages/core/chameleon_core/laya_consumer.py +cbe7c36014bbc1696c3c13a3fd5f9bc393bd07d305433395228959ff17bb8dc5 packages/core/chameleon_core/laya_contract.py +295c263f1437a7cc2b25bcd4726545da72cc756637b9536cc6fed75f7fede7df packages/core/chameleon_core/laya_input_budget.py +19fce53e6921274449da67ea4a1e4fb95424e9d1c25e01ccc3a6df9e3ad73d1f packages/core/chameleon_core/license_notices.py +859890762f81422c4d2020d8572e13236a36883eafca709b88435f9820a6eaea packages/core/chameleon_core/linux_job.py +68c40a13d2228fc93e2b78cd6bf390d7d754c69f4eb27d30b58baef533b4fdd7 packages/core/chameleon_core/locked_assets.py +228dad02300bd5bda6cc9db24fff9cfe57c3c5a0e05c3c17e5e51025d1ecf061 packages/core/chameleon_core/metafold_correspondence.py +5e5866b20f258635d67854d35c1f828bc15c6af4f791aff11bdf4223b58ed56c packages/core/chameleon_core/metafold_evidence.py +4c0bce8eee0900abe536f7ef2aa722db5dc247da0379ef6167f6dc10b64b6fe2 packages/core/chameleon_core/metafold_lookahead.py +b3fb3290b2e4919286cc678b90c03b351d41323f5cc13ffd1c80cf4c9272760a packages/core/chameleon_core/metafold_service.py +34428d7a070a76aedbbf30c69236e15851ac5dd7a75a0f4b30b2adb383bb31af packages/core/chameleon_core/metafold_steps.py +9bd9b5b255b6cc33ab88fd6783c69f0597b570ec0de606a31d9194dac6d45b40 packages/core/chameleon_core/microfold.py +c06cec891b7907e6a6513ea550226ebfa0cb17356b78be910d5fc6ac2e5a7aba packages/core/chameleon_core/module_completion.py +8a6c2530c900f9805430beed46dc991ff95ecf07104b9fa32cccc62053c7c12e packages/core/chameleon_core/module_resolution.py +b7508c93961fda0925278f54d879b13148e20fa2ae268faa3268a52743ac6a70 packages/core/chameleon_core/mount_overlay.py +b6be347dc76408c5fc9943876e60ae9ad32b266290097bf3cd659db490936467 packages/core/chameleon_core/mount_plan.py +f107d5197fe286bd0266da87fe1c417bb1bd7b607e2e599e16f0e918844abb50 packages/core/chameleon_core/oracle_spatial.py +a15fe059fc6a48d64228113851322494e49fa0b93ce162d3e730b3e73ecaf04f packages/core/chameleon_core/packages.py +80797c3950b754b603a289cdee018912f56794ffcc76abb64901d9cd41c88835 packages/core/chameleon_core/pnpm_bundle.py +f3c639dc2e190a081dbf0323e59f1df1d213a8d32c88ee4605640000ca61d72e packages/core/chameleon_core/pnpm_discovery.py +73c1ef759480211ce9238c59155226d627cba03fee6df0c31e14accee704479b packages/core/chameleon_core/pnpm_plan.py +3ea20774a4c44cd6df8d042d626d0194f073cfeb3355a244b8fef4c77198e551 packages/core/chameleon_core/providers.py +235a03d048a8866d14e56bb1da01b4673af51a3f0536ffb7f39f490606e3e896 packages/core/chameleon_core/recovery.py +acd730155ea02ddfa7aab32cab69a92449f294d712871b2e4fe36211da87ec51 packages/core/chameleon_core/repository_artifact.py +1794bac9cdbfda92bf0d4c9fab6db70fa202a4809dfcdcb6f2ad157327e952e9 packages/core/chameleon_core/repository_capture.py +d26731ac776b295475fe0a68a4109defa23b666ff7ba9db16b9acc8c3a04741f packages/core/chameleon_core/retention.py +dab98787ce8059b5ed61f5596db2ac7a3cf1ba92c2d7633c009db336d4ecf149 packages/core/chameleon_core/sass_assembly.py +4d139f705c49d01aaefd405b3e67be6bcabeaf58322cbf1ff1b01ba9147627e5 packages/core/chameleon_core/script_images.py +e41670d11227b44e2f5c5ea6efc49ee7363560dafa82e8b1cec50a1bca80c034 packages/core/chameleon_core/script_inventory.py +d92b8e91a9a2aa571e9d11b424f8be17a35103e5f579227e460a66ac3bfb1200 packages/core/chameleon_core/service.py +2e7bde501a6fddd437bb045333cfa83081115ca5b0dfb40f60834562dc4a87d7 packages/core/chameleon_core/surface_graph.py +3c78bab9fa96bf044eac255f227434a23af7cbcaba3632a0493e826f25c66ce4 packages/core/chameleon_core/trafficcop/__init__.py +0476c062124d6f1d942c49d5f67e7548d2d0b88c000520e29e90e7e02f50625d packages/core/chameleon_core/trafficcop/chameleon_capture.py +c65230b556779a697892ef2202ac01e8ae5ed3334031ee0f837f3a4283f2cb37 packages/core/chameleon_core/trafficcop/model.py +d989b8e2d523b7d9302bfab67a097138cceccecf7d7a22408d2ed6def563ae3d packages/core/chameleon_core/twins.py +911819610d11ef62646773f6392d32f60dcc4a01952580c78766f8f60fc427f8 packages/core/chameleon_core/verification_jobs.py +9eac11d9c3dd3a8c551038fe595693d7cff8430dc49e8c1cebee78243532594f packages/core/chameleon_core/visual_capture.py +364c8f1e630b05c307632bd3431d35c6825202bc22989888118296be60f96738 packages/core/chameleon_core/visual_css.py +8f33da7ac508ca55f60dadd276d10c7af2120374fd66473ee1bb514a2eee29f7 packages/core/chameleon_core/website.py +c5b55be8f8807fc23b228d07de978b15f1985c8caa3bb58520d2e5e9313d40cf packages/core/chameleon_core/website_bundle.py +bb537376285949404a07c409bb8bfa3e6c0c3f3f9f3a23a86100f962b3b5d8a8 packages/core/chameleon_core/website_bundle_capture.py +96da07b3aa2c178ad5aa1c37f62b54901712f94f60d3d0f506f611aebbbee80f packages/core/chameleon_core/website_bundle_worker.py +4fef094c1a89c8cde7e4f836a19b383f3cd73bd11870348c4b8b29e0d1e199d9 packages/core/chameleon_core/website_captures.py +cf510a2df443b39d6e72e9a3faa5918304bc9b8984a080df5744ac2a72f8bc92 packages/core/chameleon_core/windows_job.py +ce5bf6d5fbff9dd80b6c7161c9ceecdec909c3d66259dc79806df5a2076b2e74 packages/core/chameleon_core/worker_health.py +2a3d4390549531f6d8cfb022260252f4ae08ecdd6c462ed66497f89555d802ca results/metafold-tingle-heldout-audit-20260921.json +38a913e4069f19c74a20bbebfa2acb5e62dcee47c0cf6e649daa4103ea55ee3b results/metafold-tingle-heldout-first-pass-20260921.json +d57cdbfca1d03d28bf85fd58bb7abe7366e6b91e5615f5c0e019304204278f0e results/release-panel-current-20260921b.json +99feef6904483cbd34d38d10d758703b2bc27958ec334cf978ecd15f59612a48 results/trafficcop-capture-triage.json +ce4491eb04ac2e4f6e823cbc2be276c4de5c04017500b084bbf368455ddb8759 scripts/accept_saved_behavior_ui.mjs +ed56a7c2b50190300f65e2f427eb5993c2980b90c03dcbf60928a3c6d705fb9c scripts/activate_ditto_verifier_worker.py +2b795a8993dfa01f3eff537eedb011f653eb55f3561f9a362a31393b3cb721a3 scripts/archive-nav.js +5676173dd76a2e2f98472483dd3553428dc1cb7624d2383154e761c1216264a7 scripts/archive_thumbnails.mjs +e00f5264ef27cc71a6f6459992d560d8c65d8f9c291583b81e495736dd61ba46 scripts/arithmetic_expression.mjs +854569100d18a66db881480d4a9c63fbce91ffe5b2b52fceb47d76f059f21e7b scripts/audit_catalogue_revisions.py +df8a0f49e2295cc1d02309ddc31dfc40001afe475d98642dfe78a443aec95bce scripts/audit_metafold_local.py +9365af970538a912a62365dc806d6b69689758ee5ac318c8cc19fd2ef39c5e1b scripts/audit_repository_catalogue.py +c5419988186d1e5d16a289201b9ebff790bd94896a53e012a934dd2832b84d05 scripts/audit_website_catalogue.py +3d02041531be9be83c5de16bee44d08a785c9d834d94794d07f1655cf45a2fa0 scripts/benchmark_microfold.py +63d26ca330f9ba2636f39f6d671304b120103aae8f14b505ab3063e1f2f6683e scripts/bootstrap_uv_linux.py +7773d7a28481aedc0a188152bb38db4c0297e8fa1c0c29fa280322974a45b549 scripts/browser_contract.mjs +d09e41a98588ba9b0f77420778ebeb3361e754454dbc882a7620715d694f1ef3 scripts/browser_contract.test.mjs +9c81db639772c452cb02f642aaae192f68b5d3d1cc0376ccd7bfd7b0ba855323 scripts/browser_result_gate.py +c96c38c607e9eb4cb02a97209e4bf33cfcd7428515050e20087052c3e15f45a2 scripts/build_artifact_plan.mjs +43d6731f0c35fa87b7870fd56be8c197f3a48f81b023b64dfc67c4fb9d2428cf scripts/build_artifact_plan.test.mjs +ec8eb1ea43b7f5d11b6c08cb42c5a8f4b360e47fa89ad119b29fcab000a1ef7d scripts/build_calculator_overlay.mjs +14d53efe55e808fe970fc3cefec989de7eafdd15e994dc3097b3dc25addcfbc6 scripts/build_declared_module.mjs +08fbdff12a5f4d2720633715d8d5100a36fd515b9f43beb19d47f5974f85ac98 scripts/build_declared_module.test.mjs +aedd3bb5d6b1e36bf08a7184f1df4196c2b3e8c1182de3fdddbadc970636a2c4 scripts/build_defined_module.mjs +798faf73eb91e3d8eac896265de6e763bb10ca7308c8efa3c6a49b2787728475 scripts/build_graph_plan.mjs +fdda12053cb7980c6dff2d0c26f3d8f1df82d138ea6b26fb5eac30bf390d61da scripts/build_input_discovery.py +28d9de3634a3ec043dcdf24adb39cedc0d078f7a7e3ca65fbd21cd4fb4338bb1 scripts/build_metafold_candidate.mjs +b99cb0aefc643c309078c89d74c7d57b48ffa636bcb90e42fdc3a8cbb0afffcc scripts/build_module_capture.py +5d1da67d792bc7f9928d2306bb4b56a2eaf0b61312e058359c645d9c0e31c37e scripts/build_module_overlay.py +2196aa683ed1d18f3e116288e9d56a74ad058f0420f691caee1dd6e8bce815ef scripts/build_public_archive.py +e03caef945794b7cca73e029550efdbf9e22c4f90b2127a72b007521865661c5 scripts/build_saved_control.py +9c5b590528f9b58c9baedb5531f22275acf88b1d3d5a3dafd2ebc788b255ffcd scripts/build_saved_declared.py +0551aa5465ca30046a8f27a4cf2cf8f1437474d22d24caf4fad7e3340bf9354a scripts/build_saved_mount.py +f5aaa3e64134634d9408e8b98765f9930852ff6074ad208cdc3ad4d29bc9d8d8 scripts/build_staging_bundle.py +616b532d52751061974f8b6efcc38ca346b67d9fc8feae59f5ae76ccb155d522 scripts/calculator_repair.test.mjs +5002ed39682df5586f0fa8952c4a7e3d0008c0800931059b4e4c9a7559ecb7f6 scripts/capture_connected_site.py +2fb5da2f2ca1a62e5c63d1c83c559e3ca507c4071e585f69d4ecc84fee359955 scripts/capture_entry_pilot.py +9d97eb01332670823a3d43b8064efe65d72b2f192299aea52fd6d9eaf5b8c0af scripts/capture_evidence.py +bac0f03ddc86b21ed8ee96786b6ab523f3907d36a8a94aded7aa0861f60e36f4 scripts/capture_locked_assets.py +273530e186c00a36ec37552eae5de380c3d2346f20db87d140543dff082e90d7 scripts/capture_module_pilot.py +265d3aa4f3b2544f7a1e3694d301efebeb24f7c95e20c1e5206bbf00e1edd677 scripts/capture_read_form_evidence.py +3cec9043b2c949592222c0b29d3839775aceff055266f1e81cecb84ae9f58174 scripts/capture_recovery_evidence.py +1edbf3dc603733c713a0565f7c46f5a4abbdabe7408c5054ff0944438ed17d9b scripts/capture_rendered_catalogue.mjs +a1ab7a7cf9137d9d1d7243c658f508a0b998a8ab4438ddf727b5d60d949392b1 scripts/capture_repository.py +2027762517f79af4e42738a65e8889dcd2b19a7ddf7d57fd9fb155159278b1b4 scripts/capture_repository_catalogue.py +76497adc555a463678051e8c45c4030d13b76c4db1301f8d89331f3c4272a1fa scripts/capture_repository_evidence.py +1f246af3594030eaf51c9f3b0d81d9cada2af8b51e18044404f091f85fcc9703 scripts/capture_showcase.mjs +fa012539f031c4f478075f9d4a785970d1c6646c2b4560d14f14f7cba1c7d8fb scripts/capture_stage_evidence.py +ae464d0f56d6bf80645d6727179205737c3b91e0a46b6668b0e71c2f83c36eb7 scripts/capture_website_candidate.py +a72c3837e2f0e3d5571a81996689c6a25a16bd7cda491796b2d43bbf3d6bdd51 scripts/catalogue_animation_state.mjs +a29623400b8467791f9a748d61919b20741de1d2447b5a2a0921693c64a69542 scripts/catalogue_canvas_isolation.mjs +fa888b48db98326cf8259874f31961edf5d1798d8312a5b70dc1a4ee6efe2475 scripts/catalogue_canvas_replace.mjs +41c14d20fdc457230a69eadd886f8e78518be3a6f3475016264c4f00dffa3c88 scripts/catalogue_compare_sections.mjs +56b88ae23a3539eb09e0ced8961338d9f6dc45cb95f3c09ffad51af825f3e731 scripts/catalogue_contact_sheet.mjs +5f6c8356b26e2a7643f5029c6fabbc0e886798924fdeed6b597f7d60a7b63537 scripts/catalogue_cssom.mjs +aa51ec16c6a5eccb02c0407646fc4d3dd95091e982050da3646c4bf74d44fafc scripts/catalogue_failure_report.py +a9a7c4ca9c028173783ae45232f2832f7c8b44c9d8f9a33efb9cdf9078c82de6 scripts/catalogue_gallery.py +814bc2c18eee479a4924597a17408d3b3f225e583f501b492d9dbaf98ce3b831 scripts/catalogue_header_state.mjs +a26f76a1464913fbe15ec5bf8bff488e8d992092f3a7b3a306f4310ae0fdadec scripts/catalogue_header_state.test.mjs +c7524a9fa54244f8ba38fe3f8a5871f3f866ba27ed646f816438ed211615adbc scripts/catalogue_image_pixels.mjs +9320a1dba80c1ae7bd849fc04fa24c9b229fae3f9192c287e2fd9197b46b0159 scripts/catalogue_pseudo_state.mjs +a4ac4d22a92911823a9ec990be103f40f16a3ec5cb80b62fb2c3401de3291e70 scripts/catalogue_review_screenshot.mjs +286bea57726b8d1d0a3ca2a4141de6cdccee59d242a7cf72bdda9b8c8907a89d scripts/catalogue_revision_index.py +c99bdc216ea8e93ced5aae1c77920c62460ab196fb078e771b04608e0ec1572d scripts/catalogue_source_context.py +9acf284da0405c40ceccbac1807d03d1296f7a53d92285d296dce22d8b251f1a scripts/catalogue_standards_mode.test.mjs +e8badfd939ff82d3e8677f32838121eff40ae7ccc4914a57bd4303180bd10a2a scripts/catalogue_timer_freeze.mjs +d0a377e8e39bae37fb292d6581f81b3671ccd18e17a2d6d5e81546a68e882656 scripts/catalogue_timer_freeze.test.mjs +cc218de09b7cbacbcebad46ce17913866da7455aae0ff6e49211c59de99c5ae8 scripts/catalogue_visual_metrics.mjs +9a02e203e7d44e6abf89911260d71c03b11de7d75a205da25cdd2bc19bd616fd scripts/check_browser_network_policy.py +3af1a24564c676abafc97d2e6f007c3fc5d1d094fb17f4d9a218c954d9eb91e6 scripts/check_ditto_verifier.py +55ddfd98c1b2099ca1c7773ed6b70d15650c6ffef7e9758e8591dc9cc1462365 scripts/check_image_capture.py +d8ac9af53d7e69136842b74e3f368f7bd3c053569d95eb42b2def5f9eb964094 scripts/check_nasa_capture.py +2d6140c7d3e956cf2c8dba37e880f9714c3bea64e6361575d1a6ffd770cdfd80 scripts/check_production_verifier.py +31e143b2e3fb3e0055e08fe8e4df2cb6f76a29e7077c7956b86b29785f81e594 scripts/check_queued_delivery.py +fbec2e0f33f68d8a3e86d67ba0ba5fb34d2106a039228f1bb43a2dca1b73f0e0 scripts/check_rehearsal_database.py +6ad8c2e0bfe4e10bdc16d882ac019a58ba2ad746d7d8a644fa9ce9df4e37e7bc scripts/check_rehearsal_results.py +bd7ae7b8d59be73b79d1d61dcd69a7de5a5b4fde9cc8f3f38244e0467dffbb43 scripts/check_verifier_tunnel.py +ae4e92300962895daea9b661b9ab16547d619fd152b60a13efdc273b48b05750 scripts/check_website_bundle.py +1c1d4f9474ad289ac3dbb3b643ee55778874206bc54a166434dcf2c320c94a8e scripts/check_worker_filesystem.py +c17fc28b4347806e6f895b176c49d2152e631810d4a04cccaf540cee4ac4b7d5 scripts/ci-setup.py +94588ecd5e5749b52c9d446520733d74c20aecf1af7257ac1dabcc0b5996f523 scripts/clone_benchmark.mjs +93546f90fb44a0cdf6d4cfaf2b1d5c658a842520b0dd6c3eb5cf6c6afd40f30b scripts/clone_benchmark.test.mjs +91935d307e1c8ca29738ea2120399c0ddbafefb18daf508befe35226e847a358 scripts/clone_catalogue.py +59db410f74b099ef0a6e13e98c932f9248095d968de4fe65e627666d2f0d7103 scripts/compare_mount_visual.mjs +77b82ff4fc264ef4b315107f131ea018086f668af81807b62313e4aacfca20b2 scripts/compare_mount_visual.py +3034290735d6c19ef1221ed964d6ca77a50947a3c95cc7c71c5ab0641ad2d6c6 scripts/compile_frozen_sass.mjs +4b75c1603739588d3f66d72687a2a64fa75e3149d91d96179a226049d81818ea scripts/compile_frozen_sass.test.mjs +8dfcbd4dd810640edc65857d08dda90a559f3bb44347394cbb6f7e8472e211ef scripts/complete_declared_styles_local.py +44b9fe2fb5476a5ad9b9b75ad27de3d7c319d1cc215df1d46c12cff785a52494 scripts/create_define_overlay.py +6aacddf1887df7af58a094e49c74ab92b4c84aedb1a61689be0a2a04df678d1e scripts/demo.py +cbab2f5088e3b7935f4dfff9b09824fb70e25866052700d6b307c854c3ef7766 scripts/deploy_archive_nav.py +9b831a0ecbb868c8b06e9b012e329dc2eb04c503084c918ee4b09bc1ed962193 scripts/deploy_ditto_effort_profiles.py +6d2c1563fdcfc92c1a3e22668cc017a2ec877d3f73cf19add028fb5af19691d1 scripts/deploy_ditto_frame_route.py +8b93f69ce7cadd88bb865f96f615cff2f9d3df739542f7b23996b4153534b5e7 scripts/deploy_effort_profiles.py +9497ffc61de5d89796a267d4c071a610ba0807b6d925565e932f8d138d5d89b6 scripts/deploy_field_notes.py +6cf82e8f9250544f32ebbf89f6bfdfec9518080c516511959f42406eeb1e41d2 scripts/derived_overlay.py +ea3b06e9f9148fde34a9610b7ac31323c78868412fe4b2d6805103868cd81ded scripts/discover_catalogue.py +10f58d8f2941579b2c57e9f74a1001c5299437d391280611c20ebf144cb5efcd scripts/dom_references.mjs +42dce6c1fe2a12aa054580f4ed80edb88b3338a82e869003ffc27e1cbe9b3e4a scripts/dom_references.test.mjs +5ca54cb32a338f8e9fff8127f8906fa86d1f2b7db27dac85a32e7a58f292f786 scripts/enable_box_a_route.py +9e2d75f7692787db2d189ac35c4697644773f78a5f2d0c4c083d6a620fe521b3 scripts/enable_ditto_reconstruction.py +4d86286982f48353f198cd2cb4376a9c675500f5dbc70e11ac8a26a99b4c1c76 scripts/enable_production_verification.py +910a1aaab289463b654be5c5f2276897bd7b0bde894965f599d42f5dff1c36b6 scripts/evaluate_read_forms.py +b8c8ff0b44b45fd565b8dd1caaa7c3c73eee5121209519c19975abb251d64be5 scripts/expand_entry_pilot.py +e916abfbc02047baa34e3925b75658ee4bd069d4e82366bbe4895b5c5a7913a5 scripts/explore_surface_wall.py +74bc0d11d3a876c2665553b3683c184611abfa5ca9460b530f2f62dba5d09451 scripts/export_runtime.mjs +aff632a7ddbc6bb79c5c5d7b6f499fc152822da7423a2730c0e874dd65aea51d scripts/export_site_demos.mjs +9e5d231988e283de4594658bb25e7766f496b2a867c9940fd64f88980ed416fd scripts/export_verified_pilot.py +72df539a475ff93f3de66936b6b0b0a5b2367557a0af293ed1ae0755ed689879 scripts/fidelity_metrics.mjs +e104f5ef27e343fdfb20fee06e357d8dddc610ee24f331e78ee233f442d2043b scripts/fidelity_policy.mjs +48e791d22ad3e113c180d74c782612f35abece7009013fe6efb136b0f5ff42e5 scripts/fidelity_policy.test.mjs +b0f4a9308ef38157b6f1441d6f3155f0753f2d00eb74f44a3ac46d9ecfbe1bcf scripts/harden_ditto_services.py +5f92550ad60ff25e53da85c94cb2166d03b52363f2801aac418f728851a5b9b3 scripts/inspect_catalogue_layout.mjs +ff97b95f102477044a31b276f3f0d0491ade1fdacc2d59a3e791e9c6350cba1c scripts/inspect_define_local.py +1c558da8c6e1636d9556be1e2688ee1b0863f6fd13a4fcbf0cb1f314adcf6c87 scripts/inspect_laya_artifact.py +fee4bff75ea2ddf71fb97e8281e477f506ca9ff1a0fbe2f4e63134bd7e57f494 scripts/inspect_pnpm_local.py +f6387e04e18730876f3d5a433523e1e0cf50d1d1c84acb8fe0095436edf1acc0 scripts/inspect_rehearsal_queue.py +852757abd9ef37779a4bf6c78f65848b8d28216fd6c7d28dfe154d11e1b42a86 scripts/inspect_sass_local.py +513e8bdfa3bf52a047f62a3a691ea609badf1fe210978558ecd2cdce21b7fb66 scripts/interaction_surface.mjs +0247ed33d6097d7e5c8cf0abdc38419f9e8eab361b76ff1a82cc6b7769f72ca1 scripts/interaction_surface.test.mjs +bd2fdf7a0a61f76a19de4b701517c1759856ed129fbc3d46e20aa8867130c14d scripts/laya_diagnostic_supervisor.py +3e5e238b25778d4cabcdaf4eac70fc16d2609d2a3f7bc2b772e50ecb79bebdeb scripts/laya_linux_smoke.py +5c5999b3415d2704feb124b030ebbf80db05c0acf2d2823f5c5bc75fdf3cb02f scripts/laya_routing_eval.py +e33afc7b017fde3fe347aa79479ad43d676387341a2910d595fb1bee000f13bb scripts/laya_worker.py +331800f0a1ae3b79cf691fb9c98e82703226930903fd50289b04d9f4bd00dc04 scripts/linux_worker_bootstrap.py +d8c7fbf4e324c4842d97cea0f6ab5da639bc6f0516bb1cca58026d6cb5aefece scripts/list_filter_artifact.mjs +4cd6a3a269027b80a6e75e2d1997a7d76f52a9d02df8fb598bce8b37de4bb2cf scripts/list_filter_artifact.test.mjs +0e87d0e66cf89b3aa98e35c1664b67764f3e7701b716db2bba35f5f56fe6161c scripts/list_filter_observation.mjs +4181ae69f9111520e05553031d9030dc4d0becebf2fb41cdc949f24801c451ca scripts/list_filter_observation.test.mjs +16cdec94fde6051a862dbfdba2fc77ed67c1c26528aff72b4e12ae095dd26198 scripts/list_filter_operator.mjs +f89362d9f5d5b43212c84a8b9461a4fb6768ab9904388978818be9b986e51241 scripts/list_filter_operator.test.mjs +15f6a8bafef843d26259166cc00d768e3ad06f71bf7251bcc68b6b5e939012b4 scripts/local.py +4eb975b7a945b4a190453e88f5515551bdfaf8c3af42154e39c359de814476fb scripts/lock_laya_runtime.py +812673d06175ae1f94df6cd3beb86747ef8030490a8e9a175e2e220f72efa58d scripts/metafold_acceptance.mjs +c2a16cf3a50226c80e98c2e3b9a7824759eedc75360626050c5900d3a6893423 scripts/metafold_acceptance.test.mjs +bae2f74ba9bcfbc3f94881255cdba15960859e977aaa86a10e07aef930b04640 scripts/metafold_arithmetic_candidate.mjs +75601173c8ae1641ced73d0f614d4068b20d4174a34a858db2cdcc8f1692e043 scripts/metafold_arithmetic_candidate.test.mjs +700e3b252d47f8ef91436d420af7d672b04413715297a74dfbb1ec223f3df6a0 scripts/metafold_clone.mjs +8cc2c80c16a1e4148b887bc88f0bca6679bb7ba4d2a5d2e42b0ca8d308bbca5c scripts/metafold_clone.test.mjs +8c6fba4a6b78b4803e4e3c78768cc151708ec8c0ec9d828076b80d5c6a227674 scripts/metafold_correspondence.mjs +f36ceab283ebfafc831af171d81e6c790843ee4c348a0391884085768b973731 scripts/metafold_correspondence.test.mjs +b595767edd772cc955772715087744f1a839ed962e8d605a0cb8fe66898135d3 scripts/metafold_dependencies.test.mjs +2ee96a75713fc178e178482e45638b59bb8ef55df1f97ed7a5163e01b615f27c scripts/metafold_laya_shadow.mjs +13c45576d773141de03915b3ebcce6f0c6b887a2612fbc671b35645a8972aeb0 scripts/metafold_laya_shadow.test.mjs +9726be40043d6dc8e229fc98a5caab145e41b608646cbcd92944e713b412f243 scripts/metafold_observation.mjs +7ef1b8bc2bebda2272dd84d99e1c909be8a52ded509becc32663effb24880d94 scripts/metafold_observation.test.mjs +8c0e62e0b41aa23476019b6bcd5788980b459c1b1b1237e21f037e0cdd01a716 scripts/metafold_package.mjs +2d5b0a1742a4d234a7ea83d888ff0d2ea387a9ed53cba75323d03b5e5328374f scripts/metafold_trafficcop_shadow.mjs +3168d8efd9c4928b9f6b7951d1d8e0d49ab673fb3e83c48b7e7fe29323d36201 scripts/migrate_local_behavior.py +893f32cb10cf5aabdc587a56a1d35e8d3a825a173dd403244ca283f2021c9ac8 scripts/module_dependencies.mjs +726eb43eb12a3e9939397c2bd2b240a942da4b98f0515518a0babf91b4e3f040 scripts/module_dependencies.test.mjs +2bc19fce0772e756ba5351220659c18053c4c1965c91a3db93338ea4d21004ad scripts/module_dependency_driver.mjs +9595b24b45fe627fd2fb5efa8b94a88270ed269c5dad2f38e6487ba0ebdd234e scripts/module_references.mjs +d5d7a7b3e2b6032bacc8e2cbda6f836c14a38e4ff0329a549217c5b484886991 scripts/module_references.test.mjs +0b2c5fba2091088cfd92e4adf646a556ee7990a1a7805868816daaa2cc19ddfa scripts/multipage_contract.test.mjs +c5ecfec7c79e790d02edc53944bae0621e3b254de1b2b27f2c40d680f6841362 scripts/package_backend_release.py +3645ae03256daa77153f119518f81f5d83d5a42e217a43dc3a54f328decee6a2 scripts/package_cli.py +cd4fffdf7c1c44ecffb949e145f0af159eb92a20cb68a1a1c5e78ff66fbfd3a0 scripts/package_curated_2048.py +0ec60cbcffb55331e2218024eef81217cfc47e7e7e5e185e3483d5284a37bde5 scripts/package_gallery_six.py +56a82c84477277da80b620898b8ad30364c9c6b36129a5409f662f7e57c2f182 scripts/package_repository_pilot.py +969f6722f43ede1520805f7e892030f2dc2a39186fe836cb0839f67a86985be1 scripts/package_saved_demos.py +2ad3bdf0ca2e735addbe2e14dc30cc06a69b3419af028e8fe8e2726f7e442a76 scripts/plan_dom_dependencies.py +b9bde635c9c56c37876f7f951800dedb91df76621e4d31882dc61feec29294aa scripts/plan_saved_build.py +2fe5e186ce01d1dcb87e8e5e825b74644afb0d35c3b523969d39c0d945220916 scripts/plan_saved_mount.py +caac6b562a8eae7b9602530715b6ef247ca5d4b31d9552b289398eec18f358d1 scripts/prepare_jev_presentation.mjs +bd6b95644ec2a60b869560cf7d8a50fad120a294f8a450b8975c285c303085a5 scripts/prepare_laya_artifact.py +95c8473844b7d7638bded5fdd0268c42370ce443c7f4afc8d61c7d7abe3d48ac scripts/prepare_verifier_tunnel.py +28b03c30b987d5d3b93dcd00a14a33aab73f95933e32da449f59a775e399944c scripts/probe_repository_contracts.py +889fac5e2d4149ddbfb59595201ba4552da2e400d2ddaaaf637a83650c970f75 scripts/provision_box_a.py +f1f31f0df44ee6aa40b3f7c42da12b4d55d8dbe7e18ac3b349307d0011f815a2 scripts/provision_production_verifier.py +c11220c0b32d772b4b7a35666046028beacdef5c4fda99777b24942a0a59a5cc scripts/provision_rehearsal_verifier.py +4206068a8f85f26c9b1a1178c7075de7d611312f642e3ca3b6e35b33d8767227 scripts/publish_source_style_gallery.py +a1d1d00ad216bc9756956ba769af97a1ff22782f5e382f5231df598188ad256a scripts/queue_rehearsal_contract.py +3f358a86de0d2dc65037a5f9099549a9c73d5d78ac59105a0901cab495626932 scripts/recover_full_review.mjs +825074e7b38262d831bdd09f07a402dc3aace020f18af67f7150243c0a2fbe6c scripts/refresh_catalogue_previews.mjs +e3ec420588f671063513ca74ddedbb1a9d4bf5be1b05a135f974857996a9b33d scripts/rehearse_live_copy.py +72ea82e3322279ac8dbd6a7e2d9c0da94913f41ff4ffe749fc2909c75cc3e55b scripts/rehearse_verifier_migrations.py +3e0e21702d364fbe0308f24728e39e8342958358a835af90f66373bfd71658ca scripts/release_panel.py +e37e047cbce09fd93f1e42d03f5e815555e8eabb1a2c6274c15bbe4d158c3dce scripts/render_connected_site.py +0ff4e88d5c4dc05061ed8ab85082090edee2928494644c2cd4b673170ef61489 scripts/repair_catalogue_doctype.py +56b91587cdabcc52cc93b410d89f7ef59f27765f9f73318996c261d0a60e66f6 scripts/repair_catalogue_standards_batch.py +9a4bbb41e2ed3d3b8d6da6e3d3337c4465ae51b1082a1284bcc2db3bda1c43f7 scripts/repair_registry.mjs +214d07b8fdcd9ec76d15086bae7faf6db82912873569087ea144cdd4466ce79c scripts/repair_registry.test.mjs +1c6f2d028f6a3420a091f6ac611c3cbf608173cc2d0473503785ddeeb50fa91f scripts/replay_capture_failures.py +a6cf85136a25d2942014755d53a24d5759a6e2b744544a940beeba722166e4c5 scripts/replay_gallery_mapping.mjs +2721a6b38e7114cfb12346b9d818e765a6adb6b0f8fa2b3c732bbfd1d1e82295 scripts/repository_browser.mjs +36dd3ef361d32aee074555b7d649dc7b43131de98debf8d348ac89485b90424c scripts/reset-test-db.py +2521395c1a385cb6b1d70c09413bd8b94e0af7e1e8b1cdaf7b76b8e0b147f213 scripts/retention_inventory.py +ed5da725f66c0c36bc110305003e783ca18bd97f76c39dad48c4c77be06a88b4 scripts/rotate_local_test_secret.py +527cd3af72924a9b8763d4daecfc359be3477783dafc7e37615466c34e78bbdc scripts/run_asset_recovery.py +5f103745c5cdac229a2815d99a5a767488aabe8a6263ec36350a425d48febbb7 scripts/run_catalogue.py +93deffe78e1ebaf81a1c6545eb27bf349d36d421528fa33793a4be73cc9e846a scripts/run_metafold.py +410ebfd9c5445d3761c9a5913f58d158a14165e14946f1def5295207accaa405 scripts/run_metafold_package.mjs +4c2a3db8515745995c758a6a73de48613f2d2c68ef942eef97fb30ab6eda95c3 scripts/run_microfold.py +438e279bd6728d5503346a555d8267fb62606ab2b5d75874e9a6264396a951de scripts/run_reconstruction_campaign.py +ab2a982dd314516e4c0d6e3a183e61b400e1509efd212a9badd533fb478a118e scripts/serve.py +3515c272430314dd359a63e3a770f81832246d860fa8c7f55e449bf2b3583adf scripts/server_readiness.py +200252b344480ca08aa6838c825f1d2769819cc1a685aabe89f7a0baf9b91b79 scripts/smoke_arithmetic_transfer.mjs +a468d49ac9c824979ba59540341474413faeaa94cbf57c4438aab904838dec88 scripts/smoke_local_verifier.py +29b72ae8074b30dcd098d459fd81c16c2f891ac8a90d6c1ba7abcd52be2d80c1 scripts/smoke_locked_assets_live.py +b830cd860f25c2895a26e89edcc51096a3e908c8daeb1a3efbab888acd091640 scripts/smoke_metafold_local.py +add1643cefd403bb323b923529e1e682e1695aa2c4fddff0740b166b3efd26c9 scripts/smoke_pnpm_browser.py +de2b5806163428abdd75946c31883046cb0683d6719dbf1ddcc540381ef97bf9 scripts/smoke_pnpm_module_completion.py +3498257c3efa32c93b7bea5fca77891376fceed0b87c39a2f47f11c3d3801054 scripts/smoke_replay_ui.mjs +590c4e5586911951fcacfa730fd55b30bcae3000f3fc4c69303e882a4797c41c scripts/test_catalogue_animation_state.mjs +07003f6de90611b0d961836e781ccc6a145835c339b9a9d249f79affef735232 scripts/test_catalogue_border_roundtrip.mjs +b3d56cbb8e5a7162ec394d01aab21eb8f5397bdfae24be5da7ab318451941603 scripts/test_catalogue_canvas_isolation.mjs +e888a2a42d7194d2369d6389aac286a74699e4ffd876a9932d1e3c05f691ec94 scripts/test_catalogue_canvas_replace.mjs +d626a71b4ab6b3196548b8a42a101c1c6a95b0ed67912e4a1d509dcb7613c809 scripts/test_catalogue_cssom.mjs +83b1bd2860f91253ed95147f466e484a3f5fc3ed1dca14d24ad3170e6069e56d scripts/test_catalogue_image_pixels.mjs +eb7971ff75a71037c6e9a0d2404644b42fa905ba3b2158066c941df425d7db2c scripts/test_catalogue_pseudo_state.mjs +4bf5701552c6bfba93e7cef227ca38c265b5ca324ad2204c21cee7811d43bcfe scripts/test_catalogue_source_context.py +df67d42a548936d1c83673b81355baef4e18019a20d1547b98ec687d08ea4422 scripts/test_fidelity_metrics.mjs +a1f5f9f5fb25bd7210900d778c58668a09177b9773169e6506f9341e346b00cb scripts/test_laya_clone_advice.py +f97f06039a6f97345d27d05da09713b01ac1f8b38a6e15ebb0db6546bffde3dc scripts/test_laya_routing_eval.py +b36a15a18d9e8deb30a1c6fcfeadb7593b6dead2d318e91884fe375a4835a31b scripts/test_linux_browser_host.py +fc22859bfb82a9b91803703fbad03a6bc66f51ce42078977f2b660a4cab838e8 scripts/test_linux_job_host.py +eed61f243ef72b6a98f02aff47a802f03b4a01c49fa110ea052cb1ad302917a4 scripts/test_repair_catalogue_doctype.py +43dcd678cc5fbb9990637b06109139b4729e89cf9b1f6042654c620672e882fd scripts/test_trafficcop_clone_advice.py +4f11c4e0efb2b80b3a18ec630f2fc33b6f3749d975151ae928c4f7594784762e scripts/test_visual_report.py +4543cbad84599fe1a09646107bfba355368940aded544208058b9d589f3a09d1 scripts/trafficcop_capture_triage.py +bfd60e49ddfdae9bc2b7d1f951a00727642d340b30975ee0958ebada1dd5c705 scripts/trafficcop_clone_advice.py +2e9c0df99bdd10b12dcef1ba76f72a79591068ee564f549936a6128815271700 scripts/upgrade_source_style_stage.py +6a6ede81861ccf2373d6193df6f0347e2958537923159ac7765232e9d80a3e10 scripts/validate_scroll_mapping.py +16cdf16d522c6fbd8c914ddaa798b0e4b08b7720e4f8f57fed2cd9542c0e6917 scripts/verification_worker.py +c16de9a19ea7d9a69cd8752f2fb4224d2b4b50634f1c0a33d33bc638316b0935 scripts/verified_counterpart.py +caddc71b4a558656960dac594a5993183d12de7e4c82ca08552250818bbd877f scripts/verify_application_save_migration.py +8d979626534404f6c526163cf160d534790e286f0308a59b284da938965f5c87 scripts/verify_atlas_ui.mjs +ec873e969c8d9f7460211f4fee289f2b93ec1a485de2671d2ed06fe31f59e6e3 scripts/verify_backup_restore.py +52e180eb0be3b31ee78d5a4d2acd6d4b099462d325c6bd25758558f36a9e73bc scripts/verify_built_package.py +03b52315deb873d67e7644749ab449b5e0f9fd3d50f5d1695abced8dc3a0e555 scripts/verify_capture_migration.py +b7ac02578bcb2d52817323c6196735d54e1db6da5211b654e465a243b9909b6e scripts/verify_curated_game.mjs +d3de88f884259511e261a10775bf9d106b2a375a7f4541fcbab1c08f93c9e99f scripts/verify_data_gallery.mjs +f40611ab787dc76c4121a50f922b2f4ffaf6b63f449bb9ac4d6c76a180e31494 scripts/verify_ditto_burn.mjs +7fa75afc330e04acd657129ac7003e03e24c8d35d13d7c0755a0bed10c2ff8d1 scripts/verify_export_runtime.py +06bf9f8d11b9be70f55bb470854d033ed06a453873d8f33e0f3ec9bb57fdb6f3 scripts/verify_gallery_six.mjs +18f71a626889cc5177c95a4a5b8ef869b00c49c1706962b37230a44f4c250cdd scripts/verify_json_table_source.py +0ca72818a899b8d270deefb9d29b95c248c0a6e6d2780a06f21274047c4d8f69 scripts/verify_json_table_ui.mjs +4c1a4a110747bddd3a7d95e2573efea575e985be24e33664838a7271f45295f7 scripts/verify_laya_tokenizer.py +465261feefdc058cb8648e25c9a2381e61c2177bc7f6785dd4c619bc480d022c scripts/verify_laya_worker.py +2656dac48036d2cc27bcb75eca386666fd878c43567e3c8eec9d1b5514409792 scripts/verify_live_examples.mjs +bc67ff3c7689f03f4cb2a10c815c800f70df716c3eaaf6300bfe3286d24afa00 scripts/verify_packaged_json_cli.py +22ece4c413f5295f486b66c10d7ae1daca48b00660fcfedecb9473c297dd1776 scripts/verify_public_metafold.mjs +d7f4293c8b6451247639c5782e304bfac87b31c68532e449910ea497eaaf0766 scripts/verify_repository_pilot.py +7c03d3f8846677a9390c0b13ebe151ef9d5abcc191fb3922694ed953a31afffb scripts/verify_repository_ui.mjs +6568d313f5d380721aa3dbfddfd3d31fc4f94055395aedc6cf13332ad9bf5adf scripts/verify_saved_demos.mjs +e26be1af8d88ae436049a86207e3f9f030b0e85be18d22cf3f0f5061a784e4be scripts/verify_saved_repository.py +c4947899f3af447537bdbc1042704e4a7adf47a8e3f34d98343e09f1ed589a83 scripts/verify_source_fidelity.mjs +dc2391a85128e830d783e346269abce05bb396b6658270f8063a198eb24fe20c scripts/verify_source_gallery.mjs +a5ec66766c8115a758f72bf4e212f8644be1ea519e00755c68477f28d03f7167 scripts/verify_staging.mjs +814e2e06975e516b6648f7a6f2e27b1e53abb49da804f8833334fbc41184ed0f scripts/vite_define_plan.mjs +a43c0686e79d4ef6254c5cb7ba41b0155fce40eea9a46b41a75d84a35f2d7df2 scripts/vite_define_plan.test.mjs diff --git a/orbiters/chameleon/apps/api/chameleon_api/__init__.py b/orbiters/chameleon/apps/api/chameleon_api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..51df31dedfa630b577e92d4158b43ba0ca8e6cd3 --- /dev/null +++ b/orbiters/chameleon/apps/api/chameleon_api/__init__.py @@ -0,0 +1 @@ +"""Authenticated local control API.""" diff --git a/orbiters/chameleon/apps/api/chameleon_api/app.py b/orbiters/chameleon/apps/api/chameleon_api/app.py new file mode 100644 index 0000000000000000000000000000000000000000..59e0a59cc134b3dada337a20243544ba67941045 --- /dev/null +++ b/orbiters/chameleon/apps/api/chameleon_api/app.py @@ -0,0 +1,873 @@ +from __future__ import annotations + +import hashlib +import json +import secrets +from datetime import timedelta + +from chameleon_adapters.hotel_fixture import HotelAdapter +from chameleon_core.adaptation_contracts import Intake, Residual +from chameleon_core.adaptation_service import Adaptations +from chameleon_core.application_saves import ApplicationSaves, SaveRequest +from chameleon_core.config import ROOT, Settings, load_settings +from chameleon_core.contracts import StrictRecord, host_form +from chameleon_core.db import ( + Agent, + Grant, + Instance, + Run, + ScopedMemory, + SessionToken, + User, + database, + now, + uid, +) +from chameleon_core.intake import EXAMPLES, LIVE_EXAMPLES +from chameleon_core.service import Failure, Runtime, owned +from chameleon_core.twins import AttachPage, Mutation, TwinQuery, Twins +from chameleon_core.website_captures import CaptureRequest, WebsiteCaptures +from chameleon_core.worker_health import WorkerHealth +from fastapi import Depends, FastAPI, HTTPException, Query, Request, Response +from fastapi.responses import HTMLResponse, JSONResponse, StreamingResponse +from fastapi.staticfiles import StaticFiles +from pydantic import Field +from sqlalchemy import func, select, text + + +class Credentials(StrictRecord): + name: str = Field(min_length=1, max_length=80, pattern=r"^[a-zA-Z0-9 _-]+$") + password: str = Field(min_length=12, max_length=128) + + +class Seed(StrictRecord): + name: str = Field(default="Iris", min_length=1, max_length=80) + approve_synthetic_permissions: bool + + +class Start(StrictRecord): + instance_id: str = Field(pattern=r"^[a-f0-9]{32}$") + request_id: str = Field(pattern=r"^req_[a-z0-9]{1,40}$") + + +class ApprovalDecision(StrictRecord): + approved: bool + + +def token_hash(value: str) -> str: + return hashlib.sha256(value.encode()).hexdigest() + + +def password_hash(value: str, salt: str | None = None) -> str: + salt = salt or secrets.token_hex(16) + result = hashlib.scrypt(value.encode(), salt=bytes.fromhex(salt), n=16384, r=8, p=1).hex() + return salt + ":" + result + + +class DisabledFixtureAdapter: + def observe(self, *args, **kwargs): + raise Failure("SYNTHETIC_SERVICE_DISABLED", 403) + + create = observe + read = observe + + +def create_app(settings: Settings, adapter=None, provider=None) -> FastAPI: + if settings.secure_cookies and adapter is not None: + raise ValueError("Public preview cannot receive a synthetic effect adapter") + engine, sessions = database(settings.database_url) + runtime = Runtime( + sessions, + DisabledFixtureAdapter() if settings.secure_cookies else adapter or HotelAdapter(settings), + provider, + ) + app = FastAPI(title="Project Chameleon", docs_url=None, redoc_url=None, openapi_url=None) + app.state.runtime = runtime + app.state.sessions = sessions + app.state.engine = engine + adaptations = Adaptations(sessions, limits=settings.limits) + app.state.adaptations = adaptations + twins = Twins(sessions) + captures = WebsiteCaptures(sessions, limits=settings.limits) + worker_health = WorkerHealth(sessions, settings) + + @app.exception_handler(Residual) + async def residual(_request, exc): + return JSONResponse({"code": exc.code}, status_code=422) + + @app.exception_handler(Failure) + async def failure(_request, exc): + return JSONResponse( + {"code": exc.code}, + status_code=exc.status, + headers={"Retry-After": "60"} if exc.status == 429 else None, + ) + + def response_headers(response): + response.headers["Cache-Control"] = "no-store" + response.headers["X-Content-Type-Options"] = "nosniff" + response.headers["Referrer-Policy"] = "no-referrer" + preview = response.headers.get("X-Chameleon-Preview-Policy") == "isolated-v1" + if "X-Chameleon-Preview-Policy" in response.headers: + del response.headers["X-Chameleon-Preview-Policy"] + if not preview: + response.headers["Content-Security-Policy"] = ( + "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; frame-src 'self'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'" + ) + if settings.secure_cookies: + response.headers["Strict-Transport-Security"] = "max-age=31536000" + return response + + @app.middleware("http") + async def boundary(request: Request, call_next): + def denied(code, status=403): + return response_headers(JSONResponse({"code": code}, status_code=status)) + + if request.headers.get("host") not in settings.allowed_hosts: + return denied("HOST_DENIED") + if settings.secure_cookies: + # Trust the ASGI server's scheme, never an arbitrary forwarding header here. + if request.url.scheme != "https": + return denied("HTTPS_REQUIRED") + path = request.url.path + if path.startswith("/api/v1/"): + root = path.removeprefix("/api/v1/").split("/", 1)[0] + if root not in { + "auth", + "session", + "capabilities", + "examples", + "providers", + "memory", + "adaptations", + "metafold", + "twins", + "captures", + "agents", + } or (root == "auth" and path != "/api/v1/auth/guest"): + return denied("LOCAL_SERVICE_DISABLED", 404) + if request.method not in {"GET", "HEAD", "OPTIONS"}: + if request.headers.get("origin") != settings.origin: + return denied("ORIGIN_DENIED") + body = bytearray() + async for chunk in request.stream(): + body.extend(chunk) + if len(body) > 32768: + return denied("BODY_TOO_LARGE", 413) + request._body = bytes(body) + response = await call_next(request) + return response_headers(response) + + def owner(request: Request): + value = request.cookies.get("chameleon_session", "") + if not value: + raise HTTPException(401, "AUTH_REQUIRED") + with sessions() as s: + session = s.get(SessionToken, token_hash(value)) + if not session or now() >= session.expires: + raise HTTPException(401, "AUTH_REQUIRED") + if request.method not in {"GET", "HEAD"}: + csrf = request.headers.get("x-csrf-token", "") + if ( + not csrf + or not secrets.compare_digest(token_hash(csrf), session.csrf_hash) + or not secrets.compare_digest(csrf, request.cookies.get("chameleon_csrf", "")) + ): + raise HTTPException(403, "CSRF_DENIED") + return session.owner + + def issue_session(s, user, response): + token, csrf = secrets.token_urlsafe(32), secrets.token_urlsafe(32) + s.add( + SessionToken( + token_hash=token_hash(token), + owner=user.id, + csrf_hash=token_hash(csrf), + expires=now() + timedelta(hours=8), + ) + ) + response.set_cookie( + "chameleon_session", + token, + httponly=True, + secure=settings.secure_cookies, + samesite="strict", + max_age=28800, + path=settings.base_path + "/", + ) + response.set_cookie( + "chameleon_csrf", + csrf, + httponly=False, + secure=settings.secure_cookies, + samesite="strict", + max_age=28800, + path=settings.base_path + "/", + ) + return {"owner_id": user.id, "name": user.name, "csrf": csrf} + + @app.get("/health/live") + def live(): + return {"status": "live", "profile": settings.profile, "paid_providers": "unconfigured"} + + @app.get("/api/v1/capabilities") + def capabilities(): + return { + "profile": settings.profile, + "service_desk": settings.profile == "synthetic", + "counterparts": ["website_reader", "local_table", "frozen_repository_package"], + "source_style_preview": True, + "repository_packages": True, + "repository_entry_subsets": True, + "surface_wall": True, + "metafold_step_engine": settings.verification_enabled, + "recorded_asset_completion": True, + "repository_browser_execution": False, + "source_writes": False, + } + + @app.get("/health/ready") + def ready(): + result = worker_health.report() + return JSONResponse(result, status_code=200 if result["status"] == "ready" else 503) + + @app.post("/api/v1/auth/bootstrap") + def bootstrap(body: Credentials, response: Response): + with sessions.begin() as s: + s.execute(text("SELECT pg_advisory_xact_lock(7162001)")) + if s.scalar(select(func.count()).select_from(User).where(User.password != "guest-disabled")): + raise HTTPException(409, "OWNER_ALREADY_EXISTS") + user = User(name=body.name, password=password_hash(body.password)) + s.add(user) + s.flush() + return issue_session(s, user, response) + + @app.post("/api/v1/auth/login") + def login(body: Credentials, response: Response): + with sessions.begin() as s: + user = s.scalar(select(User).where(User.name == body.name)) + if ( + not user + or user.password == "guest-disabled" + or not secrets.compare_digest( + password_hash(body.password, user.password.split(":")[0]), user.password + ) + ): + raise HTTPException(401, "INVALID_CREDENTIALS") + return issue_session(s, user, response) + + @app.post("/api/v1/auth/guest") + def guest(request: Request, response: Response): + with sessions.begin() as s: + existing = s.get(SessionToken, token_hash(request.cookies.get("chameleon_session", ""))) + if existing and existing.expires > now(): + csrf = request.cookies.get("chameleon_csrf", "") + if csrf and secrets.compare_digest(token_hash(csrf), existing.csrf_hash): + return {"owner_id": existing.owner, "profile": "guest_or_existing_session"} + s.execute(text("SELECT pg_advisory_xact_lock(7162002)")) + if s.scalar(select(func.count()).select_from(User)) >= settings.limits.max_users: + raise Failure("GLOBAL_SESSION_CAP_REACHED", 429) + # Sessions have a fixed eight-hour expiry. Count actual committed + # issuance in the preceding minute without retaining visitor IPs. + if ( + s.scalar( + select(func.count()) + .select_from(SessionToken) + .where(SessionToken.expires > now() + timedelta(hours=8, minutes=-1)) + ) + >= settings.limits.new_sessions_per_minute + ): + raise Failure("GLOBAL_SESSION_ISSUANCE_LIMIT", 429) + user = User(name="guest_" + uid(), password="guest-disabled") + s.add(user) + s.flush() + return issue_session(s, user, response) + + @app.get("/api/v1/examples") + def examples(): + return [ + *LIVE_EXAMPLES, + *[ + {"source": source, "origin": "synthetic", **{k: v for k, v in data.items() if k != "data"}} + for source, data in EXAMPLES.items() + ], + ] + + @app.get("/api/v1/providers") + def providers(owner_id: str = Depends(owner)): + return [ + { + "id": "chameleon-local-v1", + "scope": "Chameleon structural forms and spatial reasoning", + "paid": False, + }, + { + "id": "structural-v1", + "scope": "structural read-form baseline; no spatial inference", + "paid": False, + }, + ] + + @app.post("/api/v1/adaptations", status_code=202) + def adapt(body: Intake, request: Request, owner_id: str = Depends(owner)): + return adaptations.report( + owner_id, adaptations.create(owner_id, body, request.headers.get("idempotency-key")) + ) + + @app.post("/api/v1/metafold/runs", status_code=202) + def metafold_create(body: dict, request: Request, owner_id: str = Depends(owner)): + from chameleon_core.metafold_service import MetaFold + + if not settings.verification_enabled: + raise Failure("VERIFICATION_DISABLED", 503) + service = MetaFold(sessions, adaptations=adaptations) + ident = service.create(owner_id, body, request.headers.get("idempotency-key")) + return service.report(owner_id, ident) + + @app.get("/api/v1/metafold/runs") + def metafold_list(response: Response, twin_id: str | None = None, owner_id: str = Depends(owner)): + from chameleon_core.metafold_service import MetaFold + + response.headers["Cache-Control"] = "no-store" + return MetaFold(sessions, adaptations=adaptations).list(owner_id, twin_id) + + @app.get("/api/v1/metafold/runs/{run_id}") + def metafold_status(run_id: str, response: Response, owner_id: str = Depends(owner)): + from chameleon_core.metafold_service import MetaFold + + response.headers["Cache-Control"] = "no-store" + return MetaFold(sessions, adaptations=adaptations).report(owner_id, run_id) + + @app.post("/api/v1/metafold/runs/{run_id}/advance") + def metafold_advance(run_id: str, owner_id: str = Depends(owner)): + from chameleon_core.metafold_service import MetaFold + + if not settings.verification_enabled: + raise Failure("VERIFICATION_DISABLED", 503) + return MetaFold(sessions, adaptations=adaptations).advance(owner_id, run_id) + + @app.get("/api/v1/adaptations") + def adaptation_list(owner_id: str = Depends(owner)): + return adaptations.list(owner_id) + + @app.get("/api/v1/adaptations/{job_id}") + def adaptation_report(job_id: str, owner_id: str = Depends(owner)): + return adaptations.report(owner_id, job_id) + + @app.post("/api/v1/adaptations/{job_id}/cancel") + def adaptation_cancel(job_id: str, owner_id: str = Depends(owner)): + adaptations.cancel(owner_id, job_id) + return adaptations.report(owner_id, job_id) + + @app.get("/api/v1/memory") + def memory(owner_id: str = Depends(owner)): + with sessions() as s: + return [ + { + "agent_id": m.agent, + "job_id": m.job, + "target_scope": m.target_scope, + "evidence_digest": m.evidence_digest, + "form_digest": m.form_digest, + "authority": m.data.get("authority"), + } + for m in s.scalars(select(ScopedMemory).where(ScopedMemory.owner == owner_id).limit(50)) + ] + + @app.post("/api/v1/adaptations/{job_id}/twin", status_code=201) + def create_twin(job_id: str, owner_id: str = Depends(owner)): + return twins.report(owner_id, twins.create(owner_id, job_id)) + + @app.get("/api/v1/twins") + def list_twins(owner_id: str = Depends(owner)): + return twins.list(owner_id) + + @app.get("/api/v1/twins/{twin_id}") + def twin_report(twin_id: str, owner_id: str = Depends(owner)): + return twins.report(owner_id, twin_id) + + @app.get("/api/v1/twins/{twin_id}/preview/{page_index}", response_class=HTMLResponse) + def twin_preview( + twin_id: str, + page_index: int, + channel: str = Query(pattern=r"^[a-f0-9]{32}$"), + owner_id: str = Depends(owner), + ): + from chameleon_core.visual_capture import render_page + + report = twins.report(owner_id, twin_id) + if not 0 <= page_index < len(report["pages"]): + raise Failure("VISUAL_PAGE_NOT_FOUND", 404) + artifact = report["pages"][page_index].get("visual") + if not artifact: + raise Failure("SOURCE_STYLE_CAPTURE_REQUIRED", 409) + nonce = secrets.token_urlsafe(24) + return HTMLResponse( + render_page(artifact, nonce, channel), + headers={ + "X-Chameleon-Preview-Policy": "isolated-v1", + "Content-Security-Policy": "default-src 'none'; script-src 'nonce-" + + nonce + + "'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'self'; sandbox allow-scripts", + "Permissions-Policy": "camera=(), microphone=(), geolocation=(), payment=()", + }, + ) + + @app.post("/api/v1/twins/{twin_id}/mutations") + def twin_mutation(twin_id: str, body: Mutation, request: Request, owner_id: str = Depends(owner)): + return twins.mutate(owner_id, twin_id, body, request.headers.get("idempotency-key", "")) + + @app.post("/api/v1/twins/{twin_id}/query") + def query_twin(twin_id: str, body: TwinQuery, owner_id: str = Depends(owner)): + return twins.query(owner_id, twin_id, body.objective) + + @app.post("/api/v1/twins/{twin_id}/pages") + def attach_page(twin_id: str, body: AttachPage, owner_id: str = Depends(owner)): + return twins.attach_page(owner_id, twin_id, body) + + @app.post("/api/v1/twins/{twin_id}/captures", status_code=202) + def capture_page(twin_id: str, body: CaptureRequest, request: Request, owner_id: str = Depends(owner)): + return captures.start(owner_id, twin_id, body, request.headers.get("idempotency-key", "")) + + @app.get("/api/v1/twins/{twin_id}/coverage") + def website_coverage(twin_id: str, owner_id: str = Depends(owner)): + return captures.coverage(owner_id, twin_id) + + @app.get("/api/v1/twins/{twin_id}/surfaces") + def surface_wall(twin_id: str, response: Response, owner_id: str = Depends(owner)): + from chameleon_core.surface_graph import SurfaceGraphs + + response.headers["Cache-Control"] = "no-store" + return SurfaceGraphs(sessions).read(owner_id, twin_id) + + @app.post("/api/v1/captures/{capture_id}/cancel") + def cancel_capture(capture_id: str, owner_id: str = Depends(owner)): + return captures.cancel(owner_id, capture_id) + + @app.get("/api/v1/twins/{twin_id}/export") + def export_twin(twin_id: str, owner_id: str = Depends(owner)): + return twins.export(owner_id, twin_id) + + @app.get("/api/v1/twins/{twin_id}/verification") + def verification_status(twin_id: str, response: Response, owner_id: str = Depends(owner)): + from chameleon_core.verification_jobs import PROFILE, VerificationJobs, supported + + evidence = twins.repository_evidence(owner_id, twin_id) + response.headers["Cache-Control"] = "no-store" + available = settings.verification_enabled and supported(evidence) + return { + "available": available, + "profile": PROFILE if available else None, + "declared_contracts_available": settings.verification_enabled, + "declared_contract_versions": ["browser-contract-v1", "browser-contract-v2"], + "declared_contract_max_steps": 12, + "declared_wait_count_timeout_ms": 2000, + "interaction_replay_available": settings.verification_enabled, + "declared_contract_scope": "Caller-declared checks only; not independent equivalence", + "scope": "Reviewed calculator addition and bounded repair only", + "jobs": VerificationJobs(sessions, limits=settings.limits).list(owner_id, twin_id) + if settings.verification_enabled + else [], + } + + @app.post("/api/v1/twins/{twin_id}/verification", status_code=202) + def verification_start(twin_id: str, request: Request, owner_id: str = Depends(owner)): + from chameleon_core.verification_jobs import VerificationJobs, supported + + evidence = twins.repository_evidence(owner_id, twin_id) + if not settings.verification_enabled: + raise Failure("VERIFICATION_DISABLED", 503) + if not supported(evidence): + raise Failure("VERIFICATION_FAMILY_UNSUPPORTED", 422) + queue = VerificationJobs(sessions, limits=settings.limits) + ident = queue.enqueue(owner_id, twin_id, request.headers.get("idempotency-key", "")) + return queue.report(owner_id, ident) + + @app.post("/api/v1/twins/{twin_id}/verification/contract", status_code=202) + def verification_contract(twin_id: str, request: Request, contract: dict, owner_id: str = Depends(owner)): + from chameleon_core.verification_jobs import CONTRACT_PROFILE, VerificationJobs + + twins.repository_evidence(owner_id, twin_id) + if not settings.verification_enabled: + raise Failure("VERIFICATION_DISABLED", 503) + queue = VerificationJobs(sessions, limits=settings.limits) + ident = queue.enqueue( + owner_id, + twin_id, + request.headers.get("idempotency-key", ""), + profile=CONTRACT_PROFILE, + contract=contract, + ) + return { + **queue.report(owner_id, ident), + "scope": "Caller-declared checks only; not independent equivalence", + } + + @app.post("/api/v1/twins/{twin_id}/verification/locked-assets", status_code=202) + def verification_locked_assets( + twin_id: str, request: Request, body: dict, owner_id: str = Depends(owner) + ): + from chameleon_core.verification_jobs import CONTRACT_PROFILE, VerificationJobs + + if not settings.verification_enabled: + raise Failure("VERIFICATION_DISABLED", 503) + if set(body) != {"contract", "lock_path"} or not isinstance(body["lock_path"], str): + raise Failure("DEPENDENCY_REQUEST_INVALID", 422) + queue = VerificationJobs(sessions, limits=settings.limits) + ident = queue.enqueue( + owner_id, + twin_id, + request.headers.get("idempotency-key", ""), + profile=CONTRACT_PROFILE, + contract=body["contract"], + dependency_lock=body["lock_path"], + ) + return { + **queue.report(owner_id, ident), + "scope": "Caller-declared checks; exact captured npm lock assets only", + } + + @app.get("/api/v1/twins/{twin_id}/dependencies/plan") + def dependency_metadata_plan(twin_id: str, owner_id: str = Depends(owner)): + from chameleon_core.dependency_plan import plan_dependencies + + evidence = twins.repository_evidence(owner_id, twin_id) + return plan_dependencies({"digest": evidence.content_digest, "repository": evidence.payload}) + + @app.post("/api/v1/twins/{twin_id}/dependencies/capture-metadata", status_code=202) + def dependency_metadata_capture(twin_id: str, request: Request, owner_id: str = Depends(owner)): + from chameleon_core.dependency_plan import metadata_intake + + intake = metadata_intake(twins.repository_evidence(owner_id, twin_id)) + ident = adaptations.create(owner_id, intake, request.headers.get("idempotency-key")) + return adaptations.report(owner_id, ident) + + @app.get("/api/v1/twins/{twin_id}/behavior") + def behavior_records(twin_id: str, response: Response, owner_id: str = Depends(owner)): + from chameleon_core.behavior_records import BehaviorRecords + + response.headers["Cache-Control"] = "no-store" + return BehaviorRecords(twins.sessions).read(owner_id, twin_id) + + @app.get("/api/v1/twins/{twin_id}/behavior/{record_id}/complete-assets") + def recorded_asset_plan(twin_id: str, record_id: str, owner_id: str = Depends(owner)): + from chameleon_core.behavior_records import BehaviorRecords + + intake = BehaviorRecords(twins.sessions).asset_completion(owner_id, twin_id, record_id) + return {"source": intake.source, "entry": intake.repository_entry, "paths": intake.repository_assets} + + @app.get("/api/v1/twins/{twin_id}/behavior/{record_id}/correspondence") + def source_correspondence(twin_id: str, record_id: str, response: Response, owner_id: str = Depends(owner)): + from chameleon_core.metafold_evidence import MetafoldEvidence + + response.headers["Cache-Control"] = "no-store" + return MetafoldEvidence(sessions).correspondence(owner_id, twin_id, record_id) + + @app.post("/api/v1/twins/{twin_id}/behavior/{record_id}/complete-assets", status_code=202) + def complete_recorded_assets( + twin_id: str, record_id: str, request: Request, owner_id: str = Depends(owner) + ): + from chameleon_core.behavior_records import BehaviorRecords + + intake = BehaviorRecords(twins.sessions).asset_completion(owner_id, twin_id, record_id) + ident = adaptations.create(owner_id, intake, request.headers.get("idempotency-key")) + return adaptations.report(owner_id, ident) + + @app.get("/api/v1/twins/{twin_id}/bundles/{bundle_id}/download") + def counterpart_bundle(twin_id: str, bundle_id: str, owner_id: str = Depends(owner)): + from chameleon_core.counterpart_bundles import CounterpartBundles + + body, fingerprint = CounterpartBundles(twins.sessions).download(owner_id, twin_id, bundle_id) + return Response( + body, + media_type="application/zip", + headers={ + "Content-Disposition": 'attachment; filename="chameleon-counterpart.zip"', + "Cache-Control": "no-store", + "X-Content-Type-Options": "nosniff", + "X-Chameleon-Bundle-SHA256": fingerprint, + }, + ) + + @app.get("/api/v1/twins/{twin_id}/bundles/{bundle_id}/frame", response_class=HTMLResponse) + def counterpart_bundle_frame(twin_id: str, bundle_id: str, owner_id: str = Depends(owner)): + from chameleon_core.bundle_preview import render + from chameleon_core.counterpart_bundles import CounterpartBundles + + body, _ = CounterpartBundles(twins.sessions).download(owner_id, twin_id, bundle_id) + nonce = secrets.token_urlsafe(24) + return HTMLResponse( + render(body, nonce), + headers={ + "X-Chameleon-Preview-Policy": "isolated-v1", + "Cache-Control": "no-store", + "Content-Security-Policy": "default-src 'none'; script-src 'nonce-" + + nonce + + "'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; " + "frame-src 'none'; worker-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; " + "frame-ancestors 'self'; sandbox allow-scripts", + "Permissions-Policy": "camera=(), microphone=(), geolocation=(), payment=()", + }, + ) + + @app.get("/api/v1/twins/{twin_id}/bundles/{bundle_id}/interaction-frame") + def counterpart_interaction_frame(twin_id: str, bundle_id: str, owner_id: str = Depends(owner)): + from chameleon_core.counterpart_bundles import CounterpartBundles + + body, fingerprint = CounterpartBundles(sessions).interaction_frame(owner_id, twin_id, bundle_id) + return Response( + body, + media_type="image/png", + headers={ + "Cache-Control": "no-store", + "X-Content-Type-Options": "nosniff", + "Cross-Origin-Resource-Policy": "same-origin", + "Content-Security-Policy": "default-src 'none'; sandbox", + "X-Chameleon-Frame-SHA256": fingerprint, + }, + ) + + @app.post("/api/v1/twins/{twin_id}/bundles/{bundle_id}/replay", status_code=202) + def counterpart_replay( + twin_id: str, bundle_id: str, request: Request, action: dict, owner_id: str = Depends(owner) + ): + from chameleon_core.counterpart_bundles import CounterpartBundles + + if not settings.verification_enabled: + raise Failure("VERIFICATION_DISABLED", 503) + result = CounterpartBundles(sessions, limits=settings.limits).replay( + owner_id, twin_id, bundle_id, action, request.headers.get("idempotency-key", "") + ) + return { + **result, + "scope": "Fresh isolated replay of recorded steps and requested action; not a persistent live session", + } + + @app.get("/api/v1/twins/{twin_id}/repository/file") + def repository_file( + twin_id: str, path: str = Query(min_length=1, max_length=240), owner_id: str = Depends(owner) + ): + return twins.repository_file(owner_id, twin_id, path) + + @app.get("/api/v1/twins/{twin_id}/repository/application") + def repository_application_status(twin_id: str, owner_id: str = Depends(owner)): + from chameleon_core.curated_app import approved_2048 + + evidence = twins.repository_evidence(owner_id, twin_id) + supported = approved_2048({"digest": evidence.content_digest, "repository": evidence.payload}) + return { + "available": supported, + "application": "2048" if supported else None, + "coverage": "Previously tested original-source revision; this acquisition does not rerun behavior tests", + "storage": "private server save; explicit Save progress required", + "source_writes": False, + } + + @app.get("/api/v1/twins/{twin_id}/repository/application/save") + def application_save_get(twin_id: str, response: Response, owner_id: str = Depends(owner)): + response.headers["Cache-Control"] = "no-store" + return ApplicationSaves(twins.sessions).read(owner_id, twin_id) + + @app.put("/api/v1/twins/{twin_id}/repository/application/save") + def application_save_put(twin_id: str, body: SaveRequest, owner_id: str = Depends(owner)): + return ApplicationSaves(twins.sessions).write(owner_id, twin_id, body) + + @app.get("/api/v1/twins/{twin_id}/repository/application/frame", response_class=HTMLResponse) + def repository_application_frame( + twin_id: str, channel: str = Query(pattern=r"^[a-f0-9]{32}$"), owner_id: str = Depends(owner) + ): + from chameleon_core.curated_app import render_2048 + + evidence = twins.repository_evidence(owner_id, twin_id) + nonce = secrets.token_urlsafe(24) + return HTMLResponse( + render_2048({"digest": evidence.content_digest, "repository": evidence.payload}, nonce, channel), + headers={ + "X-Chameleon-Preview-Policy": "isolated-v1", + "Cache-Control": "no-store", + "Content-Security-Policy": "default-src 'none'; script-src 'nonce-" + + nonce + + "'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'self'; sandbox allow-scripts", + "Permissions-Policy": "camera=(), microphone=(), geolocation=(), payment=()", + }, + ) + + @app.get("/api/v1/twins/{twin_id}/repository/download") + def repository_download(twin_id: str, owner_id: str = Depends(owner)): + body, commit = twins.repository_zip(owner_id, twin_id) + return Response( + body, + media_type="application/zip", + headers={ + "Content-Disposition": f'attachment; filename="chameleon-source-{commit[:12]}.zip"', + "X-Chameleon-Package-Scope": "frozen-source-behavior-untested", + }, + ) + + @app.get("/api/v1/session") + def session(owner_id: str = Depends(owner)): + return {"owner_id": owner_id, "profile": settings.profile, "live_providers": "unconfigured"} + + @app.post("/api/v1/demo/seed", status_code=201) + def seed(body: Seed, owner_id: str = Depends(owner)): + if not body.approve_synthetic_permissions: + raise HTTPException(403, "EXPLICIT_FIXTURE_GRANTS_REQUIRED") + return runtime.seed(owner_id, body.name) + + @app.get("/api/v1/agents") + def agents(owner_id: str = Depends(owner)): + with sessions() as s: + return [a.identity for a in s.scalars(select(Agent).where(Agent.owner == owner_id))] + + @app.get("/api/v1/agents/{agent_id}") + def agent(agent_id: str, owner_id: str = Depends(owner)): + with sessions() as s: + return owned(s, Agent, agent_id, owner_id).identity + + @app.get("/api/v1/instances") + def instances(owner_id: str = Depends(owner)): + with sessions() as s: + return [ + {"agent_id": i.agent, "instance_id": i.id, "form_digest": i.form} + for i in s.scalars(select(Instance).where(Instance.owner == owner_id).limit(100)) + ] + + @app.get("/api/v1/forms/host") + def form(owner_id: str = Depends(owner)): + return host_form().model_dump() + + @app.post("/api/v1/runs", status_code=201) + def start(body: Start, request: Request, owner_id: str = Depends(owner)): + key = request.headers.get("idempotency-key", "") + if not 1 <= len(key) <= 80 or not key.isascii(): + raise HTTPException(400, "IDEMPOTENCY_KEY_REQUIRED") + ident = runtime.start(owner_id, body.instance_id, body.request_id, key) + return runtime.report(owner_id, ident) + + @app.get("/api/v1/runs") + def runs(owner_id: str = Depends(owner)): + with sessions() as s: + return [ + {"run_id": r.id, "status": r.status, "request_id": r.request_id} + for r in s.scalars(select(Run).where(Run.owner == owner_id).limit(100)) + ] + + @app.get("/api/v1/runs/{run_id}/report") + def report(run_id: str, owner_id: str = Depends(owner)): + return runtime.report(owner_id, run_id) + + @app.post("/api/v1/runs/{run_id}/step") + def step(run_id: str, owner_id: str = Depends(owner)): + runtime.step(owner_id, run_id) + return runtime.report(owner_id, run_id) + + @app.post("/api/v1/approvals/{approval_id}/decision") + def approve(approval_id: str, body: ApprovalDecision, owner_id: str = Depends(owner)): + runtime.decide_approval(owner_id, approval_id, body.approved) + return {"recorded": True} + + @app.post("/api/v1/runs/{run_id}/pause") + def pause(run_id: str, owner_id: str = Depends(owner)): + runtime.pause(owner_id, run_id) + return runtime.report(owner_id, run_id) + + @app.post("/api/v1/runs/{run_id}/cancel") + def cancel(run_id: str, owner_id: str = Depends(owner)): + runtime.pause(owner_id, run_id, cancel=True) + return runtime.report(owner_id, run_id) + + @app.post("/api/v1/runs/{run_id}/resume") + def resume(run_id: str, owner_id: str = Depends(owner)): + runtime.resume(owner_id, run_id) + return runtime.report(owner_id, run_id) + + @app.post("/api/v1/runs/{run_id}/reconcile") + def reconcile(run_id: str, owner_id: str = Depends(owner)): + runtime.broker.reconcile(owner_id, run_id) + return runtime.report(owner_id, run_id) + + @app.post("/api/v1/grants/{grant_id}/revoke") + def revoke(grant_id: str, owner_id: str = Depends(owner)): + with sessions.begin() as s: + grant = owned(s, Grant, grant_id, owner_id, lock=True) + grant.active = False + grant.version += 1 + return {"revoked": True} + + @app.get("/api/v1/runs/{run_id}/events") + def events(run_id: str, request: Request, after: int = 0, owner_id: str = Depends(owner)): + if after < 0: + raise HTTPException(400, "INVALID_CURSOR") + try: + cursor = max(after, int(request.headers.get("last-event-id", "0"))) + except ValueError: + raise HTTPException(400, "INVALID_CURSOR") + rows = runtime.events(owner_id, run_id, cursor) + if "text/event-stream" in request.headers.get("accept", ""): + return StreamingResponse( + iter([f"id: {r['sequence']}\nevent: trace\ndata: {json.dumps(r)}\n\n" for r in rows]), + media_type="text/event-stream", + ) + return { + "events": rows, + "cursor": rows[-1]["sequence"] if rows else cursor, + "replay": True, + "external_calls": 0, + } + + @app.get("/showcase/application/2048", response_class=HTMLResponse) + def curated_game(channel: str = Query(pattern=r"^[a-f0-9]{32}$")): + from chameleon_core.curated_app import render_2048 + + path = ROOT / "apps/web/dist/showcase/2048-package.json" + if not path.is_file(): + raise Failure("EXAMPLE_NOT_AVAILABLE", 404) + nonce = secrets.token_urlsafe(24) + return HTMLResponse( + render_2048(json.loads(path.read_text(encoding="utf-8")), nonce, channel), + headers={ + "X-Chameleon-Preview-Policy": "isolated-v1", + "Content-Security-Policy": "default-src 'none'; script-src 'nonce-" + + nonce + + "'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'self'; sandbox allow-scripts", + "Permissions-Policy": "camera=(), microphone=(), geolocation=(), payment=()", + }, + ) + + @app.get("/showcase/frame/{example}/{page_index}", response_class=HTMLResponse) + def public_example_preview( + example: int, + page_index: int, + channel: str = Query(pattern=r"^[a-f0-9]{32}$"), + ): + from chameleon_core.visual_capture import render_page + + # Fixed release artifacts only. Never accept guest/twin identifiers here. + if example not in (0, 1, 2, 4, 5) or page_index not in range(8): + raise Failure("EXAMPLE_PAGE_NOT_FOUND", 404) + path = ROOT / f"apps/web/dist/showcase/demo-{example}.json" + if not path.is_file(): + raise Failure("EXAMPLE_PAGE_NOT_FOUND", 404) + capture = json.loads(path.read_text(encoding="utf-8")) + if page_index >= len(capture["pages"]): + raise Failure("EXAMPLE_PAGE_NOT_FOUND", 404) + nonce = secrets.token_urlsafe(24) + return HTMLResponse( + render_page(capture["pages"][page_index]["visual"], nonce, channel), + headers={ + "X-Chameleon-Preview-Policy": "isolated-v1", + "Content-Security-Policy": "default-src 'none'; script-src 'nonce-" + + nonce + + "'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'self'; sandbox allow-scripts", + "Permissions-Policy": "camera=(), microphone=(), geolocation=(), payment=()", + }, + ) + + static = ROOT / "apps/web/dist" + if static.exists(): + app.mount("/", StaticFiles(directory=static, html=True), name="web") + return app + + +def factory(): + return create_app(load_settings()) diff --git a/orbiters/chameleon/apps/api/chameleon_api/fixture.py b/orbiters/chameleon/apps/api/chameleon_api/fixture.py new file mode 100644 index 0000000000000000000000000000000000000000..3b44ef7ba9b0abe5070fa2b4bbf3021fb951b379 --- /dev/null +++ b/orbiters/chameleon/apps/api/chameleon_api/fixture.py @@ -0,0 +1,6 @@ +from chameleon_adapters.hotel_fixture import fixture_app +from chameleon_core.config import load_settings + + +def factory(): + return fixture_app(load_settings()) diff --git a/orbiters/chameleon/exam_pack.py b/orbiters/chameleon/exam_pack.py new file mode 100644 index 0000000000000000000000000000000000000000..8f551f4d866ddee3e64b7df10292fe68b23f8bed --- /dev/null +++ b/orbiters/chameleon/exam_pack.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +"""chameleon pack exam: each of its own test files is run alone. One that needs a package, a browser or a frozen fixture the pack doesn't carry counts as +waiting on the checked fetch; every test that can run here must pass.""" +import glob +import json +import subprocess + +done, waiting, failed = 0, [], [] +for f in sorted(glob.glob("scripts/*.test.mjs")): + p = subprocess.run(["node", "--test", f], capture_output=True, text=True, timeout=120) + text = p.stdout + p.stderr + if p.returncode == 0: + done += 1 + elif "Cannot find module" in text or "Cannot find package" in text or "ERR_MODULE_NOT_FOUND" in text or "Executable doesn't exist" in text or "/.local/" in text or " '.local/" in text: + waiting.append(f) + else: + failed.append(f) +print(json.dumps({"passed": done > 0 and not failed, "summary": "%d test files pass, %d wait on packages, a browser or fixtures, %d fail" % (done, len(waiting), len(failed)), "failed": failed})) diff --git a/orbiters/chameleon/night.py b/orbiters/chameleon/night.py new file mode 100644 index 0000000000000000000000000000000000000000..2a5305803d9e2201d456ce08a70a0f6cd80fcde7 --- /dev/null +++ b/orbiters/chameleon/night.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +"""night for artist and chameleon - each failure in the orbiter's own record becomes a typed hole in the orbiters' one format, ranked by what it costs. What fills a hole needs a +judge or a browser that isn't in the pack, so this night reports; it builds nothing. usage: python night.py""" +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent +holes = [] +if HERE.name == "artist": + d = json.load(open(HERE / "results" / "geneval_heldout.json")) + for task, r in d["by_task"].items(): + lost = r["n_images"] * (1 - r["judge"]) + gap = r["self_verified"] - r["judge"] + holes.append({"origin": "artist", "kind": "not_recognised" if gap > .2 else "failed_check", "want": "compositing an outside judge recognises" if gap > .2 else "sprites for this kind", "givens": {"task": task, "judge": r["judge"], "self_verified": r["self_verified"]}, "cost": round(lost)}) +else: + d = json.load(open(HERE / "results" / "release-panel-current-20260921b.json")) + for t in d["targets"]: + st = [a.get("status") for a in t.get("attempts", [])] + if st and st[-1] != "COMPLETE": + holes.append({"origin": "chameleon", "kind": "blocked", "want": "an operator or a contract for this target", "givens": {"id": t["id"], "family": t.get("family"), "split": t.get("split"), "status": st[-1]}, "cost": 1}) +holes.sort(key=lambda h: -h["cost"]) +print(json.dumps({"holes": len(holes), "top": holes[:4]}, indent=1)) diff --git a/orbiters/chameleon/orbiter.json b/orbiters/chameleon/orbiter.json new file mode 100644 index 0000000000000000000000000000000000000000..67f88539c3c22dfe7eb58e93ae242c3457e48aa3 --- /dev/null +++ b/orbiters/chameleon/orbiter.json @@ -0,0 +1,9 @@ +{ + "name": "chameleon", + "good_for": "Turns repositories into finished apps, and blocks with reasons rather than claim completion.", + "python": [], + "programs": [ + "node" + ], + "exam": "exam_pack.py" +} \ No newline at end of file diff --git a/orbiters/chameleon/package.json b/orbiters/chameleon/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a819f407a7906c93f1174cc828b2fd4c7eb32ba0 --- /dev/null +++ b/orbiters/chameleon/package.json @@ -0,0 +1,7 @@ +{ + "name": "project-chameleon", "version": "0.1.0", "private": true, + "packageManager": "pnpm@11.19.0", "type": "module", + "scripts": {"build": "vite build --config apps/web/vite.config.ts", "typecheck": "tsc -p apps/web/tsconfig.json --noEmit", "test:e2e": "playwright test"}, + "dependencies": {"react": "19.3.0", "react-dom": "19.3.0"}, + "devDependencies": {"vite": "8.3.0", "typescript": "7.0.2", "@vitejs/plugin-react": "6.1.1", "@types/react": "19.3.0", "@types/react-dom": "19.3.0", "@playwright/test": "1.63.0"} +} diff --git a/orbiters/chameleon/packages/adapters/chameleon_adapters/__init__.py b/orbiters/chameleon/packages/adapters/chameleon_adapters/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cf789eecc941603b72d799d5c992b876514ad439 --- /dev/null +++ b/orbiters/chameleon/packages/adapters/chameleon_adapters/__init__.py @@ -0,0 +1 @@ +"""Registered trusted executors. No dynamic code import from form packages.""" diff --git a/orbiters/chameleon/packages/adapters/chameleon_adapters/hotel_fixture.py b/orbiters/chameleon/packages/adapters/chameleon_adapters/hotel_fixture.py new file mode 100644 index 0000000000000000000000000000000000000000..2b617b8c1a9100f1ad79f171f782da69da41b1bc --- /dev/null +++ b/orbiters/chameleon/packages/adapters/chameleon_adapters/hotel_fixture.py @@ -0,0 +1,214 @@ +from __future__ import annotations + +import secrets +from typing import Literal + +import httpx +from chameleon_core.config import Settings +from chameleon_core.contracts import StrictRecord, TicketArguments, digest +from chameleon_core.db import FixtureRequest, FixtureTicket, database +from fastapi import FastAPI, Header, HTTPException +from pydantic import Field +from sqlalchemy import select + + +class CreateTicket(StrictRecord): + arguments: TicketArguments + expected_version: int = Field(ge=1) + idempotency_key: str = Field(pattern=r"^[a-f0-9]{64}$") + + +class TicketView(StrictRecord): + ticket_id: str + request_id: str + room_id: str + category: str + idempotency_key: str + status: Literal["open", "closed"] + + +def ticket_view(t: FixtureTicket) -> dict: + if t.status not in ("open", "closed"): + raise ValueError("Unexpected fixture ticket status") + return TicketView( + ticket_id=t.id, + request_id=t.request_id, + room_id=t.room, + category=t.category, + idempotency_key=t.idempotency_key, + status="open" if t.status == "open" else "closed", + ).model_dump() + + +def fixture_app(settings: Settings) -> FastAPI: + if settings.profile != "synthetic": + raise ValueError("Synthetic fixture is disabled in this profile") + engine, sessions = database(settings.database_url) + app = FastAPI(title="SYNTHETIC Hotel fixture", docs_url=None, redoc_url=None) + app.state.engine = engine + + def principal(authorization: str, owner: str): + if not secrets.compare_digest(authorization, "Bearer " + settings.fixture_key) or len(owner) != 32: + raise HTTPException(403, "FIXTURE_AUTH_REQUIRED") + + @app.get("/health") + def health(): + return {"profile": "synthetic", "version": "hotel-fixture-v1"} + + @app.get("/requests/{request_id}") + def observe(request_id: str, authorization: str = Header(default=""), x_owner: str = Header(default="")): + principal(authorization, x_owner) + with sessions() as s: + row = s.get(FixtureRequest, (request_id, x_owner)) + if not row: + raise HTTPException(404, "REQUEST_NOT_FOUND") + tickets = s.scalars( + select(FixtureTicket).where( + FixtureTicket.owner == x_owner, FixtureTicket.request_id == request_id + ) + ).all() + return { + "request_id": row.id, + "room_id": row.room, + "category": row.category, + "text": row.text, + "version": row.version, + "available": row.available, + "status": row.status, + "tickets": [ticket_view(t) for t in tickets], + "interface_version": "hotel-fixture-v1", + } + + @app.post("/tickets") + def create( + body: CreateTicket, authorization: str = Header(default=""), x_owner: str = Header(default="") + ): + principal(authorization, x_owner) + args = body.arguments + with sessions.begin() as s: + row = s.scalar( + select(FixtureRequest) + .where(FixtureRequest.id == args.request_id, FixtureRequest.owner == x_owner) + .with_for_update() + ) + if not row: + raise HTTPException(404, "REQUEST_NOT_FOUND") + binding = digest(args.model_dump()) + prior = s.scalar( + select(FixtureTicket).where( + FixtureTicket.owner == x_owner, FixtureTicket.idempotency_key == body.idempotency_key + ) + ) + if prior: + if prior.binding != binding: + raise HTTPException(409, "IDEMPOTENCY_CONFLICT") + return ticket_view(prior) + if row.version != body.expected_version: + raise HTTPException(409, "STALE_STATE") + if ( + not row.available + or row.status != "open" + or row.category != args.category + or row.room != args.room_id + ): + raise HTTPException(409, "SERVICE_UNAVAILABLE") + if s.scalar( + select(FixtureTicket).where( + FixtureTicket.owner == x_owner, FixtureTicket.request_id == args.request_id + ) + ): + raise HTTPException(409, "DUPLICATE_REQUEST") + ticket = FixtureTicket( + owner=x_owner, + request_id=args.request_id, + room=args.room_id, + category=args.category, + idempotency_key=body.idempotency_key, + binding=binding, + ) + s.add(ticket) + s.flush() + row.version += 1 + return ticket_view(ticket) + + @app.get("/tickets/by-key/{key}") + def by_key(key: str, authorization: str = Header(default=""), x_owner: str = Header(default="")): + principal(authorization, x_owner) + with sessions() as s: + ticket = s.scalar( + select(FixtureTicket).where( + FixtureTicket.owner == x_owner, FixtureTicket.idempotency_key == key + ) + ) + if not ticket: + raise HTTPException(404, "TICKET_NOT_FOUND") + return ticket_view(ticket) + + return app + + +class AdapterFailure(RuntimeError): + def __init__(self, code: str): + self.code = code + super().__init__(code) + + +class HotelAdapter: + """Connection URL is deployment-owned. Form/provider output cannot change it.""" + + def __init__(self, settings: Settings, client=None): + if settings.profile != "synthetic": + raise ValueError("Synthetic adapter is disabled in this profile") + self.settings = settings + self.client = client or httpx.Client( + base_url=settings.fixture_url, timeout=3, trust_env=False, follow_redirects=False + ) + + def call(self, method: str, path: str, owner: str, body=None): + try: + response = self.client.request( + method, + path, + headers={"Authorization": "Bearer " + self.settings.fixture_key, "X-Owner": owner}, + json=body, + ) + except httpx.TransportError as exc: + raise AdapterFailure("OUTCOME_UNKNOWN" if method == "POST" else "TARGET_UNAVAILABLE") from exc + if response.status_code >= 500: + raise AdapterFailure("OUTCOME_UNKNOWN" if method == "POST" else "TARGET_UNAVAILABLE") + if response.status_code != 200: + known = ( + response.json().get("detail") + if response.headers.get("content-type", "").startswith("application/json") + else None + ) + raise AdapterFailure( + known + if known + in { + "STALE_STATE", + "SERVICE_UNAVAILABLE", + "TICKET_NOT_FOUND", + "DUPLICATE_REQUEST", + "IDEMPOTENCY_CONFLICT", + "REQUEST_NOT_FOUND", + } + else "TARGET_ERROR" + ) + if len(response.content) > 32768: + raise AdapterFailure("TARGET_INVALID_RESULT") + return response.json() + + def observe(self, owner: str, request_id: str): + return self.call("GET", f"/requests/{request_id}", owner) + + def create(self, owner: str, candidate, key: str): + body = CreateTicket( + arguments=candidate.arguments, + expected_version=candidate.precondition_version, + idempotency_key=key, + ) + return TicketView.model_validate(self.call("POST", "/tickets", owner, body.model_dump())).model_dump() + + def read(self, owner: str, key: str): + return TicketView.model_validate(self.call("GET", f"/tickets/by-key/{key}", owner)).model_dump() diff --git a/orbiters/chameleon/packages/cli/ditto_reconstruction.py b/orbiters/chameleon/packages/cli/ditto_reconstruction.py new file mode 100644 index 0000000000000000000000000000000000000000..0465366593defa6c310bcf7f0903bcf5bb18b0e4 --- /dev/null +++ b/orbiters/chameleon/packages/cli/ditto_reconstruction.py @@ -0,0 +1,35 @@ +"""Ditto-specific durable MetaFold submission, packaged without altering Chameleon.""" +import json +from uuid import uuid4 + + +def reconstruct(client, request_path=None, effort='sol', *, resume=False): + pending = client.state.get('ditto_reconstruction_pending') + if resume: + if not pending: + raise ValueError('NO_PENDING_RECONSTRUCTION') + else: + if pending: + raise ValueError('PENDING_RECONSTRUCTION_USE_RESUME') + if effort not in {'luna', 'sol', 'astra'}: + raise ValueError('INVALID_EFFORT') + with request_path.open('rb') as stream: + raw = stream.read(32769) + if len(raw) > 32768: + raise ValueError('RECONSTRUCTION_REQUEST_TOO_LARGE') + body = json.loads(raw) + if not isinstance(body, dict) or 'max_steps' in body: + raise ValueError('USE_EFFORT_NOT_MAX_STEPS') + if 'effort' in body and body['effort'] != effort: + raise ValueError('CONFLICTING_EFFORT') + body['effort'] = effort + pending = {'key': uuid4().hex, 'body': body} + client.state['ditto_reconstruction_pending'] = pending + client.save() + result = client.request('metafold/runs', 'POST', pending['body'], key=pending['key']) + if not isinstance(result, dict) or not isinstance(result.get('id'), str): + raise ValueError('RECONSTRUCTION_DELIVERY_UNCONFIRMED') + client.state['ditto_reconstruction_last_run'] = result['id'] + client.state.pop('ditto_reconstruction_pending', None) + client.save() + return result diff --git a/orbiters/chameleon/packages/cli/src/chameleon_cli/__init__.py b/orbiters/chameleon/packages/cli/src/chameleon_cli/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3c97bc370db9cb934e55c9098b4819cf8e713876 --- /dev/null +++ b/orbiters/chameleon/packages/cli/src/chameleon_cli/__init__.py @@ -0,0 +1 @@ +"""Chameleon command-line harness.""" diff --git a/orbiters/chameleon/packages/cli/src/chameleon_cli/__main__.py b/orbiters/chameleon/packages/cli/src/chameleon_cli/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..774cc255710b50c8cadb611db68d5e43a31266dd --- /dev/null +++ b/orbiters/chameleon/packages/cli/src/chameleon_cli/__main__.py @@ -0,0 +1,3 @@ +from .main import main + +raise SystemExit(main()) diff --git a/orbiters/chameleon/packages/cli/src/chameleon_cli/client.py b/orbiters/chameleon/packages/cli/src/chameleon_cli/client.py new file mode 100644 index 0000000000000000000000000000000000000000..278840915c0f76a44680a1040abd5cc254ad80b1 --- /dev/null +++ b/orbiters/chameleon/packages/cli/src/chameleon_cli/client.py @@ -0,0 +1,183 @@ +"""A session-scoped API client. No generated code or direct source effects.""" + +import hashlib +import json +import os +import re +import tempfile +import time +from pathlib import Path +from urllib.parse import unquote, urlsplit +from uuid import uuid4 + +import httpx + + +class HarnessError(RuntimeError): + pass + + +def server_origin(value): + value = value.rstrip("/") + parsed = urlsplit(value) + if ( + parsed.username + or parsed.password + or not re.fullmatch(r"(?:/[a-zA-Z0-9_-]+)*", parsed.path) + or parsed.query + or parsed.fragment + or not parsed.hostname + or parsed.scheme not in {"https", "http"} + or (parsed.scheme == "http" and parsed.hostname not in {"127.0.0.1", "localhost", "::1"}) + ): + raise HarnessError("SERVER_MUST_BE_HTTPS_OR_LOOPBACK_ORIGIN") + return value + + +class Harness: + def __init__(self, server, home: Path, http=None): + self.server = server_origin(server) + parsed = urlsplit(self.server) + self.origin = parsed.scheme + "://" + parsed.netloc + self.home = home + self.path = home / (hashlib.sha256(self.server.encode()).hexdigest()[:24] + ".json") + self.state = json.loads(self.path.read_text()) if self.path.exists() else {} + self.http = http or httpx.Client(timeout=20, follow_redirects=False) + for cookie in self.state.get("cookies", []): + self.http.cookies.set( + cookie["name"], cookie["value"], domain=cookie["domain"], path=cookie["path"] + ) + + def save(self): + self.home.mkdir(parents=True, exist_ok=True) + self.state["cookies"] = [ + {"name": c.name, "value": c.value, "domain": c.domain, "path": c.path} + for c in self.http.cookies.jar + ] + fd, name = tempfile.mkstemp(prefix="session-", dir=self.home) + try: + with os.fdopen(fd, "w", encoding="utf-8") as stream: + json.dump(self.state, stream) + os.replace(name, self.path) + finally: + if os.path.exists(name): + os.unlink(name) + + def request(self, path, method="GET", body=None, key=None): + csrf = next((c.value for c in self.http.cookies.jar if c.name == "chameleon_csrf"), "") + headers = {"Origin": self.origin, "X-CSRF-Token": unquote(csrf)} + if key: + headers["Idempotency-Key"] = key + try: + response = self.http.request(method, self.server + "/api/v1/" + path, headers=headers, json=body) + except httpx.RequestError as exc: + raise HarnessError("TRANSPORT_UNCERTAIN_USE_RESUME_FOR_PENDING_LAUNCH") from exc + if not response.is_success: + try: + code = response.json().get("code", "REQUEST_REJECTED") + except ValueError: + code = "INVALID_SERVER_RESPONSE" + # Never echo an arbitrary server body, URLs with credentials or cookie headers. + safe = code if isinstance(code, str) and code.replace("_", "").isalnum() else "REQUEST_REJECTED" + raise HarnessError(f"HTTP_{response.status_code}_{safe}") + return response.json() + + def connect(self): + identity = self.request("auth/guest", "POST") + owner = identity["owner_id"] + if self.state.get("owner") and self.state["owner"] != owner: + raise HarnessError("SESSION_EXPIRED_USE_NEW_HOME_TO_START_AGAIN") + self.state["owner"] = owner + self.save() + + def point( + self, source, objective, provider, wait=0, presentation="reader", source_type="web", entry=None, + table_pointer=None, + ): + if self.state.get("pending"): + raise HarnessError("PENDING_LAUNCH_USE_RESUME") + if table_pointer is not None and ( + not isinstance(table_pointer, str) or len(table_pointer) > 500 + or (table_pointer != "" and not table_pointer.startswith("/")) + or source_type != "web" or presentation != "reader" + ): + raise HarnessError("INVALID_JSON_TABLE_SELECTION") + self.state["pending"] = { + "key": str(uuid4()), + "body": { + "source": source, + "objective": objective, + "provider": provider, + "build_counterpart": True, + "presentation": presentation, + **({"table_pointer": table_pointer} if table_pointer is not None else {}), + **( + {"source_type": "repository", "repository_entry": entry} + if source_type == "repository" + else {} + ), + }, + } + self.save() + return self.resume(wait) + + def resume(self, wait=0): + pending = self.state.get("pending") + if not pending: + raise HarnessError("NO_PENDING_LAUNCH") + try: + result = self.request("adaptations", "POST", pending["body"], pending["key"]) + except HarnessError as exc: + if str(exc).startswith("HTTP_4"): + self.state.pop("pending", None) + self.save() + raise + self.state.pop("pending", None) + self.state["last_job"] = result["id"] + self.save() + return self.status(result["id"], wait) if wait else result + + def status(self, ident, wait=0): + deadline = time.monotonic() + wait + while True: + result = self.request("adaptations/" + ident) + pending = ( + result["status"] in {"QUEUED", "RUNNING"} + or (result.get("counterpart") or {}).get("status") == "PENDING" + ) + if not pending or time.monotonic() >= deadline: + return result + time.sleep(0.5) + + def close(self): + self.http.close() + + def download(self, ident, output: Path): + if not re.fullmatch(r"[a-f0-9]{32}", ident): + raise HarnessError("INVALID_COUNTERPART_ID") + if output.exists(): + raise HarnessError("OUTPUT_ALREADY_EXISTS") + body = bytearray() + try: + with self.http.stream( + "GET", self.server + "/api/v1/twins/" + ident + "/repository/download" + ) as response: + if response.status_code != 200 or response.headers.get("content-type") != "application/zip": + raise HarnessError("REPOSITORY_DOWNLOAD_REJECTED") + for chunk in response.iter_bytes(): + body.extend(chunk) + if len(body) > 6 * 1024 * 1024: + raise HarnessError("REPOSITORY_DOWNLOAD_BYTE_BUDGET") + except httpx.RequestError as exc: + raise HarnessError("REPOSITORY_DOWNLOAD_TRANSPORT_FAILED") from exc + if not body.startswith(b"PK\x03\x04"): + raise HarnessError("REPOSITORY_DOWNLOAD_NOT_ZIP") + with output.open("xb") as stream: + stream.write(body) + return { + "saved": str(output), + "bytes": len(body), + "sha256": hashlib.sha256(body).hexdigest(), + "extracted": False, + "executed": False, + } diff --git a/orbiters/chameleon/packages/cli/src/chameleon_cli/main.py b/orbiters/chameleon/packages/cli/src/chameleon_cli/main.py new file mode 100644 index 0000000000000000000000000000000000000000..4c7ecd68ccd89f63ad9029d141369322a0bed155 --- /dev/null +++ b/orbiters/chameleon/packages/cli/src/chameleon_cli/main.py @@ -0,0 +1,186 @@ +"""Pixel terminal for humans; JSON interface for an external agent's tool runner.""" + +import argparse +import json +import os +import sys +from pathlib import Path + +from .client import Harness, HarnessError + +BANNER = """ + ▄████▄ + ▄█████▀ ▀██▄ + ▄██ ▀██▄ ▄███▄▄ + ▄▄▄██████████████████████▄ + ██▀▀ ▀██▀ ▀██▀ ▀████▄ + ██▄ ██ ██ ▄█▀ ██ + ▀████▄▄▄▄██ ██ ██▄▄██▀ + ▀▀▀▀▀▀▀ ▀▀▀ + + C H A M E L E O N / H A R N E S S + POINT > OBSERVE > FORM > VERIFY > RUN +""".strip("\n") + + +def schema(): + return { + "name": "chameleon-harness", + "version": "0.1.0", + "transport": "CLI arguments; one JSON result on stdout with --json", + "description": "External AI agents may call these bounded tools. They do not replace the server's reasoning provider.", + "commands": { + "examples": {}, + "providers": {}, + "point": { + "source": "public HTTPS URL or labeled example:// fixture", + "objective": "optional", + "wait": "0..120 seconds", + "presentation": "reader (default) or preserve (source-style static website)", + "source_type": "web (default) or repository (frozen public GitHub source package)", + "entry": "repository HTML entry, defaults to index.html; never executed by capture", + "table_pointer": "optional RFC 6901 JSON row-array path, e.g. /results; reader/web only; full response retained; no pagination", + }, + "resume": {"description": "Retry an uncertain launch with its saved request key"}, + "status": {"job": "job ID from point", "wait": "0..120 seconds"}, + "show": {"twin": "counterpart ID from status"}, + "query": { + "twin": "table counterpart ID", + "objective": "count rows, sum FIELD, mean FIELD, group by FIELD", + }, + "export": {"twin": "counterpart ID"}, + "download": { + "twin": "repository artifact ID", + "out": "new ZIP path; no overwrite, extraction or execution", + }, + }, + "source_writes": False, + "executes_generated_code": False, + "session": "private local cookie store; same expiry and owner boundary as the site", + } + + +def render(data): + if isinstance(data, dict) and "status" in data and "source" in data: + counterpart = data.get("counterpart") or {} + form = data.get("form") or {} + result = [ + f" SOURCE {data['source']}", + f" STATE {data['status']}", + f" ENGINE {form.get('provider', 'waiting for compiler')}", + " ROUTE " + " > ".join(step["operation"] for step in form.get("steps", [])), + f" COPY {counterpart.get('status', 'not requested')}", + f" JOB {data['id']}", + ] + if counterpart.get("twin_id"): + result += [ + f" TWIN {counterpart['twin_id']}", + " NEXT chameleon show " + counterpart["twin_id"], + ] + if data.get("residual") or counterpart.get("residual"): + result += [" NOTE " + str(data.get("residual") or counterpart.get("residual"))] + return "\n".join(result) + "\n\n Copied evidence. No source writes. Scope follows the manifest." + if isinstance(data, dict) and "manifest" in data: + manifest = data["manifest"] + return "\n".join( + [ + " WORKING COUNTERPART", + f" KIND {manifest['kind']}", + f" REVISION {data['revision']}", + f" PAGES {len(data.get('pages', []))}", + f" TABLES {len(data.get('tables', {}))}", + " MANIFEST " + json.dumps(manifest, ensure_ascii=True, indent=2), + ] + ) + return json.dumps(data, indent=2, ensure_ascii=True) + + +def main(argv=None): + parser = argparse.ArgumentParser( + description="Chameleon: bounded working counterparts, from your terminal." + ) + parser.add_argument("--server", default=os.environ.get("CHAMELEON_SERVER", "http://127.0.0.1:8120")) + parser.add_argument( + "--home", type=Path, default=Path(os.environ.get("CHAMELEON_HOME", str(Path.home() / ".chameleon"))) + ) + parser.add_argument("--json", action="store_true", help="Machine-readable output, no banner") + sub = parser.add_subparsers(dest="command", required=True) + for name in ("examples", "providers", "schema", "banner"): + sub.add_parser(name) + point = sub.add_parser("point") + point.add_argument("source") + point.add_argument("--objective", default="Discover what is possible") + point.add_argument( + "--provider", choices=["chameleon-local-v1", "structural-v1"], default="chameleon-local-v1" + ) + point.add_argument("--wait", type=int, default=30) + point.add_argument("--presentation", choices=["reader", "preserve"], default="reader") + point.add_argument("--source-type", choices=["web", "repository"], default="web") + point.add_argument("--entry") + point.add_argument("--table-pointer", help="Select a nested JSON row array, e.g. /results") + resume = sub.add_parser("resume") + resume.add_argument("--wait", type=int, default=30) + status = sub.add_parser("status") + status.add_argument("job") + status.add_argument("--wait", type=int, default=0) + for name in ("show", "query", "export"): + command = sub.add_parser(name) + command.add_argument("twin") + if name == "query": + command.add_argument("objective") + download = sub.add_parser("download") + download.add_argument("twin") + download.add_argument("--out", type=Path, required=True) + args = parser.parse_args(argv) + if not 0 <= getattr(args, "wait", 0) <= 120: + parser.error("--wait must be between 0 and 120 seconds") + if hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(encoding="utf-8") + if not args.json: + print(BANNER) + print() + if args.command in {"schema", "banner"}: + if args.command == "schema": + print(json.dumps(schema(), indent=2)) + elif args.json: + print(json.dumps({"banner": BANNER})) + return 0 + client = None + try: + client = Harness(args.server, args.home) + client.connect() + if args.command in {"examples", "providers"}: + result = client.request(args.command) + elif args.command == "point": + result = client.point( + args.source, + args.objective, + args.provider, + args.wait, + args.presentation, + args.source_type, + args.entry, + args.table_pointer, + ) + elif args.command == "resume": + result = client.resume(args.wait) + elif args.command == "status": + result = client.status(args.job, args.wait) + elif args.command == "download": + result = client.download(args.twin, args.out) + else: + path = "twins/" + args.twin + result = ( + client.request(path + "/query", "POST", {"objective": args.objective}) + if args.command == "query" + else client.request(path + ("/export" if args.command == "export" else "")) + ) + print(json.dumps(result, ensure_ascii=True) if args.json else render(result)) + return 0 + except (HarnessError, ValueError, OSError) as exc: + code = str(exc) if isinstance(exc, HarnessError) else type(exc).__name__ + print(json.dumps({"error": code}) if args.json else " STOP " + code) + return 1 + finally: + if client: + client.close() diff --git a/orbiters/chameleon/packages/core/chameleon_core/__init__.py b/orbiters/chameleon/packages/core/chameleon_core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a2facc97ab6d9fcb9e39b29d08638f12da943e88 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/__init__.py @@ -0,0 +1 @@ +"""Project-owned runtime contracts and services.""" diff --git a/orbiters/chameleon/packages/core/chameleon_core/adaptation_contracts.py b/orbiters/chameleon/packages/core/chameleon_core/adaptation_contracts.py new file mode 100644 index 0000000000000000000000000000000000000000..3c16969308705888b86fe3e6f8ea23af52f3657d --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/adaptation_contracts.py @@ -0,0 +1,140 @@ +"""Provider-neutral proposals are data; the harness owns execution and verification.""" + +from typing import Any, Literal, Protocol + +from pydantic import Field, model_validator + +from .contracts import StrictRecord + +Kind = Literal[ + "dataset", + "website", + "api_spec", + "database_snapshot", + "server_snapshot", + "spatial", + "document", + "repository", +] +Operation = Literal["profile", "count", "sum", "mean", "group_count", "spatial_reason"] + + +class Intake(StrictRecord): + source: str = Field(min_length=1, max_length=2048) + objective: str = Field(default="Discover what is possible", max_length=500) + provider: Literal["chameleon-local-v1", "oracle7-adapted-v1", "structural-v1"] = "chameleon-local-v1" + text: str | None = Field(default=None, max_length=20000) + build_counterpart: bool = False + presentation: Literal["reader", "preserve"] = "reader" + source_type: Literal["web", "repository"] = "web" + repository_entry: str | None = Field(default=None, min_length=1, max_length=240) + repository_scope: Literal["full", "entry"] = "full" + repository_assets: list[str] = Field(default_factory=list, max_length=16) + module_policy: Literal['relative-js-unique-v1'] | None = None + build_importer: str | None = Field(default=None, max_length=240) + table_pointer: str | None = Field(default=None, max_length=500) + + @model_validator(mode="after") + def source_contract(self): + if self.build_importer is not None: + from .repository_capture import safe_path, target + safe_path(self.build_importer) + if (self.source_type != 'repository' or self.repository_scope != 'entry' + or target(self.source)[2] == 'HEAD' or self.module_policy + or not self.build_importer.endswith(('.js', '.mjs'))): + raise ValueError('Build discovery requires pinned entry and a JS importer') + if self.module_policy is not None and not self.repository_assets: + raise ValueError('Module policy requires explicit pinned asset requests') + if self.repository_assets: + from .repository_capture import safe_path, target + + if ( + self.source_type != "repository" + or self.repository_scope != "entry" + or target(self.source)[2] == "HEAD" + ): + raise ValueError("Additional assets require pinned entry capture") + for path in self.repository_assets: + safe_path(path) + if len(set(self.repository_assets)) != len(self.repository_assets): + raise ValueError("Duplicate asset paths") + if self.table_pointer is not None and (self.source_type != "web" or self.presentation != "reader"): + raise ValueError("JSON table selection requires reader/data mode") + if self.source_type == "repository": + if self.text is not None or self.presentation != "reader": + raise ValueError( + "repository acquisition takes a URL and entry, not inline data or webpage mode" + ) + elif self.repository_entry is not None or self.repository_scope != "full": + raise ValueError("repository entry requires repository source type") + return self + + +class Evidence(StrictRecord): + source: str + kind: Kind + content_digest: str = Field(pattern=r"^[0-9a-f]{64}$") + captured_at: str + payload: Any + bytes_received: int = Field(ge=0, le=6291456) + external_reads: int = Field(ge=0, le=64) + authority: Literal["synthetic_fixture", "user_supplied", "public_snapshot"] + + @model_validator(mode="after") + def acquisition_budget(self): + if self.kind == "repository": + subset = ( + isinstance(self.payload, dict) + and isinstance(self.payload.get("projection"), dict) + and self.payload["projection"].get("kind") == "static-entry-subset-v1" + ) + if ( + self.external_reads > (64 if subset else 3) + or self.authority != "public_snapshot" + or (not subset and self.bytes_received > 3145728) + ): + raise ValueError("repository evidence requires bounded public acquisition") + elif self.bytes_received > (4718592 if self.kind == 'website' and isinstance(self.payload, dict) and isinstance(self.payload.get('visual'), dict) else 1572864) or self.external_reads > 36: + raise ValueError("existing non-repository acquisition budget exceeded") + return self + + +class FormStep(StrictRecord): + id: str = Field(pattern=r"^[a-z_]{1,40}$") + operation: Operation + field: str | None = Field(default=None, max_length=120) + table: str | None = Field(default=None, max_length=120) + effect: Literal["pure"] = "pure" + + +class WorkingForm(StrictRecord): + version: Literal["read-form-v1"] = "read-form-v1" + source_kind: Kind + evidence_digest: str + objective: str + provider: str + steps: list[FormStep] = Field(min_length=1, max_length=4) + requested_permissions: list[str] = Field(default_factory=lambda: ["snapshot.read"]) + compiler: Literal["structural-compiler-v1"] = "structural-compiler-v1" + + @model_validator(mode="after") + def graph(self): + if len({x.id for x in self.steps}) != len(self.steps): + raise ValueError("duplicate step ID") + if self.steps[0].operation != "profile" or len(self.steps) > 2: + raise ValueError("read-form-v1 supports profile followed by one bounded transformation") + if self.requested_permissions != ["snapshot.read"]: + raise ValueError("only snapshot.read may be requested") + return self + + +class ProposalProvider(Protocol): + version: str + + def propose(self, evidence: Evidence, objective: str) -> dict: ... + + +class Residual(ValueError): + def __init__(self, code: str): + self.code = code + super().__init__(code) diff --git a/orbiters/chameleon/packages/core/chameleon_core/adaptation_service.py b/orbiters/chameleon/packages/core/chameleon_core/adaptation_service.py new file mode 100644 index 0000000000000000000000000000000000000000..6b6517a86752148a7934961001a935457b8cd47e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/adaptation_service.py @@ -0,0 +1,406 @@ +"""Leased read-only jobs. A stale worker cannot commit a result or scoped memory.""" + +import time +from datetime import timedelta +from typing import TypedDict + +from sqlalchemy import and_, exists, func, or_, select, text +from sqlalchemy.exc import SQLAlchemyError + +from .adaptation_contracts import Evidence, Intake, Residual +from .config import ResourceLimits +from .contracts import AgentIdentity, digest +from .db import AdaptationJob, Agent, ScopedMemory, WebsiteCapture, now, uid +from .form_engine import ProviderRegistry, execute, verify +from .intake import acquire +from .service import Failure, owned + + +class RepositoryAcquireOptions(TypedDict, total=False): + repository_scope: str + repository_assets: list[str] + module_policy: str + build_importer: str + + +def append(job, event, data=None): + job.events = [ + *job.events, + {"sequence": len(job.events) + 1, "type": event, "at": now().isoformat(), "data": data or {}}, + ] + + +class Adaptations: + def __init__(self, sessions, providers=None, intake=None, limits=None): + self.sessions = sessions + self.providers = providers or ProviderRegistry() + self.acquire = intake or acquire + self.limits = limits or ResourceLimits() + + def create(self, owner: str, request: Intake, key: str | None = None): + with self.sessions.begin() as s: + return self.create_in(s, owner, request, key) + + def create_in(self, s, owner: str, request: Intake, key: str | None = None): + """Same transaction can record a durable consumer alongside its queued job.""" + if request.build_counterpart and not key: + raise Failure("COUNTERPART_REQUEST_KEY_REQUIRED", 400) + if key is not None and ( + not 1 <= len(key) <= 100 or not key.isascii() or not all(c.isalnum() or c in "-_" for c in key) + ): + raise Failure("INVALID_IDEMPOTENCY_KEY", 400) + # Global admission before owner/twin locks; shared across API processes. + s.execute(text("SELECT pg_advisory_xact_lock(7162101)")) + s.execute(text("SELECT pg_advisory_xact_lock(hashtext(:owner))"), {"owner": owner}) + # Reader is the pre-existing default; preserve old accepted retry hashes. + request_identity = request.model_dump() + if request.module_policy is None: + request_identity.pop('module_policy') + if request.build_importer is None: + request_identity.pop('build_importer') + if not request.repository_assets: + request_identity.pop("repository_assets") + if request.repository_scope == "full": + request_identity.pop("repository_scope") + if request.table_pointer is None: + request_identity.pop("table_pointer") + if request.presentation == "reader": + request_identity.pop("presentation") + if request.source_type == "web": + request_identity.pop("source_type") + request_identity.pop("repository_entry") + request_hash = digest(request_identity) + if key: + prior = s.scalar( + select(AdaptationJob).where(AdaptationJob.owner == owner, AdaptationJob.creation_key == key) + ) + if prior: + if prior.request_digest != request_hash: + raise Failure("IDEMPOTENCY_CONFLICT") + return prior.id + if request.source_type == "repository": + from .repository_capture import safe_path, target + + target(request.source) + safe_path(request.repository_entry or "index.html") + count = s.scalar( + select(func.count()) + .select_from(AdaptationJob) + .where(AdaptationJob.intake["source_type"].as_string() == "repository") + ) + if count >= self.limits.max_stored_repository_jobs: + raise Failure("GLOBAL_REPOSITORY_STORAGE_LIMIT", 429) + if s.scalar(select(func.count()).select_from(AdaptationJob)) >= self.limits.max_stored_jobs: + raise Failure("GLOBAL_STORAGE_JOB_LIMIT", 429) + pending = s.scalar( + select(func.count()) + .select_from(AdaptationJob) + .where( + or_( + AdaptationJob.status.in_(["QUEUED", "RUNNING"]), + AdaptationJob.counterpart["status"].as_string() == "PENDING", + exists().where( + WebsiteCapture.job == AdaptationJob.id, WebsiteCapture.status == "PENDING" + ), + ) + ) + ) + if pending >= self.limits.max_pending_jobs: + raise Failure("GLOBAL_PENDING_JOB_LIMIT", 429) + if ( + s.scalar(select(func.count()).select_from(AdaptationJob).where(AdaptationJob.owner == owner)) + >= 50 + ): + raise Failure("SESSION_JOB_LIMIT", 429) + active = s.scalar( + select(func.count()) + .select_from(AdaptationJob) + .where(AdaptationJob.owner == owner, AdaptationJob.status.in_(["QUEUED", "RUNNING"])) + ) + if active >= 2: + raise Failure("SESSION_CONCURRENCY_LIMIT", 429) + agent = s.scalar(select(Agent).where(Agent.owner == owner).order_by(Agent.id)) + if not agent: + ident = uid() + identity = AgentIdentity(agent_id=ident, owner_id=owner, display_name="Iris", identity_version=1) + agent = Agent(id=ident, owner=owner, name="Iris", identity=identity.model_dump()) + s.add(agent) + s.flush() + job = AdaptationJob( + owner=owner, + agent=agent.id, + source=request.source, + objective=request.objective, + provider=request.provider, + intake=request.model_dump(), + expires=now() + timedelta(minutes=3), + events=[], + creation_key=key, + request_digest=request_hash if key else None, + counterpart={"status": "PENDING", "twin_id": None, "residual": None} + if request.build_counterpart + else None, + ) + s.add(job) + s.flush() + append(job, "job.queued", {"mode": "read_only", "provider": request.provider}) + return job.id + + def list(self, owner): + with self.sessions() as s: + return [ + {"id": j.id, "source": j.source, "status": j.status, "agent_id": j.agent} + for j in s.scalars( + select(AdaptationJob) + .where(AdaptationJob.owner == owner) + .order_by(AdaptationJob.created.desc()) + .limit(50) + ) + ] + + def report(self, owner, ident): + with self.sessions() as s: + j = owned(s, AdaptationJob, ident, owner) + return { + "id": j.id, + "agent_id": j.agent, + "source": j.source, + "objective": j.objective, + "provider": j.provider, + "presentation": j.intake.get("presentation", "reader"), + "source_type": j.intake.get("source_type", "web"), + "repository_entry": j.intake.get("repository_entry"), + "repository_scope": j.intake.get("repository_scope", "full"), + "repository_assets": j.intake.get("repository_assets", []), + "table_pointer": j.intake.get("table_pointer"), + "status": j.status, + "events": j.events, + "form": j.form, + "result": j.result, + "metrics": j.metrics, + "residual": j.residual, + "evidence": {k: v for k, v in (j.evidence or {}).items() if k != "payload"}, + "attempts": j.attempts, + "counterpart": j.counterpart, + "scope": "read_only_snapshot", + "paid_model_calls": 0, + } + + def cancel(self, owner, ident): + with self.sessions.begin() as s: + j = owned(s, AdaptationJob, ident, owner, lock=True) + if j.counterpart and j.counterpart["status"] == "PENDING": + j.counterpart = {"status": "CANCELLED", "twin_id": None, "residual": "CONSTRUCTION_CANCELLED"} + append(j, "counterpart.cancelled") + if j.status in {"VERIFIED", "NEEDS_EVIDENCE", "FAILED", "CANCELLED"}: + return + j.status, j.lease_token = "CANCELLED", uid() + append( + j, "job.cancelled", {"inflight_read_may_finish": True, "future_result_commit_blocked": True} + ) + + def claim(self): + with self.sessions.begin() as s: + s.execute(text("SELECT pg_advisory_xact_lock(7162102)")) + for j in s.scalars( + select(AdaptationJob) + .where( + AdaptationJob.status.in_(["QUEUED", "RUNNING"]), + or_( + AdaptationJob.expires <= now(), + and_(AdaptationJob.attempts >= 3, AdaptationJob.lease_until < now()), + ), + ) + .with_for_update(skip_locked=True) + .limit(10) + ): + j.status, j.residual = "FAILED", "JOB_DEADLINE_OR_RECOVERY_LIMIT" + append(j, "job.failed", {"code": j.residual}) + running = s.scalar( + select(func.count()) + .select_from(AdaptationJob) + .where( + AdaptationJob.status == "RUNNING", + AdaptationJob.lease_until > now(), + AdaptationJob.expires > now(), + ) + ) + if running >= self.limits.max_running_jobs: + return None + j = s.scalar( + select(AdaptationJob) + .where( + AdaptationJob.expires > now(), + AdaptationJob.attempts < 3, + or_( + AdaptationJob.status == "QUEUED", + and_(AdaptationJob.status == "RUNNING", AdaptationJob.lease_until < now()), + ), + ) + .order_by(AdaptationJob.created) + .with_for_update(skip_locked=True) + .limit(1) + ) + if not j: + return None + recovered = j.status == "RUNNING" + lease = 60 if j.intake.get("source_type") == "repository" else 30 + j.status, j.lease_token, j.lease_until = "RUNNING", uid(), now() + timedelta(seconds=lease) + j.attempts += 1 + append(j, "worker.recovered" if recovered else "worker.claimed", {"attempt": j.attempts}) + return j.id, j.owner, j.lease_token, j.intake + + @staticmethod + def guard(s, ident, owner, token): + j = owned(s, AdaptationJob, ident, owner, lock=True) + if j.status != "RUNNING" or j.lease_token != token or j.lease_until <= now() or j.expires <= now(): + raise Failure("STALE_ADAPTATION_WORKER") + j.lease_until = now() + timedelta(seconds=60 if j.intake.get("source_type") == "repository" else 30) + return j + + def process(self, claim): + ident, owner, token, raw = claim + start, cpu = time.monotonic(), time.process_time() + try: + request = Intake.model_validate(raw) + with self.sessions.begin() as s: + held = self.guard(s, ident, owner, token) + frozen = held.evidence if request.source_type == "repository" else None + append( + held, + "evidence.reused" if frozen else "evidence.read_dispatched", + {"mode": "GET_or_supplied_snapshot"}, + ) + repository_options: RepositoryAcquireOptions = {} + if request.repository_scope == "entry": + repository_options["repository_scope"] = "entry" + if request.repository_assets: + repository_options["repository_assets"] = request.repository_assets + if request.module_policy: + repository_options['module_policy'] = request.module_policy + if request.build_importer: + repository_options['build_importer'] = request.build_importer + evidence = ( + Evidence.model_validate(frozen) + if frozen + else self.acquire(request.source, request.text, table_pointer=request.table_pointer) + if request.table_pointer is not None + else self.acquire( + request.source, + source_type="repository", + repository_entry=request.repository_entry, + **repository_options, + ) + if request.source_type == "repository" + else self.acquire(request.source, request.text, presentation="preserve") + if request.presentation == "preserve" + else self.acquire(request.source, request.text) + ) + if request.source_type == "repository": + from .repository_artifact import checked_files + + checked_files(evidence) + if evidence.payload.get('projection', {}).get('build_importer') != request.build_importer: + raise Residual('REPOSITORY_BUILD_IMPORTER_BINDING_MISMATCH') + if evidence.payload.get('projection', {}).get('module_policy') != request.module_policy: + raise Residual('REPOSITORY_MODULE_POLICY_BINDING_MISMATCH') + if ( + evidence.payload.get("projection", {}).get("additional_local_paths", []) + != request.repository_assets + ): + raise Residual("REPOSITORY_ASSET_BINDING_MISMATCH") + if ("entry" if evidence.payload.get("projection") else "full") != request.repository_scope: + raise Residual("REPOSITORY_SCOPE_BINDING_MISMATCH") + if evidence.source != request.source or evidence.payload["entry"] != ( + request.repository_entry or "index.html" + ): + raise Residual("REPOSITORY_REQUEST_BINDING_MISMATCH") + with self.sessions.begin() as s: + j = self.guard(s, ident, owner, token) + j.evidence = evidence.model_dump() + append( + j, + "evidence.captured", + { + "kind": evidence.kind, + "digest": evidence.content_digest, + "authority": evidence.authority, + }, + ) + form = self.providers.compile(evidence, request.objective, request.provider) + with self.sessions.begin() as s: + j = self.guard(s, ident, owner, token) + j.form = form.model_dump() + append( + j, + "form.compiled", + { + "digest": digest(j.form), + "compiler": form.compiler, + "operations": [x.operation for x in form.steps], + }, + ) + result = execute(form, evidence) + if not verify(form, evidence, result): + raise Residual("INDEPENDENT_RESULT_CHECK_FAILED") + metrics = { + "wall_seconds": round(time.monotonic() - start, 6), + "worker_process_cpu_seconds": round(time.process_time() - cpu, 6), + "bytes_received": evidence.bytes_received, + "external_reads": evidence.external_reads, + "steps": len(form.steps), + "spatial_kernel_invocations": sum(x.operation == "spatial_reason" for x in form.steps), + "paid_model_calls": 0, + } + with self.sessions.begin() as s: + j = self.guard(s, ident, owner, token) + j.result, j.metrics, j.status = result, metrics, "VERIFIED" + scope = digest( + { + "owner": owner, + "source": j.source, + "inline_content": evidence.content_digest + if j.source.startswith("inline://") + else None, + } + ) + s.add( + ScopedMemory( + owner=owner, + agent=j.agent, + job=j.id, + target_scope=scope, + evidence_digest=evidence.content_digest, + form_digest=digest(j.form), + data={"result": result, "authority": evidence.authority, "scope": "snapshot_only"}, + ) + ) + append( + j, + "result.verified", + {"scope": "consistency_with_captured_evidence_not_external_truth", "memory_scope": scope}, + ) + except Failure: + # Cancellation, expiry or a newer lease owns the state. Never overwrite it. + return + except SQLAlchemyError: + # Infrastructure failures are not evidence failures. Leave the lease + # recoverable; an uncertain successful commit is observed on retry. + raise + except Exception as exc: # noqa: BLE001 -- worker boundary records bounded residuals, never raw exception text + try: + with self.sessions.begin() as s: + j = self.guard(s, ident, owner, token) + j.status = "NEEDS_EVIDENCE" if isinstance(exc, Residual) else "FAILED" + j.residual = exc.code if isinstance(exc, Residual) else "INTERNAL_ADAPTATION_ERROR" + j.metrics = {"wall_seconds": round(time.monotonic() - start, 6), "paid_model_calls": 0} + append(j, "job.residual", {"code": j.residual}) + except Failure: + return + + def tick(self): + claim = self.claim() + if claim: + self.process(claim) + return True + return False diff --git a/orbiters/chameleon/packages/core/chameleon_core/application_saves.py b/orbiters/chameleon/packages/core/chameleon_core/application_saves.py new file mode 100644 index 0000000000000000000000000000000000000000..10e0176b369d254240f1748215ede837f8814282 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/application_saves.py @@ -0,0 +1,79 @@ +"""Private copied-game state, never a verified score or source-system write.""" + +import json + +from pydantic import Field, model_validator + +from .contracts import StrictRecord, canonical +from .curated_app import approved_2048 +from .db import ApplicationSave, LocalTwin, now +from .service import Failure, owned +from .twins import Twins + + +class SaveRequest(StrictRecord): + expected_revision: int = Field(ge=0, le=2147483646) + data: dict[str, str] + + @model_validator(mode="after") + def bounded(self): + if set(self.data) - {"gameState", "bestScore"} or len(canonical(self.data).encode()) > 16384: + raise ValueError("Unsupported or oversized application save") + for key, value in self.data.items(): + if len(value) > 8192: + raise ValueError("Application save value too large") + if key == "bestScore" and (not value.isascii() or not value.isdecimal() or len(value) > 16): + raise ValueError("Invalid best score") + if key == "gameState": + try: + decoded = json.loads(value) + except (ValueError, RecursionError) as exc: + raise ValueError("Invalid game state JSON") from exc + if not isinstance(decoded, dict): + raise ValueError("Game state must be an object") + return self + + +class ApplicationSaves: + def __init__(self, sessions): + self.sessions = sessions + + def access(self, owner, ident): + evidence = Twins(self.sessions).repository_evidence(owner, ident) + if not approved_2048({"digest": evidence.content_digest, "repository": evidence.payload}): + raise Failure("APPLICATION_SAVE_NOT_SUPPORTED") + return evidence.content_digest + + @staticmethod + def report(row): + return {"revision": row.revision if row else 0, "data": row.data if row else {}, + "storage": "private server save", "verified_score": False, "source_writes": False} + + def read(self, owner, ident): + source = self.access(owner, ident) + with self.sessions() as s: + row = s.get(ApplicationSave, ident) + if row and (row.owner != owner or row.source_digest != source): + raise Failure("APPLICATION_SAVE_BINDING_MISMATCH") + return self.report(row) + + def write(self, owner, ident, request): + source = self.access(owner, ident) + with self.sessions.begin() as s: + twin = owned(s, LocalTwin, ident, owner, lock=True) + if twin.source_digest != source: + raise Failure("APPLICATION_SAVE_BINDING_MISMATCH") + row = s.get(ApplicationSave, ident) + if row and (row.owner != owner or row.source_digest != source): + raise Failure("APPLICATION_SAVE_BINDING_MISMATCH") + revision = row.revision if row else 0 + if revision != request.expected_revision: + raise Failure("APPLICATION_SAVE_REVISION_CONFLICT") + if row is None: + row = ApplicationSave(twin=ident, owner=owner, source_digest=source, data={}) + s.add(row) + row.data = dict(request.data) + row.revision = revision + 1 + row.updated = now() + s.flush() + return self.report(row) diff --git a/orbiters/chameleon/packages/core/chameleon_core/behavior_records.py b/orbiters/chameleon/packages/core/chameleon_core/behavior_records.py new file mode 100644 index 0000000000000000000000000000000000000000..daabcb70def96c254d9b91bc6d6f6492a42b656e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/behavior_records.py @@ -0,0 +1,153 @@ +"""Durable internal verifier receipts. Call record only from a trusted supervisor. + +There is intentionally no public upload endpoint: hashes bind evidence, not authorship. +Records do not promote a repository to an executable application or a complete clone. +""" + +import copy +import re + +from sqlalchemy import select + +from .bundle_preview import reviewed_files +from .contracts import canonical, digest +from .db import BehaviorRecord, CounterpartBundle, LocalTwin +from .repository_artifact import REPOSITORY_KIND +from .service import Failure, owned + + +def completion_receipt_allowed(receipt, receipt_digest, discard_dependencies=False): + return (receipt_digest == digest(receipt) and not receipt.get('overlay_digest') + and (not receipt.get('dependency_digest') or ( + discard_dependencies is True and receipt['behavior'].get('status') == 'FAIL'))) + + +class BehaviorRecords: + def __init__(self, sessions): + self.sessions = sessions + + def asset_completion(self, owner, twin_id, record_id, *, discard_dependencies=False): + """Only trusted persisted original-source observations may propose capture.""" + from .entry_capture import asset_completion_intake + from .twins import Twins + + with self.sessions() as session: + twin = owned(session, LocalTwin, twin_id, owner) + record = owned(session, BehaviorRecord, record_id, owner) + if record.twin != twin.id: + raise Failure("NOT_FOUND") + if record.source_digest != twin.source_digest: + raise Failure("BEHAVIOR_SOURCE_MISMATCH") + if not completion_receipt_allowed(record.receipt, record.receipt_digest, discard_dependencies): + raise Failure("ASSET_COMPLETION_REQUIRES_ORIGINAL_RECEIPT") + report = copy.deepcopy(record.receipt["behavior"]) + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + return asset_completion_intake(evidence, report) + + def record(self, owner, twin_id, receipt): + receipt = copy.deepcopy(receipt) + if len(canonical(receipt).encode()) > 65536 or set(receipt) - {"dependency_digest"} != { + "source_digest", + "contract_digest", + "overlay_digest", + "runtime", + "behavior", + }: + raise Failure("BEHAVIOR_RECEIPT_SCHEMA") + dependency_digest = receipt.get("dependency_digest") + if dependency_digest is not None and ( + not isinstance(dependency_digest, str) or not re.fullmatch(r"[a-f0-9]{64}", dependency_digest) + ): + raise Failure("BEHAVIOR_RECEIPT_DIGEST") + for key in ("source_digest", "contract_digest", "overlay_digest"): + value = receipt[key] + if key == "overlay_digest" and value is None: + continue + if not isinstance(value, str) or not re.fullmatch(r"[a-f0-9]{64}", value): + raise Failure("BEHAVIOR_RECEIPT_DIGEST") + runtime, behavior = receipt["runtime"], receipt["behavior"] + if ( + not isinstance(runtime, dict) + or not isinstance(behavior, dict) + or behavior.get("status") not in {"PASS", "FAIL"} + ): + raise Failure("BEHAVIOR_RECEIPT_SCHEMA") + for key, expected in ( + ("package_digest", receipt["source_digest"]), + ("contract_digest", receipt["contract_digest"]), + ("overlay_digest", receipt["overlay_digest"]), + ("dependency_digest", dependency_digest), + ): + if runtime.get(key) != expected or behavior.get(key) != expected: + raise Failure("BEHAVIOR_RECEIPT_BINDING") + if behavior["status"] == "PASS" and not ( + runtime.get("returncode") == 0 + and runtime.get("remaining_job_processes") == 0 + and all( + runtime.get(key) is False + for key in ("timed_out", "cpu_budget_exhausted", "output_budget_exhausted") + ) + ): + raise Failure("BEHAVIOR_RUNTIME_NOT_PASSED") + fingerprint = digest(receipt) + with self.sessions.begin() as session: + twin = owned(session, LocalTwin, twin_id, owner, lock=True) + if twin.manifest.get("kind") != REPOSITORY_KIND or twin.source_digest != receipt["source_digest"]: + raise Failure("BEHAVIOR_SOURCE_MISMATCH") + previous = session.scalar( + select(BehaviorRecord).where( + BehaviorRecord.twin == twin_id, BehaviorRecord.receipt_digest == fingerprint + ) + ) + if previous: + return previous.id + row = BehaviorRecord( + twin=twin_id, + owner=owner, + source_digest=twin.source_digest, + receipt_digest=fingerprint, + receipt=receipt, + ) + session.add(row) + session.flush() + return row.id + + def read(self, owner, twin_id): + with self.sessions() as session: + twin = owned(session, LocalTwin, twin_id, owner) + rows = session.scalars( + select(BehaviorRecord) + .where(BehaviorRecord.twin == twin_id, BehaviorRecord.owner == owner) + .order_by(BehaviorRecord.created.desc(), BehaviorRecord.id.desc()) + .limit(20) + ).all() + bundles = { + item.record: item + for item in session.scalars( + select(CounterpartBundle).where( + CounterpartBundle.twin == twin_id, CounterpartBundle.owner == owner + ) + ) + } + return { + "scope": "Recorded supplied contracts only; not complete-clone certification", + "source_digest": twin.source_digest, + "records": [ + { + "id": row.id, + "created": row.created.isoformat(), + "receipt_digest": row.receipt_digest, + "current_source": row.source_digest == twin.source_digest, + "receipt": row.receipt, + "bundle": { + "id": bundles[row.id].id, + "sha256": bundles[row.id].sha256, + "interactive": reviewed_files(bundles[row.id].body) is not None, + "replay_supported": True, + } + if row.id in bundles and row.source_digest == twin.source_digest + else None, + } + for row in rows + ], + } diff --git a/orbiters/chameleon/packages/core/chameleon_core/browser_contract.py b/orbiters/chameleon/packages/core/chameleon_core/browser_contract.py new file mode 100644 index 0000000000000000000000000000000000000000..41b4980567d664a78222eba45d1d31372c6cb454 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/browser_contract.py @@ -0,0 +1,65 @@ +"""Bounded declarative browser checks; no executable expressions or host actions.""" + +import hashlib +import json +import re + +SHAPES = { + "click": {"op", "selector"}, + "dblclick": {"op", "selector"}, + "fill": {"op", "selector", "value"}, + "type": {"op", "selector", "value"}, + "press": {"op", "selector", "key"}, + "reload": {"op"}, + "visible": {"op", "selector"}, + "text": {"op", "selector", "equals"}, + "value": {"op", "selector", "equals"}, + "count": {"op", "selector", "equals"}, + "wait_count": {"op", "selector", "equals"}, + "location": {"op", "equals"}, +} +KEYS = {"Enter", "Tab", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Escape", "Backspace"} + + +def validate_contract(value): + def require(condition): + if not condition: + raise ValueError("INVALID_BROWSER_CONTRACT") + + require(isinstance(value, dict) and set(value) == {"version", "name", "steps"}) + require(value["version"] in {"browser-contract-v1", "browser-contract-v2"}) + require(isinstance(value["name"], str) and 1 <= len(value["name"]) <= 120) + steps = value["steps"] + require(isinstance(steps, list) and 1 <= len(steps) <= 12) + assertions = 0 + for step in steps: + require(isinstance(step, dict) and isinstance(step.get("op"), str)) + op = step["op"] + require(op in SHAPES and set(step) == SHAPES[op]) + if "selector" in step: + selector = step["selector"] + require(isinstance(selector, str) and 1 <= len(selector) <= 200) + require(">>" not in selector and not re.match(r"^(xpath|text|internal|role)=", selector)) + if op == "press": + require(isinstance(step["key"], str) and step["key"] in KEYS) + if op == 'type': + require(value['version'] == 'browser-contract-v2') + require(isinstance(step['value'], str) and bool(re.fullmatch(r'[\x20-\x7e]{1,256}', step['value']))) + if op in {"fill", "text", "value"}: + text = step["value" if op == "fill" else "equals"] + require(isinstance(text, str) and len(text) <= 1000) + if op in {"wait_count", "location", "dblclick"}: + require(value["version"] == "browser-contract-v2") + if op in {"count", "wait_count"}: + require(type(step["equals"]) is int and 0 <= step["equals"] <= 1000) + if op == "location": + target = step["equals"] + require(isinstance(target, str) and 1 <= len(target) <= 500) + require( + target.startswith("/") and not target.startswith("//") and not re.search(r"[\\\s]", target) + ) + assertions += op in {"visible", "text", "value", "count", "wait_count", "location"} + require(assertions > 0) + encoded = json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode() + require(len(encoded) <= 6000) + return json.loads(encoded), hashlib.sha256(encoded).hexdigest() diff --git a/orbiters/chameleon/packages/core/chameleon_core/build_plan.py b/orbiters/chameleon/packages/core/chameleon_core/build_plan.py new file mode 100644 index 0000000000000000000000000000000000000000..b5c3db7e5fad29bc5f9bfd0d073506a30d655c0d --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/build_plan.py @@ -0,0 +1,45 @@ +"""Bounded inert declaration inspection shared by capture and orchestration.""" +import hashlib +import json +import shutil +from pathlib import Path + +from .repository_capture import verify_package +from .windows_job import run_bounded + +ROOT = Path(__file__).resolve().parents[3] + + +def plan_saved_build(package, importer=None): + files = verify_package(package) + required = ('rollup.config.js', 'package.json') + if any(p not in files for p in required): + raise ValueError('BUILD_METADATA_NOT_CAPTURED') + request = {'config': files[required[0]].decode('utf-8'), 'package': files[required[1]].decode('utf-8')} + node = shutil.which('node') + if not node: + raise ValueError('NODE_UNAVAILABLE') + script = 'build_artifact_plan.mjs' + if importer is not None: + script = 'build_graph_plan.mjs' + request = {'package': package, 'importer': importer} + runtime = run_bounded([node, str(ROOT / 'scripts' / script)], json.dumps(request), ROOT) + stdout = runtime.pop('stdout') + if (runtime.get('returncode') != 0 or runtime.get('remaining_job_processes') != 0 + or any(runtime.get(k) is not False for k in ('timed_out', 'cpu_budget_exhausted', 'output_budget_exhausted'))): + raise ValueError('BUILD_PARSER_EXECUTION_FAILED') + plan = json.loads(stdout) + for field, name in zip(('config_sha256', 'package_sha256'), required, strict=True): + if plan[field] != hashlib.sha256(files[name]).hexdigest(): + raise ValueError('BUILD_PLAN_SOURCE_MISMATCH') + plan['source_digest'] = package['digest'] + plan['captured_inputs'] = {m['input']: hashlib.sha256(files[m['input']]).hexdigest() + for m in plan['mappings'] if m['input'] in files} + plan['missing_inputs'] = sorted({m['input'] for m in plan['mappings'] if m['input'] not in files}) + if importer is not None: + graph = plan['graph'] + if (graph['source_digest'] != package['digest'] or graph['importer'] != importer + or any(p not in files or hashlib.sha256(files[p]).hexdigest() != h for p, h in graph['used'].items())): + raise ValueError('BUILD_GRAPH_SOURCE_MISMATCH') + plan['missing_inputs'] = graph['missing_paths'] + return {'plan': plan, 'runtime': runtime} diff --git a/orbiters/chameleon/packages/core/chameleon_core/bundle_preview.py b/orbiters/chameleon/packages/core/chameleon_core/bundle_preview.py new file mode 100644 index 0000000000000000000000000000000000000000..d8d008123826d2e35b3ac339612a1f619d84c63e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/bundle_preview.py @@ -0,0 +1,55 @@ +"""Explicitly reviewed executable bundle family, not arbitrary ZIP execution.""" + +import hashlib +import html +import io +import re +import zipfile + +from .service import Failure + +REVIEWED = { + "index.html": "ad2157d4649975da0b8817ca08d834e267f808e1d479f0a6f5c06511d62bcf50", + "css/style.css": "61f3122b1664cab2b1607e0349935b02cc196356d3c11bc524cefb01bda02177", + "js/calculate.js": "f97785e4c230ac7e403feca805866b57103240b8a3447fcab983f5ca81ccbd8a", +} + + +def reviewed_files(body): + try: + with zipfile.ZipFile(io.BytesIO(body)) as archive: + names = archive.namelist() + if len(names) != len(set(names)): + return None + files = {} + for name, expected in REVIEWED.items(): + info = archive.getinfo("application/" + name) + if info.file_size > 12000: + return None + content = archive.read(info) + if hashlib.sha256(content).hexdigest() != expected: + return None + files[name] = content.decode("utf-8") + return files + except (ValueError, KeyError, UnicodeError, zipfile.BadZipFile): + return None + + +def render(body, nonce): + files = reviewed_files(body) + if files is None: + raise Failure("BUNDLE_INTERACTIVE_FAMILY_UNSUPPORTED") + document = files["index.html"] + # Exact reviewed entry contains these stylesheet and classic script references. + # External font dependencies are intentionally omitted, as in offline verification. + document = re.sub(r"]*>", "", document, flags=re.DOTALL) + document = re.sub(r"]*>.*?", "", document, flags=re.DOTALL) + document = document.replace("", "") + return document.replace( + "", + '", + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/config.py b/orbiters/chameleon/packages/core/chameleon_core/config.py new file mode 100644 index 0000000000000000000000000000000000000000..e6a02cad4d455a2c338bcb3ca5daa4d38bccda62 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/config.py @@ -0,0 +1,123 @@ +import json +import os +import re +from dataclasses import dataclass +from pathlib import Path +from urllib.parse import urlsplit + +ROOT = Path(__file__).resolve().parents[3] + + +@dataclass(frozen=True) +class ResourceLimits: + max_users: int = 1000 + new_sessions_per_minute: int = 20 + max_pending_jobs: int = 64 + max_running_jobs: int = 4 + max_stored_jobs: int = 10000 + # Each repository payload is separately bounded to 6 MiB before persistence. + max_stored_repository_jobs: int = 12 + max_verification_jobs_per_owner: int = 20 + max_metafold_runs_per_owner: int = 10 + + def __post_init__(self): + for name, value in vars(self).items(): + if type(value) is not int or not 1 <= value <= 100000: + raise ValueError(f"{name} must be a positive bounded integer") + if self.max_running_jobs > self.max_pending_jobs: + raise ValueError("Running budget cannot exceed pending budget") + + +@dataclass(frozen=True) +class Settings: + database_url: str + fixture_key: str + fixture_url: str = "http://127.0.0.1:8121" + origin: str = "http://127.0.0.1:8120" + profile: str = "synthetic" + limits: ResourceLimits = ResourceLimits() + worker_slot: str = "default" + base_path: str = "" + verification_enabled: bool = False + + def __post_init__(self): + if len(self.base_path) > 200 or not re.fullmatch(r"(?:/[a-zA-Z0-9_-]+)*", self.base_path): + raise ValueError("Base path must contain only bounded clean path segments") + if not re.fullmatch(r"[a-zA-Z0-9_-]{1,64}", self.worker_slot): + raise ValueError("Worker slot must be a bounded name") + if self.profile not in {"synthetic", "public-preview"}: + raise ValueError("Unsupported runtime profile") + if self.fixture_url != "http://127.0.0.1:8121": + raise ValueError("Only the pinned loopback fixture address is supported") + if self.profile == "synthetic": + if self.origin not in {"http://127.0.0.1:8120", "http://localhost:8120"}: + raise ValueError("Local profile requires a loopback origin") + if len(self.fixture_key) < 32: + raise ValueError("Fixture key must be locally provisioned") + else: + host = urlsplit(self.origin).hostname or "" + labels = host.split(".") + if ( + self.origin != "https://" + host + or len(labels) < 2 + or len(host) > 253 + or host.endswith((".localhost", ".local")) + or not re.fullmatch(r"[a-z]{2,63}", labels[-1]) + or any(not re.fullmatch(r"[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?", label) for label in labels) + ): + raise ValueError("Public preview requires an exact canonical HTTPS domain origin") + if self.fixture_key: + raise ValueError("Public preview must not receive synthetic fixture credentials") + + @property + def secure_cookies(self): + return self.profile == "public-preview" + + @property + def allowed_hosts(self): + if self.profile == "synthetic": + return {"127.0.0.1:8120", "localhost:8120"} + return {urlsplit(self.origin).netloc} + + +def load_settings() -> Settings: + profile = os.environ.get("CHAMELEON_PROFILE", "synthetic") + limits = ResourceLimits( + **{ + key: int(os.environ.get("CHAMELEON_" + key.upper(), str(default))) + for key, default in vars(ResourceLimits()).items() + } + ) + if profile == "public-preview": + url = os.environ.get("CHAMELEON_DATABASE_URL", "") + if not url.startswith("postgresql+psycopg://") or not os.environ.get("CHAMELEON_ORIGIN"): + raise RuntimeError("Public preview requires an explicit database URL and HTTPS origin") + if os.environ.get("CHAMELEON_TEST_DB") == "1": + raise RuntimeError("Public preview cannot use the local test-database override") + return Settings( + database_url=url, + fixture_key="", + origin=os.environ["CHAMELEON_ORIGIN"], + profile=profile, + limits=limits, + worker_slot=os.environ.get("CHAMELEON_WORKER_SLOT", "default"), + base_path=os.environ.get("CHAMELEON_BASE_PATH", ""), + verification_enabled=os.environ.get("CHAMELEON_VERIFICATION_ENABLED") == "1", + ) + path = ROOT / ".local/runtime.json" + if not path.exists(): + raise RuntimeError("Run scripts/local.py setup first; live credentials are not needed") + value = json.loads(path.read_text()) + url = os.environ.get("CHAMELEON_DATABASE_URL", value["database_url"]) + if os.environ.get("CHAMELEON_TEST_DB") == "1": + url = url.rsplit("/", 1)[0] + "/chameleon_test" + return Settings( + database_url=url, + fixture_key=value["fixture_key"], + profile=profile, + origin=os.environ.get("CHAMELEON_ORIGIN", "http://127.0.0.1:8120"), + limits=limits, + worker_slot=os.environ.get("CHAMELEON_WORKER_SLOT", "default"), + base_path=os.environ.get("CHAMELEON_BASE_PATH", ""), + verification_enabled=os.environ.get("CHAMELEON_VERIFICATION_ENABLED") == "1", + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/contracts.py b/orbiters/chameleon/packages/core/chameleon_core/contracts.py new file mode 100644 index 0000000000000000000000000000000000000000..c435ff89ec726a03219225273ff8a1fa6bb9c70e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/contracts.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +import hashlib +import json +from datetime import datetime +from typing import Any, Literal + +from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator + +Operation = Literal["hotel.observe", "hotel.create_ticket", "hotel.read_ticket"] +NodeKind = Literal["observe", "build_candidates", "choose", "request_approval", "execute", "verify", "stop"] + + +def canonical(value: Any) -> str: + return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=False, allow_nan=False) + + +def digest(value: Any) -> str: + return hashlib.sha256(canonical(value).encode()).hexdigest() + + +class StrictRecord(BaseModel): + model_config = ConfigDict(extra="forbid", strict=True, frozen=True) + schema_version: Literal[1] = 1 + + +class AgentIdentity(StrictRecord): + agent_id: str + owner_id: str + display_name: str = Field(min_length=1, max_length=80) + identity_version: int = Field(ge=1) + preferences: dict[str, str] = Field(default_factory=dict, max_length=16) + avatar_ref: str = "ascii:iris" + lineage: list[str] = Field(default_factory=list, max_length=16) + + +class ActionSpec(StrictRecord): + operation: Operation + effect: Literal["read", "write"] + approval_required: bool + executor: Literal["hotel_fixture_v1"] = "hotel_fixture_v1" + + +class Node(StrictRecord): + id: str = Field(pattern=r"^[a-z_]{1,40}$") + kind: NodeKind + next: str | None = None + operation: str | None = None + + +class Form(StrictRecord): + family: Literal["hotel_host"] = "hotel_host" + version: Literal["0.1.0"] = "0.1.0" + mode: Literal["inhabit"] = "inhabit" + target_kind: Literal["hotel_fixture"] = "hotel_fixture" + interface_version: Literal["hotel-fixture-v1"] = "hotel-fixture-v1" + provider: Literal["deterministic-fixture-v1"] = "deterministic-fixture-v1" + actions: list[ActionSpec] + graph: list[Node] + memory_scope: Literal["environment_only"] = "environment_only" + provenance: Literal["manually_authored"] = "manually_authored" + + @model_validator(mode="after") + def graph_is_supported(self) -> Form: + kinds = ["observe", "build_candidates", "choose", "request_approval", "execute", "verify", "stop"] + if [n.kind for n in self.graph] != kinds: + raise ValueError("M1 supports only the declared acyclic host graph; other graphs are unsupported") + ids = [n.id for n in self.graph] + if len(set(ids)) != len(ids): + raise ValueError("duplicate node ID") + for i, n in enumerate(self.graph): + expected = ids[i + 1] if i + 1 < len(ids) else None + if n.next != expected: + raise ValueError(f"node {n.id}: invalid binding or cycle") + operations = {a.operation: a for a in self.actions} + if len(operations) != len(self.actions) or set(operations) != { + "hotel.observe", + "hotel.create_ticket", + "hotel.read_ticket", + }: + raise ValueError("exact audited operation set required") + for node in self.graph: + required = { + "observe": "hotel.observe", + "execute": "hotel.create_ticket", + "verify": "hotel.read_ticket", + }.get(node.kind) + if node.operation != required: + raise ValueError(f"node {node.id}: incorrect operation binding") + for op, action in operations.items(): + write = op == "hotel.create_ticket" + if action.effect != ("write" if write else "read") or action.approval_required != write: + raise ValueError("effect/approval declaration disagrees with registered executor") + return self + + +class TicketArguments(StrictRecord): + request_id: str = Field(pattern=r"^req_[a-z0-9]{1,40}$") + room_id: str = Field(pattern=r"^R-[0-9]{1,4}$") + category: Literal["maintenance", "housekeeping"] + + +class Candidate(StrictRecord): + candidate_id: str + candidate_set_id: str + run_id: str + target_id: str + form_digest: str = Field(pattern=r"^[a-f0-9]{64}$") + operation: Literal["hotel.create_ticket"] = "hotel.create_ticket" + arguments: TicketArguments + precondition_version: int = Field(ge=1) + evidence_ids: list[str] = Field(min_length=1) + expires_at: str + origin: Literal["manual_host_binding_v1"] = "manual_host_binding_v1" + + @field_validator("expires_at") + @classmethod + def aware_expiry(cls, value: str) -> str: + if datetime.fromisoformat(value).tzinfo is None: + raise ValueError("timezone required") + return value + + +class DecisionResult(StrictRecord): + candidate_id: str + candidate_set_id: str + provider: Literal["deterministic-fixture-v1"] = "deterministic-fixture-v1" + confidence_kind: Literal["not_probabilistic"] = "not_probabilistic" + model_calls: Literal[0] = 0 + + +class Observation(StrictRecord): + observation_id: str + target_id: str + source: Literal["hotel_fixture_v1"] = "hotel_fixture_v1" + observed_at: str + version: int + status: Literal["observed", "inferred", "hypothetical"] + payload: dict[str, Any] + + +class Event(StrictRecord): + event_id: str + run_id: str + sequence: int + type: str + timestamp: str + component: str = "chameleon-m1" + correlation_id: str + payload: dict[str, Any] + + +def host_form() -> Form: + kinds: list[NodeKind] = [ + "observe", + "build_candidates", + "choose", + "request_approval", + "execute", + "verify", + "stop", + ] + operations: dict[str, Operation] = { + "observe": "hotel.observe", + "execute": "hotel.create_ticket", + "verify": "hotel.read_ticket", + } + return Form( + actions=[ + ActionSpec( + operation=op, + effect="write" if op == "hotel.create_ticket" else "read", + approval_required=op == "hotel.create_ticket", + ) + for op in operations.values() + ], + graph=[ + Node(id=k, kind=k, next=kinds[i + 1] if i + 1 < len(kinds) else None, operation=operations.get(k)) + for i, k in enumerate(kinds) + ], + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/control_overlay.py b/orbiters/chameleon/packages/core/chameleon_core/control_overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..7380ea737c58c32d49e961e9ba0ebfb82ff6d911 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/control_overlay.py @@ -0,0 +1,76 @@ +"""Explicit, source-documented input reconstruction; never general HTML synthesis.""" +import base64 +import hashlib +import html +import re +from html.parser import HTMLParser + +from .repository_capture import verify_package + + +def control_overlay(package, control_id): + files = verify_package(package) + if not isinstance(control_id, str) or not re.fullmatch(r'[A-Za-z_][\w-]{0,79}', control_id): + raise ValueError('CONTROL_ID_INVALID') + entry = package['repository']['entry'] + if not entry.endswith(('.html', '.htm')) or len(files[entry]) > 64000: + raise ValueError('CONTROL_ENTRY_BUDGET') + source = files[entry].decode('utf-8') + starts = [0] + [m.end() for m in re.finditer('\n', source)] + ids, pres = set(), set() + + class Surface(HTMLParser): + depth = 0 + + def handle_starttag(self, tag, attrs): + if tag == 'template': + self.depth += 1 + if self.depth: + return + attrs = dict(attrs) + if attrs.get('id'): + ids.add(attrs['id']) + if tag == 'pre': + line, col = self.getpos() + pres.add(starts[line - 1] + col) + + def handle_endtag(self, tag): + if tag == 'template': + self.depth = max(0, self.depth - 1) + + Surface().feed(source) + if control_id in ids: + raise ValueError('CONTROL_ALREADY_PRESENT') + candidates = [] + for match in re.finditer(r']*>\s*\s*([^<]+?)\s*\s*', source, re.IGNORECASE): + if match.start() not in pres: + continue + fragment = html.unescape(match[1]).strip() + if not re.fullmatch(r']+/?>', fragment, re.IGNORECASE): + continue + parsed = [] + + class Input(HTMLParser): + def handle_starttag(self, tag, attrs, parsed=parsed): + parsed.append((tag, attrs)) + + Input().feed(fragment) + if len(parsed) != 1 or dict(parsed[0][1]).get('id') != control_id: + continue + attrs = parsed[0][1] + allowed = {'id', 'class', 'type', 'placeholder', 'value', 'data-list', 'data-minchars', 'aria-label'} + if (len(dict(attrs)) != len(attrs) or any(k not in allowed or v is None for k, v in attrs) + or dict(attrs).get('type', 'text') not in {'text', 'email', 'search'}): + raise ValueError('CONTROL_ATTRIBUTES_UNSUPPORTED') + canonical = '' + candidates.append((match.end(), canonical)) + if len(candidates) != 1: + raise ValueError('CONTROL_UNIQUE_SOURCE_EXAMPLE_REQUIRED') + offset, fragment = candidates[0] + body = (source[:offset] + '\n' + fragment + '\n' + source[offset:]).encode() + if len(body) > 65536: + raise ValueError('CONTROL_OUTPUT_BUDGET') + return {'version': 'derived-html-control-v1', 'source_digest': package['digest'], 'path': entry, + 'before_sha256': hashlib.sha256(files[entry]).hexdigest(), + 'after_sha256': hashlib.sha256(body).hexdigest(), 'after_base64': base64.b64encode(body).decode(), + 'operator': 'documented-input-restoration-v1', 'control_id': control_id} diff --git a/orbiters/chameleon/packages/core/chameleon_core/counterpart_bundles.py b/orbiters/chameleon/packages/core/chameleon_core/counterpart_bundles.py new file mode 100644 index 0000000000000000000000000000000000000000..a372ee43ec36ce470080b9da491a5d57af59192a --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/counterpart_bundles.py @@ -0,0 +1,141 @@ +"""Trusted verifier output storage. No public write or execution endpoint.""" + +import hashlib +import io +import json +import zipfile + +from sqlalchemy import func, select + +from .db import BehaviorRecord, CounterpartBundle, LocalTwin +from .service import Failure, owned + + +class CounterpartBundles: + def __init__(self, sessions, *, limits=None): + self.sessions = sessions + self.limits = limits + + def store(self, owner, twin_id, record_id, body): + # Only the trusted supervisor calls this with freshly validated bundle bytes. + if not isinstance(body, bytes) or not 1 <= len(body) <= 8 * 1024 * 1024: + raise Failure("COUNTERPART_BUNDLE_BUDGET") + fingerprint = hashlib.sha256(body).hexdigest() + with self.sessions.begin() as session: + twin = owned(session, LocalTwin, twin_id, owner, lock=True) + record = owned(session, BehaviorRecord, record_id, owner) + if record.twin != twin.id or record.source_digest != twin.source_digest: + raise Failure("COUNTERPART_BUNDLE_SOURCE_MISMATCH") + if record.receipt["behavior"]["status"] != "PASS": + raise Failure("COUNTERPART_BUNDLE_NOT_PASSED") + previous = session.scalar(select(CounterpartBundle).where(CounterpartBundle.record == record.id)) + if previous: + if previous.sha256 != fingerprint: + raise Failure("COUNTERPART_BUNDLE_CONFLICT") + return previous.id + count = session.scalar( + select(func.count()).select_from(CounterpartBundle).where(CounterpartBundle.twin == twin.id) + ) + if count >= 20: + raise Failure("COUNTERPART_BUNDLE_COUNT_BUDGET") + row = CounterpartBundle( + record=record.id, twin=twin.id, owner=owner, sha256=fingerprint, body=body + ) + session.add(row) + session.flush() + return row.id + + def download(self, owner, twin_id, bundle_id): + body, fingerprint, _ = self._checked(owner, twin_id, bundle_id) + return body, fingerprint + + def interaction_frame(self, owner, twin_id, bundle_id): + body, _, receipt = self._checked(owner, twin_id, bundle_id) + expected = receipt["behavior"].get("interaction_surface", {}).get("frame") + if not isinstance(expected, dict): + raise Failure("INTERACTION_FRAME_UNAVAILABLE", 404) + try: + with zipfile.ZipFile(io.BytesIO(body)) as archive: + name = "evidence/interaction-frame.png" + if archive.namelist().count(name) != 1: + raise ValueError("duplicate or missing frame") + info = archive.getinfo(name) + if not 8 <= info.file_size <= 4 * 1024 * 1024: + raise ValueError("frame budget") + frame = archive.read(info) + fingerprint = hashlib.sha256(frame).hexdigest() + if ( + not frame.startswith(b"\x89PNG\r\n\x1a\n") + or expected.get("format") != "png" + or expected.get("bytes") != len(frame) + or expected.get("sha256") != fingerprint + ): + raise ValueError("frame binding") + return frame, fingerprint + except (ValueError, KeyError, zipfile.BadZipFile, RuntimeError) as exc: + raise Failure("INTERACTION_FRAME_INTEGRITY") from exc + + def replay(self, owner, twin_id, bundle_id, request, key): + from .interaction_replay import replay_contract + from .verification_jobs import CONTRACT_PROFILE, VerificationJobs + + _, fingerprint, receipt = self._checked(owner, twin_id, bundle_id) + assembly = None + if receipt.get("dependency_digest") or receipt.get("overlay_digest"): + assembly = { + "bundle_id": bundle_id, + "bundle_sha256": fingerprint, + "dependency_digest": receipt.get("dependency_digest"), + } + if receipt.get("overlay_digest"): + assembly["overlay_digest"] = receipt["overlay_digest"] + contract = replay_contract(receipt, request, allow_dependencies=assembly is not None, + allow_overlay=assembly is not None) + queue = VerificationJobs(self.sessions, limits=self.limits) + ident = queue.enqueue( + owner, + twin_id, + key, + CONTRACT_PROFILE, + contract, + expected_source=receipt["source_digest"], + assembly=assembly, + ) + return queue.report(owner, ident) + + def dependencies(self, owner, twin_id, assembly): + from .locked_assets import verify_locked_assets + from .twins import Twins + + body, fingerprint, receipt = self._checked(owner, twin_id, assembly["bundle_id"]) + if ( + fingerprint != assembly["bundle_sha256"] + or receipt.get("dependency_digest") != assembly["dependency_digest"] + ): + raise Failure("VERIFICATION_ASSEMBLY_MISMATCH") + with zipfile.ZipFile(io.BytesIO(body)) as archive: + name = "evidence/dependencies.json" + if archive.namelist().count(name) != 1 or archive.getinfo(name).file_size > 16 * 1024 * 1024: + raise Failure("VERIFICATION_ASSEMBLY_BUDGET") + artifact = json.loads(archive.read(name)) + if artifact["digest"] != assembly["dependency_digest"]: + raise Failure("VERIFICATION_ASSEMBLY_MISMATCH") + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + verify_locked_assets(artifact, {"digest": evidence.content_digest, "repository": evidence.payload}) + return artifact + + def _checked(self, owner, twin_id, bundle_id): + with self.sessions() as session: + twin = owned(session, LocalTwin, twin_id, owner) + row = owned(session, CounterpartBundle, bundle_id, owner) + record = owned(session, BehaviorRecord, row.record, owner) + if row.twin != twin.id or record.twin != twin.id: + raise Failure("NOT_FOUND", 404) + if record.source_digest != twin.source_digest: + raise Failure("COUNTERPART_BUNDLE_SOURCE_MISMATCH") + if ( + record.receipt["behavior"]["status"] != "PASS" + or hashlib.sha256(row.body).hexdigest() != row.sha256 + ): + raise Failure("COUNTERPART_BUNDLE_INTEGRITY") + return row.body, row.sha256, record.receipt diff --git a/orbiters/chameleon/packages/core/chameleon_core/counterparts.py b/orbiters/chameleon/packages/core/chameleon_core/counterparts.py new file mode 100644 index 0000000000000000000000000000000000000000..8484534c37f2b71bd6d70e35ecb696875e437dc2 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/counterparts.py @@ -0,0 +1,47 @@ +"""Durably construct the requested counterpart after evidence verification.""" + +from sqlalchemy import select + +from .adaptation_contracts import Residual +from .adaptation_service import append +from .db import AdaptationJob +from .service import Failure +from .twins import Twins + + +class Counterparts: + def __init__(self, sessions): + self.sessions = sessions + self.twins = Twins(sessions) + + def reconcile(self): + with self.sessions.begin() as s: + job = s.scalar( + select(AdaptationJob) + .where( + AdaptationJob.counterpart["status"].as_string() == "PENDING", + AdaptationJob.status.notin_(["QUEUED", "RUNNING"]), + ) + .order_by(AdaptationJob.created) + .with_for_update(skip_locked=True) + .limit(1) + ) + if job is None: + return False + if job.status != "VERIFIED": + job.counterpart = { + "status": "CANCELLED" if job.status == "CANCELLED" else "NEEDS_EVIDENCE", + "twin_id": None, + "residual": job.residual or job.status, + } + append(job, "counterpart.not_built", job.counterpart) + return True + try: + twin_id = self.twins.create_in(s, job.owner, job.id) + except (Failure, Residual) as exc: + job.counterpart = {"status": "NEEDS_EVIDENCE", "twin_id": None, "residual": exc.code} + append(job, "counterpart.not_built", job.counterpart) + else: + job.counterpart = {"status": "READY", "twin_id": twin_id, "residual": None} + append(job, "counterpart.created", {"twin_id": twin_id, "source_writes": False}) + return True diff --git a/orbiters/chameleon/packages/core/chameleon_core/curated_app.py b/orbiters/chameleon/packages/core/chameleon_core/curated_app.py new file mode 100644 index 0000000000000000000000000000000000000000..fe3bd0d63e1fe080a6c311795d22605b0cc0cd5f --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/curated_app.py @@ -0,0 +1,82 @@ +"""One explicitly audited source application, not arbitrary repository execution.""" + +import base64 +import html +import json +import re + +from .adaptation_contracts import Residual +from .contracts import digest +from .repository_capture import verify_package + +APP_DIGEST = "c5f60e214a6a6886c4da600f370db1ddb5737924dcadd39a7b3e9c3756652625" +CODE_DIGEST = "62dab561ee0508eacf3b08a6159eeaf7e49f1771fd11b4adf3477cb29fe660d3" + + +def approved_2048(package): + """Approval binds source bytes, not the changing acquisition timestamp.""" + if package.get("digest") != digest(package.get("repository")): + raise Residual("CURATED_APP_REVISION_NOT_APPROVED") + verify_package(package) + data = package["repository"] + return ( + data["source"] == "https://github.com/gabrielecirulli/2048" + and data["commit_sha"] == "478b6ec346e3787f589e4af751378d06ded4cbbc" + and data["tree_sha"] == "693fbb47db2d71aa65cc0e566a288473970233e6" + and digest({"entry": data["entry"], "files": {k: v["sha256"] for k, v in data["files"].items()}}) + == CODE_DIGEST + ) + + +def render_2048(package, nonce, channel): + if not approved_2048(package): + raise Residual("CURATED_APP_REVISION_NOT_APPROVED") + files = verify_package(package) + document = files["index.html"].decode() + scripts = re.findall(r'', document) + if scripts[-1] != "js/application.js" or len(scripts) != 10: + raise Residual("CURATED_APP_ENTRY_CHANGED") + document = re.sub(r'', "", document) + fonts = files["style/fonts/clear-sans.css"].decode() + + def font_url(match): + name = match[1].strip("\"'").split("?")[0].split("#")[0] + data = files["style/fonts/" + name] + media = "font/woff" if name.endswith(".woff") else "application/octet-stream" + return "url(data:" + media + ";base64," + base64.b64encode(data).decode() + ")" + + fonts = re.sub(r"url\(([^)]+)\)", font_url, fonts) + style = files["style/main.css"].decode().replace("@import url(fonts/clear-sans.css);", fonts) + document = re.sub(r"]*>", "", document) + document = document.replace("", "") + # Keep attribution, but do not impersonate the original official deployment. + document = document.replace( + "This site is the official version of 2048.", + "This is an independently hosted Chameleon source-backed adaptation of 2048.", + ) + document = re.sub( + r' href="([^"]*)"', lambda m: ' data-source-link="' + html.escape(m[1], quote=True) + '"', document + ) + source = "\n".join(files[name].decode() for name in scripts[:-1]) + boot = files[scripts[-1]].decode() + bridge = """ +const channel=CHANNEL;let started=false; +const publish=()=>parent.postMessage({type:'curated.storage',channel,data:window.fakeStorage._data},'*'); +window.addEventListener('message',event=>{ + if(event.source!==parent||event.data?.channel!==channel||event.data?.type!=='curated.restore'||started)return; + started=true;const data=event.data.data||{}; + for(const key of ['gameState','bestScore'])if(typeof data[key]==='string'&&data[key].length<=8192)window.fakeStorage._data[key]=data[key]; + const set=window.fakeStorage.setItem,remove=window.fakeStorage.removeItem; + window.fakeStorage.setItem=function(key,value){const result=set.call(this,key,value);publish();return result;}; + window.fakeStorage.removeItem=function(key){const result=remove.call(this,key);publish();return result;}; + BOOT +}); +document.addEventListener('click',e=>{if(e.target.closest('a[data-source-link]'))e.preventDefault();}); +parent.postMessage({type:'curated.ready',channel},'*'); +""".replace("CHANNEL", json.dumps(channel)).replace("BOOT", boot) + script = source + "\n" + bridge + if "", '" + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/db.py b/orbiters/chameleon/packages/core/chameleon_core/db.py new file mode 100644 index 0000000000000000000000000000000000000000..8ff4da89c5474019524c3c65ff71139318d9ea7e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/db.py @@ -0,0 +1,372 @@ +from __future__ import annotations + +from datetime import UTC, datetime +from uuid import uuid4 + +from sqlalchemy import ( + JSON, + Boolean, + DateTime, + ForeignKey, + Integer, + LargeBinary, + String, + Text, + UniqueConstraint, + create_engine, +) +from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, sessionmaker + + +def now() -> datetime: + return datetime.now(UTC) + + +def uid() -> str: + return uuid4().hex + + +class Base(DeclarativeBase): + pass + + +class User(Base): + __tablename__ = "users" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + name: Mapped[str] = mapped_column(String(80), unique=True) + password: Mapped[str] = mapped_column(Text) + + +class SessionToken(Base): + __tablename__ = "sessions" + token_hash: Mapped[str] = mapped_column(String(64), primary_key=True) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + csrf_hash: Mapped[str] = mapped_column(String(64)) + expires: Mapped[datetime] = mapped_column(DateTime(timezone=True)) + + +class Agent(Base): + __tablename__ = "agents" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + name: Mapped[str] = mapped_column(String(80)) + identity_version: Mapped[int] = mapped_column(Integer, default=1) + identity: Mapped[dict] = mapped_column(JSON) + + +class Connection(Base): + __tablename__ = "connections" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + kind: Mapped[str] = mapped_column(String(40), default="hotel_fixture") + revoked: Mapped[bool] = mapped_column(Boolean, default=False) + + +class Target(Base): + __tablename__ = "targets" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + connection: Mapped[str] = mapped_column(ForeignKey("connections.id")) + fingerprint: Mapped[str] = mapped_column(String(64)) + kind: Mapped[str] = mapped_column(String(40), default="hotel_fixture") + + +class Grant(Base): + __tablename__ = "grants" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + target: Mapped[str] = mapped_column(ForeignKey("targets.id")) + operation: Mapped[str] = mapped_column(String(60)) + active: Mapped[bool] = mapped_column(Boolean, default=True) + version: Mapped[int] = mapped_column(Integer, default=1) + __table_args__ = (UniqueConstraint("owner", "target", "operation"),) + + +class FormRow(Base): + __tablename__ = "form_versions" + digest: Mapped[str] = mapped_column(String(64), primary_key=True) + data: Mapped[dict] = mapped_column(JSON) + status: Mapped[str] = mapped_column(String(30), default="approved_fixture") + + +class Instance(Base): + __tablename__ = "instances" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + agent: Mapped[str] = mapped_column(ForeignKey("agents.id")) + identity_version: Mapped[int] = mapped_column(Integer) + target: Mapped[str] = mapped_column(ForeignKey("targets.id")) + form: Mapped[str] = mapped_column(ForeignKey("form_versions.digest")) + provider: Mapped[str] = mapped_column(String(60), default="deterministic-fixture-v1") + + +class Run(Base): + __tablename__ = "runs" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + instance: Mapped[str] = mapped_column(ForeignKey("instances.id")) + request_id: Mapped[str] = mapped_column(String(60)) + creation_key: Mapped[str] = mapped_column(String(80)) + status: Mapped[str] = mapped_column(String(40), default="READY") + sequence: Mapped[int] = mapped_column(Integer, default=0) + fence: Mapped[int] = mapped_column(Integer, default=0) + calls: Mapped[int] = mapped_column(Integer, default=0) + max_calls: Mapped[int] = mapped_column(Integer, default=100) + expires: Mapped[datetime] = mapped_column(DateTime(timezone=True)) + checkpoint: Mapped[dict] = mapped_column(JSON, default=dict) + __table_args__ = (UniqueConstraint("owner", "creation_key"),) + + +class ObservationRow(Base): + __tablename__ = "observations" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + run: Mapped[str] = mapped_column(ForeignKey("runs.id")) + data: Mapped[dict] = mapped_column(JSON) + + +class CandidateRow(Base): + __tablename__ = "candidates" + id: Mapped[str] = mapped_column(String(32), primary_key=True) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + run: Mapped[str] = mapped_column(ForeignKey("runs.id"), unique=True) + digest: Mapped[str] = mapped_column(String(64)) + data: Mapped[dict] = mapped_column(JSON) + + +class Approval(Base): + __tablename__ = "approvals" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + candidate: Mapped[str] = mapped_column(ForeignKey("candidates.id"), unique=True) + binding: Mapped[str] = mapped_column(String(64)) + decision: Mapped[str] = mapped_column(String(20), default="pending") + expires: Mapped[datetime] = mapped_column(DateTime(timezone=True)) + + +class Intent(Base): + __tablename__ = "action_intents" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + run: Mapped[str] = mapped_column(ForeignKey("runs.id"), unique=True) + candidate: Mapped[str] = mapped_column(ForeignKey("candidates.id")) + idempotency_key: Mapped[str] = mapped_column(String(64), unique=True) + status: Mapped[str] = mapped_column(String(40), default="PREPARED") + fence: Mapped[int] = mapped_column(Integer) + grant_version: Mapped[int] = mapped_column(Integer) + + +class Outbox(Base): + __tablename__ = "outbox_jobs" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + intent: Mapped[str] = mapped_column(ForeignKey("action_intents.id"), unique=True) + status: Mapped[str] = mapped_column(String(30), default="pending") + + +class Receipt(Base): + __tablename__ = "action_receipts" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + intent: Mapped[str] = mapped_column(ForeignKey("action_intents.id"), unique=True) + owner: Mapped[str] = mapped_column(ForeignKey("users.id")) + target_ticket: Mapped[str] = mapped_column(String(32)) + verified: Mapped[bool] = mapped_column(Boolean, default=False) + data: Mapped[dict] = mapped_column(JSON) + + +class EventRow(Base): + __tablename__ = "events" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + run: Mapped[str] = mapped_column(ForeignKey("runs.id")) + sequence: Mapped[int] = mapped_column(Integer) + type: Mapped[str] = mapped_column(String(80)) + at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + data: Mapped[dict] = mapped_column(JSON) + __table_args__ = (UniqueConstraint("run", "sequence"),) + + +class FixtureRequest(Base): + __tablename__ = "fixture_requests" + id: Mapped[str] = mapped_column(String(60), primary_key=True) + owner: Mapped[str] = mapped_column(String(32), primary_key=True) + room: Mapped[str] = mapped_column(String(10)) + category: Mapped[str] = mapped_column(String(40)) + text: Mapped[str] = mapped_column(String(300)) + version: Mapped[int] = mapped_column(Integer, default=1) + available: Mapped[bool] = mapped_column(Boolean, default=True) + status: Mapped[str] = mapped_column(String(20), default="open") + + +class FixtureTicket(Base): + __tablename__ = "fixture_tickets" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(String(32)) + request_id: Mapped[str] = mapped_column(String(60)) + room: Mapped[str] = mapped_column(String(10)) + category: Mapped[str] = mapped_column(String(40)) + idempotency_key: Mapped[str] = mapped_column(String(64)) + binding: Mapped[str] = mapped_column(String(64)) + status: Mapped[str] = mapped_column(String(20), default="open") + __table_args__ = (UniqueConstraint("owner", "request_id"), UniqueConstraint("owner", "idempotency_key")) + + +class AdaptationJob(Base): + __tablename__ = "adaptation_jobs" + __table_args__ = (UniqueConstraint("owner", "creation_key", name="uq_adaptation_owner_creation_key"),) + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + agent: Mapped[str] = mapped_column(ForeignKey("agents.id")) + source: Mapped[str] = mapped_column(Text) + objective: Mapped[str] = mapped_column(Text) + provider: Mapped[str] = mapped_column(String(80)) + intake: Mapped[dict] = mapped_column(JSON) + status: Mapped[str] = mapped_column(String(40), default="QUEUED", index=True) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + expires: Mapped[datetime] = mapped_column(DateTime(timezone=True)) + lease_token: Mapped[str | None] = mapped_column(String(32), nullable=True) + lease_until: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True) + attempts: Mapped[int] = mapped_column(Integer, default=0) + events: Mapped[list] = mapped_column(JSON, default=list) + evidence: Mapped[dict | None] = mapped_column(JSON, nullable=True) + form: Mapped[dict | None] = mapped_column(JSON, nullable=True) + result: Mapped[dict | None] = mapped_column(JSON, nullable=True) + metrics: Mapped[dict] = mapped_column(JSON, default=dict) + residual: Mapped[str | None] = mapped_column(String(160), nullable=True) + creation_key: Mapped[str | None] = mapped_column(String(100), nullable=True) + request_digest: Mapped[str | None] = mapped_column(String(64), nullable=True) + counterpart: Mapped[dict | None] = mapped_column(JSON, nullable=True) + + +class ScopedMemory(Base): + __tablename__ = "scoped_memories" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + agent: Mapped[str] = mapped_column(ForeignKey("agents.id")) + job: Mapped[str] = mapped_column(ForeignKey("adaptation_jobs.id"), unique=True) + target_scope: Mapped[str] = mapped_column(String(64)) + evidence_digest: Mapped[str] = mapped_column(String(64)) + form_digest: Mapped[str] = mapped_column(String(64)) + data: Mapped[dict] = mapped_column(JSON) + + +class LocalTwin(Base): + __tablename__ = "local_twins" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + agent: Mapped[str] = mapped_column(ForeignKey("agents.id")) + job: Mapped[str] = mapped_column(ForeignKey("adaptation_jobs.id"), unique=True) + source_digest: Mapped[str] = mapped_column(String(64)) + revision: Mapped[int] = mapped_column(default=0) + data: Mapped[dict] = mapped_column(JSON) + manifest: Mapped[dict] = mapped_column(JSON) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class BehaviorRecord(Base): + __tablename__ = "behavior_records" + __table_args__ = (UniqueConstraint("twin", "receipt_digest"),) + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + twin: Mapped[str] = mapped_column(ForeignKey("local_twins.id"), index=True) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + source_digest: Mapped[str] = mapped_column(String(64)) + receipt_digest: Mapped[str] = mapped_column(String(64)) + receipt: Mapped[dict] = mapped_column(JSON) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class VerificationJob(Base): + __tablename__ = "verification_jobs" + __table_args__ = (UniqueConstraint("owner", "creation_key"),) + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + twin: Mapped[str] = mapped_column(ForeignKey("local_twins.id"), index=True) + source_digest: Mapped[str] = mapped_column(String(64)) + creation_key: Mapped[str] = mapped_column(String(100)) + profile: Mapped[str] = mapped_column(String(80)) + contract: Mapped[dict | None] = mapped_column(JSON, nullable=True) + assembly: Mapped[dict | None] = mapped_column(JSON, nullable=True) + dependency_lock: Mapped[str | None] = mapped_column(String(512), nullable=True) + acquired_digest: Mapped[str | None] = mapped_column(String(64), nullable=True) + status: Mapped[str] = mapped_column(String(32), default="QUEUED", index=True) + token: Mapped[str | None] = mapped_column(String(32), nullable=True) + deadline: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True) + result: Mapped[dict | None] = mapped_column(JSON, nullable=True) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class CounterpartBundle(Base): + __tablename__ = "counterpart_bundles" + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + record: Mapped[str] = mapped_column(ForeignKey("behavior_records.id"), unique=True) + twin: Mapped[str] = mapped_column(ForeignKey("local_twins.id"), index=True) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + sha256: Mapped[str] = mapped_column(String(64)) + body: Mapped[bytes] = mapped_column(LargeBinary) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class ApplicationSave(Base): + __tablename__ = "application_saves" + twin: Mapped[str] = mapped_column(ForeignKey("local_twins.id"), primary_key=True) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + source_digest: Mapped[str] = mapped_column(String(64)) + revision: Mapped[int] = mapped_column(default=0) + data: Mapped[dict] = mapped_column(JSON) + updated: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class TwinMutation(Base): + __tablename__ = "twin_mutations" + __table_args__ = (UniqueConstraint("twin", "creation_key"),) + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + twin: Mapped[str] = mapped_column(ForeignKey("local_twins.id")) + creation_key: Mapped[str] = mapped_column(String(100)) + request_digest: Mapped[str] = mapped_column(String(64)) + receipt: Mapped[dict] = mapped_column(JSON) + + +class WebsiteCapture(Base): + __tablename__ = "website_captures" + __table_args__ = (UniqueConstraint("twin", "creation_key"),) + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + twin: Mapped[str] = mapped_column(ForeignKey("local_twins.id"), index=True) + job: Mapped[str] = mapped_column(ForeignKey("adaptation_jobs.id"), unique=True) + source: Mapped[str] = mapped_column(Text) + creation_key: Mapped[str] = mapped_column(String(100)) + request_digest: Mapped[str] = mapped_column(String(64)) + status: Mapped[str] = mapped_column(String(40), default="PENDING", index=True) + residual: Mapped[str | None] = mapped_column(String(160), nullable=True) + receipt: Mapped[dict | None] = mapped_column(JSON, nullable=True) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class MetaFoldRun(Base): + __tablename__ = "metafold_runs" + __table_args__ = (UniqueConstraint("owner", "creation_key"),) + id: Mapped[str] = mapped_column(String(32), primary_key=True, default=uid) + owner: Mapped[str] = mapped_column(ForeignKey("users.id"), index=True) + creation_key: Mapped[str] = mapped_column(String(100)) + request_digest: Mapped[str] = mapped_column(String(64)) + state: Mapped[dict] = mapped_column(JSON) + pending: Mapped[dict | None] = mapped_column(JSON, nullable=True) + status: Mapped[str] = mapped_column(String(32), default="RUNNING", index=True) + created: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + updated: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=now) + + +class WorkerPulse(Base): + __tablename__ = "worker_pulses" + slot: Mapped[str] = mapped_column(String(64), primary_key=True) + generation: Mapped[str] = mapped_column(String(32)) + configuration: Mapped[str] = mapped_column(String(64)) + state: Mapped[str] = mapped_column(String(20)) + seen: Mapped[datetime] = mapped_column(DateTime(timezone=True)) + + +def database(url: str): + if not url.startswith("postgresql+psycopg://"): + raise ValueError("A real PostgreSQL URL is required; SQLite is not a locking substitute") + engine = create_engine(url, pool_pre_ping=True, pool_size=4, max_overflow=2) + return engine, sessionmaker(engine, expire_on_commit=False) diff --git a/orbiters/chameleon/packages/core/chameleon_core/declared_dependencies.py b/orbiters/chameleon/packages/core/chameleon_core/declared_dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..585c3b3495629021623c0acded9633d528a34708 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/declared_dependencies.py @@ -0,0 +1,11 @@ +"""Worker entry point for source-declared pnpm modules and linked styles.""" +from .locked_assets import registry_fetch +from .pnpm_bundle import capture_pnpm_bundle +from .pnpm_discovery import discover_pnpm +from .sass_assembly import linked_sass_entries + + +def capture_declared_pnpm(package, fetch=registry_fetch): + names = discover_pnpm(package) + styles = linked_sass_entries(package) + return capture_pnpm_bundle(package, names, fetch, styles=styles or None) diff --git a/orbiters/chameleon/packages/core/chameleon_core/define_overlay.py b/orbiters/chameleon/packages/core/chameleon_core/define_overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..286e46af2ee3475006b50a84429c529c0a629789 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/define_overlay.py @@ -0,0 +1,124 @@ +"""Reproducible declared-constant compilation from frozen inputs only.""" +import base64 +import hashlib +import json +import re +import shutil +from pathlib import Path + +from .repository_capture import safe_path, verify_package +from .windows_job import run_bounded + +ROOT = Path(__file__).resolve().parents[3] + + +def inspect_define_failure(package, behavior): + """Propose one declared repair from diagnostics, never treat diagnostics as proof.""" + files = verify_package(package) + if (behavior.get('package_digest') != package['digest'] or behavior.get('status') != 'FAIL' + or behavior.get('overlay_digest') is not None): + raise ValueError('DEFINE_FAILURE_BINDING') + details = behavior.get('page_error_details', []) + if not isinstance(details, list) or not 1 <= len(details) <= 30: + raise ValueError('DEFINE_LOCATION_UNAVAILABLE') + selections = set() + for detail in details: + if not isinstance(detail, dict): + raise ValueError('DEFINE_DIAGNOSTIC_BOUNDARY') # noqa: TRY004 -- untrusted report schema rejection + message, stack = detail.get('message'), detail.get('stack') + if not isinstance(message, str) or not isinstance(stack, str) or len(stack) > 2000: + raise ValueError('DEFINE_DIAGNOSTIC_BOUNDARY') + symbol = re.fullmatch(r'([A-Z][A-Z0-9_]{0,63}) is not defined', message) + if not symbol or message not in behavior.get('page_errors', []): + continue + # Select only the first stack frame, not a caller that merely propagated it. + frames = [line.strip() for line in stack.splitlines() if line.strip().startswith('at ')] + if not frames: + continue + location = re.search(r'https://chameleon-package\.invalid/([^\s():?#%]+\.(?:js|mjs)):[1-9][0-9]*:[1-9][0-9]*\)?$', frames[0]) + if not location: + continue + path = location[1] + safe_path(path) + if path in files: + selections.add((path, symbol[1])) + if len(selections) != 1: + raise ValueError('DEFINE_LOCATION_MISSING_OR_AMBIGUOUS') + path, symbol = selections.pop() + return {'config': declared_define_config(package), 'module': path, 'symbol': symbol} + + +def define_overlay_from_failure(package, behavior): + selection = inspect_define_failure(package, behavior) + overlay = define_overlay(package, selection['config'], selection['module']) + symbol = selection['symbol'] + if symbol not in overlay['build']['plan']['constants']: + raise ValueError('DEFINE_SYMBOL_NOT_DECLARED') + return overlay + + +def declared_define_config(package): + """Select one explicitly declared standalone Vite config; never execute scripts.""" + files = verify_package(package) + if 'package.json' not in files or len(files['package.json']) > 65536: + raise ValueError('DEFINE_METADATA_NOT_CAPTURED') + def unique(pairs): + result = {} + for key, value in pairs: + if key in result: + raise ValueError('DEFINE_DUPLICATE_METADATA') + result[key] = value + return result + metadata = json.loads(files['package.json'], object_pairs_hook=unique) + scripts = metadata.get('scripts', {}) + if not isinstance(scripts, dict) or len(scripts) > 100: + raise ValueError('DEFINE_SCRIPT_BOUNDARY') + candidates = set() + for command in scripts.values(): + if not isinstance(command, str) or len(command) > 4096: + raise ValueError('DEFINE_SCRIPT_BOUNDARY') + # Compound shell commands, wrappers, environment flags and plugins are + # outside this selector's language. They are never partially interpreted. + match = re.fullmatch(r'vite(?:\s+(?:build|preview))?\s+--config\s+([A-Za-z0-9_./-]+)', command.strip()) + if match: + path = match[1] + safe_path(path) + candidates.add(path) + if len(candidates) != 1: + raise ValueError('DEFINE_CONFIG_MISSING_OR_AMBIGUOUS') + path = candidates.pop() + if path not in files: + raise ValueError('DEFINE_INPUT_NOT_CAPTURED') + return path + + +def define_overlay(package, config_path, module_path): + files = verify_package(package) + for path in (config_path, module_path): + safe_path(path) + if path not in files: + raise ValueError('DEFINE_INPUT_NOT_CAPTURED') + if not module_path.endswith(('.js', '.mjs')) or 'package.json' not in files: + raise ValueError('DEFINE_INPUT_UNSUPPORTED') + node = shutil.which('node') + if not node: + raise ValueError('DEFINE_COMPILER_UNAVAILABLE') + request = {'config': files[config_path].decode('utf-8'), 'package': files['package.json'].decode('utf-8'), + 'config_path': config_path, 'source': files[module_path].decode('utf-8')} + runtime = run_bounded([node, str(ROOT/'scripts/build_defined_module.mjs')], json.dumps(request), ROOT) + if (runtime['returncode'] != 0 or runtime['remaining_job_processes'] or runtime.get('stderr') + or any(runtime[k] for k in ('timed_out', 'cpu_budget_exhausted', 'output_budget_exhausted'))): + raise ValueError('DEFINE_COMPILER_FAILED') + result = json.loads(runtime['stdout']) + sha = lambda b: hashlib.sha256(b).hexdigest() + body = result['code'].encode('utf-8') + plan = result['plan'] + if (len(body) > 65536 or result['source_sha256'] != sha(files[module_path]) + or result['after_sha256'] != sha(body) or plan['config_path'] != config_path + or plan['config_sha256'] != sha(files[config_path]) + or plan['package_sha256'] != sha(files['package.json']) or result['source_executed'] is not False): + raise ValueError('DEFINE_COMPILER_BINDING') + return {'version': 'derived-define-v1', 'source_digest': package['digest'], 'path': module_path, + 'before_sha256': sha(files[module_path]), 'after_base64': base64.b64encode(body).decode(), + 'after_sha256': sha(body), 'operator': 'declared-vite-define-v1', + 'build': {'plan': plan, 'compiler': result['compiler']}} diff --git a/orbiters/chameleon/packages/core/chameleon_core/dependency_plan.py b/orbiters/chameleon/packages/core/chameleon_core/dependency_plan.py new file mode 100644 index 0000000000000000000000000000000000000000..5eceb03dc9be5e4804823686bf77eab7f98745f1 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/dependency_plan.py @@ -0,0 +1,77 @@ +"""Source-bound metadata discovery; this planner does not fetch or execute code.""" + +import posixpath + +from .adaptation_contracts import Intake, Residual +from .repository_capture import safe_path, verify_package + + +def plan_dependencies(package): + verify_package(package) + repo = package["repository"] + projection = repo.get("projection", {}) + roots: dict[str, list[str]] = {} + for gap in projection.get("gaps", []): + path = gap.get("path", "") + if gap.get("reason") != "MISSING_LOCAL_ASSET" or "node_modules" not in path.split("/"): + continue + safe_path(path) + parts = path.split("/") + index = parts.index("node_modules") + # Nested dependency resolution is not inferred from a flat local URL. + if parts.count("node_modules") != 1: + raise Residual("DEPENDENCY_NESTED_LAYOUT_UNSUPPORTED") + root = "/".join(parts[:index]) + roots.setdefault(root, []).append(path) + if not roots: + from .sass_assembly import linked_sass_entries + + styles = linked_sass_entries(package) + locked = all(p in repo['files'] for p in ('package.json', 'pnpm-lock.yaml')) + if locked or styles: + from .pnpm_discovery import discover_pnpm + + try: + names = discover_pnpm(package) + except ValueError as exc: + if str(exc) == 'PNPM_DECLARED_DEPENDENCY_METADATA_REQUIRED': + raise Residual('DEPENDENCY_DECLARED_METADATA_REQUIRED') from exc + raise + if names or styles: + return {'source_digest': package['digest'], 'groups': [{'lock_path': 'pnpm-lock.yaml' if locked else 'captured-styles-v1', + 'assets': names + styles, 'status': 'READY', 'absent': []}], 'capture_paths': []} + raise Residual("DEPENDENCY_NO_OBSERVED_ASSETS") + if len(roots) > 4: + raise Residual("DEPENDENCY_ROOT_BUDGET") + held = repo["files"] + attempted = set(projection.get("additional_local_paths", [])) + groups, capture = [], set() + for root, assets in sorted(roots.items()): + lock = posixpath.join(root, "package-lock.json") + metadata = [posixpath.join(root, "package.json"), lock] + missing = [p for p in metadata if p not in held] + absent = [p for p in missing if p in attempted] + status = "UNAVAILABLE" if absent else "CAPTURE_REQUIRED" if missing else "READY" + groups.append({"lock_path": lock, "assets": sorted(assets), "status": status, "absent": absent}) + if status == "CAPTURE_REQUIRED": + capture.update(missing) + paths = sorted(attempted | capture) + if len(paths) > 16: + raise Residual("DEPENDENCY_METADATA_PATH_BUDGET") + return {"source_digest": package["digest"], "groups": groups, "capture_paths": paths if capture else []} + + +def metadata_intake(evidence): + package = {"digest": evidence.content_digest, "repository": evidence.payload} + plan = plan_dependencies(package) + if not plan["capture_paths"]: + raise Residual("DEPENDENCY_NO_METADATA_CAPTURE_NEEDED") + repo = evidence.payload + return Intake( + source=repo["source"] + "/tree/" + repo["commit_sha"], + source_type="repository", + repository_scope="entry", + repository_entry=repo["entry"], + repository_assets=plan["capture_paths"], + build_counterpart=True, + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/entry_capture.py b/orbiters/chameleon/packages/core/chameleon_core/entry_capture.py new file mode 100644 index 0000000000000000000000000000000000000000..a6e8740efba3d8c8da05b976ea6830c1f9ade789 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/entry_capture.py @@ -0,0 +1,286 @@ +"""Explicit static-entry subset acquisition. Never installs or executes repository code.""" + +import base64 +import hashlib +import json +import posixpath +import re +from html.parser import HTMLParser +from urllib.parse import unquote, urlsplit + +from .adaptation_contracts import Residual +from .contracts import digest +from .db import now +from .repository_capture import ( + FILE_LIMIT, + TOTAL_LIMIT, + fetch_bytes, + safe_path, + target, + tree_files, + verify_package, +) + + +class References(HTMLParser): + def __init__(self): + super().__init__() + self.urls = [] + self.base = False + + def handle_starttag(self, tag, attrs): + attrs = dict(attrs) + if tag == "base": + self.base = True + if tag in {"script", "img", "source", "video", "audio", "iframe"} and attrs.get("src"): + self.urls.append(attrs["src"]) + if tag == "link" and attrs.get("href"): + self.urls.append(attrs["href"]) + + +def references(path, body): + suffix = posixpath.splitext(path)[1].lower() + if suffix not in {".html", ".htm", ".css"}: + return [] + text = body.decode("utf-8") + if suffix == ".css": + return [ + m[0] or m[1] + for m in re.findall(r"""url\(\s*['"]?([^)'"\s]+)['"]?\s*\)|@import\s+['"]([^'"]+)['"]""", text) + ] + parser = References() + parser.feed(text) + if parser.base: + raise Residual("ENTRY_BASE_URL_UNSUPPORTED") + return parser.urls + + +def capture_entry(source, entry, fetch=fetch_bytes, *, additional_paths=(), module_policy=None): + if module_policy is not None and (module_policy != 'relative-js-unique-v1' or not additional_paths): + raise Residual('REPOSITORY_MODULE_POLICY_INVALID') + if not isinstance(additional_paths, (list, tuple)) or len(additional_paths) > 16: + raise Residual("ENTRY_OBSERVED_ASSET_BUDGET") + for path in additional_paths: + safe_path(path) + owner, repo, ref = target(source) + if additional_paths and ref == "HEAD": + raise Residual("ENTRY_OBSERVED_ASSETS_REQUIRE_PINNED_SOURCE") + safe_path(entry) + endpoint = f"https://api.github.com/repos/{owner}/{repo}" + wire = reads = 0 + + def read(url, limit): + nonlocal wire, reads + if reads >= 64: + raise Residual("ENTRY_REQUEST_BUDGET") + reads += 1 + try: + data = fetch(url, limit) + except Residual: + # A failed bounded response still consumes the request/wire allowance. + wire += limit + 1 + if wire > 6 * 1024 * 1024: + raise Residual("ENTRY_WIRE_BUDGET") from None + raise + wire += len(data) + if len(data) > limit or wire > 6 * 1024 * 1024: + raise Residual("ENTRY_WIRE_BUDGET") + return json.loads(data) + + commit = read(endpoint + "/commits/" + ref, 524288) + sha, tree_sha = commit["sha"], commit["commit"]["tree"]["sha"] + if ( + not isinstance(sha, str) + or not isinstance(tree_sha, str) + or not re.fullmatch("[0-9a-f]{40}", sha) + or not re.fullmatch("[0-9a-f]{40}", tree_sha) + or (ref != "HEAD" and ref != sha) + ): + raise Residual("REPOSITORY_COMMIT_MISMATCH") + inventory_scope = "complete-repository-metadata" + try: + tree = read(endpoint + "/git/trees/" + tree_sha + "?recursive=1", 524288) + if tree.get("sha") != tree_sha: + raise Residual("REPOSITORY_TREE_SHA_MISMATCH") + inventory = tree_files(tree, metadata_only=True) + except Residual as exc: + if exc.code not in { + "REPOSITORY_WIRE_BUDGET", + "REPOSITORY_TREE_BUDGET", + "REPOSITORY_COMPLETE_TREE_REQUIRED", + "REPOSITORY_FILE_BYTE_BUDGET", + }: + raise + if module_policy: + raise Residual('MODULE_COMPLETE_INVENTORY_REQUIRED') from exc + from .entry_inventory import EntryInventory + + inventory = EntryInventory(endpoint, tree_sha, read) + inventory_scope = "visited-pinned-directories-only" + licenses = [p for p in inventory if re.fullmatch(r"(?i)(license|licence|copying)(?:\.(txt|md))?", p)] + if entry not in inventory or not entry.lower().endswith((".html", ".htm")): + raise Residual("REPOSITORY_PACKAGE_ENTRY_OR_LICENSE_MISSING") + resolved_paths, module_resolutions = [], [] + for path in additional_paths: + if module_policy and path not in inventory: + from .module_resolution import resolve_relative_import + + if inventory_scope != 'complete-repository-metadata': + raise Residual('MODULE_COMPLETE_INVENTORY_REQUIRED') + plan = resolve_relative_import('resolution.js', './' + path, inventory) + if plan['status'] != 'RESOLVED': + raise Residual('MODULE_' + plan['status']) + resolved_paths.append(plan['matches'][0]['path']) + module_resolutions.append(plan) + else: + resolved_paths.append(path) + pending = [(entry, 0)] + [(p, 0) for p in licenses] + [(p, 0) for p in resolved_paths] + files: dict[str, dict[str, str | int]] = {} + gaps, edges, total = [], [], 0 + while pending: + name, depth = pending.pop(0) + if name in files: + continue + if depth > 12 or len(files) >= 62: + raise Residual("ENTRY_DEPENDENCY_BUDGET") + if name not in inventory: + gaps.append({"path": name, "reason": "MISSING_LOCAL_ASSET"}) + continue + expected = inventory[name] + if expected['size'] > FILE_LIMIT: + raise Residual('REPOSITORY_FILE_BYTE_BUDGET') + blob = read(endpoint + "/git/blobs/" + expected["sha"], 750000) + if blob.get("encoding") != "base64": + raise Residual("ENTRY_BLOB_ENCODING") + body = base64.b64decode("".join(blob["content"].split()), validate=True) + if ( + len(body) != expected["size"] + or len(body) > FILE_LIMIT + or hashlib.sha1(f"blob {len(body)}\0".encode() + body).hexdigest() != expected["sha"] + ): + raise Residual("REPOSITORY_BLOB_DIGEST_MISMATCH") + total += len(body) + if total > TOTAL_LIMIT: + raise Residual("REPOSITORY_FILE_OR_TOTAL_BUDGET") + files[name] = { + "bytes": len(body), + "base64": base64.b64encode(body).decode(), + "sha256": hashlib.sha256(body).hexdigest(), + "git_blob_sha": expected["sha"], + } + for raw in references(name, body): + url = urlsplit(raw) + if url.scheme == "data" or (not url.path and not url.netloc): + continue + if url.scheme or url.netloc: + gaps.append({"from": name, "reference": raw[:500], "reason": "EXTERNAL_ASSET_NOT_FETCHED"}) + continue + path = unquote(url.path) + resolved = posixpath.normpath( + path.lstrip("/") if path.startswith("/") else posixpath.join(posixpath.dirname(name), path) + ) + safe_path(resolved) + edges.append({"from": name, "to": resolved}) + pending.append((resolved, depth + 1)) + notices = [] + if not licenses: + from .license_notices import inline_notices + notices = inline_notices({p: base64.b64decode(r['base64']) for p, r in files.items()}) + licenses = [n['path'] for n in notices] + if not licenses: + raise Residual('REPOSITORY_LICENSE_FILE_REQUIRED_FOR_PACKAGE') + payload = { + "version": "frozen-public-repository-v1", + "source": f"https://github.com/{owner}/{repo}", + "commit_sha": sha, + "tree_sha": tree_sha, + "entry": entry, + "captured_at": now().isoformat(), + "license_files": licenses, + "license_scope": "Preserved; compatibility not inferred", + **({'inline_license_notices': notices} if notices else {}), + "files": files, + "projection": { + "kind": "static-entry-subset-v1", + "additional_local_paths": list(additional_paths), + **({'module_policy': module_policy, 'module_resolutions': module_resolutions} if module_policy else {}), + "inventory_files": len(inventory), + "inventory_scope": inventory_scope, + "edges": edges, + "gaps": gaps, + "scope": "HTML src/link and CSS url/import only; JS dynamic imports, srcset and runtime assets not resolved", + }, + "acquisition": { + "external_reads": reads, + "wire_bytes": wire, + "file_bytes": total, + "source_writes": False, + "source_commands_executed": False, + }, + "behavior": {"status": "UNTESTED", "build_commands_executed": False, "dependencies_installed": False}, + } + package = {"digest": digest(payload), "repository": payload} + verify_package(package) + return package + + +def observed_local_assets(package, report): + """Extract proposals from trusted local browser receipts; never follow their URLs.""" + verify_package(package) + if report.get("package_digest") != package["digest"]: + raise Residual("ENTRY_OBSERVATION_SOURCE_MISMATCH") + blocked = report.get("blocked_requests", []) + if not isinstance(blocked, list) or len(blocked) > 50: + raise Residual("ENTRY_OBSERVATION_BUDGET") + paths = set(package["repository"].get("projection", {}).get("additional_local_paths", [])) + for item in blocked: + if item.get("kind") != "request" or item.get("origin") != "https://chameleon-package.invalid": + continue + path = item.get("path", "") + if not isinstance(path, str) or not path.startswith("/") or path.startswith("//"): + raise Residual("ENTRY_OBSERVED_PATH_INVALID") + parsed = urlsplit(path) + if parsed.query or parsed.fragment: + raise Residual("ENTRY_OBSERVED_PATH_INVALID") + name = unquote(parsed.path[1:]) + safe_path(name) + if name not in package["repository"]["files"]: + paths.add(name) + if len(paths) > 16: + raise Residual("ENTRY_OBSERVED_ASSET_BUDGET") + return sorted(paths) + + +def completion_paths(package, report): + """Do not repeat a capture whose pinned inventory already proved the gap.""" + paths = observed_local_assets(package, report) + payload = package["repository"] + missing = set(paths).difference(payload["files"]) + if not missing: + raise Residual("ENTRY_NO_NEW_LOCAL_ASSETS") + projection = payload.get("projection", {}) + absent = { + gap.get("path") for gap in projection.get("gaps", []) if gap.get("reason") == "MISSING_LOCAL_ASSET" + } + if missing.issubset(absent): + raise Residual("ENTRY_ASSETS_ABSENT_FROM_PINNED_SOURCE") + if missing.issubset(projection.get("additional_local_paths", [])): + raise Residual("ENTRY_ASSET_COMPLETION_STALLED") + return paths + + +def asset_completion_intake(evidence, report): + """Propose a fresh pinned job from an owned source and trusted supervisor report.""" + from .adaptation_contracts import Intake + + package = {"digest": evidence.content_digest, "repository": evidence.payload} + paths = completion_paths(package, report) + return Intake( + source=evidence.payload["source"] + "/tree/" + evidence.payload["commit_sha"], + source_type="repository", + repository_scope="entry", + repository_entry=evidence.payload["entry"], + repository_assets=paths, + build_counterpart=True, + objective="Discover what is possible", + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/entry_inventory.py b/orbiters/chameleon/packages/core/chameleon_core/entry_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..567c21bff50dc476e36bfd19a124039659dc615e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/entry_inventory.py @@ -0,0 +1,70 @@ +"""Lazy pinned-directory inventory for entry subsets of large repositories.""" + +import re + +from .adaptation_contracts import Residual +from .repository_capture import FILE_LIMIT, safe_path + + +class EntryInventory: + def __init__(self, endpoint, root_sha, read): + self.endpoint, self.read = endpoint, read + self.directories = {"": root_sha} + self.loaded, self.files = set(), {} + self.load("") + + def load(self, directory): + if directory in self.loaded: + return + sha = self.directories[directory] + tree = self.read(self.endpoint + "/git/trees/" + sha, 524288) + if tree.get("sha") != sha: + raise Residual("REPOSITORY_TREE_SHA_MISMATCH") + entries = tree.get("tree") + if tree.get("truncated") is not False or not isinstance(entries, list) or len(entries) > 512: + raise Residual("REPOSITORY_COMPLETE_TREE_REQUIRED") + seen = set() + for item in entries: + if not isinstance(item, dict): + raise Residual("REPOSITORY_TREE_INVALID") + name = safe_path(item.get("path")) + if "/" in name or name.casefold() in seen: + raise Residual("REPOSITORY_CASE_COLLISION") + seen.add(name.casefold()) + if not isinstance(item.get("sha"), str) or not re.fullmatch("[0-9a-f]{40}", item["sha"]): + raise Residual("REPOSITORY_BLOB_SHA_INVALID") + path = (directory + "/" if directory else "") + name + if item.get("type") == "tree" and item.get("mode") == "040000": + self.directories[path] = item["sha"] + else: + if item.get("type") != "blob" or item.get("mode") not in {"100644", "100755"}: + raise Residual("REPOSITORY_SYMLINK_OR_SUBMODULE_DENIED") + size = item.get("size") + if type(size) is not int or not 0 <= size <= 2**53: + raise Residual("REPOSITORY_FILE_BYTE_BUDGET") + self.files[path] = {"sha": item["sha"], "size": size, "mode": item["mode"]} + self.loaded.add(directory) + + def __contains__(self, name): + safe_path(name) + parts = name.split("/")[:-1] + if len(parts) > 24: + raise Residual("ENTRY_DEPENDENCY_BUDGET") + for length in range(1, len(parts) + 1): + directory = "/".join(parts[:length]) + if directory not in self.directories: + return False + self.load(directory) + return name in self.files + + def __getitem__(self, name): + item = self.files[name] + if item["size"] > FILE_LIMIT: + raise Residual("REPOSITORY_FILE_BYTE_BUDGET") + return item + + def __iter__(self): + return iter(self.files) + + def __len__(self): + return len(self.files) diff --git a/orbiters/chameleon/packages/core/chameleon_core/fetch_worker.py b/orbiters/chameleon/packages/core/chameleon_core/fetch_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..bda48e9ea8cefda4611f1b765ff01856a0fd0515 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/fetch_worker.py @@ -0,0 +1,30 @@ +"""Trusted bounded public-read subprocess. Input is a URL, never executable code.""" + +import json +import sys + +from .adaptation_contracts import Residual +from .intake import fetch_public_direct + + +def main(): + value = json.loads(sys.stdin.read(4096)) + try: + redirects: list[dict] = [] + body, media = fetch_public_direct(value["url"], redirects) + print( + json.dumps( + { + "body": body, + "media": media, + "redirects": redirects, + "final_url": redirects[-1]["to"] if redirects else value["url"], + } + ) + ) + except Residual as exc: + print(json.dumps({"error": exc.code})) + + +if __name__ == "__main__": + main() diff --git a/orbiters/chameleon/packages/core/chameleon_core/form_engine.py b/orbiters/chameleon/packages/core/chameleon_core/form_engine.py new file mode 100644 index 0000000000000000000000000000000000000000..5617163f045adaf2837041b49d084b770e26fb5d --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/form_engine.py @@ -0,0 +1,384 @@ +"""Evidence-bound read-form compiler, provider registry, executor and separate checks.""" + +import re +from collections import Counter +from decimal import Decimal, InvalidOperation, localcontext +from fractions import Fraction + +from . import oracle_spatial +from .adaptation_contracts import Evidence, FormStep, ProposalProvider, Residual, WorkingForm +from .contracts import canonical, digest + + +def tables(evidence: Evidence) -> dict[str, list[dict]]: + raw = {"data": evidence.payload} if evidence.kind == "dataset" else evidence.payload.get("tables", {}) + if not isinstance(raw, dict) or not 1 <= len(raw) <= 8: + raise Residual("TABLE_MAP_REQUIRED_MAX_8") + for name, rows in raw.items(): + if not isinstance(name, str) or len(name) > 120 or not isinstance(rows, list) or len(rows) > 1000: + raise Residual("INVALID_OR_OVERSIZED_TABLE") + if any(not isinstance(row, dict) or len(row) > 40 for row in rows): + raise Residual("TABLE_ROWS_REQUIRE_BOUNDED_OBJECTS") + if any( + not isinstance(k, str) or len(k) > 120 or isinstance(v, (dict, list)) + for row in rows + for k, v in row.items() + ): + raise Residual("SCALAR_TABLE_FIELDS_REQUIRED") + return raw + + +def columns(rows): + return sorted({k for row in rows for k in row}) + + +def profile(evidence: Evidence): + value, kind = evidence.payload, evidence.kind + if kind in {"dataset", "database_snapshot"}: + return { + "kind": kind, + "tables": { + name: {"rows": len(rows), "columns": columns(rows), "sample": rows[:3]} + for name, rows in tables(evidence).items() + }, + } + if kind == "website": + return {"kind": kind, **value, "linked_pages_fetched": 0} + if kind == "repository": + from .repository_artifact import repository_profile + + return repository_profile(evidence) + if kind == "api_spec": + paths = value.get("paths", {}) + if not isinstance(value.get("info", {}), dict): + raise Residual("INVALID_API_INFO") + if not isinstance(paths, dict) or len(paths) > 100: + raise Residual("API_PATH_BUDGET_OR_SCHEMA") + operations = [] + for path, methods in paths.items(): + if not isinstance(methods, dict): + raise Residual("INVALID_API_PATH_ITEM") + for method, spec in methods.items(): + if method.lower() in { + "get", + "post", + "put", + "patch", + "delete", + "head", + "options", + } and isinstance(spec, dict): + operations.append( + { + "path": path, + "method": method.upper(), + "operation_id": spec.get("operationId"), + "authority": "declared_only", + "execution_enabled": False, + } + ) + return { + "kind": kind, + "title": value.get("info", {}).get("title"), + "operations": operations, + "operations_executed": 0, + } + if kind == "server_snapshot": + if not isinstance(value.get("services"), list): + raise Residual("SERVICE_RECORDS_REQUIRED") + return { + "kind": kind, + "services": value["services"], + "fields": sorted(value), + "authority": "supplied_snapshot_not_live_probe", + } + if kind == "spatial": + return { + "kind": kind, + "premises": value.get("premises"), + "reasoning_scope": "conditional_on_supplied_premises", + } + return {"kind": kind, "fields": sorted(value), "values": value} + + +def bind_column(name: str, available: list[str]): + matches = [x for x in available if x.casefold() == name.strip().casefold()] + if len(matches) != 1: + raise Residual("FIELD_MISSING_OR_AMBIGUOUS") + return matches[0] + + +class StructuralProvider: + version = "structural-v1" + + def propose(self, evidence: Evidence, objective: str) -> dict: + steps = [FormStep(id="inspect", operation="profile")] + q = objective.strip() + if q.casefold() not in {"", "discover what is possible", "inspect", "profile", "describe structure"}: + if evidence.kind == "spatial" and self.version in {"chameleon-local-v1", "oracle7-adapted-v1"}: + if oracle_spatial.question(q, allow_route=True) is None: + raise Residual("SPATIAL_QUESTION_NOT_BOUND") + steps.append(FormStep(id="reason", operation="spatial_reason")) + elif evidence.kind in {"dataset", "database_snapshot"}: + choices = tables(evidence) + query, table_name = q, None + split = re.fullmatch(r"(.+?)\s+in\s+(.+)", q, re.IGNORECASE) + if split: + query, table_name = split.groups() + table_name = bind_column(table_name, list(choices)) + if table_name is None: + if len(choices) != 1: + raise Residual("SELECT_TABLE_WITH_IN_TABLE_NAME") + table_name = next(iter(choices)) + if query.casefold() in {"count", "count rows"}: + steps.append(FormStep(id="calculate", operation="count", table=table_name)) + else: + m = re.fullmatch(r"(sum|mean|average|group by)\s+(.+)", query, re.IGNORECASE) + if not m: + raise Residual("OBJECTIVE_NOT_BOUND_SUPPORTED_COUNT_SUM_MEAN_GROUP_BY") + field = bind_column(m[2], columns(choices[table_name])) + operation = {"sum": "sum", "mean": "mean", "average": "mean", "group by": "group_count"}[ + m[1].lower() + ] + steps.append( + FormStep.model_validate( + {"id": "calculate", "operation": operation, "table": table_name, "field": field} + ) + ) + else: + raise Residual("OBJECTIVE_REQUIRES_UNIMPLEMENTED_OPERATOR") + return WorkingForm( + source_kind=evidence.kind, + evidence_digest=evidence.content_digest, + objective=objective, + provider=self.version, + steps=steps, + ).model_dump() + + +class OracleProvider(StructuralProvider): + version = "chameleon-local-v1" + + +class LegacyLocalProvider(OracleProvider): + """Read previously queued jobs without rewriting their recorded provider identity.""" + + version = "oracle7-adapted-v1" + + +class ProviderRegistry: + """Trusted startup registration; no dynamic module or credential selection by a visitor.""" + + def __init__(self): + self.providers: dict[str, ProposalProvider] = { + p.version: p for p in (StructuralProvider(), OracleProvider(), LegacyLocalProvider()) + } + + def register(self, provider: ProposalProvider): + if provider.version in self.providers: + raise ValueError("provider version is already registered") + self.providers[provider.version] = provider + + def compile(self, evidence: Evidence, objective: str, provider_id: str) -> WorkingForm: + provider = self.providers.get(provider_id) + if not provider: + raise Residual("PROVIDER_UNCONFIGURED") + raw = provider.propose(evidence, objective) + try: + form = WorkingForm.model_validate(raw) + except (TypeError, ValueError) as exc: + raise Residual("PROVIDER_INVALID_FORM") from exc + if (form.evidence_digest, form.source_kind, form.objective, form.provider) != ( + evidence.content_digest, + evidence.kind, + objective, + provider_id, + ): + raise Residual("PROVIDER_BINDING_MISMATCH") + # Re-bind the requested operation independently of provider output. A provider cannot + # substitute a different supported task just because the output schema permits it. + binder = OracleProvider() if provider_id != "structural-v1" else StructuralProvider() + expected = WorkingForm.model_validate(binder.propose(evidence, objective)) + if [s.model_dump() for s in form.steps] != [s.model_dump() for s in expected.steps]: + raise Residual("PROVIDER_CHANGED_REQUESTED_TASK") + return form + + +def numeric(rows, field): + if any(field not in row or isinstance(row[field], bool) or row[field] is None for row in rows): + raise Residual("MISSING_OR_NONNUMERIC_VALUE") + if any(len(str(row[field])) > 80 for row in rows): + raise Residual("NUMERIC_RANGE_EXCEEDED") + try: + values = [Decimal(str(row[field])) for row in rows] + except InvalidOperation as exc: + raise Residual("MISSING_OR_NONNUMERIC_VALUE") from exc + for x in values: + exponent = x.as_tuple().exponent + if ( + not x.is_finite() + or not isinstance(exponent, int) + or not -30 <= exponent <= 30 + or abs(x) > Decimal("1e30") + ): + raise Residual("NUMERIC_RANGE_EXCEEDED") + return values + + +def execute(form: WorkingForm, evidence: Evidence): + if digest(evidence.payload) != evidence.content_digest or form.evidence_digest != evidence.content_digest: + raise Residual("EVIDENCE_DIGEST_MISMATCH") + result = {"profile": profile(evidence), "answer": None} + for step in form.steps[1:]: + if step.operation == "spatial_reason": + result["answer"] = oracle_spatial.reason( + {"request": form.objective, "context": evidence.payload, "mode": "plan"} + ) + if result["answer"]["status"] != "answered": + raise Residual(result["answer"]["residual"]["kind"]) + else: + if step.table is None: + raise Residual("TABLE_BINDING_REQUIRED") + rows = tables(evidence)[step.table] + if step.operation == "count": + result["answer"] = len(rows) + elif step.operation == "group_count": + if any(step.field not in row for row in rows): + raise Residual("GROUP_FIELD_MISSING") + result["answer"] = dict(Counter(canonical(row[step.field]) for row in rows)) + else: + values = numeric(rows, step.field) + if step.operation == "mean" and not values: + raise Residual("MEAN_OF_EMPTY_COLLECTION") + with localcontext() as context: + context.prec = 80 + total = sum(values, Decimal(0)) + result["answer"] = str(total if step.operation == "sum" else total / len(values)) + return result + + +def verify(form: WorkingForm, evidence: Evidence, result: dict) -> bool: + """Separate result checks; spatial proofs are replayed, not planned again.""" + if ( + digest(evidence.payload) != form.evidence_digest + or result.get("profile", {}).get("kind") != evidence.kind + ): + return False + p = result["profile"] + if evidence.kind in {"dataset", "database_snapshot"}: + if set(p.get("tables", {})) != set(tables(evidence)): + return False + for name, rows in tables(evidence).items(): + found = p.get("tables", {}).get(name, {}) + if ( + found.get("rows") != len(rows) + or found.get("columns") != sorted({k for row in rows for k in row}) + or found.get("sample") != rows[:3] + ): + return False + elif evidence.kind == "repository": + import hashlib + + from .repository_artifact import checked_files + + files = checked_files(evidence) + raw = evidence.payload + # Recompute byte/hash/count claims rather than accepting a provider's inventory. + expected = { + "kind": "repository", + "source": raw["source"], + "commit_sha": raw["commit_sha"], + "tree_sha": raw["tree_sha"], + "entry": raw["entry"], + "file_count": len(files), + "capture_scope": "entry" if raw.get("projection") else "full", + "projection": raw.get("projection"), + "file_bytes": sum(len(body) for body in files.values()), + "license_files": raw["license_files"], + "files": [ + {"path": path, "bytes": len(body), "sha256": hashlib.sha256(body).hexdigest()} + for path, body in sorted(files.items()) + ], + "behavior_status": "UNTESTED", + "source_writes": False, + "source_commands_executed": False, + } + if p != expected: + return False + elif evidence.kind == "website": + if p.get("linked_pages_fetched") != 0 or any( + p.get(k) != value for k, value in evidence.payload.items() + ): + return False + elif evidence.kind == "api_spec": + expected_ops = { + (path, method.upper(), spec.get("operationId")) + for path, methods in evidence.payload.get("paths", {}).items() + for method, spec in methods.items() + if method.lower() in {"get", "post", "put", "patch", "delete", "head", "options"} + and isinstance(spec, dict) + } + actual = {(row["path"], row["method"], row["operation_id"]) for row in p.get("operations", [])} + if ( + expected_ops != actual + or p.get("operations_executed") != 0 + or any(row["execution_enabled"] for row in p["operations"]) + or any(row["authority"] != "declared_only" for row in p["operations"]) + ): + return False + elif ( + evidence.kind == "server_snapshot" + and p.get("services") != evidence.payload.get("services") + or evidence.kind == "document" + and p.get("values") != evidence.payload + or evidence.kind == "spatial" + and p.get("premises") != evidence.payload.get("premises") + ): + return False + if len(form.steps) == 1: + return result.get("answer") is None + step, answer = form.steps[-1], result.get("answer") + if step.operation == "spatial_reason": + if not isinstance(answer, dict): + return False + frame, error = oracle_spatial.construct( + {"request": form.objective, "context": evidence.payload}, + allow_route=True, + max_hops=16, + max_states=256, + ) + return ( + not error + and frame == answer.get("frame") + and oracle_spatial.consistency(frame) is None + and oracle_spatial.validate(frame, answer.get("proof", {})) + and answer.get("final_answer") == answer.get("proof", {}).get("answer") + ) + if step.table is None: + return False + rows = tables(evidence)[step.table] + if step.operation == "count": + return type(answer) is int and answer == sum(1 for _ in rows) + if step.operation == "group_count": + expected_groups: dict[str, int] = {} + for row in rows: + k = canonical(row[step.field]) + expected_groups[k] = expected_groups.get(k, 0) + 1 + return answer == expected_groups + # Independent rational accumulation catches cancellation and small absolute errors. + # Mean uses a declared 80-significant-digit decimal representation, not binary floats. + numeric(rows, step.field) + try: + if not isinstance(answer, str) or len(answer) > 150: + return False + exact = sum((Fraction(str(row[step.field])) for row in rows), Fraction(0)) + if step.operation == "sum": + return Fraction(answer) == exact + if not rows: + return False + exact /= len(rows) + with localcontext() as context: + context.prec = 80 + return Decimal(answer) == Decimal(exact.numerator) / Decimal(exact.denominator) + except (ValueError, TypeError, InvalidOperation, ZeroDivisionError): + return False diff --git a/orbiters/chameleon/packages/core/chameleon_core/image_sources.py b/orbiters/chameleon/packages/core/chameleon_core/image_sources.py new file mode 100644 index 0000000000000000000000000000000000000000..ebf30f5cff463e7f7467678706166df2e9daad0b --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/image_sources.py @@ -0,0 +1,24 @@ +"""Bounded responsive-image candidates; no script evaluation or URL fetching.""" +import re + + +def srcset_candidates(value): + if not isinstance(value, str) or len(value) > 16384: + return [] + result = [] + # Data URLs contain commas: leave those to the ordinary src handler. + if 'data:' in value.lower(): + return result + # A URL token can contain commas (e.g. ?resize=300,160). Candidate + # delimiters follow a descriptor or terminate a descriptorless URL. + items = re.findall(r'\S+(?:\s+[^,]+)?(?:,|$)', value) + for item in items[:32]: + item = item.rstrip(',').strip() + fields = item.split() + if not 1 <= len(fields) <= 2: + continue + descriptor = fields[1] if len(fields) == 2 else '' + if descriptor and not re.fullmatch(r'(?:[1-9][0-9]*w|(?:[0-9]+(?:\.[0-9]+)?)x)', descriptor): + continue + result.append((fields[0], descriptor)) + return result diff --git a/orbiters/chameleon/packages/core/chameleon_core/inert_svg.py b/orbiters/chameleon/packages/core/chameleon_core/inert_svg.py new file mode 100644 index 0000000000000000000000000000000000000000..6bcf96c9d61d33461d06989aee72237965d870ff --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/inert_svg.py @@ -0,0 +1,70 @@ +"""Validate a small passive SVG subset for use only as an image data URL.""" +import re +import xml.etree.ElementTree as ET +from .adaptation_contracts import Residual + +def validate_svg(data): + original=data + # Remove this inert declaration without resolving its external DTD. + data=data.replace(b'',b'') + if len(data)>262144 or re.search(br'4096 or root.tag.split('}')[-1]!='svg': raise Residual('SVG_UNSAFE_OR_COMPLEX') + normalized=data!=original + for node in nodes: + # Badges wrap passive text in links. Retain the artwork, never the link. + if node.tag.split('}')[-1]=='a': + node.tag=node.tag[:-1]+'g' + for key in list(node.attrib): + if key.split('}')[-1].lower() in {'href','target','rel'}: + del node.attrib[key] + normalized=True + if node.tag.split('}')[-1] not in allowed: raise Residual('SVG_ACTIVE_CONTENT') + if 'style' in node.attrib: + rules={ + 'fill':r'#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?', + 'shape-rendering':r'(?:crispedges|crispEdges|geometricPrecision|auto)', + 'text-anchor':r'(?:start|middle|end)', + 'text-align':r'(?:left|right|center|start|end)', + 'font-family':r"[A-Za-z0-9 ,_'\"-]{1,256}", + 'white-space':r'(?:normal|nowrap|pre)', + 'font-size':r'\d{1,3}(?:\.\d{1,3})?(?:px|pt)?', + 'display':r'(?:none|inline|block)', + } + declarations={} + # Vector editors attach these inert default declarations to paths. + # Strip exact defaults only; unknown values still fail closed. + path_defaults = { + 'line-height': 'normal', 'font-variant-ligatures': 'normal', + 'font-variant-position': 'normal', 'font-variant-caps': 'normal', + 'font-variant-numeric': 'normal', 'font-variant-alternates': 'normal', + 'font-variant-east-asian': 'normal', 'font-feature-settings': 'normal', + 'font-variation-settings': 'normal', 'text-indent': '0', + 'text-decoration-line': 'none', 'text-decoration-style': 'solid', + 'text-decoration-color': '#000', 'text-transform': 'none', + 'text-orientation': 'mixed', 'shape-padding': '0', + 'shape-margin': '0', 'inline-size': '0', 'isolation': 'auto', + 'mix-blend-mode': 'normal', 'solid-color': '#000', 'solid-opacity': '1', + } + for declaration in node.attrib['style'].split(';'): + if not declaration.strip(): continue + key,sep,value=declaration.partition(':') + key,value=key.strip(),value.strip() + if sep and node.tag.split('}')[-1] == 'path' and path_defaults.get(key) == value: + continue + if not sep or key not in rules or not re.fullmatch(rules[key],value): + raise Residual('SVG_ACTIVE_CONTENT') + declarations[key]=value + del node.attrib['style'] + node.attrib.update(declarations) + normalized=True + for key,value in node.attrib.items(): + key=key.split('}')[-1].lower() + if key.startswith('on') or key in {'href','src','style'}: raise Residual('SVG_ACTIVE_CONTENT') + if re.search(r'url\(',value,re.I) and not re.fullmatch(r'url\(#[A-Za-z_][\w.-]*\)',value): + raise Residual('SVG_EXTERNAL_REFERENCE') + return ET.tostring(root,encoding='utf-8') if normalized else data diff --git a/orbiters/chameleon/packages/core/chameleon_core/intake.py b/orbiters/chameleon/packages/core/chameleon_core/intake.py new file mode 100644 index 0000000000000000000000000000000000000000..13d11967bed7977befd2480f6ece142ad120d4ef --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/intake.py @@ -0,0 +1,514 @@ +"""Bounded evidence acquisition. No credentials, redirects, crawling or target writes.""" + +import csv +import http.client +import io +import ipaddress +import json +import math +import os +import socket +import ssl +import subprocess +import sys +import zlib +from pathlib import Path +from typing import Any, Literal +from urllib.parse import quote, urlsplit, urlunsplit + +from .adaptation_contracts import Evidence, Residual +from .contracts import digest +from .db import now +from .website import Page, page_url + +LIMIT = 524288 +LIVE_EXAMPLES = [ + { + "source": "https://github.com/gabrielecirulli/2048/tree/478b6ec346e3787f589e4af751378d06ded4cbbc", + "label": "2048, from its original source", + "objective": "Discover what is possible", + "description": "Preserve an exact public revision, inspect its files and download the attributed source package. This capture does not execute or verify the game.", + "origin": "public_repository", + "source_type": "repository", + }, + { + "source": "https://books.toscrape.com/", + "label": "A real book catalogue", + "objective": "Discover what is possible", + "description": "Capture Books to Scrape, read its catalogue and follow observed category links. Public demo prices, not a real shop.", + "origin": "public_demo", + }, + { + "source": "https://quotes.toscrape.com/", + "label": "A browsable quotation library", + "objective": "Discover what is possible", + "description": "Turn Quotes to Scrape into a saved, searchable reader. Follow an author or the next page.", + "origin": "public_demo", + }, + { + "source": "https://www.python.org/about/", + "label": "Python’s public website", + "objective": "Discover what is possible", + "description": "Read an actual project website in Chameleon. Capture linked pages into the same workspace.", + "origin": "public_website", + }, + { + "source": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.csv", + "label": "Earthquakes in the past hour", + "objective": "count rows", + "description": "Read the current USGS CSV feed. Open a local table, filter observations and query the captured data.", + "origin": "live_public_data", + }, +] +EXAMPLES: dict[str, dict[str, Any]] = { + "example://inventory": { + "label": "Inventory dataset", + "objective": "sum stock", + "description": "Discover columns and calculate a checked total.", + "data": [ + {"item": "sensor", "stock": 12, "category": "parts"}, + {"item": "cable", "stock": 31, "category": "parts"}, + {"item": "case", "stock": 8, "category": "housing"}, + ], + }, + "example://explorer": { + "label": "Chameleon route reasoning", + "objective": "How do you go from studio to garden?", + "description": "Use Chameleon's reasoning kernel and inspect its edge witnesses.", + "data": { + "premises": [ + "Atrium is north of studio.", + "Library is east of atrium.", + "Garden is north of library.", + ] + }, + }, + "example://website": { + "label": "Website snapshot", + "objective": "Discover what is possible", + "description": "Extract a page's declared structure without clicking actions.", + "data": "Field Notes

Community observatory

Projects

ProjectsContact", + }, + "example://database": { + "label": "Database snapshot", + "objective": "count rows", + "description": "Inspect a supplied table snapshot, not a live database connection.", + "data": { + "tables": {"observations": [{"station": "north", "value": 17}, {"station": "south", "value": 21}]} + }, + }, + "example://server": { + "label": "Server status snapshot", + "objective": "Discover what is possible", + "description": "Inspect supplied service states; no shell or server access.", + "data": { + "services": [{"name": "api", "state": "running"}, {"name": "queue", "state": "degraded"}], + "cpu_percent": 24, + "memory_percent": 48, + }, + }, + "example://api": { + "label": "API specification", + "objective": "Discover what is possible", + "description": "Inspect declared operations; no API operation is executed.", + "data": { + "openapi": "3.0.3", + "info": {"title": "Observation API", "version": "1.0"}, + "paths": { + "/observations": { + "get": { + "operationId": "listObservations", + "responses": {"200": {"description": "Read observations"}}, + }, + "post": { + "operationId": "addObservation", + "responses": {"201": {"description": "Created"}}, + }, + } + }, + }, + }, +} + + +def public_address(value: str) -> bool: + addr = ipaddress.ip_address(value) + return addr.is_global and not (addr.is_multicast or addr.is_reserved or addr.is_unspecified) + + +def checked_url(source: str, resolver=socket.getaddrinfo): + try: + u = urlsplit(source) + if u.scheme != "https" or not u.hostname or u.username or u.password or u.port not in (None, 443): + raise Residual("PUBLIC_HTTPS_URL_REQUIRED") + host = u.hostname.encode("idna").decode("ascii") + if host.endswith(".") or any(c.isspace() for c in source) or "\\" in source: + raise Residual("INVALID_URL") + addresses = sorted({row[4][0] for row in resolver(host, 443, type=socket.SOCK_STREAM)}) + if not addresses or any(not public_address(ip) for ip in addresses): + raise Residual("PRIVATE_OR_RESERVED_NETWORK_DENIED") + path = quote(u.path or "/", safe="/%:@!$&'()*+,;=-._~") + if u.query: + path += "?" + quote(u.query, safe="/%?:@!$&'()*+,;=-._~") + return host, addresses[0], path + except (ValueError, UnicodeError, OSError) as exc: + if isinstance(exc, Residual): + raise + raise Residual("URL_OR_DNS_INVALID") from exc + + +class PinnedHTTPS(http.client.HTTPSConnection): + def __init__(self, host, address): + super().__init__(host, timeout=5) + self.address = address + + def connect(self): + raw = socket.create_connection((self.address, 443), timeout=5) + try: + context = ssl.create_default_context() + context.set_alpn_protocols(["http/1.1"]) + self.sock = context.wrap_socket(raw, server_hostname=self.host) + except BaseException: + raw.close() + raise + + +def fetch_public_direct(source: str, redirects: list | None = None): + host, address, path = checked_url(source) + connection = PinnedHTTPS(host, address) + try: + connection.request( + "GET", + path, + headers={ + "Host": host, + "User-Agent": "Chameleon-ReadOnly-Preview/0.2", + "Accept": "application/json,text/html,text/csv,text/plain", + "Accept-Encoding": "identity", + }, + ) + response = connection.getresponse() + if 300 <= response.status < 400: + if redirects is None: + raise Residual("REDIRECT_NOT_FOLLOWED_USE_FINAL_PUBLIC_URL") + location = response.getheader("Location", "") + advertised = location + # Try only a same-host HTTPS equivalent, never an HTTP read. + try: + parsed = urlsplit(location) + if ( + parsed.scheme == "http" + and parsed.hostname == urlsplit(source).hostname + and parsed.port in (None, 80) + and not parsed.username + and not parsed.password + and not any(c.isspace() for c in location) + and "\\" not in location + ): + location = urlunsplit(("https", urlsplit(source).netloc, parsed.path, parsed.query, "")) + except ValueError: + raise Residual("SOURCE_REDIRECT_OUTSIDE_ORIGIN") from None + target = page_url(source, location) if location and len(location) <= 2048 else None + if not target or urlsplit(target).netloc != urlsplit(source).netloc: + raise Residual("SOURCE_REDIRECT_OUTSIDE_ORIGIN") + if len(redirects) >= 3 or target == source or any(h["from"] == target for h in redirects): + raise Residual("SOURCE_REDIRECT_LOOP_OR_BUDGET") + if response.status not in {301, 302, 303, 307, 308}: + raise Residual("SOURCE_REDIRECT_STATUS_NOT_SUPPORTED") + hop = {"from": source, "to": target, "status": response.status} + if advertised != location: + hop["advertised_target"] = advertised + hop["https_upgrade"] = True + redirects.append(hop) + connection.close() + # No cookie/auth propagation; every hop repeats DNS validation and TLS pinning. + return fetch_public_direct(target, redirects) + if response.status != 200: + raise Residual("SOURCE_HTTP_" + str(response.status)) + data = response.read(LIMIT + 1) + if len(data) > LIMIT: + raise Residual("SOURCE_BYTE_BUDGET_EXCEEDED") + data = decode_transfer(data, response.getheader("Content-Encoding", "identity")) + return data.decode("utf-8-sig"), response.getheader("Content-Type", "").split(";")[0] + except (OSError, http.client.HTTPException, UnicodeError) as exc: + raise Residual("SOURCE_UNAVAILABLE_OR_NOT_UTF8") from exc + finally: + connection.close() + + +def fetch_asset_direct(source: str, *, script_resources: bool = False, catalogue_assets: bool = False): + """Bounded binary/CSS read, used only by the isolated visual capture helper.""" + host, address, path = checked_url(source) + connection = PinnedHTTPS(host, address) + try: + connection.request( + "GET", + path, + headers={ + "Host": host, + "User-Agent": "Chameleon-ReadOnly-Preview/0.3", + "Accept": "text/javascript,application/javascript,text/css" if script_resources else "text/css,image/webp,image/png,image/jpeg,image/*;q=0.8,font/*;q=0.8", + "Accept-Encoding": "identity", + }, + ) + response = connection.getresponse() + if response.status != 200: + raise Residual( + "ASSET_REDIRECT_NOT_FOLLOWED" + if 300 <= response.status < 400 + else "ASSET_HTTP_" + str(response.status) + ) + media = response.getheader("Content-Type", "").split(";")[0].strip().lower() + asset_limit = 2097152 if media in {"image/jpeg", "image/png", "image/webp"} else LIMIT if media == "text/css" else 262144 + if catalogue_assets and not script_resources: + if media in {"image/jpeg", "image/png", "image/webp"}: + asset_limit = 8388608 + elif media in {"font/ttf", "font/otf", "font/woff", "font/woff2", "application/x-font-ttf", "font/truetype", "application/octet-stream"}: + asset_limit = 2097152 + data = response.read(asset_limit + 1) + if len(data) > asset_limit: + raise Residual("ASSET_BYTE_BUDGET") + data = decode_transfer(data, response.getheader("Content-Encoding", "identity"), limit=asset_limit) + if len(data) > asset_limit: + raise Residual("ASSET_BYTE_BUDGET") + return data, media + except (OSError, http.client.HTTPException) as exc: + raise Residual("ASSET_UNAVAILABLE") from exc + finally: + connection.close() + + +def decode_transfer(data: bytes, encoding: str, *, limit: int = LIMIT) -> bytes: + """Bound compressed input AND decompressed output; never unbounded gzip.decompress.""" + if len(data) > limit: + raise Residual("SOURCE_BYTE_BUDGET_EXCEEDED") + encoding = encoding.strip().lower() + if encoding in {"", "identity"}: + return data + if encoding != "gzip": + raise Residual("ENCODED_BODY_UNSUPPORTED") + try: + decoder = zlib.decompressobj(16 + zlib.MAX_WBITS) + plain = decoder.decompress(data, limit + 1) + if len(plain) > limit or decoder.unconsumed_tail: + raise Residual("SOURCE_BYTE_BUDGET_EXCEEDED") + if not decoder.eof or decoder.unused_data: + raise Residual("SOURCE_GZIP_INVALID_OR_MULTIPART") + return plain + except zlib.error as exc: + raise Residual("SOURCE_GZIP_INVALID_OR_MULTIPART") from exc + + +class FetchedText(str): + final_url: str + redirects: list + + +def fetch_public(source: str): + # A process boundary puts an overall deadline around DNS, headers and slow bodies. + # Only this trusted intake helper runs, never code supplied by a target or provider. + environment = dict(os.environ) + environment["PYTHONPATH"] = str(Path(__file__).resolve().parents[1]) + try: + result = subprocess.run( + [sys.executable, "-m", "chameleon_core.fetch_worker"], + input=json.dumps({"url": source}), + text=True, + capture_output=True, + timeout=12, + check=False, + env=environment, + ) + except subprocess.TimeoutExpired as exc: + raise Residual("SOURCE_WALL_TIME_BUDGET_EXCEEDED") from exc + if result.returncode: + raise Residual("SOURCE_FETCH_WORKER_FAILED") + data = json.loads(result.stdout) + if data.get("error"): + raise Residual(data["error"]) + body = FetchedText(data["body"]) + body.final_url = data.get("final_url", source) + body.redirects = data.get("redirects", []) + return body, data["media"] + + +def finite_depth(value, depth=0): + if depth > 16: + raise Residual("SOURCE_NESTING_EXCEEDED") + if isinstance(value, float) and not math.isfinite(value): + raise Residual("NONFINITE_JSON") + if isinstance(value, dict): + if len(value) > 1000: + raise Residual("SOURCE_OBJECT_BUDGET_EXCEEDED") + for item in value.values(): + finite_depth(item, depth + 1) + if isinstance(value, list): + if len(value) > 1000: + raise Residual("SOURCE_COLLECTION_BUDGET_EXCEEDED") + for item in value: + finite_depth(item, depth + 1) + + +def unique_object(pairs): + result = {} + for key, value in pairs: + if key in result: + raise Residual("DUPLICATE_JSON_KEY") + result[key] = value + return result + + +def decode(text: str, media: str): + if len(text.encode()) > LIMIT: + raise Residual("SOURCE_BYTE_BUDGET_EXCEEDED") + try: + if media == "text/csv": + reader = csv.DictReader(io.StringIO(text)) + if not reader.fieldnames or len(set(reader.fieldnames)) != len(reader.fieldnames): + raise Residual("CSV_UNIQUE_HEADERS_REQUIRED") + value = list(reader) + elif media == "text/html" or text.lstrip().startswith((" 4 or int(token) >= len(selected): + raise Residual("JSON_TABLE_POINTER_NOT_FOUND") + selected = selected[int(token)] + else: + raise Residual("JSON_TABLE_POINTER_NOT_FOUND") + if not isinstance(selected, list) or len(selected) > 1000: + raise Residual("JSON_TABLE_ARRAY_REQUIRED") + for row in selected: + if not isinstance(row, dict) or len(row) > 40: + raise Residual("TABLE_ROWS_REQUIRE_BOUNDED_OBJECTS") + if any(len(key) > 120 or isinstance(value, (dict, list)) for key, value in row.items()): + raise Residual("SCALAR_TABLE_FIELDS_REQUIRED") + return { + "tables": {"selected": selected}, + "source_document": document, + "selection": {"json_pointer": pointer, "transform": "explicit-json-table-v1"}, + } + + +def acquire( + source: str, + text: str | None = None, + presentation: str = "reader", + source_type: str = "web", + repository_entry: str | None = None, + repository_scope: str = "full", + repository_assets: list[str] | None = None, + module_policy: str | None = None, + build_importer: str | None = None, + table_pointer: str | None = None, +) -> Evidence: + if source_type == "repository": + from .repository_artifact import acquire_repository + + if text is not None or presentation != "reader" or table_pointer is not None: + raise Residual("REPOSITORY_INTAKE_CONTRACT_REQUIRED") + return acquire_repository( + source, + repository_entry or "index.html", + scope=repository_scope, + additional_paths=repository_assets or [], + **({'module_policy': module_policy} if module_policy else {}), + **({'build_importer': build_importer} if build_importer else {}), + ) + if ( + source_type != "web" + or repository_entry is not None + or repository_scope != "full" + or repository_assets + or module_policy + or build_importer + ): + raise Residual("UNSUPPORTED_SOURCE_TYPE") + authority: Literal["synthetic_fixture", "user_supplied", "public_snapshot"] + if source in EXAMPLES: + value = EXAMPLES[source]["data"] + body = value if isinstance(value, str) else json.dumps(value) + media, authority, reads = "", "synthetic_fixture", 0 + elif source in {"inline://json", "inline://csv", "inline://html"} and text: + body, media, authority, reads = ( + text, + {"inline://csv": "text/csv", "inline://html": "text/html"}.get(source, ""), + "user_supplied", + 0, + ) + elif source.startswith("https://") and text is None: + body, media = fetch_public(source) + authority, reads = "public_snapshot", 1 + len(getattr(body, "redirects", [])) + else: + raise Residual("UNSUPPORTED_SOURCE_USE_PUBLIC_HTTPS_OR_INLINE_DATA") + kind, payload = decode(body, media) + if table_pointer is not None: + if presentation != "reader" or media in {"text/html", "text/csv"} or kind == "website": + raise Residual("JSON_TABLE_SELECTION_REQUIRES_JSON") + payload = select_json_table(payload, table_pointer) + kind = "database_snapshot" + resolved = getattr(body, "final_url", source) + if kind == "website" and resolved != source: + payload["document_base_url"] = resolved + payload["fetch_redirects"] = getattr(body, "redirects", []) + received = len(body.encode()) + if presentation == "preserve": + if kind != "website": + raise Residual("SOURCE_STYLE_REQUIRES_WEBSITE") + from .visual_capture import capture + + payload["visual"] = capture(resolved, body, authority == "public_snapshot") + received += payload["visual"].get("asset_bytes_received", payload["visual"]["asset_bytes_stored"]) + reads += payload["visual"]["asset_fetch_attempts"] + return Evidence( + source=source, + kind=kind, + content_digest=digest(payload), + captured_at=now().isoformat(), + payload=payload, + bytes_received=received, + external_reads=reads, + authority=authority, + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/interaction_replay.py b/orbiters/chameleon/packages/core/chameleon_core/interaction_replay.py new file mode 100644 index 0000000000000000000000000000000000000000..054c68ba71fa81eb93ffbc939da1340660d9a180 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/interaction_replay.py @@ -0,0 +1,58 @@ +"""Compile a bounded observed-control replay; no target code executes here.""" + +from .browser_contract import validate_contract +from .contracts import digest +from .service import Failure + + +def replay_contract(receipt, request, *, allow_dependencies=False, allow_overlay=False): + if not isinstance(request, dict) or set(request) != {"control", "actions", "expect"}: + raise Failure("REPLAY_REQUEST_INVALID", 422) + if receipt.get("overlay_digest") is not None and not allow_overlay: + raise Failure("REPLAY_DERIVED_SOURCE_NOT_SUPPORTED", 422) + if receipt.get("dependency_digest") is not None and not allow_dependencies: + raise Failure("REPLAY_DEPENDENCY_ASSEMBLY_NOT_SUPPORTED", 422) + behavior = receipt.get("behavior", {}) + surface = behavior.get("interaction_surface", {}) + if behavior.get("status") != "PASS" or surface.get("version") != "interaction-surface-v1": + raise Failure("REPLAY_SURFACE_UNAVAILABLE", 422) + index, controls = request["control"], surface.get("controls", []) + if type(index) is not int or not 0 <= index < len(controls): + raise Failure("REPLAY_CONTROL_INVALID", 422) + control = controls[index] + if control.get("disabled") or not isinstance(control.get("selector"), str): + raise Failure("REPLAY_CONTROL_UNAVAILABLE", 422) + actions, expected = request["actions"], request["expect"] + if not isinstance(actions, list) or not 1 <= len(actions) <= 3: + raise Failure("REPLAY_ACTION_BUDGET", 422) + if not isinstance(expected, dict) or expected.get("op") not in {"visible", "text", "value", "count"}: + raise Failure("REPLAY_EXPECTATION_REQUIRED", 422) + compiled = [] + for action in actions: + if not isinstance(action, dict) or action.get("op") not in {"click", "fill", "press"}: + raise Failure("REPLAY_ACTION_INVALID", 422) + if "selector" in action: + raise Failure("REPLAY_SELECTOR_OVERRIDE", 422) + if action["op"] == "fill" and control.get("kind") not in { + "text", + "search", + "email", + "url", + "tel", + "number", + "textarea", + }: + raise Failure("REPLAY_CONTROL_NOT_EDITABLE", 422) + compiled.append({**action, "selector": control["selector"]}) + try: + previous, _ = validate_contract(behavior.get("behavior_contract")) + contract, _ = validate_contract( + { + "version": previous["version"], + "name": "Replay " + digest(receipt), + "steps": previous["steps"] + compiled + [expected], + } + ) + except ValueError as exc: + raise Failure("REPLAY_CONTRACT_OR_BUDGET_INVALID", 422) from exc + return contract diff --git a/orbiters/chameleon/packages/core/chameleon_core/interfaces.py b/orbiters/chameleon/packages/core/chameleon_core/interfaces.py new file mode 100644 index 0000000000000000000000000000000000000000..16eb72685de34634d12835befc8cdbb06c9e44ff --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/interfaces.py @@ -0,0 +1,16 @@ +from typing import Protocol + + +class StateEngine(Protocol): + def reduce(self, observations: list[dict]) -> dict: ... + + +class MemoryIndex(Protocol): + def retrieve(self, *, owner: str, target: str, branch: str, query: str) -> list[dict]: ... + + +class TypedStateEngine: + """M1 implementation; deliberately does not claim Oracle7 inference.""" + + def reduce(self, observations: list[dict]) -> dict: + return {"observed": observations, "inferred": [], "hypothetical": []} diff --git a/orbiters/chameleon/packages/core/chameleon_core/laya_consumer.py b/orbiters/chameleon/packages/core/chameleon_core/laya_consumer.py new file mode 100644 index 0000000000000000000000000000000000000000..5072b0c3c6db14aee97685a209929649076227c2 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/laya_consumer.py @@ -0,0 +1,89 @@ +"""Bounded caller-side admission and revalidation. Returns advice, never dispatches.""" + +import math +import threading +import time + +from .contracts import digest +from .laya_contract import DecisionRequest, normalize, prepare +from .providers import ProviderError + + +class DecisionInbox: + def __init__(self, artifact_id, *, capacity=16, clock=time.monotonic): + if not artifact_id or type(capacity) is not int or not 1 <= capacity <= 16: + raise ValueError("Invalid decision inbox configuration") + self.artifact_id = artifact_id + self.capacity = capacity + self.clock = clock + self.pending = {} + self.seen = set() + self.lock = threading.Lock() + + def _expire(self, now): + for key in list(self.pending): + if self.pending[key].deadline_monotonic <= now: + del self.pending[key] + + def admit(self, request: DecisionRequest): + # Frozen Pydantic records can still contain mutable lists/dicts. Snapshot them. + snapshot = DecisionRequest.model_validate_json(request.model_dump_json()) + with self.lock: + now = self.clock() + if not math.isfinite(now): + raise ProviderError("LAYA_INVALID_CLOCK") + self._expire(now) + if snapshot.request_id in self.seen: + raise ProviderError("LAYA_REQUEST_REPLAY") + remaining = snapshot.deadline_monotonic - now + if not 0.001 <= remaining <= 30: + raise ProviderError("LAYA_CALLER_BUDGET") + if len(self.pending) >= self.capacity or len(self.seen) >= 4096: + raise ProviderError("LAYA_ADMISSION_CAPACITY") + if any(r.instance_id == snapshot.instance_id for r in self.pending.values()): + raise ProviderError("LAYA_INSTANCE_ALREADY_PENDING") + self.pending[snapshot.request_id] = snapshot + self.seen.add(snapshot.request_id) + return { + "request": snapshot.model_dump(exclude={"deadline_monotonic"}), + "budget_ms": int(remaining * 1000), + } + + def cancel(self, request_id): + with self.lock: + return self.pending.pop(request_id, None) is not None + + def receive(self, request_id, response, *, current_binding): + with self.lock: + snapshot = self.pending.pop(request_id, None) + if snapshot is None: + raise ProviderError("LAYA_NO_PENDING_REQUEST") + if not isinstance(response, dict) or response.get("status") != "COMPLETED": + raise ProviderError("LAYA_WORKER_NOT_COMPLETED") + if response.get("request_digest") != digest(snapshot.model_dump(exclude={"deadline_monotonic"})): + raise ProviderError("LAYA_REQUEST_DIGEST_MISMATCH") + expected = prepare(snapshot) + if expected["questions"]: + if ( + response.get("artifact_id") != self.artifact_id + or response.get("inference_executed") is not True + ): + raise ProviderError("LAYA_WORKER_PROVENANCE_MISMATCH") + raw = response.get("raw") + else: + if response.get("inference_executed") is not False: + raise ProviderError("LAYA_FORCED_ACTION_MUST_NOT_CLAIM_INFERENCE") + raw = None + # Independently normalize raw evidence. Do not trust the worker's selected answer. + result = normalize( + snapshot, + raw, + expected_input_hash=expected["input_hash"], + current_binding=current_binding, + now_monotonic=self.clock(), + artifact_id=self.artifact_id, + actual_device=response.get("actual_device", ""), + actual_dtype=response.get("actual_dtype", ""), + ) + result["action_dispatch"] = False + return result diff --git a/orbiters/chameleon/packages/core/chameleon_core/laya_contract.py b/orbiters/chameleon/packages/core/chameleon_core/laya_contract.py new file mode 100644 index 0000000000000000000000000000000000000000..714b6034667575f204235bdd88d7f4e763e78a9d --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/laya_contract.py @@ -0,0 +1,215 @@ +"""Pure Laya boundary checks. No model loading, permission grants or fallback policy.""" + +import copy +import math +from typing import Any, Literal + +from pydantic import Field, model_validator + +from .contracts import StrictRecord, canonical, digest +from .providers import ProviderError + + +class Question(StrictRecord): + kind: Literal["choice", "score", "noul"] + instructions: str = Field(min_length=1, max_length=1000) + # Ordered pairs preserve Choice option order in the input fingerprint. + options: list[tuple[str, str]] = Field(default_factory=list, max_length=8) + + @model_validator(mode="after") + def validate_options(self): + if len({key for key, _ in self.options}) != len(self.options): + raise ValueError("Duplicate option identity") + if any(not key or len(key) > 80 or len(label) > 500 for key, label in self.options): + raise ValueError("Option outside input bounds") + if self.kind == "score" and len(self.options) < 2: + raise ValueError("Score needs at least two ordered levels") + if self.kind == "noul" and self.options: + raise ValueError("Noul does not accept options") + return self + + +class DecisionRequest(StrictRecord): + request_id: str = Field(min_length=1, max_length=100) + run_id: str = Field(min_length=1, max_length=100) + instance_id: str = Field(min_length=1, max_length=100) + form_version: str = Field(min_length=1, max_length=100) + state_version: int = Field(ge=0) + observation_hash: str = Field(pattern=r"^[a-f0-9]{64}$") + state: dict[str, Any] + questions: dict[str, Question] = Field(min_length=1, max_length=4) + deadline_monotonic: float = Field(gt=0, allow_inf_nan=False) + + @model_validator(mode="after") + def bounded_state(self): + if len(canonical(self.state).encode()) > 16384 or digest(self.state) != self.observation_hash: + raise ValueError("Observation hash mismatch or state byte budget") + if any(not key or len(key) > 80 for key in self.questions): + raise ValueError("Question identity outside bounds") + return self + + +def prepare(request: DecisionRequest): + questions, forced = {}, {} + for key, question in request.questions.items(): + if question.kind == "choice" and len(question.options) < 2: + forced[key] = { + "status": "forced_action" if question.options else "no_action", + "choice": question.options[0][0] if question.options else None, + "inference_executed": False, + } + continue + item: dict[str, Any] = {"type": question.kind, "instructions": question.instructions} + if question.kind == "choice": + item["criteria"] = dict(question.options) + elif question.kind == "score": + item["criteria"] = [label for _, label in question.options] + questions[key] = item + return { + "questions": questions, + "forced": forced, + "input_hash": digest(request.model_dump()), + "token_budget_checked": False, + } + + +def probability(value): + if type(value) not in (int, float) or not math.isfinite(value) or not 0 <= value <= 1: + raise ProviderError("LAYA_INVALID_PROBABILITY") + return float(value) + + +def distribution(raw, keys): + if not isinstance(raw, dict) or set(raw) != set(keys): + raise ProviderError("LAYA_OPTION_IDENTITY_MISMATCH") + values = {key: probability(raw[key]) for key in keys} + total = sum(values.values()) + # SDK rounds each probability to four decimal places. + if total <= 0 or abs(total - 1) > len(keys) * 0.00005 + 1e-9: + raise ProviderError("LAYA_DISTRIBUTION_SUM") + return {key: value / total for key, value in values.items()}, abs(total - 1) > 1e-12 + + +def normalize( + request: DecisionRequest, + raw, + *, + expected_input_hash: str, + current_binding: dict, + now_monotonic: float, + artifact_id: str, + actual_device: str, + actual_dtype: str, +): + """Caller supplies current state and trusted worker metadata, never model output authority.""" + binding = { + key: getattr(request, key) + for key in ( + "request_id", + "run_id", + "instance_id", + "form_version", + "state_version", + "observation_hash", + ) + } + if current_binding != binding or digest(request.model_dump()) != expected_input_hash: + raise ProviderError("LAYA_STALE_BINDING") + if not math.isfinite(now_monotonic) or now_monotonic >= request.deadline_monotonic: + raise ProviderError("LAYA_DEADLINE_EXPIRED") + prepared = prepare(request) + expected = prepared["questions"] + if not expected: + if raw is not None: + raise ProviderError("LAYA_FORCED_ACTION_MUST_NOT_CLAIM_INFERENCE") + return {"answers": prepared["forced"], "inference_executed": False, "binding": binding} + if ( + not artifact_id + or actual_device not in {"cpu", "cuda", "mps"} + or actual_dtype not in {"float32", "float16", "bfloat16"} + ): + raise ProviderError("LAYA_RUNTIME_PROVENANCE_REQUIRED") + if ( + not isinstance(raw, dict) + or set(raw) != {"model", "answers", "usage"} + or raw["model"] != "laya-rl-agent" + ): + raise ProviderError("LAYA_INVALID_RESPONSE") + if not isinstance(raw["answers"], dict) or set(raw["answers"]) != set(expected): + raise ProviderError("LAYA_QUESTION_IDENTITY_MISMATCH") + usage = raw["usage"] + if ( + not isinstance(usage, dict) + or set(usage) != {"input_tokens", "output_tokens"} + or type(usage["input_tokens"]) is not int + or not 0 < usage["input_tokens"] <= 32768 + or type(usage["output_tokens"]) is not int + or usage["output_tokens"] != 0 + ): + raise ProviderError("LAYA_INVALID_USAGE") + answers = copy.deepcopy(prepared["forced"]) + for key, item in expected.items(): + value = raw["answers"][key] + kind = item["type"] + fields = {"type", "confidence", "action"} | ( + {"choice", "probabilities"} + if kind == "choice" + else {"score", "legend", "probabilities"} + if kind == "score" + else {"noul"} + ) + if not isinstance(value, dict) or set(value) != fields or value["type"] != kind: + raise ProviderError("LAYA_ANSWER_SCHEMA") + if not isinstance(value["action"], dict) or set(value["action"]) != {"act_probability"}: + raise ProviderError("LAYA_ACTION_SCHEMA") + answer = { + "type": kind, + "confidence": probability(value["confidence"]), + "confidence_meaning": "normalized_entropy" if kind != "noul" else "larger_binary_probability", + "act_probability": probability(value["action"]["act_probability"]), + "calibration": "uncalibrated_for_this_task", + "inference_executed": True, + } + if kind == "noul": + answer["noul"] = probability(value["noul"]) + if abs(answer["confidence"] - max(answer["noul"], 1 - answer["noul"])) > 0.00011: + raise ProviderError("LAYA_INCONSISTENT_CONFIDENCE") + else: + keys = ( + list(item["criteria"]) if kind == "choice" else [str(i) for i in range(len(item["criteria"]))] + ) + scores, changed = distribution(value["probabilities"], keys) + answer.update(probabilities=scores, renormalized=changed) + if kind == "choice": + choice = value["choice"] + if ( + not isinstance(choice, str) + or choice not in scores + or scores[choice] + 0.00011 < max(scores.values()) + ): + raise ProviderError("LAYA_INVALID_CHOICE") + answer["choice"] = choice + else: + legend = {str(i): label for i, label in enumerate(item["criteria"])} + if ( + value["legend"] != legend + or type(value["score"]) not in (int, float) + or not math.isfinite(value["score"]) + ): + raise ProviderError("LAYA_INVALID_SCORE") + estimate = sum(int(i) * p for i, p in scores.items()) + if abs(value["score"] - estimate) > len(keys) ** 2 * 0.0001: + raise ProviderError("LAYA_INCONSISTENT_SCORE") + answer["score"] = value["score"] + answers[key] = answer + return { + "answers": answers, + "binding": binding, + "input_hash": expected_input_hash, + "artifact_id": artifact_id, + "actual_device": actual_device, + "actual_dtype": actual_dtype, + "inference_executed": True, + "raw": copy.deepcopy(raw), + "usage": copy.deepcopy(usage), + } diff --git a/orbiters/chameleon/packages/core/chameleon_core/laya_input_budget.py b/orbiters/chameleon/packages/core/chameleon_core/laya_input_budget.py new file mode 100644 index 0000000000000000000000000000000000000000..09183596edee601be2da84f7d93a0739649804f1 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/laya_input_budget.py @@ -0,0 +1,66 @@ +"""Reject lossy SDK input construction before invoking neural inference.""" + +from .contracts import digest +from .providers import ProviderError + + +def check_sequence( + tokenizer, state, question, *, max_len, head_max_len, build_sequence, render_options, serialize_state +): + if not 1 <= max_len <= 8192 or not 1 <= head_max_len <= max_len: + raise ProviderError("LAYA_SEQUENCE_CONFIG") + if question["t"] not in {"choice", "score", "noul"}: + raise ProviderError("LAYA_QUESTION_TYPE") + options = render_options(question) + if not 2 <= len(options) <= 8: + raise ProviderError("LAYA_OPTION_COUNT") + state_text = serialize_state(state) + instruction = str(question["ins"]) + if any(tokenizer.mask_token in text for text in [state_text, instruction, *options]): + raise ProviderError("LAYA_MASK_TOKEN_WOULD_BE_REWRITTEN") + encode = lambda text: tokenizer(text, add_special_tokens=False)["input_ids"] + head = encode(f"{question['t']} question: {instruction}") + option_ids = [[tokenizer.mask_token_id] + encode(" " + option) for option in options] + fields = [] + clipped = [] + for index, ids in enumerate(option_ids): + if len(ids) > 49: + fields.append(f"option:{index}") + clipped.append(ids[:49]) + budget = head_max_len - sum(map(len, clipped)) + if budget < 16: + per = max(4, (head_max_len - 16) // len(clipped)) + for index, ids in enumerate(clipped): + if len(ids) > per and f"option:{index}" not in fields: + fields.append(f"option:{index}") + clipped = [ids[:per] for ids in clipped] + budget = head_max_len - sum(map(len, clipped)) + if len(head) > max(8, budget): + fields.append("instructions") + state_ids = encode(state_text) + room = max_len - (1 + min(len(head), max(8, budget)) + 1 + sum(map(len, clipped)) + 1) - 1 + if len(state_ids) > max(0, room): + fields.append("state") + sequence, markers = build_sequence(tokenizer, state, question, max_len, head_max_len) + if fields: + return { + "accepted": False, + "truncated_fields": fields, + "input_tokens": len(sequence), + "input_token_hash": digest(sequence), + } + expected = [tokenizer.cls_token_id] + head + [tokenizer.sep_token_id] + expected_markers = [] + for ids in option_ids: + expected_markers.append(len(expected)) + expected.extend(ids) + expected += [tokenizer.sep_token_id] + state_ids + [tokenizer.sep_token_id] + if sequence != expected or markers != expected_markers: + raise ProviderError("LAYA_SDK_SEQUENCE_PARITY_FAILED") + return { + "accepted": True, + "truncated_fields": [], + "input_tokens": len(sequence), + "input_token_hash": digest(sequence), + "markers": markers, + } diff --git a/orbiters/chameleon/packages/core/chameleon_core/license_notices.py b/orbiters/chameleon/packages/core/chameleon_core/license_notices.py new file mode 100644 index 0000000000000000000000000000000000000000..3285da3fc3b22edafcca311f7d8ec55f9f8bfcf5 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/license_notices.py @@ -0,0 +1,32 @@ +"""Preserve explicit source-header declarations, not legal compatibility judgments.""" +import hashlib +import re + + +def inline_notices(files): + notices = [] + for path, body in sorted(files.items()): + if not path.lower().endswith(('.js', '.mjs', '.css')): + continue + # Only a leading bounded comment, never strings, examples or executable text. + # A UTF-8 BOM is an encoding marker, not executable source. Keep it in + # the matched bytes so persisted offsets and hashes remain exact. + match = re.match(rb'(?:\xef\xbb\xbf)?\s*/\*([\s\S]*?)\*/', body[:4096]) + if not match: + continue + try: + comment = match[1].decode('utf-8', errors='strict') + except UnicodeDecodeError: + # An unreadable declaration supplies no license evidence. Other + # captured files can still contain a valid explicit notice. + continue + declarations = re.findall(r'(?im)^\s*\*?\s*(?:License|SPDX-License-Identifier)\s*:\s*(.*?)\s*$', comment) + allowed = {'MIT', 'http://www.opensource.org/licenses/mit-license.php', + 'https://www.opensource.org/licenses/mit-license.php', + 'https://opensource.org/licenses/MIT'} + if len(declarations) != 1 or declarations[0] not in allowed: + continue + notices.append({'path': path, 'declared_identifier': 'MIT', 'start_byte': match.start(), + 'end_byte': match.end(), 'notice_sha256': hashlib.sha256(match[0]).hexdigest(), + 'file_sha256': hashlib.sha256(body).hexdigest()}) + return notices diff --git a/orbiters/chameleon/packages/core/chameleon_core/linux_job.py b/orbiters/chameleon/packages/core/chameleon_core/linux_job.py new file mode 100644 index 0000000000000000000000000000000000000000..966030224f8c3ff907058f6cc7196edd72b7b4c9 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/linux_job.py @@ -0,0 +1,121 @@ +"""Linux cgroup-v2 process accounting. Requires an explicitly delegated subtree. + +No fallback to an unbounded subprocess. This is resource supervision, not a +filesystem sandbox. The trusted child must wait for its stdin payload. +""" +import os +from pathlib import Path +import subprocess +import threading +import time +import uuid + + +def child_environment(source=None): + """Only runtime configuration crosses into children, never worker credentials.""" + source = os.environ if source is None else source + allowed = {'PATH', 'HOME', 'TMPDIR', 'LANG', 'LC_ALL', 'TZ', + 'LD_LIBRARY_PATH', 'PLAYWRIGHT_BROWSERS_PATH', + 'FONTCONFIG_PATH', 'FONTCONFIG_FILE'} + return {key: value for key, value in source.items() if key in allowed} + + +def run_bounded(command, payload, cwd, *, wall_seconds=35, cpu_seconds=25, + memory_bytes=1073741824, max_output_bytes=8*1024*1024): + if not 0 < wall_seconds <= 60 or not 0 < cpu_seconds <= 40 or not 0 < memory_bytes <= 1073741824: + raise ValueError('Invalid browser process budget') + if type(max_output_bytes) is not int or not 0 < max_output_bytes <= 8*1024*1024: + raise ValueError('Invalid process output budget') + configured = os.environ.get('CHAMELEON_CGROUP_ROOT') + if not configured: + raise RuntimeError('DELEGATED_CGROUP_REQUIRED; no unbounded fallback') + parent = Path(configured).resolve() + if not parent.is_relative_to('/sys/fs/cgroup') or parent == Path('/sys/fs/cgroup'): + raise RuntimeError('DEDICATED_CGROUP_REQUIRED') + required = {'memory', 'pids', 'cpu'} + if not required.issubset(set((parent/'cgroup.subtree_control').read_text().split())): + raise RuntimeError('CGROUP_CONTROLLERS_NOT_DELEGATED') + group = parent / ('job-' + uuid.uuid4().hex) + group.mkdir() + process = None + started = time.monotonic() + chunks = [bytearray(), bytearray()] + lock = threading.Lock() + exhausted = threading.Event() + total = 0 + def read(pipe, index): + nonlocal total + while data := pipe.read(4096): + with lock: + room = max(0, max_output_bytes-total) + chunks[index].extend(data[:room]) + total += len(data) + if total > max_output_bytes: + exhausted.set() + def kill(): + (group/'cgroup.kill').write_text('1') + def counters(): + return dict(line.split() for line in (group/'cpu.stat').read_text().splitlines()) + try: + (group/'memory.max').write_text(str(memory_bytes)) + (group/'memory.swap.max').write_text('0') + # Linux pids counts threads as well as processes; Chromium needs more + # tasks than the Windows process-only cap. Keep the units explicit. + (group/'pids.max').write_text('256') + (group/'cpu.max').write_text('50000 100000') + # The bootstrap joins before executing any supplied command or descendant. + bootstrap = "import os,sys; open(sys.argv[1],'w').write(str(os.getpid())); os.execvpe(sys.argv[2],sys.argv[2:],os.environ)" + import sys + process = subprocess.Popen([sys.executable, '-c', bootstrap, str(group/'cgroup.procs'), *command], + cwd=cwd, env=child_environment(), stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + readers = [threading.Thread(target=read,args=(pipe,i),daemon=True) + for i,pipe in enumerate((process.stdout,process.stderr))] + for t in readers: + t.start() + def send(): + try: + process.stdin.write(payload.encode()) + process.stdin.close() + except (BrokenPipeError, OSError): + pass + sender = threading.Thread(target=send,daemon=True) + sender.start() + timed_out = cpu_exhausted = False + while process.poll() is None: + timed_out = time.monotonic()-started >= wall_seconds + cpu_exhausted = int(counters()['usage_usec']) >= cpu_seconds*1000000 + if timed_out or cpu_exhausted or exhausted.is_set(): + kill() + break + time.sleep(.02) + process.wait(timeout=5) + kill() # Also remove descendants of a normally exited parent. + for t in readers: + t.join(5) + sender.join(5) + if any(t.is_alive() for t in [*readers,sender]): + raise RuntimeError('PROCESS_IO_CLEANUP_FAILED') + deadline = time.monotonic()+5 + while 'populated 1' in (group/'cgroup.events').read_text() and time.monotonic() 0, + 'cpu_budget_exhausted': cpu_exhausted, 'output_budget_exhausted': exhausted.is_set(), + 'captured_output_bytes': total, 'stdout': chunks[0].decode(errors='replace'), + 'stderr': chunks[1].decode(errors='replace'), 'wall_seconds': round(time.monotonic()-started,6), + 'job_cpu_seconds': int(counters()['usage_usec'])/1000000, + 'reported_peak_job_memory_bytes': int((group/'memory.peak').read_text()), + 'memory_counter_note': 'Linux cgroup v2 memory.peak', + 'configured_job_memory_bytes': memory_bytes, 'remaining_job_processes': 0, + 'process_tree_terminated': True, + 'limits': {'wall_seconds':wall_seconds,'user_cpu_seconds':cpu_seconds, + 'memory_bytes':memory_bytes,'tasks_including_threads':256,'output_bytes':max_output_bytes}} + finally: + if process is not None: + kill() + process.wait(timeout=5) + group.rmdir() diff --git a/orbiters/chameleon/packages/core/chameleon_core/locked_assets.py b/orbiters/chameleon/packages/core/chameleon_core/locked_assets.py new file mode 100644 index 0000000000000000000000000000000000000000..853ba127a232109e317e9029b4f6199ac062f978 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/locked_assets.py @@ -0,0 +1,184 @@ +"""Read exact npm tarballs as data. No install, extraction to disk or script execution.""" + +import base64 +import hashlib +import io +import json +import posixpath +import re +import tarfile +import urllib.request +from urllib.parse import urlsplit + +from .adaptation_contracts import Residual +from .contracts import digest +from .repository_capture import safe_path, verify_package + + +def registry_fetch(url): + parsed = urlsplit(url) + if ( + parsed.scheme != "https" + or parsed.netloc != "registry.npmjs.org" + or parsed.query + or parsed.fragment + or not parsed.path.endswith(".tgz") + ): + raise Residual("DEPENDENCY_REGISTRY_BOUNDARY") + + class NoRedirect(urllib.request.HTTPRedirectHandler): + def redirect_request(self, *args, **kwargs): + raise Residual("DEPENDENCY_REDIRECT_DENIED") + + request = urllib.request.Request(url, headers={"User-Agent": "Chameleon-locked-assets"}) + with urllib.request.build_opener(NoRedirect).open(request, timeout=10) as response: + body = response.read(2 * 1024 * 1024 + 1) + if len(body) > 2 * 1024 * 1024: + raise Residual("DEPENDENCY_ARCHIVE_BUDGET") + return body + + +def archive_files(body, integrity): + if not isinstance(integrity, str) or not integrity.startswith("sha512-"): + raise Residual("DEPENDENCY_SHA512_REQUIRED") + try: + expected = base64.b64decode(integrity[7:], validate=True) + except ValueError: + raise Residual("DEPENDENCY_INTEGRITY_INVALID") from None + if len(body) > 2 * 1024 * 1024 or len(expected) != 64 or hashlib.sha512(body).digest() != expected: + raise Residual("DEPENDENCY_INTEGRITY_MISMATCH") + files, seen, total = {}, set(), 0 + with tarfile.open(fileobj=io.BytesIO(body), mode="r|gz") as archive: + for index, member in enumerate(archive): + if index >= 500: + raise Residual("DEPENDENCY_MEMBER_BUDGET") + if not member.name.startswith("package/"): + raise Residual("DEPENDENCY_ARCHIVE_PATH") + name = member.name[len("package/") :].rstrip("/") + if not name and member.isdir(): + continue + safe_path(name) + if member.isdir(): + continue + if not member.isfile() or name.casefold() in seen: + raise Residual("DEPENDENCY_ARCHIVE_TYPE_OR_COLLISION") + seen.add(name.casefold()) + total += member.size + if member.size > 262144 or total > 4 * 1024 * 1024: + raise Residual("DEPENDENCY_EXPANSION_BUDGET") + stream = archive.extractfile(member) + if stream is None: + raise Residual("DEPENDENCY_ARCHIVE_TYPE_OR_COLLISION") + files[name] = stream.read(member.size + 1) + return files + + +def capture_locked_assets(package, lock_path, fetch=registry_fetch): + verify_package(package) + safe_path(lock_path) + repo = package["repository"] + lock_record = repo["files"][lock_path] + lock = json.loads(base64.b64decode(lock_record["base64"])) + if lock.get("lockfileVersion") not in (2, 3): + raise Residual("DEPENDENCY_LOCK_VERSION") + base = posixpath.dirname(lock_path) + prefix = base + "/node_modules/" if base else "node_modules/" + needed: dict[str, set[str]] = {} + for gap in repo.get("projection", {}).get("gaps", []): + name = gap.get("path", "") + if gap.get("reason") != "MISSING_LOCAL_ASSET" or not name.startswith(prefix): + continue + relative = name[len(prefix) :] + parts = relative.split("/") + count = 2 if relative.startswith("@") else 1 + dependency, asset = "/".join(parts[:count]), "/".join(parts[count:]) + safe_path(asset) + needed.setdefault(dependency, set()).add(asset) + if not 1 <= len(needed) <= 4: + raise Residual("DEPENDENCY_SELECTION_BUDGET") + outputs, receipts = {}, [] + for name, assets in sorted(needed.items()): + key = "node_modules/" + name + record = lock["packages"][key] + if name not in lock["packages"][""].get("dependencies", {}): + raise Residual("DEPENDENCY_NOT_DIRECT_RUNTIME") + url = record["resolved"] + # Validate even with an injected transport. + parsed = urlsplit(url) + if ( + parsed.scheme != "https" + or parsed.netloc != "registry.npmjs.org" + or parsed.query + or parsed.fragment + or not parsed.path.endswith(".tgz") + ): + raise Residual("DEPENDENCY_REGISTRY_BOUNDARY") + archive = fetch(url) + members = archive_files(archive, record["integrity"]) + metadata = json.loads(members["package.json"]) + if metadata.get("name") != name or metadata.get("version") != record["version"]: + raise Residual("DEPENDENCY_PACKAGE_IDENTITY") + licenses = [p for p in members if re.fullmatch(r"(?i)(license|licence|copying)(\.[a-z]+)?", p)] + if not licenses: + raise Residual("DEPENDENCY_LICENSE_MISSING") + for asset in assets | set(licenses) | {"package.json"}: + if asset not in members: + raise Residual("DEPENDENCY_ASSET_ABSENT") + body = members[asset] + outputs[prefix + name + "/" + asset] = { + "base64": base64.b64encode(body).decode(), + "bytes": len(body), + "sha256": hashlib.sha256(body).hexdigest(), + } + receipts.append( + { + "name": name, + "version": record["version"], + "resolved": url, + "integrity": record["integrity"], + "archive_sha256": hashlib.sha256(archive).hexdigest(), + "archive_base64": base64.b64encode(archive).decode(), + "license": metadata.get("license"), + "license_files": licenses, + } + ) + payload = { + "version": "locked-npm-asset-bundle-v1", + "source_package_digest": package["digest"], + "lock_path": lock_path, + "lock_sha256": lock_record["sha256"], + "packages": receipts, + "files": outputs, + "scripts_executed": False, + "dependencies_installed": False, + } + return {"digest": digest(payload), "bundle": payload} + + +def verify_locked_assets(bundle, package): + """Rebuild selected files from retained SRI-verified archives without network.""" + if isinstance(bundle, dict) and isinstance(bundle.get('bundle'), dict) and bundle['bundle'].get('version') in {'locked-pnpm-leaf-bundle-v1', 'locked-pnpm-leaf-bundle-v2', 'locked-pnpm-leaf-bundle-v3'}: + from .pnpm_bundle import verify_pnpm_bundle + + try: + return verify_pnpm_bundle(bundle, package) + except ValueError as exc: + raise Residual('DEPENDENCY_PNPM_BUNDLE_INVALID') from exc + try: + payload = bundle["bundle"] + if bundle["digest"] != digest(payload) or payload["source_package_digest"] != package["digest"]: + raise Residual("DEPENDENCY_BUNDLE_BINDING") + records = payload["packages"] + if not 1 <= len(records) <= 4: + raise Residual("DEPENDENCY_SELECTION_BUDGET") + archives = {} + for record in records: + if len(record["archive_base64"]) > 2800000 or record["resolved"] in archives: + raise Residual("DEPENDENCY_ARCHIVE_BUDGET") + archives[record["resolved"]] = base64.b64decode(record["archive_base64"], validate=True) + rebuilt = capture_locked_assets(package, payload["lock_path"], fetch=lambda url: archives[url]) + if rebuilt != bundle or set(payload["files"]) & set(package["repository"]["files"]): + raise Residual("DEPENDENCY_BUNDLE_RECONSTRUCTION_MISMATCH") + return payload["files"] + except (KeyError, TypeError) as exc: + raise Residual("DEPENDENCY_BUNDLE_INVALID") from exc diff --git a/orbiters/chameleon/packages/core/chameleon_core/metafold_correspondence.py b/orbiters/chameleon/packages/core/chameleon_core/metafold_correspondence.py new file mode 100644 index 0000000000000000000000000000000000000000..03fecfc519bef728d61a2d67898684fb855b1507 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/metafold_correspondence.py @@ -0,0 +1,415 @@ +"""Read-only, evidence-bound runtime-control to source inspection candidates. + +HTMLParser supplies lexical positions, not an HTML5 tree builder. Consequently +this module accepts only explicit, balanced documents without tree-repair cases. +A match identifies where to inspect; it is never proof of event-handler identity. +""" + +import hashlib +import re +from dataclasses import dataclass, field +from html.parser import HTMLParser + +from .adaptation_contracts import Residual +from .contracts import canonical, digest +from .repository_capture import verify_package + +VOID = { + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "link", + "meta", + "param", + "source", + "track", + "wbr", +} +UNSUPPORTED = { + "table", + "tbody", + "thead", + "tfoot", + "tr", + "td", + "th", + "caption", + "colgroup", + "template", + "svg", + "math", + "frameset", + "frame", + "noscript", + "plaintext", + "xmp", + "iframe", + "noembed", + "noframes", + "select", + "option", + "optgroup", + "image", +} +BLOCK = { + "address", + "article", + "aside", + "blockquote", + "div", + "dl", + "fieldset", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "header", + "hgroup", + "hr", + "main", + "menu", + "nav", + "ol", + "p", + "pre", + "section", + "table", + "ul", +} +PATH = re.compile(r"[a-z][a-z0-9-]*:nth-child\([1-9][0-9]*\)( > [a-z][a-z0-9-]*:nth-child\([1-9][0-9]*\))*") + + +def _sha(body): + return hashlib.sha256(body).hexdigest() + + +def _clip(value): + return re.sub(r"\s+", " ", value or "").strip()[:120] + + +@dataclass(eq=False) +class Element: + tag: str + attrs: dict + start: int + start_end: int + line: int + column: int + selector: str + parent: object = None + children: list = field(default_factory=list) + text: list = field(default_factory=list) + end: int | None = None + + +class ExplicitDocument(HTMLParser): + """Fail closed where browser insertion/repair could change element paths.""" + + def __init__(self, source): + super().__init__(convert_charrefs=True) + self.source = source + self.lines = [0] + [match.end() for match in re.finditer("\n", source)] + self.elements: list[Element] = [] + self.stack: list[Element] = [] + self.roots: list[Element] = [] + + def _position(self): + line, column = self.getpos() + return self.lines[line - 1] + column + + def handle_starttag(self, tag, attrs): + if len(self.elements) >= 5000 or len(self.stack) >= 64: + raise Residual("CORRESPONDENCE_HTML_BUDGET") + if tag in UNSUPPORTED or not re.fullmatch(r"[a-z][a-z0-9-]*", tag): + raise Residual("CORRESPONDENCE_UNSUPPORTED_HTML_TREE") + if len({key for key, _ in attrs}) != len(attrs): + raise Residual("CORRESPONDENCE_DUPLICATE_ATTRIBUTE") + ancestors = [element.tag for element in self.stack] + if ( + ("p" in ancestors and tag in BLOCK) + or ( + tag in {"a", "button", "form", "li", "dt", "dd", "h1", "h2", "h3", "h4", "h5", "h6"} + and tag in ancestors + ) + or (tag in {"dt", "dd"} and any(value in ancestors for value in ("dt", "dd"))) + or (re.fullmatch(r"h[1-6]", tag) and any(re.fullmatch(r"h[1-6]", value) for value in ancestors)) + or (self.stack and self.stack[-1].tag in {"title", "textarea"}) + ): + raise Residual("CORRESPONDENCE_UNSUPPORTED_HTML_TREE") + parent = self.stack[-1] if self.stack else None + siblings = parent.children if parent else self.roots + start = self._position() + selector = (parent.selector + " > " if parent else "") + f"{tag}:nth-child({len(siblings) + 1})" + line, column = self.getpos() + raw_tag = self.get_starttag_text() + if raw_tag is None: + raise Residual("CORRESPONDENCE_TAG_POSITION_MISSING") + element = Element(tag, dict(attrs), start, start + len(raw_tag), line, column + 1, selector, parent) + siblings.append(element) + self.elements.append(element) + if tag in VOID: + element.end = element.start_end + else: + self.stack.append(element) + + def handle_startendtag(self, tag, attrs): + if tag not in VOID: + raise Residual("CORRESPONDENCE_NONVOID_SELF_CLOSING") + self.handle_starttag(tag, attrs) + + def handle_endtag(self, tag): + if not self.stack or self.stack[-1].tag != tag: + raise Residual("CORRESPONDENCE_UNBALANCED_HTML") + element = self.stack.pop() + end = self.source.find(">", self._position()) + if end < 0: + raise Residual("CORRESPONDENCE_UNBALANCED_HTML") + element.end = end + 1 + + def handle_data(self, data): + if not self.stack and data.strip(): + raise Residual("CORRESPONDENCE_IMPLICIT_DOCUMENT") + if self.stack and self.stack[-1].tag in {"html", "head"} and data.strip(): + raise Residual("CORRESPONDENCE_UNSUPPORTED_HTML_TREE") + for element in self.stack: + element.text.append(data) + + def unknown_decl(self, data): + raise Residual("CORRESPONDENCE_UNSUPPORTED_HTML_TREE") + + def finish(self): + self.feed(self.source) + self.close() + if self.stack or any(element.end is None for element in self.elements): + raise Residual("CORRESPONDENCE_UNBALANCED_HTML") + if len(self.roots) != 1 or self.roots[0].tag != "html": + raise Residual("CORRESPONDENCE_IMPLICIT_DOCUMENT") + root = self.roots[0] + if [element.tag for element in root.children] != ["head", "body"]: + raise Residual("CORRESPONDENCE_IMPLICIT_DOCUMENT") + if any( + element.tag in {"html", "head", "body"} + for element in self.elements + if element not in [root, *root.children] + ): + raise Residual("CORRESPONDENCE_UNSUPPORTED_HTML_TREE") + if any( + element.tag not in {"base", "link", "meta", "title", "style", "script"} + for element in root.children[0].children + ): + raise Residual("CORRESPONDENCE_UNSUPPORTED_HTML_TREE") + return self.elements + + +def _kind(element): + if element.tag == "input": + kind = (element.attrs.get("type") or "text").lower() + return ( + kind + if kind + in { + "button", + "checkbox", + "color", + "date", + "datetime-local", + "email", + "file", + "hidden", + "image", + "month", + "number", + "password", + "radio", + "range", + "reset", + "search", + "submit", + "tel", + "text", + "time", + "url", + "week", + } + else "text" + ) + return element.tag + + +def _label(element, elements): + if element.attrs.get("aria-label"): + return _clip(element.attrs["aria-label"]) + if element.tag in {"button", "input", "textarea", "select", "output", "meter", "progress"}: + labels = [] + for candidate in elements: + if candidate.tag != "label": + continue + if candidate.attrs.get("for") is not None: + if candidate.attrs.get("for") == element.attrs.get("id"): + labels.append(candidate) + elif candidate.start < element.start < candidate.end: + labels.append(candidate) + if labels and "".join(labels[0].text): + return _clip("".join(labels[0].text)) + return _clip("".join(element.text) or element.attrs.get("placeholder")) + + +def _location(path, body, source, element): + start = len(source[: element.start].encode("utf-8")) + end = len(source[: element.start_end].encode("utf-8")) + # These are syntax search keys, never DOM identity or authorization claims. + keys = [] + ident = element.attrs.get("id") or "" + if re.fullmatch(r"[A-Za-z_][A-Za-z0-9_-]{0,100}", ident): + keys.extend([ident, "#" + ident]) + for value in (element.attrs.get("class") or "").split()[:32]: + if re.fullmatch(r"[A-Za-z_][A-Za-z0-9_-]{0,100}", value): + keys.extend([value, "." + value, element.tag + "." + value]) + return { + "path": path, + "file_sha256": _sha(body), + "start_byte": start, + "end_byte": end, + "span_sha256": _sha(body[start:end]), + "line": element.line, + "column": element.column, + "tag": element.tag, + "selector": element.selector, + "kind": _kind(element), + "span_kind": "start_tag", + "syntax_search_keys": sorted(set(keys)), + } + + +def source_correspondence(package, receipt, *, document_path=None): + """Return inspection candidates bound to exact source and runtime observation. + + ``receipt`` is either an internal receipt's behavior dict or that full receipt. + Admission/authenticity of a receipt is the trusted caller's responsibility. + The package digest and every byte are verified here; derived overlays require + their own future correspondence support and are explicitly refused. + """ + files = verify_package(package) + if len(canonical(receipt).encode()) > 1024 * 1024: + raise Residual("CORRESPONDENCE_RECEIPT_BUDGET") + behavior = receipt.get("behavior", receipt) + if behavior.get("package_digest") != package["digest"]: + raise Residual("CORRESPONDENCE_SOURCE_STALE") + if behavior.get("overlay_digest") or receipt.get("overlay_digest"): + raise Residual("CORRESPONDENCE_DERIVED_SOURCE_UNSUPPORTED") + surface = behavior.get("interaction_surface") + if not isinstance(surface, dict) or surface.get("version") != "interaction-surface-v1": + raise Residual("CORRESPONDENCE_RUNTIME_SURFACE_REQUIRED") + controls = surface.get("controls") + if not isinstance(controls, list) or len(controls) > 100: + raise Residual("CORRESPONDENCE_CONTROL_BUDGET") + path = document_path or package["repository"]["entry"] + if path not in files or not path.lower().endswith((".html", ".htm")): + raise Residual("CORRESPONDENCE_HTML_DOCUMENT_REQUIRED") + body = files[path] + gaps, locations, observations = [], [], [] + try: + source = body.decode("utf-8", errors="strict") + if "\x00" in source or len(body) > 262144: + raise Residual("CORRESPONDENCE_HTML_BUDGET") + elements = ExplicitDocument(source).finish() + for element in elements: + if not ( + element.tag in {"button", "input", "select", "textarea"} + or (element.tag == "a" and "href" in element.attrs) + or element.attrs.get("role") == "button" + ): + continue + if _kind(element) in {"password", "file", "hidden"}: + continue + locations.append({**_location(path, body, source, element), "label": _label(element, elements)}) + except (Residual, UnicodeDecodeError) as exc: + gaps.append( + { + "path": path, + "reason": exc.code if isinstance(exc, Residual) else "CORRESPONDENCE_UTF8_REQUIRED", + } + ) + for index, control in enumerate(controls): + if ( + not isinstance(control, dict) + or not isinstance(control.get("selector"), str) + or not PATH.fullmatch(control["selector"]) + or len(control["selector"]) > 200 + ): + raise Residual("CORRESPONDENCE_RUNTIME_SELECTOR_INVALID") + if not isinstance(control.get("label"), str) or not isinstance(control.get("kind"), str): + raise Residual("CORRESPONDENCE_RUNTIME_CONTROL_INVALID") + candidates = [ + location + for location in locations + if location["kind"] == control["kind"] and location["label"] == _clip(control["label"]) + ] + if not control["label"]: + status, reason = "UNRESOLVED", "NO_RUNTIME_LABEL_FINGERPRINT" + elif len(candidates) > 1: + status, reason = "AMBIGUOUS", "DUPLICATE_SOURCE_FINGERPRINT" + elif not candidates: + status, reason = "UNRESOLVED", "NO_SOURCE_FINGERPRINT" + else: + status = "CANDIDATE" + reason = ( + "STRUCTURE_AND_LABEL_AGREE" + if candidates[0]["selector"] == control["selector"] + else "UNIQUE_LABEL_STRUCTURE_CHANGED" + ) + observations.append( + { + "control_index": index, + "runtime_selector": control["selector"], + "status": status, + "reason": reason, + "candidate_count": len(candidates), + "locations": candidates[:16] if status != "UNRESOLVED" else [], + "locations_truncated": status != "UNRESOLVED" and len(candidates) > 16, + } + ) + report = { + "version": "metafold-source-correspondence-v1", + "source_digest": package["digest"], + "observation_digest": digest(behavior), + "surface_digest": digest(surface), + "document_path": path, + "document_binding": "SOURCE_DOCUMENT_CANDIDATE; interaction-surface-v1 does not record final URL", + "observations": observations, + "gaps": gaps, + "source_writes": False, + "source_executed": False, + "scope": "Inspection candidates from source syntax and runtime kind/label/path; no handler identity, causal attribution or inferred semantics. Runtime replacement can preserve a fingerprint.", + } + if len(canonical(report).encode()) > 1024 * 1024: + raise Residual("CORRESPONDENCE_REPORT_BUDGET") + return {**report, "digest": digest(report)} + + +def read_source_location(package, report, location): + """Recheck a reported span against the current frozen package before use.""" + files = verify_package(package) + if ( + report.get("digest") != digest({key: value for key, value in report.items() if key != "digest"}) + or report.get("source_digest") != package["digest"] + ): + raise Residual("CORRESPONDENCE_REPORT_STALE") + if not any(location in observation["locations"] for observation in report["observations"]): + raise Residual("CORRESPONDENCE_LOCATION_NOT_REPORTED") + body = files[location["path"]] + start, end = location["start_byte"], location["end_byte"] + if type(start) is not int or type(end) is not int or not 0 <= start < end <= len(body): + raise Residual("CORRESPONDENCE_SPAN_INVALID") + if location["file_sha256"] != _sha(body) or location["span_sha256"] != _sha(body[start:end]): + raise Residual("CORRESPONDENCE_SPAN_STALE") + return body[start:end] diff --git a/orbiters/chameleon/packages/core/chameleon_core/metafold_evidence.py b/orbiters/chameleon/packages/core/chameleon_core/metafold_evidence.py new file mode 100644 index 0000000000000000000000000000000000000000..1fd6c9ec4f01de4d64cadc1fcf38c6a4f8820ce5 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/metafold_evidence.py @@ -0,0 +1,94 @@ +"""Owner-scoped correspondence from authoritative frozen evidence and receipts.""" + +from .adaptation_contracts import Evidence, Residual +from .contracts import digest +from .db import AdaptationJob, BehaviorRecord, LocalTwin +from .metafold_correspondence import source_correspondence +from .repository_artifact import REPOSITORY_KIND, checked_files, manifest_matches +from .service import Failure, owned + + +class MetafoldEvidence: + def __init__(self, sessions): + self.sessions = sessions + + def correspondence(self, owner, twin_id, record_id): + """Read-only graph; receipt authenticity comes from internal durable admission.""" + with self.sessions.begin() as session: + twin = owned(session, LocalTwin, twin_id, owner, lock=True) + record = owned(session, BehaviorRecord, record_id, owner) + if record.twin != twin.id: + raise Failure("NOT_FOUND", 404) + if twin.manifest.get("kind") != REPOSITORY_KIND: + raise Failure("CORRESPONDENCE_REPOSITORY_REQUIRED") + if record.source_digest != twin.source_digest: + raise Failure("CORRESPONDENCE_SOURCE_STALE") + receipt = record.receipt + if digest(receipt) != record.receipt_digest: + raise Failure("CORRESPONDENCE_RECEIPT_DIGEST_MISMATCH") + if receipt.get("source_digest") != record.source_digest: + raise Failure("CORRESPONDENCE_RECEIPT_BINDING_MISMATCH") + behavior, runtime = receipt.get("behavior"), receipt.get("runtime") + if not isinstance(behavior, dict) or not isinstance(runtime, dict): + raise Failure("CORRESPONDENCE_RECEIPT_BINDING_MISMATCH") + for key, expected in ( + ("package_digest", record.source_digest), + ("contract_digest", receipt.get("contract_digest")), + ("overlay_digest", receipt.get("overlay_digest")), + ("dependency_digest", receipt.get("dependency_digest")), + ): + if behavior.get(key) != expected or runtime.get(key) != expected: + raise Failure("CORRESPONDENCE_RECEIPT_BINDING_MISMATCH") + if receipt.get("overlay_digest"): + raise Failure("CORRESPONDENCE_DERIVED_SOURCE_UNSUPPORTED") + if receipt.get("dependency_digest"): + raise Failure("CORRESPONDENCE_DEPENDENCY_ASSEMBLY_UNSUPPORTED") + job = owned(session, AdaptationJob, twin.job, owner) + if job.status != "VERIFIED" or not job.evidence: + raise Failure("CORRESPONDENCE_VERIFIED_EVIDENCE_REQUIRED") + evidence = Evidence.model_validate(job.evidence) + if ( + evidence.content_digest != twin.source_digest + or twin.data != {"source_job": job.id, "package_digest": evidence.content_digest} + or not manifest_matches(twin.manifest, evidence) + ): + raise Failure("CORRESPONDENCE_REPOSITORY_BINDING_MISMATCH") + try: + checked_files(evidence) + report = source_correspondence( + {"digest": evidence.content_digest, "repository": evidence.payload}, receipt + ) + except Residual as exc: + raise Failure(exc.code) from None + nodes, edges = {}, [] + for observation in report["observations"]: + control_id = digest(["runtime_control", record.id, observation["control_index"]]) + nodes[control_id] = { + "id": control_id, + "kind": "runtime_control", + "record_id": record.id, + "control_index": observation["control_index"], + "status": observation["status"], + } + for location in observation["locations"]: + span_id = digest(["source_span", location]) + nodes[span_id] = {"id": span_id, "kind": "source_span", **location} + edges.append( + { + "from": control_id, + "to": span_id, + "kind": "inspection_candidate", + "status": observation["status"], + "reason": observation["reason"], + } + ) + report.pop("digest") + report.update( + { + "twin_id": twin.id, + "record_id": record.id, + "receipt_digest": record.receipt_digest, + "graph": {"nodes": list(nodes.values()), "edges": edges}, + } + ) + return {**report, "digest": digest(report)} diff --git a/orbiters/chameleon/packages/core/chameleon_core/metafold_lookahead.py b/orbiters/chameleon/packages/core/chameleon_core/metafold_lookahead.py new file mode 100644 index 0000000000000000000000000000000000000000..b3bd3853f91a78ab8e78f41aabd5e4c49879d4fd --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/metafold_lookahead.py @@ -0,0 +1,79 @@ +"""Project current evidence into an optimistic, explicitly conditional CPU model. + +The first operation is constrained by the existing evidence/permission kernel. +Predicted effects never become receipts; every external result causes replanning. +""" + +import time + +from .metafold_steps import REPAIR_SCOPES, effective_goal, next_step +from .microfold import search, validate_plan + + +def forecast(state, *, backend="auto"): + started = time.perf_counter_ns() + step = next_step(state) + report = {"version": "metafold-lookahead-v1", "state_digest": state["state_digest"], + "next_step_id": step["id"], "next_kind": step["kind"], "external_steps": 0, + "prediction": None} + if step["kind"] in {"COMPLETE", "BLOCKED", "BUDGET_EXHAUSTED"}: + report["reason"] = "OUTER_KERNEL_TERMINAL" + report["planning_wall_ns"] = time.perf_counter_ns() - started + return report + current, goal = state["current"], effective_goal(state) + checks = ["check:" + str(i) for i in range(len(goal["contracts"]))] + facts = ["source", "metadata", "assets", "dependencies", "code", "delivered", "first"] + checks + initial = ["first"] + if current["source_digest"]: + initial.append("source") + if not current.get("metadata_missing") or not goal["locked_assets"]: + initial.append("metadata") + if step["kind"] != "COMPLETE_ASSETS": + initial.append("assets") + if current.get("dependency_digest") or not current.get("lock_path") or not goal["locked_assets"]: + initial.append("dependencies") + if step["kind"] != "REPAIR_CODE": + initial.append("code") + for index, contract_digest in enumerate(state["contract_digests"]): + if contract_digest in state["checks"]: + initial.append(checks[index]) + operators = [] + + def operation(ident, requires, adds, removes=()): + operators.append({"id": ident, "requires": list(requires), "forbids": ["first"], + "adds": list(adds), "removes": list(removes), "cost": 1}) + + operation("ACQUIRE", [], ["source"], checks) + operation("CAPTURE_METADATA", ["source"], ["metadata"], checks) + operation("COMPLETE_ASSETS", ["source", "metadata"], ["assets"], checks) + operation("LOCKED_ASSETS", ["source", "metadata", "assets"], ["dependencies"], checks) + if goal.get("repair_scope") in REPAIR_SCOPES: + operation("REPAIR_CODE", ["source", "metadata", "assets", "dependencies"], ["code"], checks) + ready = ["source", "metadata", "assets", "dependencies", "code"] + for index, check in enumerate(checks): + operation("VERIFY:" + str(index), ready, [check]) + operation("FINALIZE", ready + checks, ["delivered"]) + first_id = step["kind"] + if first_id == "VERIFY": + first_id += ":" + str(state["contract_digests"].index(step["inputs"]["contract_digest"])) + selected = next(op for op in operators if op["id"] == first_id) + # Force the kernel-authorized first action; optimize only the conditional tail. + first = {**selected, "id": "NEXT/" + first_id, "requires": ["first"], "forbids": [], + "removes": list(selected["removes"]) + ["first"]} + if step["kind"] in {"REPAIR_CODE", "LOCKED_ASSETS"}: + checked = checks[state["contract_digests"].index(step["inputs"]["contract_digest"])] + first["adds"] = first["adds"] + [checked] + first["removes"] = [name for name in first["removes"] if name != checked] + model = {"version": "microfold-model-v1", "evidence_digest": state["state_digest"], + "facts": facts, "initial": initial, "goal": {"all": ["delivered"], "none": []}, + "operators": [first] + operators} + prediction = search(model, backend=backend) + if prediction["status"] == "PLAN_FOUND" and not validate_plan(model, prediction): + raise ValueError("METAFOLD_FORECAST_WITNESS_INVALID") + report["prediction"] = prediction + report["assumptions"] = [ + "Proposed operations succeed and reveal no new gaps; actual results may invalidate the entire tail", + "Only the next kernel-authorized operation may execute; no predicted check counts as a pass", + ] + report["planning_wall_ns"] = time.perf_counter_ns() - started + return report diff --git a/orbiters/chameleon/packages/core/chameleon_core/metafold_service.py b/orbiters/chameleon/packages/core/chameleon_core/metafold_service.py new file mode 100644 index 0000000000000000000000000000000000000000..61d48af8331c76ed99212fb934c353ae6fa8d2dc --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/metafold_service.py @@ -0,0 +1,440 @@ +"""Durable orchestration of existing brokers; no target code runs in this service. + +Pending intent is committed before dispatch. Stable downstream idempotency keys +make a crash between enqueue and recording its handle recoverable. +""" + +import copy +import hashlib +from pathlib import PurePosixPath + +from sqlalchemy import func, select + +from .adaptation_contracts import Intake, Residual +from .adaptation_service import Adaptations +from .behavior_records import BehaviorRecords +from .contracts import digest +from .counterpart_bundles import CounterpartBundles +from .db import BehaviorRecord, CounterpartBundle, LocalTwin, MetaFoldRun, User, now +from .metafold_steps import create_state, next_step, record_result, validate_request +from .service import Failure, owned +from .twins import Twins +from .verification_jobs import ( + BUILD_REPAIR_PROFILE, + CONTRACT_PROFILE, + CONTROL_REPAIR_PROFILE, + DEFINE_REPAIR_PROFILE, + MODULE_REPAIR_PROFILE, + MOUNT_REPAIR_PROFILE, + REPAIR_PROFILE, + VerificationJobs, +) + + +class MetaFold: + def __init__(self, sessions, *, adaptations=None, limits=None): + self.sessions = sessions + self.adaptations = adaptations or Adaptations(sessions, limits=limits) + self.verification = VerificationJobs(sessions, limits=self.adaptations.limits) + + def create(self, owner, request, key): + if not isinstance(key, str) or not 1 <= len(key) <= 100: + raise Failure('METAFOLD_KEY_REQUIRED', 400) + try: + request = validate_request(request) + if request['source_type'] != 'repository' or bool(request.get('source')) == bool(request.get('twin_id')): + raise ValueError('METAFOLD_REPOSITORY_SOURCE_OR_TWIN_REQUIRED') + if request.get('source'): + from .repository_capture import safe_path, target + + options = {k: request[k] for k in ('source', 'source_type', 'repository_entry', + 'repository_scope', 'repository_assets')} + Intake(**options, build_counterpart=True) + target(request['source']) + safe_path(request['repository_entry']) + except ValueError as exc: + raise Failure('METAFOLD_REQUEST_INVALID', 422) from exc + identity = digest(request) + with self.sessions.begin() as s: + if s.scalar(select(User).where(User.id == owner).with_for_update()) is None: + raise Failure('NOT_FOUND', 404) + old = s.scalar(select(MetaFoldRun).where(MetaFoldRun.owner == owner, + MetaFoldRun.creation_key == key)) + if old: + if old.request_digest != identity: + raise Failure('METAFOLD_KEY_CONFLICT') + return old.id + if request.get('twin_id'): + owned(s, LocalTwin, request['twin_id'], owner) + count = s.scalar(select(func.count()).select_from(MetaFoldRun).where(MetaFoldRun.owner == owner)) + if count >= self.adaptations.limits.max_metafold_runs_per_owner: + raise Failure('METAFOLD_OWNER_BUDGET', 429) + row = MetaFoldRun(owner=owner, creation_key=key, request_digest=identity, + state=create_state(request)) + s.add(row) + s.flush() + return row.id + + def report(self, owner, ident): + with self.sessions() as s: + row = owned(s, MetaFoldRun, ident, owner) + return {'id': row.id, 'status': row.status, 'state': row.state, 'pending': row.pending, + 'next_step': next_step(row.state), 'request_digest': row.request_digest, + 'scope': 'Recorded acceptance contracts on one source and dependency assembly'} + + def list(self, owner, twin_id=None): + with self.sessions() as s: + if twin_id: + owned(s, LocalTwin, twin_id, owner) + rows = s.scalars(select(MetaFoldRun).where(MetaFoldRun.owner == owner) + .order_by(MetaFoldRun.created.desc()).limit(10)).all() + return [{'id': row.id, 'status': row.status, 'created': row.created.isoformat(), + 'twin_id': row.state['current']['twin_id']} + for row in rows if not twin_id or twin_id in { + row.state['goal'].get('twin_id'), row.state['current']['twin_id']}] + + def advance(self, owner, ident): + with self.sessions.begin() as s: + row = owned(s, MetaFoldRun, ident, owner, lock=True) + if row.status != 'RUNNING': + return self._summary(row) + step = next_step(row.state) + if step['kind'] in {'COMPLETE', 'BLOCKED', 'BUDGET_EXHAUSTED'}: + row.status = step['kind'] + return self._summary(row) + if row.pending is None: + row.pending = {'step': step, 'handle': None} + row.updated = now() + pending = copy.deepcopy(row.pending) + state = copy.deepcopy(row.state) + # Never retain run/owner/twin locks across existing queue operations. + if 'planning' not in pending: + from .metafold_lookahead import forecast + + pending['planning'] = forecast(state) + try: + handle, result = self._execute(owner, ident, pending, state) + except (Failure, Residual) as exc: + handle, result = pending['handle'], {'status': 'ERROR', 'error': exc.code} + with self.sessions.begin() as s: + row = owned(s, MetaFoldRun, ident, owner, lock=True) + # A concurrent driver may already have recorded this exact result. + if row.pending is None or row.pending['step']['id'] != pending['step']['id']: + return self._summary(row) + if result is None: + row.pending = {**pending, 'handle': handle} + else: + row.state = record_result(row.state, pending['step'], result, planning=pending.get('planning')) + row.pending = None + row.status = row.state['status'] + row.updated = now() + return self._summary(row) + + @staticmethod + def _summary(row): + return {'id': row.id, 'status': row.status, 'state': row.state, 'pending': row.pending} + + def tick(self): + with self.sessions() as s: + rows = s.execute(select(MetaFoldRun.id, MetaFoldRun.owner).where( + MetaFoldRun.status == 'RUNNING').order_by(MetaFoldRun.updated).limit(8)).all() + changed = False + for ident, owner in rows: + before = self.report(owner, ident) + after = self.advance(owner, ident) + changed = changed or before['state'] != after['state'] or before['pending'] != after['pending'] + return changed + + def _inspect(self, owner, twin): + from .dependency_plan import plan_dependencies + + evidence = Twins(self.sessions).repository_evidence(owner, twin) + entry = PurePosixPath(evidence.payload['entry']) + files = evidence.payload['files'] + gaps = evidence.payload.get('projection', {}).get('gaps', []) + lock = None + for directory in entry.parents: + candidate = str(directory / 'package-lock.json') + prefix = str(directory / 'node_modules') + '/' + if candidate in files and any(g.get('reason') == 'MISSING_LOCAL_ASSET' + and g.get('path', '').startswith(prefix) for g in gaps): + lock = candidate + break + metadata_missing = False + try: + plan = plan_dependencies({'digest': evidence.content_digest, 'repository': evidence.payload}) + metadata_missing = bool(plan['capture_paths']) + # The current asset assembler supports one locked root per candidate. + if len(plan['groups']) > 1: + raise Failure('METAFOLD_MULTIPLE_LOCK_ROOTS_UNSUPPORTED', 422) + if any(group['status'] == 'UNAVAILABLE' for group in plan['groups']): + raise Failure('METAFOLD_DEPENDENCY_METADATA_UNAVAILABLE', 422) + ready = [group['lock_path'] for group in plan['groups'] if group['status'] == 'READY'] + lock = ready[0] if ready else lock + except Residual as exc: + if exc.code != 'DEPENDENCY_NO_OBSERVED_ASSETS': + raise + return {'status': 'PASS', 'twin_id': twin, 'source_digest': evidence.content_digest, + 'lock_path': lock, 'metadata_missing': metadata_missing} + + def _completion(self, owner, twin, record, *, module_policy=None): + if module_policy: + from .entry_capture import observed_local_assets + + evidence = Twins(self.sessions).repository_evidence(owner, twin) + with self.sessions() as session: + saved = owned(session, BehaviorRecord, record, owner) + if (saved.twin != twin or saved.source_digest != evidence.content_digest + or digest(saved.receipt) != saved.receipt_digest): + raise Failure('METAFOLD_RECEIPT_BINDING_MISMATCH') + paths = observed_local_assets({'digest': evidence.content_digest, 'repository': evidence.payload}, + saved.receipt['behavior']) + paths = [p for p in paths if 'node_modules' not in PurePosixPath(p).parts] + if not paths: + raise Residual('ENTRY_NO_NEW_LOCAL_ASSETS') + return Intake(source=evidence.payload['source'] + '/tree/' + evidence.payload['commit_sha'], + source_type='repository', repository_scope='entry', + repository_entry=evidence.payload['entry'], repository_assets=paths, + module_policy=module_policy, build_counterpart=True) + intake = BehaviorRecords(self.sessions).asset_completion(owner, twin, record) + paths = [p for p in intake.repository_assets if 'node_modules' not in PurePosixPath(p).parts] + if not paths: + raise Residual('ENTRY_NO_NEW_LOCAL_ASSETS') + return intake.model_copy(update={'repository_assets': paths}) + + def _execute(self, owner, ident, pending, state): + from .metafold_steps import effective_goal + state = {**state, 'goal': effective_goal(state)} + step, handle = pending['step'], pending['handle'] + inputs, kind = step['inputs'], step['kind'] + key = f"mf-{ident}-{step['sequence']}" + if kind == 'FINALIZE': + self._finalize(owner, state) + return None, {'status': 'PASS'} + if kind == 'ACQUIRE' and inputs.get('twin_id'): + return None, self._inspect(owner, inputs['twin_id']) + if kind in {'ACQUIRE', 'COMPLETE_ASSETS', 'CAPTURE_METADATA'}: + if not handle: + if kind == 'COMPLETE_ASSETS': + if state['goal'].get('repair_scope') == 'entry-mount': + from .mount_overlay import mount_capture_paths + evidence = Twins(self.sessions).repository_evidence(owner, inputs['twin_id']) + if evidence.content_digest != inputs['source_digest']: + raise Failure('METAFOLD_SOURCE_CHANGED') + repo = evidence.payload + try: + paths = mount_capture_paths({'digest': evidence.content_digest, 'repository': repo}, state['goal']['mount_prefix']) + except ValueError as exc: + raise Failure('METAFOLD_MOUNT_INPUTS_UNAVAILABLE', 422) from exc + intake = Intake(source=repo['source']+'/tree/'+repo['commit_sha'], + source_type='repository', repository_scope='entry', repository_entry=repo['entry'], + repository_assets=paths, build_counterpart=True) + elif state['goal'].get('repair_scope') == 'modern-esm': + evidence = Twins(self.sessions).repository_evidence(owner, inputs['twin_id']) + if evidence.content_digest != inputs['source_digest']: + raise Failure('METAFOLD_SOURCE_CHANGED') + repo = evidence.payload + intake = Intake(source=repo['source']+'/tree/'+repo['commit_sha'], + source_type='repository', repository_scope='entry', repository_entry=repo['entry'], + repository_assets=repo.get('projection', {}).get('additional_local_paths', []), + build_importer=state['goal']['module_importer'], build_counterpart=True) + else: + intake = self._completion(owner, inputs['twin_id'], inputs['record_id'], + module_policy='relative-js-unique-v1' + if state['goal'].get('repair_scope') == 'relative-modules' else None) + elif kind == 'CAPTURE_METADATA': + from .dependency_plan import metadata_intake + + evidence = Twins(self.sessions).repository_evidence(owner, inputs['twin_id']) + if evidence.content_digest != inputs['source_digest']: + raise Failure('METAFOLD_SOURCE_CHANGED') + intake = metadata_intake(evidence) + else: + options = {k: v for k, v in inputs.items() if k in { + 'source', 'source_type', 'repository_entry', 'repository_scope', 'repository_assets'}} + intake = Intake(**options, build_counterpart=True) + job = self.adaptations.create(owner, intake, key) + handle = {'kind': 'adaptation', 'id': job} + report = self.adaptations.report(owner, handle['id']) + counterpart = report.get('counterpart') or {} + if report['status'] in {'QUEUED', 'RUNNING'} or counterpart.get('status') == 'PENDING': + return handle, None + if counterpart.get('status') != 'READY': + return handle, {'status': 'FAIL', 'error': report.get('residual') or 'METAFOLD_ACQUISITION_FAILED'} + if kind == 'COMPLETE_ASSETS' and state['goal'].get('repair_scope') in {'relative-modules', 'modern-esm', 'entry-mount'}: + before = Twins(self.sessions).repository_evidence(owner, inputs['twin_id']).payload + after = Twins(self.sessions).repository_evidence(owner, counterpart['twin_id']).payload + if (any(before[k] != after[k] for k in ('source', 'commit_sha', 'tree_sha', 'entry')) + or any(after['files'].get(p) != f for p, f in before['files'].items())): + raise Failure('METAFOLD_MODULE_RECAPTURE_MISMATCH') + return handle, self._inspect(owner, counterpart['twin_id']) + if kind in {'VERIFY', 'LOCKED_ASSETS', 'REPAIR_CODE'}: + if not handle: + assembly = inputs.get('assembly') if kind == 'VERIFY' else None + if kind == 'REPAIR_CODE': + assembly = {key: inputs[key] for key in ('failure_record_id', 'failure_receipt_digest')} + if state['goal'].get('repair_scope') == 'declared-constants': + retained = self.verification.failure_dependencies(owner, inputs['twin_id'], inputs['failure_record_id']) + if retained is not None: + assembly.update(dependency_artifact=retained, dependency_digest=retained['digest']) + if inputs.get('module_importer'): + assembly['importer'] = inputs['module_importer'] + if inputs.get('mount_prefix'): + assembly['mount_prefix'] = inputs['mount_prefix'] + if inputs.get('control_id'): + assembly['control_id'] = inputs['control_id'] + job = self.verification.enqueue(owner, inputs['twin_id'], key, + profile=(DEFINE_REPAIR_PROFILE if state['goal'].get('repair_scope') == 'declared-constants' + else CONTROL_REPAIR_PROFILE if state['goal'].get('repair_scope') == 'documented-control' + else MOUNT_REPAIR_PROFILE if state['goal'].get('repair_scope') == 'entry-mount' + else BUILD_REPAIR_PROFILE if state['goal'].get('repair_scope') == 'modern-esm' + else MODULE_REPAIR_PROFILE if inputs.get('module_importer') else REPAIR_PROFILE) + if kind == 'REPAIR_CODE' else CONTRACT_PROFILE, + contract=inputs['contract'], expected_source=inputs['source_digest'], + assembly=assembly, + dependency_lock=inputs.get('lock_path') if kind == 'LOCKED_ASSETS' else None) + handle = {'kind': 'verification', 'id': job} + report = self.verification.report(owner, handle['id']) + if report['status'] in {'QUEUED', 'RUNNING'}: + return handle, None + record_id = (report.get('result') or {}).get('record_id') + if report['status'] not in {'PASS', 'FAIL'} or not record_id: + return handle, {'status': 'ERROR', 'error': 'METAFOLD_VERIFICATION_' + report['status']} + return handle, self._observed_result(owner, inputs['twin_id'], record_id, + module_importer=state['goal'].get('module_importer'), + build_scope=state['goal'].get('repair_scope') == 'modern-esm', + mount_prefix=state['goal'].get('mount_prefix'), control_id=state['goal'].get('control_id')) + raise Failure('METAFOLD_OPERATOR_UNAVAILABLE', 422) + + def _observed_result(self, owner, twin_id, record_id, *, module_importer=None, build_scope=False, mount_prefix=None, control_id=None): + observed = self._inspect(owner, twin_id) + with self.sessions() as s: + record = owned(s, BehaviorRecord, record_id, owner) + r = record.receipt + if (record.twin != twin_id or record.source_digest != observed['source_digest'] + or digest(r) != record.receipt_digest): + raise Failure('METAFOLD_RECEIPT_BINDING_MISMATCH') + saved = s.scalar(select(CounterpartBundle).where(CounterpartBundle.record == record.id, + CounterpartBundle.owner == owner)) + bundle = {'id': saved.id, 'sha256': saved.sha256} if saved else None + dependency = r.get('dependency_digest') + overlay = r.get('overlay_digest') + result = {**observed, 'status': r['behavior']['status'], 'record_id': record.id, + 'receipt_digest': record.receipt_digest, 'contract_digest': r['contract_digest'], + 'dependency_digest': dependency, 'overlay_digest': overlay, + 'bundle': bundle, 'assembly': None, + 'missing_assets': False, 'error': r['behavior'].get('error')} + if bundle and (dependency or overlay): + result['assembly'] = {'bundle_id': bundle['id'], 'bundle_sha256': bundle['sha256'], + 'dependency_digest': dependency} + if overlay: + result['assembly']['overlay_digest'] = overlay + if bundle: + CounterpartBundles(self.sessions).download(owner, twin_id, bundle['id']) + if result['status'] == 'FAIL' and not overlay: + from .define_overlay import inspect_define_failure + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + try: + inspect_define_failure({'digest': evidence.content_digest, 'repository': evidence.payload}, r['behavior']) + except ValueError: + pass # No structural match; never invent a scope from an error alone. + else: + result['repair_candidate'] = 'declared-constants' + if not dependency and not overlay: + if control_id and result['status'] == 'FAIL': + from .control_overlay import control_overlay + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + try: + control_overlay({'digest': evidence.content_digest, 'repository': evidence.payload}, control_id) + except ValueError as exc: + raise Failure('METAFOLD_CONTROL_INPUTS_UNAVAILABLE', 422) from exc + if mount_prefix: + from .mount_overlay import mount_capture_paths, mount_overlay + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + try: + package = {'digest': evidence.content_digest, 'repository': evidence.payload} + paths = mount_capture_paths(package, mount_prefix) + if any(p not in evidence.payload['files'] for p in paths): + result['missing_assets'] = True + return result + mount_overlay(package, mount_prefix) + except ValueError as exc: + raise Failure('METAFOLD_MOUNT_INPUTS_UNAVAILABLE', 422) from exc + return result + # An explicit compatibility request may have held destinations for + # extensionless failed requests. This only defers asset acquisition + # to the repair worker's AST gate; it never credits a behavior pass. + if module_importer: + import posixpath + + from .entry_capture import observed_local_assets + from .module_resolution import resolve_relative_import + + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + files = evidence.payload['files'] + package = {'digest': evidence.content_digest, 'repository': evidence.payload} + missing = [p for p in observed_local_assets(package, r['behavior']) if p not in files] + if build_scope and missing: + if module_importer not in files or any(p not in files for p in ('package.json', 'rollup.config.js')): + result['missing_assets'] = True + return result + from .build_plan import plan_saved_build + try: + declaration = plan_saved_build(package, module_importer)['plan'] + except ValueError as exc: + raise Failure('METAFOLD_BUILD_DECLARATION_UNSUPPORTED', 422) from exc + if declaration['missing_inputs']: + result['missing_assets'] = True + return result + result['module_resolution_pending'] = True + return result + inventory = {p: {'sha': f['git_blob_sha'], 'size': f['bytes']} for p, f in files.items()} + ready = module_importer in files and bool(missing) + for path in missing: + specifier = posixpath.relpath(path, posixpath.dirname(module_importer) or '.') + if not specifier.startswith('.'): + specifier = './' + specifier + try: + ready = ready and resolve_relative_import(module_importer, specifier, inventory)['status'] == 'RESOLVED' + except ValueError: + ready = False + if ready: + result['module_resolution_pending'] = True + return result + if missing and module_importer in files: + result['missing_assets'] = True + return result + try: + self._completion(owner, twin_id, record_id) + result['missing_assets'] = True + except Residual as exc: + if exc.code not in {'ENTRY_NO_NEW_LOCAL_ASSETS', 'ENTRY_ASSETS_ABSENT_FROM_PINNED_SOURCE', + 'ENTRY_ASSET_COMPLETION_STALLED'}: + raise + if exc.code != 'ENTRY_NO_NEW_LOCAL_ASSETS': + from .entry_capture import observed_local_assets + + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + paths = observed_local_assets({'digest': evidence.content_digest, + 'repository': evidence.payload}, r['behavior']) + if any(path not in evidence.payload['files'] + and 'node_modules' not in PurePosixPath(path).parts for path in paths): + raise Failure('METAFOLD_SOURCE_ASSET_UNAVAILABLE', 422) from exc + return result + + def _finalize(self, owner, state): + current = state['current'] + actual = self._inspect(owner, current['twin_id']) + if actual['source_digest'] != current['source_digest']: + raise Failure('METAFOLD_FINAL_SOURCE_CHANGED') + for contract_digest, check in state['checks'].items(): + result = self._observed_result(owner, current['twin_id'], check['record_id']) + if (result['status'] != 'PASS' or result['contract_digest'] != contract_digest + or result['source_digest'] != current['source_digest'] + or result['overlay_digest'] != current.get('overlay_digest') + or result['dependency_digest'] != current.get('dependency_digest') or not result['bundle']): + raise Failure('METAFOLD_FINAL_EVIDENCE_MISMATCH') + body, fingerprint = CounterpartBundles(self.sessions).download( + owner, current['twin_id'], result['bundle']['id']) + if hashlib.sha256(body).hexdigest() != fingerprint: + raise Failure('METAFOLD_FINAL_BUNDLE_MISMATCH') diff --git a/orbiters/chameleon/packages/core/chameleon_core/metafold_steps.py b/orbiters/chameleon/packages/core/chameleon_core/metafold_steps.py new file mode 100644 index 0000000000000000000000000000000000000000..cde401c85d77b28dde8a385b1bf6fe7d71191f97 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/metafold_steps.py @@ -0,0 +1,540 @@ +"""Pure, finite reconstruction planning over caller-verified durable facts. + +The service adapter owns authorization, receipts and all broker effects. This +kernel never reads a target, runs source, changes acceptance contracts, or turns +an absent result into a pass. The digest detects stale plans and accidental +state changes; it is not a signature or a substitute for receipt admission. +""" + +import copy +import hashlib +import json +import re + +from .browser_contract import validate_contract + +VERSION = "metafold-step-engine-v1" +EFFORT_STEPS = {"luna": 6, "sol": 8, "astra": 10} +WORK = {"ACQUIRE", "VERIFY", "COMPLETE_ASSETS", "CAPTURE_METADATA", "LOCKED_ASSETS", "REPAIR_CODE"} +REPAIR_SCOPES = frozenset({'arithmetic', 'relative-modules', 'modern-esm', 'entry-mount', 'documented-control', 'declared-constants'}) +TERMINAL = {"COMPLETE", "BLOCKED", "BUDGET_EXHAUSTED"} +REQUEST_KEYS = { + "effort", + "source", + "twin_id", + "contracts", + "max_steps", + "complete_assets", + "locked_assets", + "source_type", + "repository_entry", + "repository_scope", + "repository_assets", + "repair_scope", + "module_importer", + "mount_prefix", + "control_id", +} + + +def _require(condition, code="INVALID_METAFOLD_REQUEST"): + if not condition: + raise ValueError(code) + + +def _digest(value): + encoded = json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode() + return hashlib.sha256(encoded).hexdigest() + + +def _hash(value): + return isinstance(value, str) and bool(re.fullmatch(r"[a-f0-9]{64}", value)) + + +def _text(value, limit=512): + return isinstance(value, str) and 0 < len(value) <= limit and not any(ord(c) < 32 for c in value) + + +def repair_gap(goal, result): + """Describe unavailable routing without claiming an operator is applicable.""" + scope = goal.get('repair_scope') + return { + 'classification': ('OPERATOR_SELECTION_UNRESOLVED' if scope is None + else 'OPERATOR_COMPOSITION_UNSUPPORTED'), + 'selected_scope': scope, + 'registered_scopes': sorted(REPAIR_SCOPES), + 'applicability': 'NOT_ESTABLISHED', + 'evidence': {key: result.get(key) for key in + ('source_digest', 'contract_digest', 'record_id', 'receipt_digest')}, + 'next_requirement': ('Match captured structure and failure evidence to operator preconditions' + if scope is None else + 'Check selected operator against the current dependency and overlay assembly'), + } + + +def validate_request(value): + """Return a detached, canonical bounded goal with unchanged browser checks.""" + _require(isinstance(value, dict) and not set(value) - REQUEST_KEYS) + value = copy.deepcopy(value) + if "repair_scope" in value: + _require(isinstance(value["repair_scope"], str) + and value["repair_scope"] in REPAIR_SCOPES) + if value.get('repair_scope') == 'documented-control': + _require(isinstance(value.get('control_id'), str) and bool(re.fullmatch(r'[A-Za-z_][\w-]{0,79}', value['control_id']))) + else: + _require('control_id' not in value) + if value.get('repair_scope') == 'entry-mount': + _require(isinstance(value.get('mount_prefix'), str) and bool(re.fullmatch(r'[A-Za-z0-9_-]{1,80}', value['mount_prefix']))) + else: + _require('mount_prefix' not in value) + if value.get("repair_scope") in {'relative-modules', 'modern-esm'}: + from .repository_capture import safe_path + + _require(_text(value.get("module_importer"))) + safe_path(value["module_importer"]) + _require(value["module_importer"].endswith((".js", ".mjs"))) + else: + _require("module_importer" not in value) + _require(value.get("source") is not None or value.get("twin_id") is not None) + if "source" in value: + _require(_text(value["source"], 2048)) + if "twin_id" in value: + _require(_text(value["twin_id"], 100)) + contracts = value.get("contracts") + _require(isinstance(contracts, list) and 1 <= len(contracts) <= 4) + checked = [validate_contract(contract) for contract in contracts] + _require(len({item[1] for item in checked}) == len(checked)) + value["contracts"] = [item[0] for item in checked] + if "effort" in value: + _require(isinstance(value["effort"], str) and value["effort"] in EFFORT_STEPS) + selected_limit = EFFORT_STEPS[value["effort"]] + _require("max_steps" not in value or value["max_steps"] == selected_limit, + "METAFOLD_EFFORT_BUDGET_CONFLICT") + value["max_steps"] = selected_limit + value.setdefault("max_steps", 10) # Preserve existing persisted requests exactly. + _require(type(value["max_steps"]) is int and 1 <= value["max_steps"] <= 10) + for key in ("complete_assets", "locked_assets"): + value.setdefault(key, True) + _require(type(value[key]) is bool) + value.setdefault("source_type", "repository") + _require(value["source_type"] in {"repository", "website"}) + value.setdefault("repository_entry", "index.html") + value.setdefault("repository_scope", "entry") + _require(_text(value["repository_entry"])) + _require(value["repository_scope"] == "entry") + value.setdefault("repository_assets", []) + paths = value["repository_assets"] + _require(isinstance(paths, list) and len(paths) <= 16 and all(_text(path) for path in paths)) + _require(len(paths) == len(set(paths))) + value["repository_assets"] = sorted(paths) + return value + + +def _seal(state): + state["state_digest"] = _digest({key: value for key, value in state.items() if key != "state_digest"}) + return state + + +def create_state(request): + goal = validate_request(request) + return _seal( + { + "version": VERSION, + "goal": goal, + "goal_digest": _digest(goal), + "contract_digests": [validate_contract(contract)[1] for contract in goal["contracts"]], + "sequence": 0, + "status": "RUNNING", + "current": { + "twin_id": goal.get("twin_id"), + "source_digest": None, + "dependency_digest": None, + "overlay_digest": None, + "assembly": None, + "lock_path": None, + "metadata_missing": False, + "bundle": None, + }, + "checks": {}, + "history": [], + "budget": {"limit": goal["max_steps"], "used": 0}, + } + ) + + +def _validate_state(state): + _require(isinstance(state, dict) and state.get("version") == VERSION, "INVALID_METAFOLD_STATE") + _require( + state.get("state_digest") + == _digest({key: value for key, value in state.items() if key != "state_digest"}), + "METAFOLD_STATE_CHANGED", + ) + _require(state["goal"] == validate_request(state["goal"]), "METAFOLD_GOAL_CHANGED") + _require(state["goal_digest"] == _digest(state["goal"]), "METAFOLD_GOAL_CHANGED") + _require( + state["contract_digests"] == [validate_contract(c)[1] for c in state["goal"]["contracts"]], + "METAFOLD_GOAL_CHANGED", + ) + _require(state["sequence"] == len(state["history"]), "INVALID_METAFOLD_STATE") + _require(state["budget"]["limit"] == state["goal"]["max_steps"], "METAFOLD_GOAL_CHANGED") + _require( + state["budget"]["used"] == sum(item["step"]["kind"] in WORK for item in state["history"]), + "INVALID_METAFOLD_STATE", + ) + + +def _identity(value): + return value.get("source_digest"), value.get("dependency_digest"), value.get("overlay_digest") + + +def _current_verifications(state): + return [ + item + for item in state["history"] + if item["step"]["kind"] in {"VERIFY", "LOCKED_ASSETS", "REPAIR_CODE"} + and _identity(item["result"]) == _identity(state["current"]) + ] + + +def _contract_inputs(state, index): + current = state["current"] + return { + "twin_id": current["twin_id"], + "source_digest": current["source_digest"], + "assembly": copy.deepcopy(current["assembly"]), + "contract": copy.deepcopy(state["goal"]["contracts"][index]), + "contract_digest": state["contract_digests"][index], + } + + +def effective_goal(state): + goal = copy.deepcopy(state['goal']) + if 'repair_scope' not in goal: + for item in reversed(state['history']): + result = item['result'] + if result.get('source_digest') != state['current']['source_digest']: + continue + if result.get('repair_candidate') == 'declared-constants': + goal['repair_scope'] = 'declared-constants' + break + return goal + + +def _decision(state): + current, goal = state["current"], effective_goal(state) + if state["status"] == "COMPLETE": + return "COMPLETE", {"bundle": current["bundle"], "reason": "ALL_CONTRACTS_VERIFIED"} + history = state["history"] + if history and history[-1]["result"]["status"] == "ERROR": + return "BLOCKED", {"reason": history[-1]["result"]["error"]} + if history and history[-1]["step"]["kind"] == "REPAIR_CODE" and history[-1]["result"]["status"] == "FAIL": + return "BLOCKED", {"reason": "REPAIR_CONTRACT_FAILED", "record_id": history[-1]["result"]["record_id"]} + if not current["source_digest"]: + inputs = { + key: goal[key] + for key in ( + "source", + "twin_id", + "source_type", + "repository_entry", + "repository_scope", + "repository_assets", + ) + if key in goal + } + return "ACQUIRE", inputs + if current.get("metadata_missing") and goal["locked_assets"]: + attempted = any( + item["step"]["kind"] == "CAPTURE_METADATA" + and item["step"]["inputs"]["source_digest"] == current["source_digest"] + for item in history + ) + if attempted: + return "BLOCKED", {"reason": "DEPENDENCY_METADATA_NO_PROGRESS"} + return "CAPTURE_METADATA", { + "twin_id": current["twin_id"], + "source_digest": current["source_digest"], + } + observations = _current_verifications(state) + latest = observations[-1] if observations else None + # A layout pass is still a pass, but it cannot erase an observed unresolved + # import. Try the remaining declared contracts for diagnostic evidence; + # never fabricate the failed receipt required by the repair worker. + pending_module = any(item['result'].get('module_resolution_pending') for item in observations) + if pending_module and latest['result']['status'] == 'PASS': + observed_contracts = {item['result']['contract_digest'] for item in observations} + for index, contract_digest in enumerate(state['contract_digests']): + if contract_digest not in observed_contracts: + return 'VERIFY', _contract_inputs(state, index) + return 'BLOCKED', {'reason': 'MODULE_REPAIR_REQUIRES_FAILED_BEHAVIOR', + 'record_id': latest['result']['record_id']} + if latest and latest["result"].get("missing_assets"): + if not goal["complete_assets"]: + return "BLOCKED", {"reason": "SOURCE_ASSETS_MISSING"} + if current["dependency_digest"]: + return "BLOCKED", {"reason": "DEPENDENCY_ASSEMBLY_ASSET_RECAPTURE_UNSUPPORTED"} + attempted = any( + item["step"]["kind"] == "COMPLETE_ASSETS" + and item["step"]["inputs"]["source_digest"] == current["source_digest"] + for item in history + ) + if attempted: + return "BLOCKED", {"reason": "ASSET_COMPLETION_NO_PROGRESS"} + return "COMPLETE_ASSETS", { + "twin_id": current["twin_id"], + "source_digest": current["source_digest"], + "record_id": latest["result"]["record_id"], + } + if (latest and latest['result']['status'] == 'FAIL' and goal.get('repair_scope') == 'declared-constants' + and not latest['result'].get('overlay_digest') + and not any(item['step']['kind'] == 'REPAIR_CODE' for item in history) + and (latest['result'].get('dependency_digest') or not goal['locked_assets'] or not current['lock_path'])): + index = state['contract_digests'].index(latest['result']['contract_digest']) + return 'REPAIR_CODE', {**_contract_inputs(state, index), + 'failure_record_id':latest['result']['record_id'], + 'failure_receipt_digest':latest['result'].get('receipt_digest')} + if latest and goal["locked_assets"] and current["lock_path"] and not current["dependency_digest"]: + locked_attempt = next( + ( + item + for item in reversed(history) + if item["step"]["kind"] == "LOCKED_ASSETS" + and item["step"]["inputs"]["source_digest"] == current["source_digest"] + ), + None, + ) + if locked_attempt: + if locked_attempt["result"].get("dependency_digest") and locked_attempt["result"]["status"] == "FAIL": + if (goal.get('repair_scope') == 'declared-constants' + and not any(item['step']['kind'] == 'REPAIR_CODE' for item in history)): + result = locked_attempt['result'] + index = state['contract_digests'].index(result['contract_digest']) + return 'REPAIR_CODE', {**_contract_inputs(state, index), + 'failure_record_id':result['record_id'], + 'failure_receipt_digest':result.get('receipt_digest')} + return "BLOCKED", { + "reason": "REPAIR_OPERATOR_MISSING", + "repair_gap": repair_gap(goal, locked_attempt['result']), + "record_id": locked_attempt["result"]["record_id"], + "dependency_digest": locked_attempt["result"]["dependency_digest"], + } + return "BLOCKED", {"reason": "LOCKED_ASSET_ASSEMBLY_UNRESOLVED"} + index = state["contract_digests"].index(latest["step"]["inputs"]["contract_digest"]) + return "LOCKED_ASSETS", {**_contract_inputs(state, index), "lock_path": current["lock_path"]} + if latest and latest["result"]["status"] == "FAIL": + if (goal.get("repair_scope") in {"arithmetic", "relative-modules", 'modern-esm', 'entry-mount', 'documented-control'} and not current.get("overlay_digest") + and not current.get("dependency_digest") + and not any(item["step"]["kind"] == "REPAIR_CODE" for item in history)): + index = state["contract_digests"].index(latest["result"]["contract_digest"]) + return "REPAIR_CODE", { + **_contract_inputs(state, index), + "failure_record_id": latest["result"]["record_id"], + "failure_receipt_digest": latest["result"].get("receipt_digest"), + **({'mount_prefix': goal['mount_prefix']} if goal.get('repair_scope') == 'entry-mount' else {}), + **({'control_id': goal['control_id']} if goal.get('repair_scope') == 'documented-control' else {}), + **({"module_importer": goal["module_importer"]} + if goal.get("repair_scope") in {'relative-modules', 'modern-esm'} else {}), + } + return "BLOCKED", {"reason": "REPAIR_OPERATOR_MISSING", "record_id": latest["result"]["record_id"], + "repair_gap": repair_gap(goal, latest['result'])} + for index, contract_digest in enumerate(state["contract_digests"]): + check = state["checks"].get(contract_digest) + if not check or _identity(check) != _identity(current) or not check.get("bundle"): + return "VERIFY", _contract_inputs(state, index) + return "FINALIZE", { + "twin_id": current["twin_id"], + "source_digest": current["source_digest"], + "dependency_digest": current["dependency_digest"], + "bundle": current["bundle"], + "contract_digests": state["contract_digests"], + } + + +def _next(state): + kind, inputs = _decision(state) + if kind in WORK and state["budget"]["used"] >= state["budget"]["limit"]: + kind, inputs = "BUDGET_EXHAUSTED", {"reason": "STEP_BUDGET_EXHAUSTED", "pending_kind": kind} + step = {"kind": kind, "sequence": state["sequence"] + 1, "inputs": copy.deepcopy(inputs)} + step["id"] = _digest({"state_digest": state["state_digest"], **step}) + return step + + +def next_step(state): + """Return the only admissible next operation, or a typed terminal decision.""" + _validate_state(state) + return _next(state) + + +def _bundle(value): + _require( + isinstance(value, dict) + and set(value) == {"id", "sha256"} + and _text(value["id"], 100) + and _hash(value["sha256"]), + "METAFOLD_BUNDLE_REQUIRED", + ) + return copy.deepcopy(value) + + +def _normalize_result(state, step, supplied): + _require(isinstance(supplied, dict), "INVALID_METAFOLD_RESULT") + result = copy.deepcopy(supplied) + status = result.get("status") + _require(status in {"PASS", "FAIL", "ERROR"}, "INVALID_METAFOLD_RESULT") + if status == "ERROR" or ( + status == "FAIL" + and ( + step["kind"] in {"ACQUIRE", "COMPLETE_ASSETS", "CAPTURE_METADATA"} or not result.get("record_id") + ) + ): + _require(_text(result.get("error"), 200), "INVALID_METAFOLD_RESULT") + return {"status": "ERROR", "error": result["error"]} + if step["kind"] == "FINALIZE": + _require(result == {"status": "PASS"}, "INVALID_METAFOLD_RESULT") + return result + _require(_hash(result.get("source_digest")), "METAFOLD_SOURCE_REQUIRED") + if "lock_path" in result and result["lock_path"] is not None: + _require( + _text(result["lock_path"]) and (result["lock_path"] == 'captured-styles-v1' or result["lock_path"].split("/")[-1] in {"package-lock.json", "pnpm-lock.yaml"}), + "INVALID_METAFOLD_RESULT", + ) + if "metadata_missing" in result: + _require(type(result["metadata_missing"]) is bool, "INVALID_METAFOLD_RESULT") + if step["kind"] in {"ACQUIRE", "COMPLETE_ASSETS", "CAPTURE_METADATA"}: + _require(status == "PASS" and _text(result.get("twin_id"), 100), "INVALID_METAFOLD_RESULT") + if step["kind"] == "ACQUIRE" and state["goal"].get("twin_id"): + _require(result["twin_id"] == state["goal"]["twin_id"], "METAFOLD_TWIN_MISMATCH") + return { + key: result[key] + for key in ("status", "twin_id", "source_digest", "lock_path", "metadata_missing") + if key in result + } + _require(result["source_digest"] == step["inputs"]["source_digest"], "METAFOLD_SOURCE_MISMATCH") + result.setdefault("contract_digest", step["inputs"]["contract_digest"]) + _require(result["contract_digest"] == step["inputs"]["contract_digest"], "METAFOLD_CONTRACT_MISMATCH") + _require(_text(result.get("record_id"), 100), "METAFOLD_RECEIPT_REQUIRED") + if "receipt_digest" in result: + _require(_hash(result["receipt_digest"]), "INVALID_METAFOLD_RESULT") + if 'repair_candidate' in result: + _require(result['repair_candidate'] == 'declared-constants' and status == 'FAIL' + and _hash(result.get('receipt_digest')) and not result.get('overlay_digest'), + 'INVALID_REPAIR_CANDIDATE') + result.setdefault("missing_assets", False) + _require(type(result["missing_assets"]) is bool, "INVALID_METAFOLD_RESULT") + if "module_resolution_pending" in result: + _require(type(result["module_resolution_pending"]) is bool, "INVALID_METAFOLD_RESULT") + _require(state['goal'].get('repair_scope') in {'relative-modules', 'modern-esm'}, 'INVALID_METAFOLD_RESULT') + result.setdefault("dependency_digest", None) + result.setdefault("overlay_digest", None) + result.setdefault("assembly", None) + dependency = result["dependency_digest"] + overlay = result["overlay_digest"] + _require(overlay is None or _hash(overlay), "INVALID_METAFOLD_RESULT") + _require(dependency is None or _hash(dependency), "INVALID_METAFOLD_RESULT") + if step["kind"] == "VERIFY": + _require(dependency == state["current"]["dependency_digest"], "METAFOLD_ASSEMBLY_MISMATCH") + _require(overlay == state["current"].get("overlay_digest"), "METAFOLD_ASSEMBLY_MISMATCH") + elif step["kind"] == "REPAIR_CODE": + expected_dependency = (state['history'][-1]['result'].get('dependency_digest') + if effective_goal(state).get('repair_scope') == 'declared-constants' else None) + _require(dependency == expected_dependency and _hash(overlay), "METAFOLD_REPAIR_OVERLAY_REQUIRED") + else: + _require(overlay is None, "METAFOLD_ASSEMBLY_MISMATCH") + if status == "PASS": + result["bundle"] = _bundle(result.get("bundle")) + if dependency or overlay: + expected = { + "bundle_id": result["bundle"]["id"], + "bundle_sha256": result["bundle"]["sha256"], + "dependency_digest": dependency, + } + if overlay: + expected["overlay_digest"] = overlay + _require(result["assembly"] == expected, "METAFOLD_ASSEMBLY_MISMATCH") + else: + _require(result["assembly"] is None, "METAFOLD_ASSEMBLY_MISMATCH") + return { + key: result[key] + for key in ( + "status", + "source_digest", + "contract_digest", + "record_id", + "bundle", + "dependency_digest", + "overlay_digest", + "assembly", + "missing_assets", + "module_resolution_pending", + "repair_candidate", + "lock_path", + "error", + "receipt_digest", + ) + if key in result + } + + +def record_result(state, step, result, *, planning=None): + """Apply one caller-verified terminal result without mutating either input.""" + _validate_state(state) + _require(step == _next(state), "METAFOLD_STEP_STALE") + _require(step["kind"] in WORK | {"FINALIZE"}, "METAFOLD_RUN_TERMINAL") + result = _normalize_result(state, step, result) + updated = copy.deepcopy(state) + current = updated["current"] + kind = step["kind"] + if result["status"] != "ERROR": + if kind in {"ACQUIRE", "COMPLETE_ASSETS", "CAPTURE_METADATA"}: + updated["checks"] = {} + current.update( + { + "twin_id": result["twin_id"], + "source_digest": result["source_digest"], + "dependency_digest": None, + "overlay_digest": None, + "assembly": None, + "bundle": None, + "lock_path": result.get("lock_path"), + "metadata_missing": result.get("metadata_missing", False), + } + ) + elif kind == "FINALIZE": + updated["status"] = "COMPLETE" + else: + if "lock_path" in result: + current["lock_path"] = result["lock_path"] + if kind in {"LOCKED_ASSETS", "REPAIR_CODE"} and result["status"] == "PASS": + if _identity(result) != _identity(current): + updated["checks"] = {} + current["dependency_digest"] = result["dependency_digest"] + current["overlay_digest"] = result["overlay_digest"] + current["assembly"] = result["assembly"] + if result["status"] == "PASS": + current["bundle"] = result["bundle"] + if current["dependency_digest"] or current.get("overlay_digest"): + current["assembly"] = result["assembly"] + updated["checks"][result["contract_digest"]] = { + key: result[key] for key in ( + "source_digest", "dependency_digest", "overlay_digest", "record_id", "bundle") + } + if "receipt_digest" in result: + updated["checks"][result["contract_digest"]]["receipt_digest"] = result["receipt_digest"] + else: + updated["checks"].pop(result["contract_digest"], None) + entry = {"step": copy.deepcopy(step), "result": result} + if planning is not None: + _require(isinstance(planning, dict) and planning.get("version") == "metafold-lookahead-v1" + and planning.get("state_digest") == state["state_digest"] + and planning.get("next_step_id") == step["id"] + and planning.get("external_steps") == 0 + and len(json.dumps(planning)) <= 8192, "METAFOLD_PLANNING_BINDING") + entry["planning"] = copy.deepcopy(planning) + updated["history"].append(entry) + updated["sequence"] += 1 + updated["budget"]["used"] += kind in WORK + _seal(updated) + decision = _next(updated) + if decision["kind"] in TERMINAL: + updated["status"] = decision["kind"] + return _seal(updated) diff --git a/orbiters/chameleon/packages/core/chameleon_core/microfold.py b/orbiters/chameleon/packages/core/chameleon_core/microfold.py new file mode 100644 index 0000000000000000000000000000000000000000..744aaf51bf7c03db9288d44d8159de98666101b1 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/microfold.py @@ -0,0 +1,191 @@ +"""Bounded CPU search over explicit transition models; never executes target code. + +A plan is a conditional prediction, not a browser receipt. The independent +scalar replayer checks its witness before it can be offered to an outer broker. +""" + +import hashlib +import heapq +import importlib.util +import json +import time +from dataclasses import dataclass + + +def fingerprint(value): + return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":"), + ensure_ascii=True, allow_nan=False).encode()).hexdigest() + + +def require(value, message="MICROFOLD_MODEL_INVALID"): + if not value: + raise ValueError(message) + + +@dataclass(frozen=True) +class Operation: + ident: str + requires: int + forbids: int + adds: int + removes: int + cost: int + + +def compile_model(model): + require(isinstance(model, dict) and set(model) == { + "version", "evidence_digest", "facts", "initial", "goal", "operators"}) + require(model["version"] == "microfold-model-v1") + evidence = model["evidence_digest"] + require(isinstance(evidence, str) and len(evidence) == 64 and all(c in "0123456789abcdef" for c in evidence)) + facts = model["facts"] + require(isinstance(facts, list) and 1 <= len(facts) <= 63) + require(all(isinstance(f, str) and 1 <= len(f) <= 80 for f in facts)) + require(len(set(facts)) == len(facts)) + bits = {name: 1 << index for index, name in enumerate(facts)} + + def mask(names): + require(isinstance(names, list) and len(names) <= len(facts)) + require(all(isinstance(name, str) and name in bits for name in names)) + require(len(set(names)) == len(names)) + return sum(bits[name] for name in names) + + require(isinstance(model["goal"], dict) and set(model["goal"]) == {"all", "none"}) + initial, wanted, forbidden = mask(model["initial"]), mask(model["goal"]["all"]), mask(model["goal"]["none"]) + require(not wanted & forbidden) + rows = model["operators"] + require(isinstance(rows, list) and len(rows) <= 128) + operations = [] + for row in rows: + require(isinstance(row, dict) and set(row) == {"id", "requires", "forbids", "adds", "removes", "cost"}) + require(isinstance(row["id"], str) and 1 <= len(row["id"]) <= 100) + require(type(row["cost"]) is int and 1 <= row["cost"] <= 1_000_000) + op = Operation(row["id"], mask(row["requires"]), mask(row["forbids"]), + mask(row["adds"]), mask(row["removes"]), row["cost"]) + require(not op.requires & op.forbids and not op.adds & op.removes) + operations.append(op) + require(len({op.ident for op in operations}) == len(operations)) + return initial, wanted, forbidden, tuple(operations) + + +def transition_batch(states, operations, backend="python"): + """Return (parent index, operator index, resulting bits) for applicable pairs. + + Caller bounds pairs to 1,000. Both backends preserve the same iteration order. + """ + require(len(states) * len(operations) <= 1000, "MICROFOLD_BATCH_BUDGET") + if backend == "numpy": + import numpy as np + + source = np.asarray(states, dtype=np.uint64)[:, None] + needs = np.asarray([op.requires for op in operations], dtype=np.uint64) + forbids = np.asarray([op.forbids for op in operations], dtype=np.uint64) + adds = np.asarray([op.adds for op in operations], dtype=np.uint64) + removes = np.asarray([op.removes for op in operations], dtype=np.uint64) + result = (source & ~removes) | adds + allowed = ((source & needs) == needs) & ((source & forbids) == 0) & (source != result) + parents, indices = np.nonzero(allowed) + return list(zip(parents.tolist(), indices.tolist(), result[parents, indices].tolist())) + require(backend == "python", "MICROFOLD_BACKEND_INVALID") + return [(parent, index, (state & ~op.removes) | op.adds) + for parent, state in enumerate(states) for index, op in enumerate(operations) + if state & op.requires == op.requires and not state & op.forbids + and ((state & ~op.removes) | op.adds) != state] + + +def search(model, *, backend="auto", rounds=10, batch_size=1000): + started = time.perf_counter_ns() + initial, wanted, forbidden, operations = compile_model(model) + require(type(rounds) is int and 1 <= rounds <= 10, "MICROFOLD_ROUND_BUDGET") + require(type(batch_size) is int and max(1, len(operations)) <= batch_size <= 1000, + "MICROFOLD_BATCH_BUDGET") + require(backend in {"auto", "python", "numpy"}, "MICROFOLD_BACKEND_INVALID") + if backend == "auto": + # Tiny action sets do not justify array conversion/import overhead. + backend = "numpy" if len(operations) >= 16 and importlib.util.find_spec("numpy") else "python" + frontier = [(0, (), initial)] + best = {initial: (0, ())} + attempts = valid = expanded = completed_rounds = 0 + trace: list[dict[str, int]] = [] + + def goal(state): + return state & wanted == wanted and not state & forbidden + + def finish(status, winner=None): + plan = [operations[index].ident for index in winner[1]] if winner else None + report = { + "version": "microfold-search-v1", "status": status, + "model_digest": fingerprint(model), "evidence_digest": model["evidence_digest"], + "plan": plan, "predicted_cost": winner[0] if winner else None, + "predicted_state": winner[2] if winner else None, + "backend": backend, "rounds": completed_rounds, "microsteps": attempts, + "applicable_transitions": valid, "expanded_states": expanded, "unique_states": len(best), + "round_trace": trace, "wall_ns": time.perf_counter_ns() - started, + "budget": {"rounds": rounds, "batch_size": batch_size, "microsteps": rounds * batch_size}, + "external_steps": 0, "verified_application": False, + "scope": "Conditional plan under supplied transition model; external outcomes must be observed", + } + report["model_witness_validated"] = winner is not None and validate_plan(model, report) + if winner is not None: + require(report["model_witness_validated"], "MICROFOLD_WITNESS_INVALID") + report["wall_ns"] = time.perf_counter_ns() - started + return report + + if goal(initial): + return finish("PLAN_FOUND", frontier[0]) + if not operations: + return finish("NO_PLAN_IN_MODEL") + width = batch_size // len(operations) + for _ in range(rounds): + parents: list[tuple[int, tuple[int, ...], int]] = [] + while frontier and len(parents) < width: + item = heapq.heappop(frontier) + if best[item[2]] == item[:2]: + parents.append(item) + if not parents: + return finish("NO_PLAN_IN_MODEL") + completed_rounds += 1 + count = len(parents) * len(operations) + attempts += count + expanded += len(parents) + children = transition_batch([row[2] for row in parents], operations, backend) + valid += len(children) + winners = [] + for parent, index, state in children: + cost, path, _ = parents[parent] + candidate = (cost + operations[index].cost, path + (index,), state) + if state in best and best[state] <= candidate[:2]: + continue + best[state] = candidate[:2] + heapq.heappush(frontier, candidate) + if goal(state): + winners.append(candidate) + trace.append({"microsteps": count, "applicable": len(children), "frontier": len(frontier)}) + if winners: + # Bounded batched search does not claim globally minimal cost. + return finish("PLAN_FOUND", min(winners)) + return finish("BUDGET_EXHAUSTED" if frontier else "NO_PLAN_IN_MODEL") + + +def validate_plan(model, report): + """Independent scalar witness replay; does not call search or batch backend.""" + try: + state, wanted, forbidden, operations = compile_model(model) + if (report.get("status") != "PLAN_FOUND" or report.get("model_digest") != fingerprint(model) + or report.get("evidence_digest") != model["evidence_digest"]): + return False + plan = report.get("plan") + if not isinstance(plan, list) or len(plan) > 10: + return False + by_id = {op.ident: op for op in operations} + cost = 0 + for name in plan: + op = by_id[name] + if state & op.requires != op.requires or state & op.forbids: + return False + state = (state & ~op.removes) | op.adds + cost += op.cost + return (state & wanted == wanted and not state & forbidden + and state == report.get("predicted_state") and cost == report.get("predicted_cost")) + except (ValueError, KeyError, TypeError): + return False diff --git a/orbiters/chameleon/packages/core/chameleon_core/module_completion.py b/orbiters/chameleon/packages/core/chameleon_core/module_completion.py new file mode 100644 index 0000000000000000000000000000000000000000..843e2312026d34bc146e4877559b8364c626409c --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/module_completion.py @@ -0,0 +1,65 @@ +"""Bounded transitive module plans, with immutable source and capture provenance.""" + +from .adaptation_contracts import Residual +from .repository_capture import safe_path, verify_package + + +def complete_modules(package, plan_for, capture, save, *, max_rounds=4): + if type(max_rounds) is not int or not 1 <= max_rounds <= 4: + raise Residual("MODULE_ROUND_BUDGET") + verify_package(package) + original = package["repository"] + history = [] + for index in range(max_rounds): + plan = plan_for(package, index) + if plan.get("package_digest") != package["digest"]: + raise Residual("MODULE_PLAN_SOURCE_MISMATCH") + paths = plan.get("paths") + if not isinstance(paths, list) or len(paths) > 16: + raise Residual("MODULE_PATH_BUDGET") + for name in paths: + safe_path(name) + repo = package["repository"] + missing = set(paths) - set(repo["files"]) + history.append( + { + "index": index, + "package_digest": package["digest"], + "missing": sorted(missing), + "gaps": plan.get("gaps", []), + } + ) + if not missing: + return { + "status": "LOCAL_DEPENDENCIES_CAPTURED" + if not plan.get("gaps") + else "UNRESOLVED_MODULE_FORMS", + "rounds": history, + } + projection = repo.get("projection", {}) + absent = { + g.get("path") for g in projection.get("gaps", []) if g.get("reason") == "MISSING_LOCAL_ASSET" + } + attempted = set(projection.get("additional_local_paths", [])) + if missing <= absent: + return {"status": "ABSENT_FROM_PINNED_SOURCE", "rounds": history} + if missing <= attempted: + return {"status": "STALLED", "rounds": history} + if index + 1 == max_rounds: + return {"status": "BUDGET_EXHAUSTED", "rounds": history} + additions = sorted(missing | attempted) + if len(additions) > 16: + return {"status": "PATH_BUDGET_EXHAUSTED", "rounds": history} + expanded = capture( + original["source"] + "/tree/" + original["commit_sha"], + original["entry"], + additional_paths=additions, + ) + verify_package(expanded) + new = expanded["repository"] + if any(new[k] != original[k] for k in ("source", "commit_sha", "entry")): + raise Residual("MODULE_CAPTURE_SOURCE_CHANGED") + if any(new["files"].get(n) != v for n, v in repo["files"].items()): + raise Residual("MODULE_CAPTURE_EXISTING_BYTES_CHANGED") + save(expanded, index + 1) + package = expanded diff --git a/orbiters/chameleon/packages/core/chameleon_core/module_resolution.py b/orbiters/chameleon/packages/core/chameleon_core/module_resolution.py new file mode 100644 index 0000000000000000000000000000000000000000..1c2e7521f3fc23105750589aec0645f22e25b482 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/module_resolution.py @@ -0,0 +1,50 @@ +"""Plan explicit relative-module resolution against an already pinned inventory. + +This is a proposed compatibility policy, not browser/Node resolution equivalence. +It neither fetches bytes nor rewrites imports. A resolved path still requires +capture, import-site binding, derived-artifact verification and delivery replay. +""" +import posixpath +import re + +from .repository_capture import FILE_LIMIT, safe_path + +POLICY = "relative-js-unique-v1" + + +def resolve_relative_import(importer, specifier, inventory): + safe_path(importer) + if not importer.endswith((".js", ".mjs")): + raise ValueError("MODULE_IMPORTER_UNSUPPORTED") + if not isinstance(inventory, dict) or len(inventory) > 20000: + raise ValueError("MODULE_INVENTORY_BUDGET") + if (not isinstance(specifier, str) or not 1 <= len(specifier) <= 512 + or not specifier.startswith(("./", "../")) + or re.search(r"[\\%?#:\s\x00-\x1f]", specifier)): + raise ValueError("MODULE_SPECIFIER_UNSUPPORTED") + requested = posixpath.normpath(posixpath.join(posixpath.dirname(importer), specifier)) + safe_path(requested) + suffix = posixpath.splitext(requested)[1] + if suffix and suffix not in {".js", ".mjs"}: + raise ValueError("MODULE_EXTENSION_UNSUPPORTED") + candidates = [requested] if suffix else [ + requested, requested + ".js", requested + ".mjs", + requested + "/index.js", requested + "/index.mjs"] + matches = [] + for path in candidates: + if path not in inventory: + continue + record = inventory[path] + if (not isinstance(record, dict) or not isinstance(record.get("sha"), str) + or not re.fullmatch(r"[a-f0-9]{40}", record["sha"]) + or type(record.get("size")) is not int or not 0 <= record["size"] <= FILE_LIMIT + or record.get("mode", "100644") not in {"100644", "100755"} + or record.get("type", "blob") != "blob"): + raise ValueError("MODULE_INVENTORY_ENTRY_INVALID") + matches.append({"path": path, "git_blob_sha": record["sha"], "bytes": record["size"]}) + # Never silently select one of multiple plausible files using an assumed bundler order. + status = "RESOLVED" if len(matches) == 1 else "AMBIGUOUS" if matches else "MISSING" + return {"policy": POLICY, "status": status, "importer": importer, + "specifier": specifier, "requested_path": requested, "candidates": candidates, + "matches": matches, "source_writes": False, + "scope": "Pinned inventory path plan only; executable compatibility not verified"} diff --git a/orbiters/chameleon/packages/core/chameleon_core/mount_overlay.py b/orbiters/chameleon/packages/core/chameleon_core/mount_overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..ffcfb24dd3dce37112392689f02bf73ccab435a8 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/mount_overlay.py @@ -0,0 +1,73 @@ +"""Deterministic entry-only URL relocation, recomputed by artifact validation.""" +import base64 +import hashlib +import posixpath +import re +from html.parser import HTMLParser + +from .repository_capture import safe_path, verify_package + + +def mount_capture_paths(package, prefix): + from .entry_capture import references + files = verify_package(package) + if not isinstance(prefix, str) or not re.fullmatch(r'[A-Za-z0-9_-]{1,80}', prefix): + raise ValueError('MOUNT_PREFIX_INVALID') + repo = package['repository'] + paths = set() + for raw in references(repo['entry'], files[repo['entry']]): + if raw.startswith('/'+prefix+'/'): + destination = safe_path(raw[len(prefix)+2:]) + if any(c in destination for c in '%?#&'): + raise ValueError('MOUNT_REFERENCE_UNSUPPORTED') + paths.add(destination) + if len(paths) < 2: + raise ValueError('MOUNT_CORROBORATION_REQUIRED') + paths.update(repo.get('projection', {}).get('additional_local_paths', [])) + if len(paths) > 16: + raise ValueError('MOUNT_CAPTURE_BUDGET') + return sorted(paths) + + +def mount_overlay(package, prefix): + files = verify_package(package) + if not isinstance(prefix, str) or not re.fullmatch(r'[A-Za-z0-9_-]{1,80}', prefix): + raise ValueError('MOUNT_PREFIX_INVALID') + entry = package['repository']['entry'] + if not entry.endswith(('.html', '.htm')) or len(files[entry]) > 12000: + raise ValueError('MOUNT_ENTRY_BUDGET') + source = files[entry].decode('utf-8') + starts = [0] + for match in re.finditer('\n', source): + starts.append(match.end()) + edits, paths = [], set() + class Parser(HTMLParser): + def handle_starttag(self, tag, attrs): + wanted = 'src' if tag in {'script', 'img', 'source', 'video', 'audio', 'iframe'} else 'href' if tag == 'link' else None + if not wanted: + return + raw = self.get_starttag_text() + line, col = self.getpos() + offset = starts[line-1] + col + # Consume entire quoted attributes, avoiding matches inside other values. + for m in re.finditer(r'''([^\s=<>/]+)\s*=\s*(["'])(.*?)\2''', raw, re.DOTALL): + if m[1].lower() != wanted or not m[3].startswith('/'+prefix+'/'): + continue + requested = safe_path(m[3][1:]) + destination = safe_path(m[3][len(prefix)+2:]) + if requested in files or destination not in files or any(c in destination for c in '%?#&'): + raise ValueError('MOUNT_DESTINATION_BINDING') + paths.add(requested) + relative = posixpath.relpath(destination, posixpath.dirname(entry) or '.') + edits.append((offset+m.start(3), offset+m.end(3), relative)) + parser = Parser(convert_charrefs=False) + parser.feed(source) + if len(paths) < 2 or len(edits) > 32: + raise ValueError('MOUNT_CORROBORATION_REQUIRED') + for start, end, text in sorted(edits, reverse=True): + source = source[:start] + text + source[end:] + after = source.encode('utf-8') + return {'version': 'derived-html-mount-v1', 'source_digest': package['digest'], 'path': entry, + 'before_sha256': hashlib.sha256(files[entry]).hexdigest(), + 'after_base64': base64.b64encode(after).decode(), 'after_sha256': hashlib.sha256(after).hexdigest(), + 'operator': 'entry-mount-relocation-v1', 'mount_prefix': prefix} diff --git a/orbiters/chameleon/packages/core/chameleon_core/mount_plan.py b/orbiters/chameleon/packages/core/chameleon_core/mount_plan.py new file mode 100644 index 0000000000000000000000000000000000000000..865fcf9d2d339aacb68a5cfecdb34343bfd1ab48 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/mount_plan.py @@ -0,0 +1,46 @@ +"""Conservative deployment-prefix proposal; never rewrites or serves an alias.""" +from urllib.parse import urlsplit + +from .contracts import digest +from .entry_capture import references +from .repository_capture import safe_path, tree_files, verify_package + + +def plan_entry_mount(package, tree): + files = verify_package(package) + repo = package['repository'] + if tree.get('sha') != repo['tree_sha']: + raise ValueError('MOUNT_TREE_BINDING') + inventory = tree_files(tree, metadata_only=True) + for name, record in repo['files'].items(): + if (inventory.get(name, {}).get('sha') != record['git_blob_sha'] + or inventory[name]['size'] != record['bytes']): + raise ValueError('MOUNT_HELD_TREE_MISMATCH') + mappings = [] + for reference in references(repo['entry'], files[repo['entry']]): + url = urlsplit(reference) + if url.scheme or url.netloc or not url.path.startswith('/'): + continue + if url.query or url.fragment or '%' in url.path: + raise ValueError('MOUNT_REFERENCE_UNSUPPORTED') + original = safe_path(url.path[1:]) + if original in inventory: + continue + parts = original.split('/', 1) + if len(parts) != 2 or parts[1] not in inventory: + raise ValueError('MOUNT_DESTINATION_ABSENT') + destination = parts[1] + record = inventory[destination] + mappings.append({'requested_path': original, 'source_path': destination, + 'git_blob_sha': record['sha'], 'bytes': record['size'], 'prefix': parts[0]}) + prefixes = {m['prefix'] for m in mappings} + if len({m['requested_path'] for m in mappings}) < 2 or len(prefixes) != 1: + raise ValueError('MOUNT_CORROBORATION_REQUIRED') + paths = sorted(set(repo.get('projection', {}).get('additional_local_paths', [])) | + {m['source_path'] for m in mappings}) + if len(paths) > 16: + raise ValueError('MOUNT_CAPTURE_BUDGET') + return {'version': 'entry-mount-proposal-v1', 'source_digest': package['digest'], + 'inventory_digest': digest(tree), 'prefix': next(iter(prefixes)), 'mappings': mappings, + 'capture_paths': paths, 'status': 'PROPOSED', 'verified_application': False, + 'scope': 'Two or more entry references and exact pinned-tree destinations; deployment semantics unverified'} diff --git a/orbiters/chameleon/packages/core/chameleon_core/oracle_spatial.py b/orbiters/chameleon/packages/core/chameleon_core/oracle_spatial.py new file mode 100644 index 0000000000000000000000000000000000000000..124e8231cee4968e02a32a062a7dc3395e755f01 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/oracle_spatial.py @@ -0,0 +1,330 @@ +"""Adapted Oracle7 spatial kernel from the frozen pass242 lineage. + +Only the bounded spatial functions are ported; this is not the whole Oracle7 runtime. +Source hashes and excluded integrations are in docs/oracle-kernel-provenance.json. +""" + +import collections +import copy +import hashlib +import json +import re +from typing import Any + + +def digest(x): + return hashlib.sha256( + json.dumps(x, sort_keys=True, separators=(",", ":"), allow_nan=False).encode() + ).hexdigest() + + +def finish(frame): + f = copy.deepcopy(frame) + f.pop("frame_id", None) + f["frame_id"] = digest(f) + return f + + +def valid_id(frame): + return frame.get("frame_id") == digest({k: v for k, v in frame.items() if k != "frame_id"}) + + +INVERSE = {"north": "south", "south": "north", "east": "west", "west": "east"} + +SHORT = {"north": "n", "south": "s", "east": "e", "west": "w"} + +NAME = r"([A-Za-z][A-Za-z_-]*)" + +DIR = r"(north|south|east|west)" + +FACT = re.compile(r"(?:The )?" + NAME + r" is " + DIR + r" of (?:the )?" + NAME + r"\.", re.IGNORECASE) + +SUBJECT = re.compile(r"What is " + DIR + r" of (?:the )?" + NAME + r"\?", re.IGNORECASE) + +OBJECT = re.compile(r"What is (?:the )?" + NAME + r" " + DIR + r" of\?", re.IGNORECASE) + +ROUTE = re.compile(r"How do you go from (?:the )?" + NAME + r" to (?:the )?" + NAME + r"\?", re.IGNORECASE) + + +def fail(kind, frame=None, detail=None): + out = { + "status": "clarification" if kind == "multiple_supported_answers" else "withheld", + "residual": {"kind": kind, "stage": "spatial_frame", "detail": detail}, + "published": False, + } + if frame is not None: + out["frame"] = frame + return out + + +def question(text, allow_route=False): + if not isinstance(text, str): + return None + m = SUBJECT.fullmatch(text.strip()) + if m: + return { + "kind": "relative", + "anchor": m[2].lower(), + "direction": m[1].lower(), + "missing_role": "subject", + } + m = OBJECT.fullmatch(text.strip()) + if m: + return { + "kind": "relative", + "anchor": m[1].lower(), + "direction": INVERSE[m[2].lower()], + "missing_role": "object", + } + m = ROUTE.fullmatch(text.strip()) if allow_route else None + if m: + return {"kind": "path", "anchor": m[1].lower(), "target": m[2].lower()} + return None + + +def construct(payload, allow_route=False, max_hops=8, max_states=128): + if not isinstance(payload, dict) or not isinstance(payload.get("context", {}), dict): + return None, fail("invalid_payload") + q = question(payload.get("request"), allow_route) + if q is None: + return None, None + if ( + type(max_hops) != int + or not 0 <= max_hops <= 32 + or type(max_states) != int + or not 1 <= max_states <= 1024 + ): + return None, fail("invalid_budget") + ctx = payload.get("context", {}) + premises = ctx.get("premises") + if set(ctx) - {"premises"}: + return None, fail("unsupported_context_constraints") + if not isinstance(premises, list) or len(premises) > 128: + return None, fail("invalid_premise_collection") + records = [] + unknowns = [] + ids = set() + for i, row in enumerate(premises): + if isinstance(row, str): + ident, text = str(i + 1), row + elif isinstance(row, dict) and set(row) == {"id", "text"}: + ident, text = row["id"], row["text"] + else: + return None, fail("invalid_premise") + if ( + not isinstance(ident, str) + or not ident + or ident in ids + or not isinstance(text, str) + or len(text) > 256 + ): + return None, fail("invalid_premise") + ids.add(ident) + m = FACT.fullmatch(text) + fact = {"subject": m[1].lower(), "relation": m[2].lower(), "object": m[3].lower()} if m else None + records.append({"id": ident, "text": text, "text_sha256": digest(text), "fact": fact}) + if fact is None: + unknowns.append(ident) + frame = finish( + { + "schema": "spatial-frame-v1", + "domain": "spatial", + "request_sha256": digest(payload["request"]), + "context_sha256": digest(ctx), + "goal": q, + "premises": records, + "unknowns": unknowns, + "bounds": {"proof_hops": max_hops, "expanded_states": max_states}, + "assumptions": ["cardinal relations use the registered inverse pairs"] + + ( + ["path task treats each supplied relation as a traversable one-step connection"] + if q["kind"] == "path" + else [] + ), + "permissions": {"publish": False, "external_lookup": False}, + "revision": None, + } + ) + if unknowns: + return frame, fail("unconsumed_premises", frame, unknowns) + return frame, None + + +def edges(frame): + graph = collections.defaultdict(list) + for row in frame["premises"]: + f = row["fact"] + a, b, d = f["subject"], f["object"], f["relation"] + graph[b].append({"from": b, "to": a, "direction": d, "evidence_id": row["id"], "inverse": False}) + graph[a].append( + {"from": a, "to": b, "direction": INVERSE[d], "evidence_id": row["id"], "inverse": True} + ) + return graph + + +def validate(frame, proof): + """Replay exact named edge witnesses; do not invoke the search/planner.""" + try: + if not valid_id(frame) or frame["unknowns"]: + return False + q = frame["goal"] + steps = proof["steps"] + current = q["anchor"] + ids = {r["id"]: r for r in frame["premises"]} + if len(steps) > frame["bounds"]["proof_hops"]: + return False + for s in steps: + if s["from"] != current or type(s["inverse"]) != bool: + return False + f = ids[s["evidence_id"]]["fact"] + a, b, d = f["subject"], f["object"], f["relation"] + expected = (a, b, INVERSE[d]) if s["inverse"] else (b, a, d) + if (s["from"], s["to"], s["direction"]) != expected: + return False + current = s["to"] + if q["kind"] == "relative": + return len(steps) == 1 and steps[0]["direction"] == q["direction"] and proof["answer"] == current + return current == q["target"] and proof["answer"] == ",".join(SHORT[s["direction"]] for s in steps) + except (KeyError, TypeError, ValueError): + return False + + +def answer(frame, steps): + q = frame["goal"] + text = steps[-1]["to"] if q["kind"] == "relative" else ",".join(SHORT[s["direction"]] for s in steps) + proof = {"steps": copy.deepcopy(steps), "answer": text} + if not validate(frame, proof): + return fail("invalid_witness", frame) + return { + "status": "answered", + "final_answer": text, + "frame": frame, + "proof": proof, + "witness_validated": True, + "verified": False, + "verification_scope": "conditional formal consequence of supplied premises", + "published": False, + } + + +def relative(frame): + if not valid_id(frame): + return fail("invalid_frame_integrity") + q = frame["goal"] + candidates = [e for e in edges(frame).get(q["anchor"], []) if e["direction"] == q["direction"]] + if not candidates: + return fail("no_supported_conclusion", frame) + if len({e["to"] for e in candidates}) > 1: + return fail("multiple_supported_answers", frame) + if frame["bounds"]["proof_hops"] < 1: + return fail("proof_budget_exhausted", frame) + return answer(frame, [candidates[0]]) + + +def navigate(frame): + q = frame["goal"] + graph = edges(frame) + origin, target = q["anchor"], q["target"] + if origin not in graph or target not in graph: + return fail("unknown_entity", frame) + queue: collections.deque[tuple[str, list[dict[str, Any]]]] = collections.deque([(origin, [])]) + visited = {origin} + expanded = 0 + depth_limited = False + while queue: + node, path = queue.popleft() + if node == target: + return answer(frame, path) + if expanded >= frame["bounds"]["expanded_states"]: + return fail("state_budget_exhausted", frame) + expanded += 1 + for e in graph.get(node, []): + if e["to"] in visited: + continue + if len(path) >= frame["bounds"]["proof_hops"]: + depth_limited = True + continue + visited.add(e["to"]) + queue.append((e["to"], path + [e])) + return fail("proof_budget_exhausted" if depth_limited else "disconnected_goal", frame) + + +DELTA = {"north": (0, 1), "south": (0, -1), "east": (1, 0), "west": (-1, 0)} + + +def consistency(frame): + """Paths use unit adjacency; relative questions require only strict axis order. + + Qualitative 'north of' is NOT silently converted into unit distance. + Both checks are linear in the bounded supplied graph. + """ + if frame["goal"]["kind"] == "path": + graph = edges(frame) + coords = {} + witness_paths: dict[str, list[str]] = {} + for origin in graph: + if origin in coords: + continue + coords[origin] = (0, 0) + witness_paths[origin] = [] + queue = collections.deque([origin]) + while queue: + node = queue.popleft() + for edge in graph[node]: + dx, dy = DELTA[edge["direction"]] + x, y = coords[node] + proposed = (x + dx, y + dy) + n = edge["to"] + if n in coords and coords[n] != proposed: + return { + "kind": "inconsistent_unit_adjacency", + "evidence_ids": sorted( + set(witness_paths[node] + [edge["evidence_id"]] + witness_paths[n]) + ), + } + if n not in coords: + coords[n] = proposed + witness_paths[n] = witness_paths[node] + [edge["evidence_id"]] + queue.append(n) + return None + for axis, positive, negative in [("vertical", "north", "south"), ("horizontal", "east", "west")]: + graph = collections.defaultdict(set) + indegree: collections.defaultdict[str, int] = collections.defaultdict(int) + evidence = [] + for row in frame["premises"]: + f = row["fact"] + d = f["relation"] + if d not in (positive, negative): + continue + a, b = (f["object"], f["subject"]) if d == positive else (f["subject"], f["object"]) + if b not in graph[a]: + indegree[b] += 1 + graph[a].add(b) + indegree[a] += 0 + evidence.append(row["id"]) + queue = collections.deque(n for n, v in indegree.items() if v == 0) + removed = 0 + while queue: + node = queue.popleft() + removed += 1 + for n in graph[node]: + indegree[n] -= 1 + if indegree[n] == 0: + queue.append(n) + if removed != len(indegree): + return {"kind": "inconsistent_strict_order", "axis": axis, "evidence_ids": evidence} + return None + + +def reason(payload, *, max_hops=16, max_states=256): + frame, error = construct(payload, allow_route=True, max_hops=max_hops, max_states=max_states) + if error: + return error + if frame is None: + return fail("unsupported_spatial_question") + if set(payload) - {"request", "context", "mode"} or payload.get("mode", "plan") != "plan": + return fail("unsupported_spatial_payload_constraints", frame) + conflict = consistency(frame) + if conflict: + return fail("inconsistent_spatial_premises", frame, conflict) + return navigate(frame) if frame["goal"]["kind"] == "path" else relative(frame) diff --git a/orbiters/chameleon/packages/core/chameleon_core/packages.py b/orbiters/chameleon/packages/core/chameleon_core/packages.py new file mode 100644 index 0000000000000000000000000000000000000000..6b40ac1226b7723b4b91276b2c4d7a39955e48d3 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/packages.py @@ -0,0 +1,86 @@ +"""Bounded JSON/YAML imports. Packages contain data, never Python hooks.""" + +import yaml + +from .contracts import AgentIdentity, Form, canonical, digest + + +class DataLoader(yaml.SafeLoader): + pass + + +def mapping(loader, node, deep=False): + result = {} + for k, v in node.value: + key = loader.construct_object(k, deep=deep) + if not isinstance(key, str) or key in result: + raise ValueError("duplicate or non-string mapping key") + result[key] = loader.construct_object(v, deep=deep) + return result + + +DataLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, mapping) + + +def bounded_load(text: str): + if not isinstance(text, str) or len(text.encode()) > 32768: + raise ValueError("import size exceeded") + depth = 0 + for event in yaml.parse(text): + if isinstance(event, yaml.AliasEvent) or getattr(event, "anchor", None): + raise ValueError("YAML aliases/anchors are unsupported") + if isinstance(event, (yaml.MappingStartEvent, yaml.SequenceStartEvent)): + depth += 1 + if depth > 16: + raise ValueError("import nesting exceeded") + elif isinstance(event, (yaml.MappingEndEvent, yaml.SequenceEndEvent)): + depth -= 1 + value = yaml.load(text, Loader=DataLoader) + canonical(value) # reject non-finite values and non-JSON tags/types + return value + + +def form_package(form: Form, identity: AgentIdentity): + data = form.model_dump() + files = { + "state.schema.json": {"type": "object", "required": ["observed", "inferred", "hypothetical"]}, + "observations.json": {"source": "hotel_fixture_v1", "operation": "hotel.observe"}, + "operations.json": data["actions"], + "decision_graph.json": data["graph"], + "memory_policy.json": {"scope": data["memory_scope"], "portable_guest_data": False}, + "verification.json": {"operation": "hotel.read_ticket", "independent_read": True}, + } + files["manifest.json"] = { + "schema_version": 1, + "identity": identity.model_dump(), + "form": data, + "component_digests": {k: digest(v) for k, v in files.items()}, + } + files["package_files.json"] = {k: digest(v) for k, v in files.items()} + return {"files": files, "digest": digest(files)} + + +def validate_package(value): + if set(value) != {"files", "digest"}: + raise ValueError("unexpected package keys") + files = value["files"] + required = { + "manifest.json", + "state.schema.json", + "observations.json", + "operations.json", + "decision_graph.json", + "memory_policy.json", + "verification.json", + "package_files.json", + } + if set(files) != required or value["digest"] != digest(files): + raise ValueError("invalid file set or digest") + if files["package_files.json"] != {k: digest(v) for k, v in files.items() if k != "package_files.json"}: + raise ValueError("component digest mismatch") + manifest = files["manifest.json"] + form = Form.model_validate(manifest["form"]) + identity = AgentIdentity.model_validate(manifest["identity"]) + if form_package(form, identity) != value: + raise ValueError("package components do not agree with the typed form") + return identity, form diff --git a/orbiters/chameleon/packages/core/chameleon_core/pnpm_bundle.py b/orbiters/chameleon/packages/core/chameleon_core/pnpm_bundle.py new file mode 100644 index 0000000000000000000000000000000000000000..3f7d60f14d2c0bda7e4f8a32f5327b1a83ee451f --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/pnpm_bundle.py @@ -0,0 +1,161 @@ +"""Replayable, source-bound pnpm leaf archives for isolated browser builds.""" +import base64 +import hashlib +import json +import posixpath +from html.parser import HTMLParser + +from .contracts import digest +from .locked_assets import archive_files, registry_fetch +from .pnpm_plan import inspect_saved_direct_leaf +from .repository_capture import safe_path, verify_package + + +def import_map_entry(package, source, imports): + """Insert before source scripts; preserve all original markup otherwise.""" + entry = package['repository']['entry'] + text = source[entry].decode('utf-8') + if not entry.endswith(('.html', '.htm')) or len(source[entry]) > 262144: + raise ValueError('PNPM_HTML_ENTRY_REQUIRED') + starts = [0] + for index, char in enumerate(text): + if char == '\n': + starts.append(index + 1) + heads = [] + + class Parser(HTMLParser): + def handle_starttag(self, tag, attrs): + if tag == 'base' or (tag == 'script' and not heads): + raise ValueError('PNPM_ENTRY_ORDER_UNSUPPORTED') + if tag == 'script' and dict(attrs).get('type', '').lower() == 'importmap': + raise ValueError('PNPM_EXISTING_IMPORTMAP') + if tag == 'head': + line, col = self.getpos() + heads.append(starts[line - 1] + col + len(self.get_starttag_text())) + + Parser().feed(text) + if len(heads) != 1: + raise ValueError('PNPM_EXPLICIT_HEAD_REQUIRED') + mapping = {name: './' + posixpath.relpath(path, posixpath.dirname(entry) or '.') for name, path in imports.items()} + script = '' + after = (text[:heads[0]] + script + text[heads[0]:]).encode() + return {'path': entry, 'before_sha256': hashlib.sha256(source[entry]).hexdigest(), + 'base64': base64.b64encode(after).decode(), 'bytes': len(after), 'sha256': hashlib.sha256(after).hexdigest()} + + +def captured_module_aliases(package): + """Use explicit inventory resolution receipts, never guess missing extensions.""" + files = verify_package(package) + projection = package['repository'].get('projection', {}) + plans = projection.get('module_resolutions', []) + if not plans: + return {} + if projection.get('module_policy') != 'relative-js-unique-v1' or len(plans) > 16: + raise ValueError('PNPM_MODULE_POLICY') + from .module_resolution import resolve_relative_import + + inventory = {p: {'sha': r['git_blob_sha'], 'size': r['bytes']} for p, r in package['repository']['files'].items()} + aliases = {} + for plan in plans: + rebuilt = resolve_relative_import(plan['importer'], plan['specifier'], inventory) + if rebuilt != plan or rebuilt['status'] != 'RESOLVED': + raise ValueError('PNPM_MODULE_RESOLUTION_BINDING') + requested, destination = plan['requested_path'], plan['matches'][0]['path'] + if requested in files or requested in aliases: + raise ValueError('PNPM_MODULE_ALIAS_COLLISION') + aliases[requested] = destination + return aliases + + +def capture_pnpm_bundle(package, names, fetch=registry_fetch, *, styles=None): + source = verify_package(package) + if not isinstance(names, list) or not (0 if styles else 1) <= len(names) <= 4 or any(not isinstance(n, str) for n in names): + raise ValueError('PNPM_SELECTION_BUDGET') + if len(set(names)) != len(names): + raise ValueError('PNPM_DUPLICATE_SELECTION') + outputs, records, imports = {}, [], {} + for name in sorted(names): + retained = [] + + def retain(url, retained=retained): + body = fetch(url) + retained.append(body) + return body + + inspection = inspect_saved_direct_leaf(package, name, retain) + body = retained[0] + files = archive_files(body, inspection['integrity']) + metadata = json.loads(files['package.json']) + # Only an unambiguous ESM branch; no environment-dependent remaps. + exported = metadata.get('exports') + entry = exported if isinstance(exported, str) else metadata.get('module') if exported is None else None + if isinstance(exported, dict) and set(exported) == {'.'}: + root = exported['.'] + if isinstance(root, str): + entry = root + elif isinstance(root, dict) and set(root) <= {'import', 'require', 'types'}: + entry = root.get('import') + if not isinstance(entry, str) or metadata.get('browser'): + raise ValueError('PNPM_ESM_ENTRY_UNSUPPORTED') + entry = entry.removeprefix('./') + safe_path(entry) + if entry not in files or not (entry.endswith('.mjs') or (entry.endswith('.js') and metadata.get('type') == 'module')): + raise ValueError('PNPM_ESM_ENTRY_UNSUPPORTED') + prefix = 'node_modules/' + name + '/' + imports[name] = prefix + entry + for path, content in files.items(): + target = prefix + path + safe_path(target) + if target.casefold() in {p.casefold() for p in source} | {p.casefold() for p in outputs}: + raise ValueError('PNPM_SOURCE_COLLISION') + outputs[target] = {'base64': base64.b64encode(content).decode(), 'bytes': len(content), + 'sha256': hashlib.sha256(content).hexdigest()} + records.append({**inspection, 'archive_base64': base64.b64encode(body).decode()}) + aliases = captured_module_aliases(package) + entry_dir = posixpath.dirname(package['repository']['entry']) or '.' + mapped = {**imports, **{'./' + posixpath.relpath(k, entry_dir): v for k, v in aliases.items()}} + payload = {'version': 'locked-pnpm-leaf-bundle-v2', 'source_package_digest': package['digest'], + 'lock_path': 'pnpm-lock.yaml' if 'pnpm-lock.yaml' in source else 'captured-styles-v1', + 'packages': records, 'files': outputs, 'imports': imports, + 'entry_overlay': import_map_entry(package, source, mapped), + 'scripts_executed': False, 'dependencies_installed': False} + if styles is not None: + from .sass_assembly import assemble_styles + + css, entry, builds = assemble_styles(package, payload['entry_overlay'], styles) + if set(css) & set(outputs): + raise ValueError('PNPM_STYLE_COLLISION') + payload.update(version='locked-pnpm-leaf-bundle-v3', entry_overlay=entry, style_builds=builds) + payload['files'].update(css) + return {'digest': digest(payload), 'bundle': payload} + + +def verify_pnpm_bundle(bundle, package): + """Reconstruct every output from retained archives with no network.""" + try: + payload = bundle['bundle'] + if bundle['digest'] != digest(payload) or payload['source_package_digest'] != package['digest']: + raise ValueError('PNPM_BUNDLE_BINDING') + records = payload['packages'] + if not (0 if payload.get('version') == 'locked-pnpm-leaf-bundle-v3' and payload.get('style_builds') else 1) <= len(records) <= 4: + raise ValueError('PNPM_SELECTION_BUDGET') + archives = {} + for record in records: + if len(record['archive_base64']) > 2800000 or record['url'] in archives: + raise ValueError('PNPM_ARCHIVE_BUDGET') + archives[record['url']] = base64.b64decode(record['archive_base64'], validate=True) + styles = [b['entry'] for b in payload['style_builds']] if payload.get('version') == 'locked-pnpm-leaf-bundle-v3' else None + rebuilt = capture_pnpm_bundle(package, [r['name'] for r in records], lambda url: archives[url], styles=styles) + if payload.get('version') == 'locked-pnpm-leaf-bundle-v1': + rebuilt['bundle'].pop('entry_overlay') + rebuilt['bundle'].pop('lock_path') + rebuilt['bundle']['version'] = 'locked-pnpm-leaf-bundle-v1' + rebuilt['digest'] = digest(rebuilt['bundle']) + elif 'lock_path' not in payload: + rebuilt['bundle'].pop('lock_path') + rebuilt['digest'] = digest(rebuilt['bundle']) + if rebuilt != bundle: + raise ValueError('PNPM_BUNDLE_RECONSTRUCTION') + return payload['files'] + except (KeyError, TypeError, AttributeError): + raise ValueError('PNPM_BUNDLE_INVALID') from None diff --git a/orbiters/chameleon/packages/core/chameleon_core/pnpm_discovery.py b/orbiters/chameleon/packages/core/chameleon_core/pnpm_discovery.py new file mode 100644 index 0000000000000000000000000000000000000000..62f8a280be44a08fea4cb301d3066cd3d9edc21c --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/pnpm_discovery.py @@ -0,0 +1,33 @@ +"""Inert, bounded AST discovery of declared bare imports in frozen source.""" +import json +import shutil +from pathlib import Path + +from .pnpm_plan import plan_direct_leaf +from .repository_capture import verify_package +from .windows_job import run_bounded + +ROOT = Path(__file__).resolve().parents[3] + + +def discover_pnpm(package): + files = verify_package(package) + node = shutil.which('node') + if not node: + raise ValueError('PNPM_NODE_UNAVAILABLE') + runtime = run_bounded([node, str(ROOT/'scripts/module_dependency_driver.mjs')], json.dumps(package), ROOT) + if runtime['returncode'] != 0 or runtime['remaining_job_processes'] or any(runtime[k] for k in ('timed_out', 'cpu_budget_exhausted', 'output_budget_exhausted')): + raise ValueError('PNPM_DISCOVERY_FAILED') + plan = json.loads(runtime['stdout']) + if plan['package_digest'] != package['digest']: + raise ValueError('PNPM_DISCOVERY_BINDING') + names = sorted({gap['reference'] for gap in plan['gaps'] if gap['reason'] == 'BARE_MODULE_SPECIFIER'}) + if not names: + return [] + if len(names) > 4: + raise ValueError('PNPM_SELECTION_BUDGET') + if 'package.json' not in files or 'pnpm-lock.yaml' not in files: + raise ValueError('PNPM_DECLARED_DEPENDENCY_METADATA_REQUIRED') + for name in names: + plan_direct_leaf(files['package.json'].decode(), files['pnpm-lock.yaml'].decode(), name) + return names diff --git a/orbiters/chameleon/packages/core/chameleon_core/pnpm_plan.py b/orbiters/chameleon/packages/core/chameleon_core/pnpm_plan.py new file mode 100644 index 0000000000000000000000000000000000000000..e11abeca889ef900ac473438b344fe95da36abcd --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/pnpm_plan.py @@ -0,0 +1,111 @@ +"""Bounded pnpm v9 direct-leaf lock inspection. No install or code execution.""" +import base64 +import hashlib +import json +import re + +import yaml + +from .locked_assets import archive_files, registry_fetch +from .repository_capture import verify_package + + +def unique(pairs): + result = {} + for key, value in pairs: + if not isinstance(key, str): + raise TypeError('PNPM_MAPPING_KEY') + if key in result: + raise ValueError('PNPM_DUPLICATE_KEY') + result[key] = value + return result + + +class StrictLoader(yaml.BaseLoader): + def construct_mapping(self, node, deep=False): + return unique((self.construct_object(k, deep=deep), self.construct_object(v, deep=deep)) for k, v in node.value) + + +def inspect_saved_direct_leaf(package, name, fetch=registry_fetch): + files = verify_package(package) + if 'package.json' not in files or 'pnpm-lock.yaml' not in files: + raise ValueError('PNPM_METADATA_REQUIRED') + result = inspect_direct_leaf(files['package.json'].decode('utf-8'), + files['pnpm-lock.yaml'].decode('utf-8'), name, fetch) + return {**result, 'source_package_digest': package['digest']} + + +def inspect_direct_leaf(package_text, lock_text, name, fetch=registry_fetch): + """Check locked archive identity as data; never install or execute it.""" + plan = plan_direct_leaf(package_text, lock_text, name) + body = fetch(plan['url']) + files = archive_files(body, plan['integrity']) + metadata = json.loads(files.get('package.json', b'{}'), object_pairs_hook=unique) + if metadata.get('name') != name or metadata.get('version') != plan['version']: + raise ValueError('PNPM_ARCHIVE_IDENTITY') + if any(metadata.get(k) for k in ('dependencies', 'optionalDependencies', 'peerDependencies')): + raise ValueError('PNPM_ARCHIVE_NOT_LEAF') + licenses = sorted(p for p in files if re.fullmatch(r'(?i)(license|licence|copying)(\.[a-z]+)?', p)) + if not licenses: + raise ValueError('PNPM_ARCHIVE_LICENSE_MISSING') + return {**plan, 'archive_sha256': hashlib.sha256(body).hexdigest(), + 'files': {p: hashlib.sha256(v).hexdigest() for p, v in sorted(files.items())}, + 'license_files': licenses, 'scripts_executed': False, + 'dependencies_installed': False} + + +def plan_direct_leaf(package_text, lock_text, name): + try: + return _plan_direct_leaf(package_text, lock_text, name) + except (KeyError, TypeError, AttributeError, yaml.YAMLError, RecursionError): + raise ValueError('PNPM_INVALID_STRUCTURE') from None + + +def _plan_direct_leaf(package_text, lock_text, name): + if any(not isinstance(s, str) or len(s.encode()) > 262144 for s in (package_text, lock_text)): + raise ValueError('PNPM_INPUT_BUDGET') + if not re.fullmatch(r'(?:@[a-z0-9_-]+/)?[a-z0-9_-]+', name): + raise ValueError('PNPM_PACKAGE_NAME') + depth = 0 + for i, event in enumerate(yaml.parse(lock_text)): + if i > 30000 or getattr(event, 'anchor', None) or getattr(event, 'tag', None): + raise ValueError('PNPM_YAML_BOUNDARY') + if isinstance(event, (yaml.MappingStartEvent, yaml.SequenceStartEvent)): + depth += 1 + if isinstance(event, (yaml.MappingEndEvent, yaml.SequenceEndEvent)): + depth -= 1 + if depth > 32: + raise ValueError('PNPM_YAML_DEPTH') + package = json.loads(package_text, object_pairs_hook=unique) + lock = yaml.load(lock_text, Loader=StrictLoader) + if lock.get('lockfileVersion') != '9.0': + raise ValueError('PNPM_LOCK_VERSION') + matches = [(section, package.get(section, {}).get(name)) for section in ('dependencies', 'devDependencies') if name in package.get(section, {})] + if len(matches) != 1: + raise ValueError('PNPM_DIRECT_DECLARATION_REQUIRED') + section, version = matches[0] + if not isinstance(version, str) or not re.fullmatch(r'\d+\.\d+\.\d+', version): + raise ValueError('PNPM_EXACT_VERSION_REQUIRED') + entry = lock['importers']['.'][section][name] + if entry.get('specifier') != version or entry.get('version') != version: + raise ValueError('PNPM_IMPORTER_MISMATCH') + key = name + '@' + version + snapshot = lock['snapshots'][key] + if not isinstance(snapshot, dict): + raise TypeError('PNPM_INVALID_SNAPSHOT') + if any(snapshot.get(k) for k in ('dependencies', 'optionalDependencies', 'transitivePeerDependencies')): + raise ValueError('PNPM_TRANSITIVE_UNSUPPORTED') + metadata = lock['packages'][key] + if metadata.get('peerDependencies') or metadata.get('optionalDependencies'): + raise ValueError('PNPM_TRANSITIVE_UNSUPPORTED') + resolution = metadata['resolution'] + if set(resolution) != {'integrity'}: + raise ValueError('PNPM_RESOLUTION_UNSUPPORTED') + integrity = resolution['integrity'] + if not integrity.startswith('sha512-') or len(base64.b64decode(integrity[7:], validate=True)) != 64: + raise ValueError('PNPM_INTEGRITY_REQUIRED') + return {'name': name, 'version': version, 'integrity': integrity, + 'url': f'https://registry.npmjs.org/{name}/-/{name.split("/")[-1]}-{version}.tgz', + 'package_sha256': hashlib.sha256(package_text.encode()).hexdigest(), + 'lock_sha256': hashlib.sha256(lock_text.encode()).hexdigest(), + 'scope': 'Exact declared direct leaf only; not a complete build or permission grant'} diff --git a/orbiters/chameleon/packages/core/chameleon_core/providers.py b/orbiters/chameleon/packages/core/chameleon_core/providers.py new file mode 100644 index 0000000000000000000000000000000000000000..9c0c6a6294a5e8e4619de01526ed1b088b68a622 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/providers.py @@ -0,0 +1,34 @@ +from .contracts import Candidate, DecisionResult + + +class ProviderError(ValueError): + pass + + +class FixtureDecisionProvider: + version = "deterministic-fixture-v1" + + def evaluate(self, candidates: list[Candidate]) -> dict: + if len(candidates) != 1: + raise ProviderError("PROVIDER_INADEQUATE_CANDIDATES") + return DecisionResult( + candidate_id=candidates[0].candidate_id, candidate_set_id=candidates[0].candidate_set_id + ).model_dump() + + +def validate_decision(raw: dict, candidates: list[Candidate]) -> DecisionResult: + try: + decision = DecisionResult.model_validate(raw) + except ValueError as exc: + raise ProviderError("PROVIDER_INVALID_RESULT") from exc + if not any( + c.candidate_id == decision.candidate_id and c.candidate_set_id == decision.candidate_set_id + for c in candidates + ): + raise ProviderError("PROVIDER_INVALID_RESULT") + return decision + + +class UnconfiguredProvider: + def evaluate(self, *_args, **_kwargs): + raise ProviderError("PROVIDER_UNCONFIGURED") diff --git a/orbiters/chameleon/packages/core/chameleon_core/recovery.py b/orbiters/chameleon/packages/core/chameleon_core/recovery.py new file mode 100644 index 0000000000000000000000000000000000000000..524aa4ffc4817c7528b1ad9c82120fc116858c57 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/recovery.py @@ -0,0 +1,296 @@ +"""Local PostgreSQL restore rehearsal. Never restores over an existing database.""" + +import copy +import hashlib +import json +import os +import re +import subprocess +from datetime import UTC, datetime +from pathlib import Path +from uuid import uuid4 + +import psycopg +from psycopg import sql +from sqlalchemy import MetaData, inspect, select, text +from sqlalchemy.engine import make_url + +from .db import BehaviorRecord, CounterpartBundle, LocalTwin, database +from .repository_artifact import REPOSITORY_KIND +from .twins import Mutation, Twins + + +class RecoveryFailure(RuntimeError): + pass + + +def local_source(url): + value = make_url(url) + if ( + value.drivername != "postgresql+psycopg" + or value.host != "127.0.0.1" + or value.port != 55432 + or value.database not in {"chameleon", "chameleon_test"} + or value.username != "chameleon" + or value.query + ): + raise RecoveryFailure("REHEARSAL_REQUIRES_DEDICATED_LOCAL_SOURCE") + return value + + +def table_snapshot(conn): + metadata = MetaData(schema="public") + metadata.reflect(conn) + inspector = inspect(conn) + result = {} + for table in metadata.sorted_tables: + if not table.primary_key.columns: + raise RecoveryFailure("REHEARSAL_REQUIRES_PRIMARY_KEYS") + checksum, count = hashlib.sha256(), 0 + for row in conn.execute(select(table).order_by(*table.primary_key.columns)).mappings(): + checksum.update( + json.dumps(dict(row), sort_keys=True, separators=(",", ":"), default=str).encode() + ) + checksum.update(b"\n") + count += 1 + schema = { + "columns": [ + { + "name": c.name, + "type": str(c.type), + "nullable": c.nullable, + "default": str(getattr(c.server_default, "arg", None)) + if c.server_default is not None + else None, + } + for c in table.columns + ], + "primary_key": list(table.primary_key.columns.keys()), + "foreign_keys": inspector.get_foreign_keys(table.name, schema="public"), + "indexes": inspector.get_indexes(table.name, schema="public"), + "unique": inspector.get_unique_constraints(table.name, schema="public"), + "checks": inspector.get_check_constraints(table.name, schema="public"), + } + result[table.name] = { + "rows": count, + "sha256": checksum.hexdigest(), + "schema_sha256": hashlib.sha256( + json.dumps(schema, sort_keys=True, default=str).encode() + ).hexdigest(), + } + return result + + +def _functional_check(sessions, expected): + service = Twins(sessions) + result = { + "counterparts_checked": 0, + "website_pages_checked": 0, + "repository_packages_checked": 0, + "counterpart_bundles_checked": 0, + "table_queries_checked": 0, + "isolated_edit_verified": False, + } + edit = None + with sessions() as session: + # Older local schemas can still be rehearsed before the additive migration. + if inspect(session.connection()).has_table("counterpart_bundles"): + from .counterpart_bundles import CounterpartBundles + + bundles = list(session.scalars(select(CounterpartBundle))) + for item in bundles: + record = session.get(BehaviorRecord, item.record) + twin = session.get(LocalTwin, item.twin) + if ( + hashlib.sha256(item.body).hexdigest() != item.sha256 + or record is None + or twin is None + or record.owner != item.owner + or twin.owner != item.owner + or record.twin != twin.id + ): + raise RecoveryFailure("RESTORED_BUNDLE_MISMATCH") + # Historical bundles are retained but intentionally not downloadable. + if record.source_digest == twin.source_digest: + CounterpartBundles(sessions).download(item.owner, item.twin, item.id) + result["counterpart_bundles_checked"] += 1 + for twin in expected: + report = service.report(twin["owner"], twin["id"]) + if report["manifest"] != twin["manifest"] or report["revision"] != twin["revision"]: + raise RecoveryFailure("RESTORED_COUNTERPART_METADATA_MISMATCH") + if twin["manifest"]["kind"] == "local-website-reader-v1": + if report["pages"] != twin["data"]["pages"]: + raise RecoveryFailure("RESTORED_WEBSITE_MISMATCH") + result["website_pages_checked"] += len(report["pages"]) + elif twin["manifest"]["kind"] == REPOSITORY_KIND: + # This validates every stored file and the owning evidence binding. + # A frozen repository is not a table and must not receive table queries. + evidence = service.repository_evidence(twin["owner"], twin["id"]) + if evidence.content_digest != twin["source_digest"]: + raise RecoveryFailure("RESTORED_REPOSITORY_MISMATCH") + result["repository_packages_checked"] += 1 + elif twin["manifest"]["kind"] == "local-table-application-v1": + if report["tables"] != twin["data"]: + raise RecoveryFailure("RESTORED_TABLE_MISMATCH") + for name, table in twin["data"].items(): + answer = service.query(twin["owner"], twin["id"], "count rows in " + name) + if answer["result"]["answer"] != len(table["rows"]): + raise RecoveryFailure("RESTORED_QUERY_MISMATCH") + result["table_queries_checked"] += 1 + if edit is None and table["rows"] and twin["revision"] < 100: + row = table["rows"][0] + values = copy.deepcopy(row["values"]) + key = next((k for k, value in values.items() if isinstance(value, str)), None) + if key is not None: + values[key] = values[key][:1900] + " [restore rehearsal]" + edit = (twin, name, row["id"], values) + else: + raise RecoveryFailure("RESTORED_COUNTERPART_KIND_UNSUPPORTED") + result["counterparts_checked"] += 1 + if edit: + twin, name, row_id, values = edit + receipt = service.mutate( + twin["owner"], + twin["id"], + Mutation( + table=name, action="update", row_id=row_id, values=values, expected_revision=twin["revision"] + ), + "restore-rehearsal", + ) + rows = service.report(twin["owner"], twin["id"])["tables"][name]["rows"] + if ( + next(row["values"] for row in rows if row["id"] == row_id) != values + or receipt["before_digest"] == receipt["after_digest"] + ): + raise RecoveryFailure("RESTORED_EDIT_MISMATCH") + result["isolated_edit_verified"] = True + return result + + +def rehearse(source_url: str, artifact_root: Path, pg_bin: Path, runner=subprocess.run): + source = local_source(source_url) + target = "chameleon_restore_" + uuid4().hex[:12] + if not re.fullmatch(r"chameleon_restore_[a-f0-9]{12}", target) or target == source.database: + raise RecoveryFailure("UNSAFE_RESTORE_TARGET") + folder = artifact_root / target + folder.mkdir(parents=True, exist_ok=False) + archive = folder / "snapshot.dump" + env = {k: v for k, v in os.environ.items() if not k.upper().startswith("PG")} + env.update(PGPASSWORD=source.password or "", PGCONNECT_TIMEOUT="5", PGSSLMODE="disable") + common = ["--host=127.0.0.1", "--port=55432", "--username=chameleon", "--no-password"] + admin = { + "host": "127.0.0.1", + "port": 55432, + "user": source.username, + "password": source.password, + "dbname": "postgres", + "connect_timeout": 5, + "sslmode": "disable", + "autocommit": True, + } + source_engine, _ = database(source_url) + restored_engine, created = None, False + phase = "snapshot" + report = { + "recorded_at": datetime.now(UTC).isoformat(), + "status": "FAILED", + "source_database": source.database, + "source_writes": 0, + "target_database": target, + "private_archive": str(archive), + "archive_contains_private_data": True, + "source_snapshot_consistent": False, + "restored_data_equal": False, + "cleanup_complete": False, + "public_deployment": False, + } + + def command(tool, args): + completed = runner( + [str(pg_bin / (tool + (".exe" if os.name == "nt" else ""))), *common, *args], + env=env, + capture_output=True, + timeout=90, + check=False, + ) + if completed.returncode: + raise RecoveryFailure(tool.upper() + "_FAILED") + + try: + with ( + source_engine.connect().execution_options(isolation_level="REPEATABLE READ") as conn, + conn.begin(), + ): + conn.execute(text("SET TRANSACTION READ ONLY")) + if conn.scalar(text("SELECT pg_database_size(current_database())")) > 268435456: + raise RecoveryFailure("LOCAL_REHEARSAL_SIZE_LIMIT_256_MIB") + snapshot = conn.scalar(text("SELECT pg_export_snapshot()")) + before = table_snapshot(conn) + twins = [dict(row) for row in conn.execute(select(LocalTwin.__table__)).mappings()] + command( + "pg_dump", + [ + "--dbname=" + source.database, + "--format=custom", + "--snapshot=" + snapshot, + "--file=" + str(archive), + ], + ) + report["source_snapshot_consistent"] = True + report["backup_bytes"] = archive.stat().st_size + with archive.open("rb") as stream: + report["backup_sha256"] = hashlib.file_digest(stream, "sha256").hexdigest() + phase = "create_isolated_database" + with psycopg.connect(**admin) as conn: + if conn.execute("SELECT 1 FROM pg_database WHERE datname=%s", [target]).fetchone(): + raise RecoveryFailure("RESTORE_TARGET_ALREADY_EXISTS") + conn.execute(sql.SQL("CREATE DATABASE {} TEMPLATE template0").format(sql.Identifier(target))) + created = True + phase = "restore" + command( + "pg_restore", + [ + "--dbname=" + target, + "--exit-on-error", + "--single-transaction", + "--no-owner", + "--no-privileges", + str(archive), + ], + ) + phase = "compare" + restored_url = source.set(database=target).render_as_string(hide_password=False) + restored_engine, restored_sessions = database(restored_url) + with ( + restored_engine.connect().execution_options(isolation_level="REPEATABLE READ") as conn, + conn.begin(), + ): + conn.execute(text("SET TRANSACTION READ ONLY")) + after = table_snapshot(conn) + report["source_tables"], report["restored_tables"] = before, after + if before != after: + raise RecoveryFailure("RESTORED_DATA_OR_SCHEMA_MISMATCH") + report["restored_data_equal"] = True + phase = "functional_check" + report["functional"] = _functional_check(restored_sessions, twins) + report["status"] = "PASS" + except Exception as exc: # noqa: BLE001 -- retain a sanitized operation report, never raw tool/SQL output + report["error"] = str(exc) if isinstance(exc, RecoveryFailure) else type(exc).__name__ + report["failed_phase"] = phase + finally: + source_engine.dispose() + if restored_engine is not None: + restored_engine.dispose() + if created: + try: + with psycopg.connect(**admin) as conn: + # Only the exact newly-created database is dropped. Never + # terminate another connection or use DROP ... FORCE. + conn.execute(sql.SQL("DROP DATABASE {}").format(sql.Identifier(target))) + report["cleanup_complete"] = True + except psycopg.Error: + report["status"] = "FAILED" + report["cleanup_error"] = "ISOLATED_DATABASE_CLEANUP_REQUIRES_ATTENTION" + else: + report["cleanup_complete"] = True + return report diff --git a/orbiters/chameleon/packages/core/chameleon_core/repository_artifact.py b/orbiters/chameleon/packages/core/chameleon_core/repository_artifact.py new file mode 100644 index 0000000000000000000000000000000000000000..2412f9300ee8aed5c3843f3c696b988d5826862c --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/repository_artifact.py @@ -0,0 +1,186 @@ +"""Durable frozen source artifacts. Reading/packaging never runs repository code.""" + +import io +import zipfile + +from .adaptation_contracts import Evidence, Residual +from .contracts import canonical +from .repository_capture import capture, safe_path, target, verify_package + +REPOSITORY_KIND = "frozen-repository-package-v1" +PACKAGE_BYTES = 6 * 1024 * 1024 +TEXT_PREVIEW_BYTES = 16384 + + +def checked_files(evidence: Evidence): + if evidence.kind != "repository" or len(canonical(evidence.payload).encode()) > PACKAGE_BYTES: + raise Residual("REPOSITORY_EVIDENCE_OR_STORAGE_BUDGET") + data = evidence.payload + files = verify_package({"digest": evidence.content_digest, "repository": data}) + owner, repo, ref = target(evidence.source) + if data["source"] != f"https://github.com/{owner}/{repo}" or ( + ref != "HEAD" and data["commit_sha"] != ref + ): + raise Residual("REPOSITORY_REQUEST_BINDING_MISMATCH") + if data.get("behavior") != { + "status": "UNTESTED", + "build_commands_executed": False, + "dependencies_installed": False, + }: + raise Residual("REPOSITORY_CAPTURE_CANNOT_ASSERT_BEHAVIOR") + acquisition = data.get("acquisition", {}) + if "projection" in data and ( + not isinstance(data["projection"], dict) or data["projection"].get("kind") != "static-entry-subset-v1" + ): + raise Residual("REPOSITORY_PROJECTION_INVALID") + subset = data.get("projection", {}).get("kind") == "static-entry-subset-v1" + reads = acquisition.get("external_reads") + if subset and (type(reads) is not int or not 3 <= reads <= 64): + raise Residual("REPOSITORY_ACQUISITION_RECEIPT_MISMATCH") + if ( + (not subset and reads != 3) + or acquisition.get("file_bytes") != sum(map(len, files.values())) + or acquisition.get("wire_bytes") != evidence.bytes_received + or acquisition.get("source_writes") is not False + or acquisition.get("source_commands_executed") is not False + or evidence.external_reads != reads + ): + raise Residual("REPOSITORY_ACQUISITION_RECEIPT_MISMATCH") + return files + + +def acquire_repository(source, entry, *, scope="full", additional_paths=(), module_policy=None, build_importer=None): + if build_importer is not None and (scope != 'entry' or module_policy): + raise Residual('REPOSITORY_BUILD_SCOPE_INVALID') + if scope not in {"full", "entry"}: + raise Residual("REPOSITORY_CAPTURE_SCOPE") + if module_policy is not None and (scope != 'entry' or not additional_paths + or module_policy != 'relative-js-unique-v1'): + raise Residual('REPOSITORY_MODULE_POLICY_INVALID') + package = ( + capture( + source, + entry, + scope="entry", + **({"additional_paths": additional_paths} if additional_paths else {}), + **({'module_policy': module_policy} if module_policy else {}), + **({'build_importer': build_importer} if build_importer else {}), + ) + if scope == "entry" + else capture(source, entry) + ) + data = package["repository"] + if ("entry" if data.get("projection") else "full") != scope: + raise Residual("REPOSITORY_SCOPE_BINDING_MISMATCH") + evidence = Evidence( + source=source, + kind="repository", + content_digest=package["digest"], + captured_at=data["captured_at"], + payload=data, + bytes_received=data["acquisition"]["wire_bytes"], + external_reads=data["acquisition"]["external_reads"], + authority="public_snapshot", + ) + checked_files(evidence) + if data["entry"] != entry: + raise Residual("REPOSITORY_ENTRY_BINDING_MISMATCH") + return evidence + + +def repository_profile(evidence): + files = checked_files(evidence) + data = evidence.payload + return { + "kind": "repository", + "source": data["source"], + "commit_sha": data["commit_sha"], + "tree_sha": data["tree_sha"], + "entry": data["entry"], + "file_count": len(files), + "capture_scope": "entry" if data.get("projection") else "full", + "projection": data.get("projection"), + "file_bytes": sum(map(len, files.values())), + "license_files": data["license_files"], + "files": [ + {"path": p, "bytes": len(b), "sha256": data["files"][p]["sha256"]} + for p, b in sorted(files.items()) + ], + "behavior_status": "UNTESTED", + "source_writes": False, + "source_commands_executed": False, + } + + +def repository_manifest(evidence): + return { + **repository_profile(evidence), + "kind": REPOSITORY_KIND, + "captured_at": evidence.captured_at, + "package_digest": evidence.content_digest, + "lifecycle": {"capture": "VERIFIED", "package": "READY", "behavior": "UNTESTED"}, + "supported": ["inspect_files", "read_text_file", "download_source_package"], + "fidelity": "Original source bytes verified against a frozen Git tree; application behavior not tested in this job", + "not_reconstructed": [ + "build outputs", + "dependency installation", + "private server behavior", + "credentials", + "continuous synchronization", + ], + "license_scope": evidence.payload["license_scope"], + "browser_execution_enabled": False, + } + + +def manifest_matches(manifest, evidence): + """Accept the exact pre-subset full-capture schema without mutating history.""" + expected = repository_manifest(evidence) + if manifest == expected: + return True + if "projection" in evidence.payload or "capture_scope" in manifest or "projection" in manifest: + return False + legacy = {key: value for key, value in expected.items() if key not in {"capture_scope", "projection"}} + return manifest == legacy + + +def file_preview(evidence, path): + safe_path(path) + files = checked_files(evidence) + if path not in files: + raise Residual("REPOSITORY_FILE_NOT_FOUND") + body = files[path] + try: + text = body.decode("utf-8") + if any(ord(c) < 32 and c not in "\r\n\t" for c in text): + text = None + except UnicodeDecodeError: + text = None + return { + "path": path, + "bytes": len(body), + "sha256": evidence.payload["files"][path]["sha256"], + "text": None if text is None else body[:TEXT_PREVIEW_BYTES].decode("utf-8", errors="replace"), + "binary": text is None, + "truncated": text is not None and len(body) > TEXT_PREVIEW_BYTES, + "executed": False, + } + + +def source_zip(evidence): + files = checked_files(evidence) + metadata = repository_manifest(evidence) + metadata["archive_sha256"] = evidence.payload.get("archive_sha256") + metadata["entry_in_archive"] = "source/" + evidence.payload["entry"] + output = io.BytesIO() + # Stable ZIP metadata; reserve an outer namespace without altering source paths. + with zipfile.ZipFile(output, "w", compression=zipfile.ZIP_DEFLATED) as archive: + for name, body in [ + ("CHAMELEON_CAPTURE.json", canonical(metadata).encode()), + *[("source/" + p, b) for p, b in sorted(files.items())], + ]: + info = zipfile.ZipInfo(name) + info.compress_type = zipfile.ZIP_DEFLATED + info.external_attr = 0o100644 << 16 + archive.writestr(info, body) + return output.getvalue() diff --git a/orbiters/chameleon/packages/core/chameleon_core/repository_capture.py b/orbiters/chameleon/packages/core/chameleon_core/repository_capture.py new file mode 100644 index 0000000000000000000000000000000000000000..1457d4ce7dd951118b7e06374cac986c7cc94d07 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/repository_capture.py @@ -0,0 +1,372 @@ +"""Bounded public GitHub acquisition. Repository instructions are never executed. + +Resolve once, then bind archive bytes to that commit's recursive Git tree. +No git hooks, checkout, package installation, submodules or archive extraction. +""" + +import base64 +import hashlib +import http.client +import io +import json +import os +import re +import subprocess +import sys +import tarfile +import zlib +from pathlib import Path, PurePosixPath +from urllib.parse import urlsplit + +from .adaptation_contracts import Residual +from .contracts import digest +from .db import now +from .intake import PinnedHTTPS, checked_url + +WIRE_LIMIT = 2 * 1024 * 1024 +TAR_LIMIT = 8 * 1024 * 1024 +FILE_LIMIT = 512 * 1024 +TOTAL_LIMIT = 4 * 1024 * 1024 +FILE_COUNT = 128 +SHA = re.compile(r"[0-9a-f]{40}") +NAME = re.compile(r"[A-Za-z0-9_.-]{1,100}") + + +def target(source): + try: + u = urlsplit(source) + parts = u.path.strip("/").split("/") + if ( + u.scheme != "https" + or u.netloc != "github.com" + or u.query + or u.fragment + or len(parts) not in (2, 4) + or not all(NAME.fullmatch(p) and p not in {".", ".."} for p in parts[:2]) + or (len(parts) == 4 and (parts[2] != "tree" or not SHA.fullmatch(parts[3]))) + ): + raise Residual("REPOSITORY_ROOT_OR_PINNED_COMMIT_URL_REQUIRED") + owner, repo = parts[:2] + repo = repo.removesuffix(".git") + if not repo or repo in {".", ".."}: + raise Residual("REPOSITORY_ROOT_OR_PINNED_COMMIT_URL_REQUIRED") + return owner, repo, parts[3] if len(parts) == 4 else "HEAD" + except ValueError as exc: + if isinstance(exc, Residual): + raise + raise Residual("REPOSITORY_ROOT_OR_PINNED_COMMIT_URL_REQUIRED") from None + + +def safe_path(path): + if not isinstance(path, str) or not 1 <= len(path) <= 240: + raise Residual("REPOSITORY_UNSAFE_PATH") + parts = path.split("/") + if ( + any(c in path for c in '\\:\x00<>"|?*') + or any(ord(c) < 32 or ord(c) == 127 for c in path) + or any(p.casefold() in {"", ".", "..", ".git"} or p.endswith((".", " ")) for p in parts) + or any(re.fullmatch(r"(?i)(con|prn|aux|nul|com[0-9]|lpt[0-9])(?:\..*)?", p) for p in parts) + ): + raise Residual("REPOSITORY_UNSAFE_PATH") + return path + + +def fetch_bytes(url, limit): + host, address, path = checked_url(url) + if host not in {"api.github.com", "codeload.github.com"}: + raise Residual("REPOSITORY_FETCH_HOST_DENIED") + connection = PinnedHTTPS(host, address) + try: + connection.request( + "GET", + path, + headers={ + "Host": host, + "User-Agent": "Chameleon-Public-Repository/0.1", + "Accept": "application/vnd.github+json" if host == "api.github.com" else "application/gzip", + "Accept-Encoding": "identity", + "X-GitHub-Api-Version": "2022-11-28", + }, + ) + response = connection.getresponse() + if response.status != 200: + raise Residual(f"REPOSITORY_HTTP_{response.status}") + if response.getheader("Content-Encoding", "identity").lower() not in {"", "identity"}: + raise Residual("REPOSITORY_TRANSFER_ENCODING_DENIED") + body = response.read(limit + 1) + if len(body) > limit: + raise Residual("REPOSITORY_WIRE_BUDGET") + return body + except (OSError, http.client.HTTPException) as exc: + raise Residual("REPOSITORY_UNAVAILABLE") from exc + finally: + connection.close() + + +def tree_files(data, *, metadata_only=False): + if not isinstance(data, dict) or data.get("truncated") is not False: + raise Residual("REPOSITORY_COMPLETE_TREE_REQUIRED") + entries = data.get("tree") + if not isinstance(entries, list) or len(entries) > 512: + raise Residual("REPOSITORY_TREE_BUDGET") + files, seen, total = {}, set(), 0 + for entry in entries: + if not isinstance(entry, dict): + raise Residual("REPOSITORY_TREE_INVALID") + path = safe_path(entry.get("path")) + if path.casefold() in seen: + raise Residual("REPOSITORY_CASE_COLLISION") + seen.add(path.casefold()) + if entry.get("type") == "tree" and entry.get("mode") == "040000": + continue + if entry.get("type") != "blob" or entry.get("mode") not in {"100644", "100755"}: + raise Residual("REPOSITORY_SYMLINK_OR_SUBMODULE_DENIED") + if not isinstance(entry.get("sha"), str) or not SHA.fullmatch(entry["sha"]): + raise Residual("REPOSITORY_BLOB_SHA_INVALID") + size = entry.get("size") + if type(size) is not int or not 0 <= size <= (2**53 if metadata_only else FILE_LIMIT): + raise Residual("REPOSITORY_FILE_BYTE_BUDGET") + total += size + files[path] = {"sha": entry["sha"], "size": size, "mode": entry["mode"]} + if not files or (not metadata_only and (len(files) > FILE_COUNT or total > TOTAL_LIMIT)): + raise Residual("REPOSITORY_FILE_OR_TOTAL_BUDGET") + return files + + +def unpack_verified(archive, expected): + if len(archive) > WIRE_LIMIT: + raise Residual("REPOSITORY_WIRE_BUDGET") + try: + decoder = zlib.decompressobj(16 + zlib.MAX_WBITS) + raw = decoder.decompress(archive, TAR_LIMIT + 1) + if len(raw) > TAR_LIMIT or decoder.unconsumed_tail: + raise Residual("REPOSITORY_EXPANDED_BUDGET") + if not decoder.eof or decoder.unused_data: + raise Residual("REPOSITORY_ARCHIVE_INVALID") + files, prefix, seen = {}, None, set() + with tarfile.open(fileobj=io.BytesIO(raw), mode="r:") as tar: + for index, member in enumerate(tar): + if index >= 512: + raise Residual("REPOSITORY_ARCHIVE_ENTRY_BUDGET") + name = member.name.rstrip("/") + safe_path(name) + if name.casefold() in seen: + raise Residual("REPOSITORY_ARCHIVE_DUPLICATE") + seen.add(name.casefold()) + root, _, path = name.partition("/") + prefix = prefix or root + if root != prefix: + raise Residual("REPOSITORY_ARCHIVE_ROOT_MISMATCH") + if member.isdir(): + continue + if not member.isfile() or not path or member.sparse: + raise Residual("REPOSITORY_ARCHIVE_SPECIAL_FILE_DENIED") + info = expected.get(path) + if not info or member.size != info["size"] or member.size > FILE_LIMIT: + raise Residual("REPOSITORY_ARCHIVE_TREE_MISMATCH") + stream = tar.extractfile(member) + if stream is None: + raise Residual("REPOSITORY_ARCHIVE_INVALID") + body = stream.read(FILE_LIMIT + 1) + git_sha = hashlib.sha1(f"blob {len(body)}\0".encode() + body).hexdigest() + if len(body) != info["size"] or git_sha != info["sha"]: + raise Residual("REPOSITORY_BLOB_DIGEST_MISMATCH") + files[path] = body + if files.keys() != expected.keys(): + raise Residual("REPOSITORY_ARCHIVE_INCOMPLETE_TREE") + return files + except (zlib.error, tarfile.TarError, EOFError, OSError) as exc: + raise Residual("REPOSITORY_ARCHIVE_INVALID") from exc + + +def capture_direct(source, entry="index.html", fetch=fetch_bytes): + owner, repo, ref = target(source) + safe_path(entry) + endpoint = f"https://api.github.com/repos/{owner}/{repo}" + commit_raw = fetch(endpoint + "/commits/" + ref, 524288) + try: + commit = json.loads(commit_raw) + sha, tree_sha = commit["sha"], commit["commit"]["tree"]["sha"] + if not SHA.fullmatch(sha) or not SHA.fullmatch(tree_sha) or (ref != "HEAD" and ref != sha): + raise Residual("REPOSITORY_COMMIT_MISMATCH") + tree_raw = fetch(endpoint + "/git/trees/" + tree_sha + "?recursive=1", 524288) + tree = json.loads(tree_raw) + if tree.get("sha") != tree_sha: + raise Residual("REPOSITORY_TREE_SHA_MISMATCH") + expected = tree_files(tree) + except (KeyError, TypeError, ValueError) as exc: + if isinstance(exc, Residual): + raise + raise Residual("REPOSITORY_METADATA_INVALID") from None + archive_url = f"https://codeload.github.com/{owner}/{repo}/tar.gz/{sha}" + archive = fetch(archive_url, WIRE_LIMIT) + files = unpack_verified(archive, expected) + if entry not in files or PurePosixPath(entry).suffix.lower() not in {".html", ".htm"}: + raise Residual("REPOSITORY_STATIC_ENTRY_MISSING") + licenses = [p for p in files if re.fullmatch(r"(?i)(license|licence|copying)(?:\.(txt|md))?", p)] + notices = [] + if not licenses: + from .license_notices import inline_notices + notices = inline_notices(files) + licenses = [n['path'] for n in notices] + if not licenses: + raise Residual("REPOSITORY_LICENSE_FILE_REQUIRED_FOR_PACKAGE") + payload = { + "version": "frozen-public-repository-v1", + "source": f"https://github.com/{owner}/{repo}", + "commit_sha": sha, + "tree_sha": tree_sha, + "entry": entry, + "captured_at": now().isoformat(), + "archive_url": archive_url, + "archive_sha256": hashlib.sha256(archive).hexdigest(), + "license_files": licenses, + "license_scope": "Files preserved verbatim; no automatic legal compatibility determination", + **({'inline_license_notices': notices} if notices else {}), + "files": { + p: { + "git_blob_sha": expected[p]["sha"], + "sha256": hashlib.sha256(body).hexdigest(), + "bytes": len(body), + "base64": base64.b64encode(body).decode(), + } + for p, body in sorted(files.items()) + }, + "acquisition": { + "external_reads": 3, + "wire_bytes": len(commit_raw) + len(tree_raw) + len(archive), + "file_bytes": sum(map(len, files.values())), + "source_writes": False, + "source_commands_executed": False, + }, + "behavior": {"status": "UNTESTED", "build_commands_executed": False, "dependencies_installed": False}, + } + return {"digest": digest(payload), "repository": payload} + + +def capture(source, entry="index.html", *, scope="full", additional_paths=(), module_policy=None, build_importer=None): + if scope not in {"full", "entry"}: + raise Residual("REPOSITORY_CAPTURE_SCOPE") + if additional_paths and scope != "entry": + raise Residual("REPOSITORY_CAPTURE_SCOPE") + if module_policy is not None and (scope != 'entry' or not additional_paths + or module_policy != 'relative-js-unique-v1'): + raise Residual('REPOSITORY_MODULE_POLICY_INVALID') + target(source) + if build_importer is not None: + safe_path(build_importer) + if scope != 'entry' or module_policy or target(source)[2] == 'HEAD': + raise Residual('REPOSITORY_BUILD_SCOPE_INVALID') + safe_path(entry) + env = {key: os.environ[key] for key in ("SystemRoot", "WINDIR", "PATH") if key in os.environ} + env["PYTHONPATH"] = str(Path(__file__).resolve().parents[1]) + try: + result = subprocess.run( + [sys.executable, "-m", "chameleon_core.repository_capture"], + input=json.dumps( + {"source": source, "entry": entry, "scope": scope, "additional_paths": additional_paths, + **({'module_policy': module_policy} if module_policy else {}), + **({'build_importer': build_importer} if build_importer else {})} + ), + text=True, + capture_output=True, + check=False, + timeout=30, + env=env, + ) + except subprocess.TimeoutExpired as exc: + raise Residual("REPOSITORY_WALL_TIME_BUDGET") from exc + if result.returncode: + raise Residual("REPOSITORY_CAPTURE_PROCESS_FAILED") + try: + answer = json.loads(result.stdout) + if "error" in answer: + raise Residual(answer["error"]) + verify_package(answer) + return answer + except (ValueError, TypeError) as exc: + if isinstance(exc, Residual): + raise + raise Residual("REPOSITORY_CAPTURE_RESPONSE_INVALID") from None + + +def verify_package(package): + try: + if not isinstance(package, dict) or not isinstance(package.get("repository"), dict): + raise Residual("REPOSITORY_PACKAGE_INVALID") + data = package["repository"] + if package["digest"] != digest(data) or data["version"] != "frozen-public-repository-v1": + raise Residual("REPOSITORY_PACKAGE_DIGEST_MISMATCH") + target(data["source"] + "/tree/" + data["commit_sha"]) + if not SHA.fullmatch(data["tree_sha"]): + raise Residual("REPOSITORY_TREE_SHA_MISMATCH") + if not isinstance(data.get("files"), dict) or not 1 <= len(data["files"]) <= FILE_COUNT: + raise Residual("REPOSITORY_FILE_OR_TOTAL_BUDGET") + if not isinstance(data.get("license_files"), list) or len(data["license_files"]) > FILE_COUNT: + raise Residual("REPOSITORY_PACKAGE_ENTRY_OR_LICENSE_MISSING") + files, seen, total = {}, set(), 0 + for path, record in data["files"].items(): + safe_path(path) + if path.casefold() in seen: + raise Residual("REPOSITORY_CASE_COLLISION") + seen.add(path.casefold()) + if len(record["base64"]) > (FILE_LIMIT + 2) // 3 * 4: + raise Residual("REPOSITORY_FILE_BYTE_BUDGET") + body = base64.b64decode(record["base64"], validate=True) + if ( + len(body) != record["bytes"] + or len(body) > FILE_LIMIT + or hashlib.sha256(body).hexdigest() != record["sha256"] + or hashlib.sha1(f"blob {len(body)}\0".encode() + body).hexdigest() != record["git_blob_sha"] + ): + raise Residual("REPOSITORY_BLOB_DIGEST_MISMATCH") + files[path] = body + total += len(body) + if not files or len(files) > FILE_COUNT or total > TOTAL_LIMIT: + raise Residual("REPOSITORY_FILE_OR_TOTAL_BUDGET") + if safe_path(data["entry"]) not in files or not data["license_files"]: + raise Residual("REPOSITORY_PACKAGE_ENTRY_OR_LICENSE_MISSING") + if any(p not in files for p in data["license_files"]): + raise Residual("REPOSITORY_PACKAGE_ENTRY_OR_LICENSE_MISSING") + if ('inline_license_notices' not in data and any( + not re.fullmatch(r'(?i)(license|licence|copying)(?:\.(txt|md))?', p) + for p in data['license_files'])): + raise Residual('REPOSITORY_INLINE_LICENSE_EVIDENCE_REQUIRED') + if 'inline_license_notices' in data: + from .license_notices import inline_notices + expected = inline_notices(files) + if (not expected or data['inline_license_notices'] != expected + or data['license_files'] != [n['path'] for n in expected]): + raise Residual('REPOSITORY_INLINE_LICENSE_BINDING_MISMATCH') + return files + except (KeyError, TypeError, ValueError) as exc: + if isinstance(exc, Residual): + raise + raise Residual("REPOSITORY_PACKAGE_INVALID") from None + + +if __name__ == "__main__": + try: + request = json.loads(sys.stdin.read(4097)) + if request.get("scope", "full") == "entry": + from .entry_capture import capture_entry + + if request.get('build_importer'): + sys.path.insert(0, str(Path(__file__).resolve().parents[3] / 'scripts')) + from build_input_discovery import capture_build_inputs + result = capture_build_inputs(request['source'], request['entry'], request['build_importer'], + additional_paths=request.get('additional_paths', [])) + else: + result = capture_entry( + request["source"], request["entry"], additional_paths=request.get("additional_paths", []), + **({'module_policy': request['module_policy']} if request.get('module_policy') else {}) + ) + elif request.get("scope", "full") == "full": + result = capture_direct(request["source"], request["entry"]) + else: + raise Residual("REPOSITORY_CAPTURE_SCOPE") + except Residual as exc: + result = {"error": exc.code} + except (KeyError, ValueError, TypeError, RecursionError): + result = {"error": "REPOSITORY_CAPTURE_INVALID"} + print(json.dumps(result)) diff --git a/orbiters/chameleon/packages/core/chameleon_core/retention.py b/orbiters/chameleon/packages/core/chameleon_core/retention.py new file mode 100644 index 0000000000000000000000000000000000000000..13a26c33c8f3af858245a7615879bbb320621158 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/retention.py @@ -0,0 +1,72 @@ +"""Read-only aggregate retention inventory, never a deletion command.""" + +from datetime import timedelta + +from sqlalchemy import exists, func, or_, select, text + +from .db import AdaptationJob, Base, Instance, SessionToken, User, WebsiteCapture + + +def inventory(sessions, inactive_hours): + if type(inactive_hours) is not int or not 1 <= inactive_hours <= 87600: + raise ValueError("Specify an analysis window between one hour and ten years") + with sessions() as s: + s.connection(execution_options={"isolation_level": "REPEATABLE READ"}) + s.execute(text("SET TRANSACTION READ ONLY")) + timestamp = s.scalar(select(func.now())) + cutoff = timestamp - timedelta(hours=inactive_hours) + tables = {} + for name, table in sorted(Base.metadata.tables.items()): + tables[name] = { + "rows": s.scalar(select(func.count()).select_from(table)), + "relation_bytes_including_indexes": s.scalar( + text("SELECT pg_total_relation_size(CAST(:name AS regclass))"), {"name": name} + ), + } + last_session = ( + select(SessionToken.owner.label("owner"), func.max(SessionToken.expires).label("last_expiry")) + .group_by(SessionToken.owner) + .subquery() + ) + pending = exists().where( + AdaptationJob.owner == User.id, + or_( + AdaptationJob.created > cutoff, + AdaptationJob.status.in_(["QUEUED", "RUNNING"]), + AdaptationJob.counterpart["status"].as_string() == "PENDING", + ), + ) + potential = s.scalar( + select(func.count()) + .select_from(User) + .join(last_session, last_session.c.owner == User.id) + .where( + User.password == "guest-disabled", + last_session.c.last_expiry <= cutoff, + ~pending, + ~exists().where(WebsiteCapture.owner == User.id, WebsiteCapture.status == "PENDING"), + ~exists().where(Instance.owner == User.id), + ) + ) + expired = s.scalar( + select(func.count()).select_from(SessionToken).where(SessionToken.expires <= timestamp) + ) + return { + "recorded_at": timestamp.isoformat(), + "mode": "read_only_analysis", + "writes": 0, + "deletion_authorized": False, + "analysis_window_hours": inactive_hours, + "policy_selected": False, + "expired_sessions": expired, + "potentially_inactive_read_only_guests": potential, + "exclusions": [ + "non-guest accounts", + "valid or recently expired sessions", + "recent or pending read work", + "pending page/construct consumers", + "any manual effect-form instance", + ], + "tables": tables, + "note": "Counts are an inventory, not approved deletion eligibility or predicted reclaimable disk space.", + } diff --git a/orbiters/chameleon/packages/core/chameleon_core/sass_assembly.py b/orbiters/chameleon/packages/core/chameleon_core/sass_assembly.py new file mode 100644 index 0000000000000000000000000000000000000000..e119a08867c1f9a479645c6cf96dab71957a1c55 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/sass_assembly.py @@ -0,0 +1,120 @@ +"""Compile captured linked Sass; deterministic bytes for dependency replay.""" +import base64 +import hashlib +import json +import posixpath +import re +import shutil +from html.parser import HTMLParser +from pathlib import Path +from urllib.parse import urlsplit + +from .repository_capture import safe_path, verify_package +from .windows_job import run_bounded + +ROOT = Path(__file__).resolve().parents[3] + + +def linked_sass_entries(package): + files = verify_package(package) + entry = package['repository']['entry'] + found = set() + + class Links(HTMLParser): + def handle_starttag(self, tag, attrs): + if tag == 'base': + raise ValueError('SASS_BASE_UNSUPPORTED') + if tag != 'link': + return + pairs = [(k,v) for k,v in attrs if k in {'href','rel'}] + if len({k for k,_ in pairs}) != len(pairs): + raise ValueError('SASS_DUPLICATE_LINK_ATTRIBUTE') + values = dict(pairs) + if 'stylesheet' not in (values.get('rel') or '').lower().split(): + return + raw = values.get('href') or '' + url = urlsplit(raw) + if not url.path.endswith(('.scss','.sass')): + return + if url.scheme or url.netloc or url.query or url.fragment or '%' in raw or '\\' in raw: + raise ValueError('SASS_LINK_BOUNDARY') + path = posixpath.normpath(url.path.lstrip('/') if url.path.startswith('/') else posixpath.join(posixpath.dirname(entry),url.path)) + safe_path(path) + if path not in files: + raise ValueError('SASS_ENTRY_NOT_CAPTURED') + found.add(path) + if len(found)>4: + raise ValueError('SASS_ENTRY_BUDGET') + + Links().feed(files[entry].decode('utf-8')) + return sorted(found) + + +def assemble_styles(package, entry_overlay, entries): + source = verify_package(package) + if not isinstance(entries, list) or not 1 <= len(entries) <= 4 or len(set(entries)) != len(entries): + raise ValueError('SASS_ENTRY_BUDGET') + for entry in entries: + safe_path(entry) + if entry not in source or not entry.endswith(('.scss', '.sass')): + raise ValueError('SASS_ENTRY_NOT_CAPTURED') + text = base64.b64decode(entry_overlay['base64'], validate=True).decode('utf-8') + html_path = package['repository']['entry'] + starts = [0] + [m.end() for m in re.finditer('\n', text)] + edits, found = [], set() + + class Links(HTMLParser): + def handle_starttag(self, tag, attrs): + if tag != 'link' or 'stylesheet' not in dict(attrs).get('rel', '').lower().split(): + return + raw = self.get_starttag_text() + matches = [m for m in re.finditer(r'''([^\s=<>/]+)\s*=\s*(?:(["'])(.*?)\2|([^\s"'=<>`]+))''', raw, re.DOTALL) if m[1].lower() == 'href'] + if len(matches) != 1: + raise ValueError('SASS_LINK_UNSUPPORTED') + match = matches[0] + value_group = 3 if match[2] else 4 + value = match[value_group] + url = urlsplit(value) + if url.scheme or url.netloc or url.query or url.fragment: + return + path = posixpath.normpath(url.path.lstrip('/') if url.path.startswith('/') else posixpath.join(posixpath.dirname(html_path), url.path)) + if path not in entries: + return + if '%' in url.path or '\\' in url.path: + raise ValueError('SASS_LINK_UNSUPPORTED') + line, col = self.getpos() + offset = starts[line-1] + col + edits.append((offset+match.start(value_group), offset+match.end(value_group), value+'.css')) + found.add(path) + + Links().feed(text) + if found != set(entries): + raise ValueError('SASS_ENTRY_NOT_LINKED') + files, builds = {}, [] + for entry in sorted(entries): + destination = entry+'.css' + if destination.casefold() in {p.casefold() for p in source}: + raise ValueError('SASS_OUTPUT_COLLISION') + request = {'entry': entry, 'files': {p:r for p,r in package['repository']['files'].items() if p.endswith(('.scss','.sass','.css'))}} + node = shutil.which('node') + if not node: + raise ValueError('SASS_COMPILER_UNAVAILABLE') + runtime = run_bounded([node, str(ROOT/'scripts/compile_frozen_sass.mjs')], json.dumps(request), ROOT) + if runtime['returncode'] or runtime['remaining_job_processes'] or runtime.get('stderr') or any(runtime[k] for k in ('timed_out','cpu_budget_exhausted','output_budget_exhausted')): + raise ValueError('SASS_COMPILER_FAILED') + result = json.loads(runtime['stdout']) + if result['status'] != 'PASS': + raise ValueError('SASS_COMPILATION_UNRESOLVED') + body = result['css'].encode() + if len(body)>262144 or hashlib.sha256(body).hexdigest()!=result['sha256'] or result['source_executed'] is not False: + raise ValueError('SASS_OUTPUT_BINDING') + for path, fingerprint in result['used'].items(): + if path not in source or hashlib.sha256(source[path]).hexdigest()!=fingerprint: + raise ValueError('SASS_SOURCE_BINDING') + files[destination] = {'base64':base64.b64encode(body).decode(),'bytes':len(body),'sha256':result['sha256']} + builds.append({'entry':entry,'destination':destination,'used':result['used'],'compiler':result['compiler'],'warnings':result['warnings']}) + for start,end,replacement in sorted(edits,reverse=True): + text=text[:start]+replacement+text[end:] + body=text.encode() + updated={**entry_overlay,'base64':base64.b64encode(body).decode(),'bytes':len(body),'sha256':hashlib.sha256(body).hexdigest()} + return files, updated, builds diff --git a/orbiters/chameleon/packages/core/chameleon_core/script_images.py b/orbiters/chameleon/packages/core/chameleon_core/script_images.py new file mode 100644 index 0000000000000000000000000000000000000000..3e09491b181d019ba6d7c55e14a68450e6634e3a --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/script_images.py @@ -0,0 +1,101 @@ +"""Bounded static discovery of image URLs declared by JavaScript. + +This is a literal scanner, not a JavaScript runtime. It recognizes direct +``src``/``srcset``/``backgroundImage`` assignments and ``setAttribute`` calls; +dynamic expressions and template strings with interpolation are not inferred. +""" + +import re + +from .image_sources import srcset_candidates + +MAX_SCRIPT_BYTES = 131072 +MAX_IMAGE_REFERENCES = 128 + +_ASSIGNMENT = re.compile( + r"\.\s*(?Psrcset|src|backgroundImage)\s*(?:=|:)\s*" + r"(?:new\s+URL\s*\(\s*)?$", + re.IGNORECASE, +) +_SET_ATTRIBUTE = re.compile( + r"\.\s*setAttribute\s*\(\s*(['\"])(?Psrcset|src)\1\s*,\s*$", + re.IGNORECASE, +) + + +def _strings_and_code(source): + """Return source with comments blanked plus bounded static string tokens.""" + code = list(source) + strings = [] + i = 0 + while i < len(source): + if source.startswith("//", i): + end = source.find("\n", i + 2) + end = len(source) if end < 0 else end + code[i:end] = " " * (end - i) + i = end + continue + if source.startswith("/*", i): + end = source.find("*/", i + 2) + end = len(source) if end < 0 else end + 2 + code[i:end] = " " * (end - i) + i = end + continue + quote = source[i] + if quote not in "'\"`": + i += 1 + continue + start = i + i += 1 + value = [] + dynamic = False + while i < len(source): + char = source[i] + if char == "\\" and i + 1 < len(source): + value.append(source[i + 1]) + i += 2 + continue + if quote == "`" and source.startswith("${", i): + dynamic = True + if char == quote: + i += 1 + break + value.append(char) + i += 1 + if quote != "`" or not dynamic: + strings.append((start, i, "".join(value))) + i = max(i, start + 1) + return "".join(code), strings + + +def image_references(source): + """Find literal image candidates in JS without evaluating the source.""" + if not isinstance(source, str) or len(source.encode("utf-8", errors="ignore")) > MAX_SCRIPT_BYTES: + return [] + code, strings = _strings_and_code(source) + found = [] + seen = set() + for start, end, value in strings: + prefix = code[max(0, start - 160):start] + match = _ASSIGNMENT.search(prefix) + set_attribute = _SET_ATTRIBUTE.search(prefix) + if not (match or set_attribute): + continue + name = (match.group("name") if match else set_attribute.group("name")).lower() + if name == "srcset": + candidates = [url for url, _ in srcset_candidates(value)] + elif name == "backgroundimage": + from .visual_css import references + + candidates = [url for url, kind in references(value, inline=True) if kind == "binary"] + else: + candidates = [value] + for candidate in candidates: + candidate = candidate.replace("\\/", "/").strip() + if not candidate or any(ord(char) < 32 for char in candidate) or candidate in seen: + continue + seen.add(candidate) + found.append(candidate) + if len(found) >= MAX_IMAGE_REFERENCES: + return found + return found diff --git a/orbiters/chameleon/packages/core/chameleon_core/script_inventory.py b/orbiters/chameleon/packages/core/chameleon_core/script_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..cf91113d7a191bfefb55d6b8f257f42524ca5bc0 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/script_inventory.py @@ -0,0 +1,66 @@ +"""Retain inert script evidence for reconstruction; never fetch or execute it.""" +from hashlib import sha256 +from html.parser import HTMLParser + + +def script_inventory(raw, *, limit=64, byte_budget=131072, external_scripts_fetched=False): + records = [] + used = 0 + omitted = 0 + + class Parser(HTMLParser): + current = None + chunks = None + + def handle_starttag(self, tag, attrs): + nonlocal omitted + if tag != 'script': + return + if len(records) >= limit: + omitted += 1 + self.current = None + return + attributes = dict(attrs) + self.current = { + 'line': self.getpos()[0], + 'src_attribute': attributes.get('src'), + 'type': attributes.get('type') or 'text/javascript', + 'async': 'async' in attributes, + 'defer': 'defer' in attributes, + } + self.chunks = [] + + def handle_data(self, data): + if self.current is not None: + self.chunks.append(data) + + def finish(self): + nonlocal used + if self.current is None: + return + body = ''.join(self.chunks) + encoded = body.encode('utf-8') + retained = len(encoded) <= byte_budget - used + self.current.update({ + 'inline_sha256': sha256(encoded).hexdigest(), + 'inline_bytes': len(encoded), + 'inline_source': body if retained else None, + 'source_retained': retained, + 'status': 'UNVERIFIED_SOURCE_EVIDENCE', + }) + if retained: + used += len(encoded) + records.append(self.current) + self.current = None + + def handle_endtag(self, tag): + if tag == 'script': + self.finish() + + parser = Parser(convert_charrefs=False) + parser.feed(raw) + parser.close() + parser.finish() + return {'version': 'script-inventory-v1', 'scripts': records, + 'omitted_scripts': omitted, 'retained_inline_bytes': used, + 'external_scripts_fetched': bool(external_scripts_fetched), 'execution_verified': False} diff --git a/orbiters/chameleon/packages/core/chameleon_core/service.py b/orbiters/chameleon/packages/core/chameleon_core/service.py new file mode 100644 index 0000000000000000000000000000000000000000..2fe1b59b6ae27876b30851d15063ed9981f41903 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/service.py @@ -0,0 +1,594 @@ +from __future__ import annotations + +from datetime import datetime, timedelta + +from sqlalchemy import select +from sqlalchemy import text as sql_text + +from .contracts import AgentIdentity, Candidate, Form, Observation, TicketArguments, digest, host_form +from .db import ( + Agent, + Approval, + CandidateRow, + Connection, + EventRow, + FixtureRequest, + FormRow, + Grant, + Instance, + Intent, + ObservationRow, + Outbox, + Receipt, + Run, + now, + uid, +) +from .providers import FixtureDecisionProvider, ProviderError, validate_decision + + +class Failure(RuntimeError): + def __init__(self, code: str, status=409): + self.code = code + self.status = status + super().__init__(code) + + +def owned(s, model, ident: str, owner: str, lock=False): + query = select(model).where(model.id == ident, model.owner == owner) + row = s.scalar(query.with_for_update() if lock else query) + if row is None: + raise Failure("NOT_FOUND", 404) + return row + + +def event(s, run: Run, kind: str, data: dict): + run.sequence += 1 + s.add(EventRow(owner=run.owner, run=run.id, sequence=run.sequence, type=kind, data=data)) + + +def authorize(s, run: Run, operation: str, *, reconciliation=False): + from .db import Target + + instance = owned(s, Instance, run.instance, run.owner) + target = owned(s, Target, instance.target, run.owner) + connection = owned(s, Connection, target.connection, run.owner) + form = s.get(FormRow, instance.form) + if connection.revoked: + raise Failure("PERMISSION_DENIED", 403) + if not form or form.status != "approved_fixture" or digest(form.data) != form.digest: + raise Failure("FORM_INCOMPATIBLE") + Form.model_validate(form.data) + if instance.provider != "deterministic-fixture-v1": + raise Failure("PROVIDER_UNCONFIGURED") + grant = s.scalar( + select(Grant) + .where(Grant.owner == run.owner, Grant.target == target.id, Grant.operation == operation) + .with_for_update() + ) + if not grant or not grant.active: + raise Failure("PERMISSION_DENIED", 403) + if not reconciliation and (run.calls >= run.max_calls or now() >= run.expires): + raise Failure("BUDGET_EXHAUSTED") + if reconciliation and run.checkpoint.get("reconciliation_reads", 0) >= 5: + raise Failure("RECONCILIATION_BUDGET_EXHAUSTED") + if target.fingerprint != digest({"interface": "hotel-fixture-v1"}): + raise Failure("FORM_INCOMPATIBLE") + return instance, grant + + +class Runtime: + """Manual host graph runner. It cannot dispatch effects without Broker.""" + + def __init__(self, sessions, adapter, provider=None): + self.sessions = sessions + self.provider = provider or FixtureDecisionProvider() + self.broker = Broker(sessions, adapter) + + def seed(self, owner: str, name="Iris"): + from .db import Target + + with self.sessions.begin() as s: + s.execute(sql_text("SELECT pg_advisory_xact_lock(hashtext(:owner))"), {"owner": owner}) + a = s.scalar(select(Agent).where(Agent.owner == owner).order_by(Agent.id)) + if not a: + agent_id = uid() + identity = AgentIdentity( + agent_id=agent_id, owner_id=owner, display_name=name, identity_version=1 + ) + a = Agent(id=agent_id, owner=owner, name=name, identity=identity.model_dump()) + s.add(a) + connection = Connection(owner=owner) + s.add(connection) + s.flush() + target = Target( + owner=owner, connection=connection.id, fingerprint=digest({"interface": "hotel-fixture-v1"}) + ) + s.add(target) + s.flush() + for op in ["hotel.observe", "hotel.create_ticket", "hotel.read_ticket"]: + s.add(Grant(owner=owner, target=target.id, operation=op)) + form = host_form().model_dump() + form_hash = digest(form) + if not s.get(FormRow, form_hash): + s.add(FormRow(digest=form_hash, data=form)) + s.flush() + inst = Instance(owner=owner, agent=a.id, identity_version=1, target=target.id, form=form_hash) + s.add(inst) + for ident, room, category, text, available in [ + ("req_lamp", "R-12", "maintenance", "The desk lamp does not work.", True), + ("req_towels", "R-14", "housekeeping", "Please replace the towels.", True), + ("req_closed", "R-16", "maintenance", "Service is currently unavailable.", False), + ]: + if not s.get(FixtureRequest, (ident, owner)): + s.add( + FixtureRequest( + id=ident, + owner=owner, + room=room, + category=category, + text=text, + available=available, + ) + ) + s.flush() + return { + "agent_id": a.id, + "instance_id": inst.id, + "target_id": target.id, + "form_digest": form_hash, + "provider": inst.provider, + "profile": "DETERMINISTIC DEMO", + "requests": ["req_lamp", "req_towels", "req_closed"], + } + + def start(self, owner, instance_id, request_id, creation_key): + with self.sessions.begin() as s: + instance = owned(s, Instance, instance_id, owner, lock=True) + prior = s.scalar(select(Run).where(Run.owner == owner, Run.creation_key == creation_key)) + if prior: + if prior.instance != instance_id or prior.request_id != request_id: + raise Failure("IDEMPOTENCY_CONFLICT") + return prior.id + run = Run( + owner=owner, + instance=instance.id, + request_id=request_id, + creation_key=creation_key, + expires=now() + timedelta(minutes=15), + checkpoint={"node": "observe"}, + ) + s.add(run) + s.flush() + event(s, run, "run.created", {"form_digest": instance.form, "provider": instance.provider}) + return run.id + + def step(self, owner, run_id): + with self.sessions() as s: + run = owned(s, Run, run_id, owner) + status, node = run.status, run.checkpoint.get("node") + if status != "READY": + raise Failure("RUN_NOT_READY") + if node == "execute": + self.broker.prepare(owner, run_id) + return self.broker.dispatch(owner, run_id) + if node != "observe": + raise Failure("GRAPH_NODE_UNSUPPORTED") + observation, fence = self.broker.observe(owner, run_id) + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + if run.status != "RUNNING" or run.fence != fence: + raise Failure("STALE_WORKER") + if ( + not observation["available"] + or observation["status"] != "open" + or observation["category"] not in ("maintenance", "housekeeping") + ): + run.status = "FAILED" + event(s, run, "run.failed", {"code": "SERVICE_UNAVAILABLE"}) + return + if observation["tickets"]: + run.status = "FAILED" + event(s, run, "run.failed", {"code": "EXISTING_TICKET_REQUIRES_REVIEW"}) + return + instance = owned(s, Instance, run.instance, owner) + obs_id = uid() + obs = Observation( + observation_id=obs_id, + target_id=instance.target, + observed_at=now().isoformat(), + version=observation["version"], + status="observed", + payload=observation, + ) + s.add(ObservationRow(id=obs_id, owner=owner, run=run.id, data=obs.model_dump())) + s.flush() + event(s, run, "observation.recorded", {"observation_id": obs_id, "version": obs.version}) + candidate = Candidate( + candidate_id=uid(), + candidate_set_id=uid(), + run_id=run.id, + target_id=instance.target, + form_digest=instance.form, + arguments=TicketArguments( + request_id=run.request_id, + room_id=observation["room_id"], + category=observation["category"], + ), + precondition_version=obs.version, + evidence_ids=[obs_id], + expires_at=(now() + timedelta(minutes=5)).isoformat(), + ) + event( + s, + run, + "candidates.built", + {"candidate_id": candidate.candidate_id, "origin": candidate.origin}, + ) + try: + decision = validate_decision(self.provider.evaluate([candidate]), [candidate]) + except (ProviderError, ValueError): + run.status = "FAILED" + event(s, run, "provider.invalid", {"code": "PROVIDER_INVALID_RESULT"}) + return + event(s, run, "decision.recorded", decision.model_dump()) + row = CandidateRow( + id=candidate.candidate_id, + owner=owner, + run=run.id, + digest=digest(candidate.model_dump()), + data=candidate.model_dump(), + ) + s.add(row) + s.flush() + approval = Approval( + owner=owner, + candidate=row.id, + binding=row.digest, + expires=datetime.fromisoformat(candidate.expires_at), + ) + s.add(approval) + s.flush() + run.status = "WAITING_APPROVAL" + run.checkpoint = {"node": "request_approval", "candidate_id": row.id} + event( + s, + run, + "approval.requested", + { + "approval_id": approval.id, + "operation": candidate.operation, + "arguments": candidate.arguments.model_dump(), + "binding": row.digest, + }, + ) + + def decide_approval(self, owner, approval_id, approved): + with self.sessions.begin() as s: + approval = owned(s, Approval, approval_id, owner) + candidate = owned(s, CandidateRow, approval.candidate, owner) + run = owned(s, Run, candidate.run, owner, lock=True) + if run.status != "WAITING_APPROVAL" or approval.decision != "pending": + raise Failure("APPROVAL_NOT_PENDING") + if now() >= approval.expires or now() >= run.expires: + approval.decision = "expired" + run.status = "FAILED" + event(s, run, "approval.expired", {}) + return + if digest(candidate.data) != approval.binding: + raise Failure("APPROVAL_BINDING_MISMATCH") + approval.decision = "approved" if approved else "denied" + run.status = "READY" if approved else "CANCELLED" + run.checkpoint = {**run.checkpoint, "node": "execute"} + event( + s, + run, + "approval." + approval.decision, + {"approval_id": approval.id, "binding": approval.binding}, + ) + + def pause(self, owner, run_id, cancel=False): + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + if run.status in {"SUCCEEDED", "FAILED", "CANCELLED"}: + raise Failure("RUN_TERMINAL") + intent = s.scalar(select(Intent).where(Intent.run == run.id)) + prior = run.status + run.fence += 1 + if intent and intent.status in {"DISPATCHING", "OUTCOME_UNKNOWN"}: + run.status = "RECONCILIATION_REQUIRED" + else: + run.status = "CANCELLED" if cancel else "PAUSED" + run.checkpoint = { + **run.checkpoint, + "prior_status": prior, + "stop_requested": True, + "cancel_requested": cancel, + } + event( + s, + run, + "run.cancel_requested" if cancel else "run.paused", + {"in_flight": run.status == "RECONCILIATION_REQUIRED"}, + ) + + def resume(self, owner, run_id): + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + if run.status != "PAUSED": + raise Failure("RUN_NOT_PAUSED") + if now() >= run.expires: + raise Failure("BUDGET_EXHAUSTED") + if run.checkpoint.get("node") == "stop": + run.status = "SUCCEEDED" if run.checkpoint.get("verified") else "FAILED" + event(s, run, "run.completed_after_pause", {}) + return + run.status = ( + "WAITING_APPROVAL" if run.checkpoint.get("prior_status") == "WAITING_APPROVAL" else "READY" + ) + run.checkpoint = {**run.checkpoint, "stop_requested": False, "cancel_requested": False} + intent = s.scalar(select(Intent).where(Intent.run == run.id)) + if intent and intent.status == "PREPARED": + intent.fence = run.fence + event(s, run, "run.resumed", {}) + + def report(self, owner, run_id): + with self.sessions() as s: + run = owned(s, Run, run_id, owner) + instance = owned(s, Instance, run.instance, owner) + agent = owned(s, Agent, instance.agent, owner) + candidate = s.scalar(select(CandidateRow).where(CandidateRow.run == run_id)) + approval = ( + s.scalar(select(Approval).where(Approval.candidate == candidate.id)) if candidate else None + ) + intent = s.scalar(select(Intent).where(Intent.run == run_id)) + receipt = s.scalar(select(Receipt).where(Receipt.intent == intent.id)) if intent else None + return { + "run_id": run.id, + "status": run.status, + "agent": agent.identity, + "instance_id": instance.id, + "target_id": instance.target, + "form_digest": instance.form, + "provider": instance.provider, + "profile": "DETERMINISTIC DEMO", + "checkpoint": run.checkpoint, + "calls": run.calls, + "max_calls": run.max_calls, + "approval": { + "id": approval.id, + "decision": approval.decision, + "binding": approval.binding, + "candidate": candidate.data, + } + if approval + else None, + "receipt": {"ticket_id": receipt.target_ticket, "verified": receipt.verified, **receipt.data} + if receipt + else None, + "model_calls": 0, + "live_providers": "unconfigured", + } + + def events(self, owner, run_id, after=0): + with self.sessions() as s: + owned(s, Run, run_id, owner) + rows = s.scalars( + select(EventRow) + .where(EventRow.run == run_id, EventRow.owner == owner, EventRow.sequence > after) + .order_by(EventRow.sequence) + .limit(1000) + ).all() + return [ + { + "event_id": e.id, + "run_id": e.run, + "sequence": e.sequence, + "type": e.type, + "timestamp": e.at.isoformat(), + "component": "chameleon-m1", + "correlation_id": e.run, + "schema_version": 1, + "payload": e.data, + } + for e in rows + ] + + +class Broker: + """Only target-call authority. Durable dispatch claim precedes each write.""" + + def __init__(self, sessions, adapter): + self.sessions, self.adapter = sessions, adapter + + def observe(self, owner, run_id): + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + if run.status != "READY": + raise Failure("RUN_NOT_READY") + authorize(s, run, "hotel.observe") + run.calls += 1 + run.fence += 1 + run.status = "RUNNING" + fence, request = run.fence, run.request_id + event(s, run, "observation.dispatched", {"request_id": request}) + try: + value = self.adapter.observe(owner, request) + except Exception: # noqa: BLE001 -- adapter faults must terminate the read claim without leaking details + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + if run.fence == fence: + run.status = "FAILED" + event(s, run, "observation.failed", {"code": "TARGET_UNAVAILABLE"}) + raise Failure("TARGET_UNAVAILABLE") + return value, fence + + def prepare(self, owner, run_id): + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + prior = s.scalar(select(Intent).where(Intent.run == run.id)) + if prior: + return prior.id + if run.status != "READY": + raise Failure("RUN_NOT_READY") + row = s.scalar(select(CandidateRow).where(CandidateRow.run == run.id)) + if row is None: + raise Failure("CANDIDATE_MISSING") + instance, grant = authorize(s, run, "hotel.create_ticket") + candidate = self.check_candidate(s, run, instance, row) + run.fence += 1 + intent = Intent( + owner=owner, + run=run.id, + candidate=row.id, + fence=run.fence, + grant_version=grant.version, + idempotency_key=digest( + {"owner": owner, "target": instance.target, "request": candidate.arguments.request_id} + ), + ) + s.add(intent) + s.flush() + s.add(Outbox(intent=intent.id)) + event(s, run, "intent.prepared", {"intent_id": intent.id, "approval_digest": row.digest}) + return intent.id + + @staticmethod + def check_candidate(s, run, instance, row): + candidate = Candidate.model_validate(row.data) + approval = s.scalar(select(Approval).where(Approval.candidate == row.id)) + binding = digest(candidate.model_dump()) + if ( + not approval + or approval.decision != "approved" + or approval.binding != binding + or row.digest != binding + ): + raise Failure("APPROVAL_BINDING_MISMATCH", 403) + if now() >= approval.expires or now() >= datetime.fromisoformat(candidate.expires_at): + raise Failure("APPROVAL_EXPIRED") + if ( + candidate.run_id != run.id + or candidate.target_id != instance.target + or candidate.form_digest != instance.form + ): + raise Failure("APPROVAL_BINDING_MISMATCH", 403) + return candidate + + def dispatch(self, owner, run_id): + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + intent = s.scalar(select(Intent).where(Intent.run == run.id).with_for_update()) + if not intent: + raise Failure("INTENT_MISSING") + if intent.status == "VERIFIED": + return + if intent.status != "PREPARED": + raise Failure("RECONCILIATION_REQUIRED") + if run.status != "READY" or run.fence != intent.fence or run.checkpoint.get("stop_requested"): + raise Failure("STALE_WORKER") + instance, grant = authorize(s, run, "hotel.create_ticket") + row = owned(s, CandidateRow, intent.candidate, owner) + candidate = self.check_candidate(s, run, instance, row) + intent.grant_version = grant.version + intent.status = "DISPATCHING" + run.status = "RUNNING" + run.calls += 1 + job = s.scalar(select(Outbox).where(Outbox.intent == intent.id)) + job.status = "claimed" + key = intent.idempotency_key + event( + s, + run, + "action.dispatched", + {"intent_id": intent.id, "operation": candidate.operation, "grant_version": grant.version}, + ) + # No transaction spans external I/O. The committed dispatch is now in-flight. + try: + self.adapter.create(owner, candidate, key) + except Exception as exc: # noqa: BLE001 -- any unclassified write fault has an uncertain outcome + code = getattr(exc, "code", "OUTCOME_UNKNOWN") + definitive = code in { + "STALE_STATE", + "SERVICE_UNAVAILABLE", + "DUPLICATE_REQUEST", + "IDEMPOTENCY_CONFLICT", + "REQUEST_NOT_FOUND", + } + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + intent = s.scalar(select(Intent).where(Intent.run == run.id)) + intent.status = "REJECTED" if definitive else "OUTCOME_UNKNOWN" + run.status = "FAILED" if definitive else "RECONCILIATION_REQUIRED" + event(s, run, "action.rejected" if definitive else "action.outcome_unknown", {"code": code}) + return + self.reconcile(owner, run_id) + + def reconcile(self, owner, run_id): + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + intent = s.scalar(select(Intent).where(Intent.run == run.id)) + if not intent or intent.status not in {"DISPATCHING", "OUTCOME_UNKNOWN", "VERIFIED"}: + raise Failure("NOT_RECONCILABLE") + if intent.status == "VERIFIED": + return + try: + authorize(s, run, "hotel.read_ticket", reconciliation=True) + except Failure as exc: + run.status = "RECONCILIATION_REQUIRED" + event(s, run, "verification.blocked", {"code": exc.code}) + return + run.checkpoint = { + **run.checkpoint, + "reconciliation_reads": run.checkpoint.get("reconciliation_reads", 0) + 1, + } + candidate = Candidate.model_validate(owned(s, CandidateRow, intent.candidate, owner).data) + key = intent.idempotency_key + event(s, run, "verification.dispatched", {"operation": "hotel.read_ticket"}) + try: + ticket = self.adapter.read(owner, key) + except Exception: # noqa: BLE001 -- do not retry writes when verification fails + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + run.status = "RECONCILIATION_REQUIRED" + event(s, run, "verification.pending", {"code": "OUTCOME_UNKNOWN"}) + return + args = candidate.arguments + valid = all( + ticket.get(k) == v + for k, v in { + "request_id": args.request_id, + "room_id": args.room_id, + "category": args.category, + "idempotency_key": key, + "status": "open", + }.items() + ) + with self.sessions.begin() as s: + run = owned(s, Run, run_id, owner, lock=True) + intent = s.scalar(select(Intent).where(Intent.run == run.id)) + if intent.status in {"VERIFIED", "REJECTED"}: + return + receipt = Receipt( + intent=intent.id, + owner=owner, + target_ticket=ticket["ticket_id"], + verified=valid, + data={"verification_source": "separate_fixture_read", "ticket": ticket}, + ) + s.add(receipt) + intent.status = "VERIFIED" if valid else "REJECTED" + job = s.scalar(select(Outbox).where(Outbox.intent == intent.id)) + job.status = "done" + run.status = ( + ("CANCELLED" if run.checkpoint.get("cancel_requested") else "PAUSED") + if run.checkpoint.get("stop_requested") + else ("SUCCEEDED" if valid else "FAILED") + ) + run.checkpoint = {**run.checkpoint, "node": "stop", "verified": valid} + event( + s, + run, + "effect.verified" if valid else "verification.failed", + {"ticket_id": ticket["ticket_id"], "verified": valid}, + ) diff --git a/orbiters/chameleon/packages/core/chameleon_core/surface_graph.py b/orbiters/chameleon/packages/core/chameleon_core/surface_graph.py new file mode 100644 index 0000000000000000000000000000000000000000..6bc2e68dacf936b2bb9bde1306d69f9f60a064c5 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/surface_graph.py @@ -0,0 +1,323 @@ +"""MetaFold evidence wall: deterministic, owner-scoped projection of durable captures. + +Reading the wall performs no I/O against a target and executes no captured code. +Discovery, captured bytes and verified behavior remain distinct kinds of evidence. +""" + +import hashlib +from html.parser import HTMLParser +from pathlib import PurePosixPath +from typing import Any +from urllib.parse import urljoin, urlsplit + +from sqlalchemy import select + +from .adaptation_contracts import Evidence +from .contracts import canonical, digest +from .db import AdaptationJob, BehaviorRecord, LocalTwin, VerificationJob, WebsiteCapture +from .repository_artifact import REPOSITORY_KIND, checked_files, manifest_matches +from .service import Failure, owned +from .website import WEBSITE_KIND + + +class Elements(HTMLParser): + """Declarations only. A control's presence does not establish its behavior.""" + + def __init__(self): + super().__init__(convert_charrefs=True) + self.elements = [] + self.references = [] + self.truncated = False + + def handle_starttag(self, tag, attrs): + attrs = dict(attrs) + if tag in {'a', 'button', 'input', 'select', 'textarea', 'form', 'details', 'canvas'}: + if len(self.elements) < 256: + self.elements.append({'tag': tag, 'id': attrs.get('id', '')[:120], + 'type': attrs.get('type', '')[:80], + 'name': attrs.get('name', '')[:120]}) + else: + self.truncated = True + for attr in ('href', 'src', 'action'): + if attrs.get(attr) and len(self.references) < 400: + self.references.append({'tag': tag, 'attribute': attr, 'value': attrs[attr][:2048]}) + + +class Wall: + def __init__(self, twin): + self.twin = twin + self.nodes = {} + self.edges = {} + self.gaps = [] + self.actions = [] + + def node(self, kind, identity, **data): + ident = digest({'kind': kind, 'identity': identity}) + self.nodes.setdefault(ident, {'id': ident, 'kind': kind, 'identity': identity, **data}) + if len(self.nodes) > 8192: + raise Failure('SURFACE_NODE_BUDGET', 413) + return ident + + def edge(self, source, relation, target): + value = {'source': source, 'relation': relation, 'target': target} + self.edges[digest(value)] = value + if len(self.edges) > 16384: + raise Failure('SURFACE_EDGE_BUDGET', 413) + + def document(self, parent, raw, evidence_hash): + parsed = Elements() + parsed.feed(raw) + for index, element in enumerate(parsed.elements): + component = self.node('control', [parent, index], declaration=element, + evidence_digest=evidence_hash, behavior='UNOBSERVED') + self.edge(parent, 'declares', component) + if parsed.elements: + self.gaps.append({'surface': parent, 'kind': 'CONTROL_TRANSITIONS_UNOBSERVED', + 'count': len(parsed.elements)}) + if parsed.truncated: + self.gaps.append({'surface': parent, 'kind': 'CONTROL_DISCOVERY_LIMIT'}) + return parsed.references + + def finish(self): + report = {'version': 'metafold-surface-wall-v1', 'twin_id': self.twin.id, + 'revision': self.twin.revision, 'source_digest': self.twin.source_digest, + 'nodes': sorted(self.nodes.values(), key=lambda n: n['id']), + 'edges': sorted(self.edges.values(), key=lambda e: (e['source'], e['relation'], e['target'])), + 'gaps': self.gaps, 'actions': self.actions, + 'source_writes': False, 'external_reads': 0, + 'scope': 'Captured declarations and recorded checks; no claim of complete target equivalence'} + report['reconstruction_plan'] = reconstruction_plan(report) + if len(canonical(report).encode()) > 3 * 1024 * 1024: + raise Failure('SURFACE_REPORT_BYTE_BUDGET', 413) + return {**report, 'surface_digest': digest(report)} + + +def reconstruction_plan(report): + """Evidence-directed next work; only capture actions are executable here.""" + checks = [n for n in report['nodes'] if n['kind'] == 'behavior_check' and n.get('current_source')] + conflicts = [g for g in report['gaps'] if g['kind'] == 'CONFLICTING_CHECK_RESULTS'] + failures = [n for n in checks if n['status'] == 'FAIL'] + steps = [] + if conflicts: + steps.append({'kind': 'REPRODUCE_CONFLICT', 'executable': False, + 'evidence': [check for gap in conflicts for check in gap['checks']], + 'reason': 'The same candidate and contract have conflicting recorded outcomes.'}) + elif failures: + steps.append({'kind': 'DIAGNOSE_FAILED_CHECK', 'executable': False, + 'evidence': [n['id'] for n in failures], + 'reason': 'Inspect failed receipts before selecting a repair; no general repair is registered.'}) + if report['actions']: + steps.append({'kind': 'CAPTURE_OBSERVED_PAGE', 'executable': True, + 'action': report['actions'][0], + 'reason': 'Acquire the highest-ranked eligible observed route through the capture queue.'}) + if not checks: + steps.append({'kind': 'DEFINE_BEHAVIOR_CONTRACT', 'executable': False, + 'reason': 'Specify observable expected outcomes before judging functional equivalence.'}) + elif not failures and not conflicts: + steps.append({'kind': 'EXPAND_INDEPENDENT_CHECKS', 'executable': False, + 'evidence': [n['id'] for n in checks], + 'reason': 'Recorded checks pass; test uncovered behavior on the current candidate.'}) + return {'version': 'metafold-reconstruction-plan-v1', 'steps': steps, + 'completion': 'NOT_ESTABLISHED', + 'execution': 'Only executable capture steps may use the existing evidence-bound capture endpoint.'} + + +def website_wall(s, owner, twin, wall): + pages = twin.data['pages'] + captured = {p['source'] for p in pages} + attempts = s.scalars(select(WebsiteCapture).where( + WebsiteCapture.twin == twin.id, WebsiteCapture.owner == owner + ).order_by(WebsiteCapture.created, WebsiteCapture.id)).all() + latest = {a.source: a for a in attempts} + pending = any(a.status == 'PENDING' for a in attempts) + frontier: dict[str, dict[str, Any]] = {} + for page in pages: + if digest({k: v for k, v in page.items() if k != 'projection_digest'}) != page['projection_digest']: + raise Failure('SURFACE_PAGE_PROJECTION_MISMATCH') + p = wall.node('page', page['source'], status='CAPTURED', + evidence_digest=page['source_digest'], document_digest=page['raw_document_sha256'], + projection_digest=page['projection_digest'], behavior='UNVERIFIED') + wall.gaps.append({'surface': p, 'kind': 'PAGE_BEHAVIOR_UNVERIFIED', 'omitted': page['omitted'], + 'capture_truncated': page['truncated']}) + visual = page.get('visual') + if visual: + if hashlib.sha256(visual['html'].encode()).hexdigest() != visual['document_sha256']: + raise Failure('SURFACE_VISUAL_DIGEST_MISMATCH') + wall.document(p, visual['html'], visual['document_sha256']) + for asset in visual['assets']: + a = wall.node('asset', asset['sha256'], status='CAPTURED', evidence_digest=asset['sha256']) + wall.edge(p, 'uses', a) + for asset in visual['missing_assets']: + wall.gaps.append({'surface': p, 'kind': 'ASSET_UNAVAILABLE', **asset}) + for link in page['links']: + prior = latest.get(link['url']) + state = 'CAPTURED' if link['url'] in captured else prior.status if prior else 'DISCOVERED' + target = wall.node('page', link['url'], status=state, + evidence_digest=None, behavior='UNVERIFIED') + wall.edge(p, 'observed_link', target) + if link['url'] not in captured: + item = frontier.setdefault(link['url'], {'parents': set(), 'same_origin': link['same_origin']}) + item['parents'].add(p) + if not link['same_origin']: + wall.gaps.append({'surface': target, 'kind': 'OUTSIDE_CAPTURE_SCOPE'}) + # Upgrade discovered nodes with exact evidence regardless of page iteration order. + for page in pages: + ident = digest({'kind': 'page', 'identity': page['source']}) + wall.nodes[ident].update(status='CAPTURED', evidence_digest=page['source_digest'], + document_digest=page['raw_document_sha256'], projection_digest=page['projection_digest']) + for attempt in attempts: + a = wall.node('capture_attempt', attempt.id, status=attempt.status, residual=attempt.residual, + source=attempt.source, job_id=attempt.job) + p = wall.node('page', attempt.source, status=attempt.status, behavior='UNVERIFIED', evidence_digest=None) + wall.edge(a, 'observes', p) + remaining = max(0, min(10, twin.manifest['page_budget']) - len(pages)) + for url, item in sorted(frontier.items(), key=lambda pair: (-len(pair[1]['parents']), pair[0])): + if item['same_origin'] and url not in latest and remaining and not pending: + wall.actions.append({'kind': 'capture_page', 'source': url, + 'expected_revision': twin.revision, 'observed_on_count': len(item['parents']), + 'reason': 'Inspect an observed same-origin route; shared incoming links rank first'}) + wall.gaps.append({'kind': 'CAPTURE_BUDGET', 'remaining_pages': remaining, 'pending': pending}) + + +def repository_wall(s, owner, twin, wall): + job = owned(s, AdaptationJob, twin.job, owner) + evidence = Evidence.model_validate(job.evidence) + if (job.status != 'VERIFIED' or twin.source_digest != evidence.content_digest + or not manifest_matches(twin.manifest, evidence) + or twin.data != {'source_job': job.id, 'package_digest': evidence.content_digest}): + raise Failure('SURFACE_REPOSITORY_BINDING_MISMATCH') + files = checked_files(evidence) + root = wall.node('repository', evidence.source, commit=evidence.payload['commit_sha'], + evidence_digest=evidence.content_digest, behavior='UNVERIFIED') + file_ids = {} + for path, body in sorted(files.items()): + f = wall.node('file', path, evidence_digest=hashlib.sha256(body).hexdigest(), status='CAPTURED') + file_ids[path] = f + wall.edge(root, 'contains', f) + for path, body in sorted(files.items()): + if PurePosixPath(path).suffix.lower() not in {'.html', '.htm'}: + continue + refs = wall.document(file_ids[path], body.decode('utf-8', errors='replace'), hashlib.sha256(body).hexdigest()) + for ref in refs: + resolved = urlsplit(urljoin('https://package.invalid/' + path, ref['value'])) + local = resolved.scheme == 'https' and resolved.netloc == 'package.invalid' + target = resolved.path.lstrip('/') if local else ref['value'] + if local and target in file_ids: + wall.edge(file_ids[path], 'declares_' + ref['attribute'], file_ids[target]) + else: + r = wall.node('reference', [path, ref['attribute'], target], status='UNINSPECTED', declaration=ref) + wall.edge(file_ids[path], 'declares_reference', r) + wall.gaps.append({'surface': r, 'kind': 'DEPENDENCY_OR_ROUTE_UNINSPECTED'}) + wall.gaps.append({'surface': root, 'kind': 'RUNTIME_AND_HIDDEN_BEHAVIOR_NOT_INFERRED_FROM_SOURCE'}) + + +def runtime_wall(wall, check, candidate, receipt, current): + """Connect recorded runtime observations without guessing source correspondence.""" + surface = receipt['behavior'].get('interaction_surface') + if not surface or surface.get('version') != 'interaction-surface-v1': + return + controls = surface.get('controls', []) + if len(controls) > 100: + raise Failure('SURFACE_RUNTIME_CONTROL_BUDGET', 413) + snapshot = wall.node('runtime_snapshot', check, evidence_digest=digest(surface), + viewport=surface.get('viewport'), current_source=current, + status='OBSERVED' if current else 'STALE') + wall.edge(check, 'observed', snapshot) + wall.edge(snapshot, 'renders', candidate) + if surface.get('frame'): + frame = wall.node('runtime_frame', [check, surface['frame']['sha256']], + evidence_digest=surface['frame']['sha256'], + format=surface['frame']['format'], bytes=surface['frame']['bytes']) + wall.edge(snapshot, 'records_frame', frame) + for index, control in enumerate(controls): + observed = wall.node('runtime_control', [check, index], + control_kind=control.get('kind'), label=control.get('label'), + disabled=control.get('disabled'), bounds=control.get('bounds'), + in_viewport=control.get('in_viewport'), + status='OBSERVED' if current else 'STALE') + wall.edge(snapshot, 'contains_observed_control', observed) + # Match only identical recorded selectors within this same execution. + for step_index, step in enumerate(receipt['behavior'].get('behavior_contract', {}).get('steps', [])): + if control.get('selector') and step.get('selector') == control['selector']: + step_node = wall.node('runtime_contract_step', [check, step_index], + operation=step['op'], scope='Recorded contract; final snapshot only') + wall.edge(check, 'executed_contract_step', step_node) + wall.edge(step_node, 'shares_recorded_selector', observed) + wall.gaps.append({'surface': snapshot, 'kind': 'RUNTIME_TO_SOURCE_CORRESPONDENCE_UNRESOLVED'}) + if surface.get('truncated'): + wall.gaps.append({'surface': snapshot, 'kind': 'RUNTIME_CONTROL_DISCOVERY_LIMIT'}) + + +def behavior_wall(s, owner, twin, wall): + rows = s.scalars(select(BehaviorRecord).where(BehaviorRecord.owner == owner, BehaviorRecord.twin == twin.id) + .order_by(BehaviorRecord.created, BehaviorRecord.id).limit(101)).all() + if len(rows) > 100: + raise Failure('SURFACE_BEHAVIOR_RECORD_BUDGET', 413) + claims: dict[tuple[str, str | None, str], list[str]] = {} + for row in rows: + if digest(row.receipt) != row.receipt_digest: + raise Failure('SURFACE_RECEIPT_DIGEST_MISMATCH') + r = row.receipt + current = row.source_digest == twin.source_digest + check = wall.node('behavior_check', row.id, evidence_digest=row.receipt_digest, + contract_digest=r['contract_digest'], overlay_digest=r['overlay_digest'], + status=r['behavior']['status'] if current else 'STALE', current_source=current) + candidate = wall.node('candidate', [row.source_digest, r['overlay_digest']], + source_digest=row.source_digest, overlay_digest=r['overlay_digest']) + wall.edge(check, 'evaluates', candidate) + sources = [n['id'] for n in wall.nodes.values() + if n['kind'] in {'repository', 'page'} and n.get('evidence_digest') == row.source_digest] + for source in sources: + wall.edge(candidate, 'derived_from', source) + contract = wall.node('behavior_contract', r['contract_digest'], scope='Supplied checks only') + wall.edge(check, 'checks_contract', contract) + runtime_wall(wall, check, candidate, r, current) + claims.setdefault((row.source_digest, r['overlay_digest'], r['contract_digest']), []).append(check) + for group, checks in claims.items(): + if {wall.nodes[c]['status'] for c in checks} == {'PASS', 'FAIL'}: + wall.gaps.append({'kind': 'CONFLICTING_CHECK_RESULTS', 'candidate': list(group), 'checks': checks}) + jobs = s.scalars(select(VerificationJob).where(VerificationJob.owner == owner, VerificationJob.twin == twin.id) + .order_by(VerificationJob.created, VerificationJob.id).limit(20)).all() + for job in jobs: + from .browser_contract import validate_contract + + contract_digest = validate_contract(job.contract)[1] if job.contract else None + task = wall.node('verification_job', job.id, status=job.status, profile=job.profile, + contract_digest=contract_digest, result=job.result) + if job.contract: + contract = wall.node('behavior_contract', contract_digest, scope='Supplied checks only') + wall.edge(task, 'runs_contract', contract) + for index, step in enumerate(job.contract['steps']): + operation = wall.node('behavior_step', [contract_digest, index], + operation=step['op'], selector=step.get('selector'), + expected=step.get('equals'), status='DECLARED_CHECK') + wall.edge(contract, 'contains_step', operation) + # Exact simple ID binding only; complex selectors require a runtime observation. + selector = step.get('selector', '') + if selector.startswith('#') and selector[1:].replace('-', '').replace('_', '').isalnum(): + for node in list(wall.nodes.values()): + if node['kind'] == 'control' and node['declaration']['id'] == selector[1:]: + wall.edge(operation, 'statically_targets', node['id']) + + +class SurfaceGraphs: + def __init__(self, sessions): + self.sessions = sessions + + @staticmethod + def build_in(s, owner, twin): + wall = Wall(twin) + kind = twin.manifest['kind'] + if kind == WEBSITE_KIND: + website_wall(s, owner, twin, wall) + elif kind == REPOSITORY_KIND: + repository_wall(s, owner, twin, wall) + else: + raise Failure('SURFACE_FAMILY_NOT_SUPPORTED') + behavior_wall(s, owner, twin, wall) + return wall.finish() + + def read(self, owner, twin_id): + with self.sessions.begin() as s: + twin = owned(s, LocalTwin, twin_id, owner, lock=True) + return self.build_in(s, owner, twin) diff --git a/orbiters/chameleon/packages/core/chameleon_core/trafficcop/__init__.py b/orbiters/chameleon/packages/core/chameleon_core/trafficcop/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2f68c08a9613351ac4f93c9321a9059f556ef09e --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/trafficcop/__init__.py @@ -0,0 +1,2 @@ +"""oracle7-trafficcop, vendored: Oracle7-style decision model (no neural weights) used by Chameleon in SHADOW mode.""" +from .model import decide, MODEL, VERSION # noqa: F401 diff --git a/orbiters/chameleon/packages/core/chameleon_core/trafficcop/chameleon_capture.py b/orbiters/chameleon/packages/core/chameleon_core/trafficcop/chameleon_capture.py new file mode 100644 index 0000000000000000000000000000000000000000..bbce2e6c488cebdef5889d759a00bb960d0dc290 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/trafficcop/chameleon_capture.py @@ -0,0 +1,194 @@ +# VENDORED from Desktop/ClaudeCode/oracle7-trafficcop/trafficcop/chameleon_capture.py (oracle7-trafficcop, 2026-09-23). Edit upstream, then re-vendor. +"""trafficcop operator card for Chameleon captures: triage + repair routing from the capture RECEIPTS alone. + +Chameleon's capture/repair handoff (docs/CHAMELEON_CAPTURE_REPAIR_HANDOFF_2026_09_23.md) names a finite set of recurring +failure mechanisms, each with a written repair. That is trafficcop's shape: operators with checkable preconditions, +evidence that says which one applies, and an honest "not established" when nothing does. Every decision carries a receipt +naming the facts that licensed it. + +trafficcop NEVER approves a capture: approval needs human comparison notes (clone_catalogue.approval_evidence). The best it +says is `candidate_for_approval`, i.e. no mechanism fires and source/clone images agree - a queue ordering, not a verdict. +Stdlib only; the image comparison uses Pillow when present and is reported as unavailable otherwise. +""" +from __future__ import annotations + +import json +import os +import re +from urllib.parse import urlsplit + +MODEL = "oracle7-trafficcop/chameleon-capture-v0" +VISUAL_EXT = re.compile(r"\.(png|jpe?g|gif|webp|svg|avif|ico|bmp|woff2?|ttf|otf|eot|css)(?:[?#].*)?$", re.I) +NON_VISUAL_REASONS = {"SCRIPT_BYTE_BUDGET", "SCRIPT_OMITTED", "SCRIPT_NOT_EXECUTED"} +EVIDENCE_FILES = ("source.png", "review.png", "source-full.png", "review-full.png", "capture.json", "observation.json") + +try: + from PIL import Image, ImageChops, ImageStat +except Exception: # noqa: BLE001 + Image = None + + +def _load(path, default=None): + try: + with open(path, encoding="utf8") as f: + return json.load(f) + except Exception: # noqa: BLE001 + return default + + +def _site(url): + h = (urlsplit(url or "").hostname or "").lower() + return h[4:] if h.startswith("www.") else h + + +def _image_facts(d): + """blankness of each image and the source/clone difference, on a small grey thumbnail (cheap, deterministic)""" + if Image is None: + return {"available": False} + out = {"available": True} + thumbs = {} + for name in ("source.png", "review.png"): + p = os.path.join(d, name) + if not os.path.isfile(p): + continue + try: + im = Image.open(p).convert("L").resize((96, 60)) + except Exception: # noqa: BLE001 + continue + thumbs[name] = im + st = ImageStat.Stat(im) + hist = im.histogram() + top = max(hist) / float(sum(hist) or 1) + out[name] = {"stddev": round(st.stddev[0], 1), "dominant_share": round(top, 3), + "blank": st.stddev[0] < 6.0 or top > 0.95} + if "source.png" in thumbs and "review.png" in thumbs: + diff = ImageChops.difference(thumbs["source.png"], thumbs["review.png"]) + out["mean_abs_diff"] = round(ImageStat.Stat(diff).mean[0], 2) + # FULL-PAGE comparison: reviewers judge whole pages; losses below the fold (absent portrait, stacked layout, + # faded cards) never show in the first viewport. Height change = layout collapse or expansion. + try: + sf, rf = os.path.join(d, "source-full.png"), os.path.join(d, "review-full.png") + if os.path.isfile(sf) and os.path.isfile(rf): + a, b = Image.open(sf), Image.open(rf) + if a.size[0] * a.size[1] > 40_000_000 or b.size[0] * b.size[1] > 40_000_000: + out["full_compare"] = "skipped: page larger than 40 MP" + raise StopIteration + a, b = a.convert("L"), b.convert("L") + out["full_height_ratio"] = round(b.size[1] / float(a.size[1] or 1), 3) + w = 64 + ha, hb = max(1, int(a.size[1] * w / a.size[0])), max(1, int(b.size[1] * w / b.size[0])) + h = min(ha, hb, 2000) + ta = a.resize((w, ha)).crop((0, 0, w, h)) + tb = b.resize((w, hb)).crop((0, 0, w, h)) + out["full_mean_abs_diff"] = round(ImageStat.Stat(ImageChops.difference(ta, tb)).mean[0], 2) + except Exception: # noqa: BLE001 + pass + return out + + +def read_receipts(d, failure=None): + """facts from a capture directory (and/or a recorded failure string). Missing files are facts too.""" + f = {"dir": d, "failure": failure or ""} + cap = _load(os.path.join(d, "capture.json"), {}) if d else {} + obs = _load(os.path.join(d, "observation.json"), {}) if d else {} + ras = _load(os.path.join(d, "rasterization.json"), {}) if d else {} + rdy = _load(os.path.join(d, "readiness.json"), []) if d else [] + f["evidence_missing"] = [n for n in EVIDENCE_FILES if not (d and os.path.isfile(os.path.join(d, n)))] + f["has_html"] = bool(cap.get("html")) + missing = cap.get("missing_assets") or [] + visual = [m for m in missing if isinstance(m, dict) and m.get("reason") not in NON_VISUAL_REASONS + and (VISUAL_EXT.search(str(m.get("url", ""))) or str(m.get("url", "")).startswith("embedded:"))] + f["visual_missing"] = len(visual) + f["visual_missing_offsite"] = 0 + src, fin = obs.get("source", ""), obs.get("finalUrl", "") + f["redirected_site"] = bool(src and fin and _site(src) != _site(fin)) + if f["redirected_site"]: + f["visual_missing_offsite"] = sum(1 for m in visual if _site(str(m.get("url", ""))) == _site(src)) + f["svg_omissions"] = int(ras.get("svgOmissions") or 0) if isinstance(ras, dict) else 0 + r0 = rdy[-1] if isinstance(rdy, list) and rdy else (rdy if isinstance(rdy, dict) else {}) + f["loading"] = bool(r0.get("loading")) + f["empty"] = bool(r0.get("empty")) + f["text_length"] = int(r0.get("textLength") or 0) + f["image"] = _image_facts(d) if d and os.path.isdir(d) else {"available": False} + return f + + +# ---- operators: (name, precondition(facts) -> reason or None). Order = priority: a later one is not reached when an +# earlier one blocks everything after it (unreachable / tool crash / oversize end the triage). +def _fail(pat): + return lambda f: ("recorded failure: %s" % f["failure"][:80]) if re.search(pat, f["failure"], re.I) else None + + +BLOCKING = [ + ("exclude_access_disallowed", _fail(r"ROBOTS_OR_ACCESS_DISALLOWED")), + ("retry_later_unreachable", _fail(r"getaddrinfo|WRONG_VERSION_NUMBER|SSL|timed out|ECONNREFUSED|Connection refused")), + ("exclude_oversize", _fail(r"ARCHIVE_EXCEEDS")), + ("fix_capture_tool", _fail(r"STEP_\d+_FAILED|Traceback|node:internal|parse_starttag|Command '\[")), +] + + +def _readiness(f): + img = f["image"] + why = [] + if f["loading"]: + why.append("page reported loading") + if f["empty"] or (0 < f["text_length"] < 120): + why.append("page text empty/near-empty (%d chars)" % f["text_length"]) + if img.get("review.png", {}).get("blank"): + why.append("clone screenshot blank (dominant share %.2f)" % img["review.png"]["dominant_share"]) + if img.get("source.png", {}).get("blank"): + why.append("SOURCE screenshot blank: observation not ready") + return "; ".join(why) or None + + +def _mismatch(f): + """viewport or full-page disagreement. Dev evidence 2026-09-23: approved viewport diff max 9.8 (median 0.25).""" + img = f["image"] + why = [] + if img.get("mean_abs_diff") is not None and img["mean_abs_diff"] > 10: + why.append("viewport differs (mean abs %.1f)" % img["mean_abs_diff"]) + if img.get("full_mean_abs_diff") is not None and img["full_mean_abs_diff"] > 10: + why.append("full page differs (mean abs %.1f)" % img["full_mean_abs_diff"]) + r = img.get("full_height_ratio") + if r is not None and not 0.9 <= r <= 1.1: + why.append("page height changed x%.2f (layout collapsed or expanded)" % r) + return "; ".join(why) or None + + +REPAIRS = [ + ("repair_readiness", _readiness), + ("collect_full_evidence", lambda f: ("approval evidence missing: " + ", ".join(f["evidence_missing"])) + if f["evidence_missing"] else None), + ("repair_redirect_assets", lambda f: ("site changed %s and %d visual assets were requested from the old site" + % ("on redirect", f["visual_missing_offsite"])) + if f["redirected_site"] and f["visual_missing_offsite"] else None), + # approved captures carry up to 2 missing visual assets at p75 (dev, 2026-09-23): a few misses are normal + ("repair_missing_assets", lambda f: ("%d visual assets missing" % f["visual_missing"]) if f["visual_missing"] >= 3 + else None), + ("repair_svg_isolation", lambda f: ("%d SVGs omitted in rasterization" % f["svg_omissions"]) if f["svg_omissions"] + else None), + ("review_visual_mismatch", _mismatch), +] + + +def decide(facts): + """-> {'primary', 'plan': [(operator, reason)], 'receipt'}""" + for name, pre in BLOCKING: + why = pre(facts) + if why: + return {"model": MODEL, "primary": name, "plan": [(name, why)], "receipt": _receipt(facts)} + plan = [(n, w) for n, pre in REPAIRS for w in [pre(facts)] if w] + if not plan: + img = facts["image"] + if not img.get("available") or img.get("mean_abs_diff") is None: + plan = [("needs_human_review", "no mechanism fires, but no image comparison was possible")] + else: + plan = [("candidate_for_approval", "no mechanism fires; thumbnails agree (mean abs %.1f); needs human " + "comparison notes to approve" % img["mean_abs_diff"])] + return {"model": MODEL, "primary": plan[0][0], "plan": plan, "receipt": _receipt(facts)} + + +def _receipt(f): + keep = ("failure", "evidence_missing", "visual_missing", "visual_missing_offsite", "redirected_site", + "svg_omissions", "loading", "empty", "text_length", "image") + return {k: f[k] for k in keep} diff --git a/orbiters/chameleon/packages/core/chameleon_core/trafficcop/model.py b/orbiters/chameleon/packages/core/chameleon_core/trafficcop/model.py new file mode 100644 index 0000000000000000000000000000000000000000..b7536dbf0ec4608c677405a2785b1c0217b91536 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/trafficcop/model.py @@ -0,0 +1,214 @@ +# VENDORED from Desktop/ClaudeCode/oracle7-trafficcop/trafficcop/model.py (oracle7-trafficcop, 2026-09-23). Edit upstream, then re-vendor. +"""oracle7-trafficcop: an Oracle7-style decision model. No neural weights. + +A decision is a verified binding, not a guess: + request -> facts (typed detectors over the state) -> open obligations + options -> the SAME detectors over each option label -> what each option would discharge + admissibility (preconditions) strikes options that cannot run in this state + an option is chosen only because it discharges the highest-priority open obligation + confidence comes from counted receipts (evidence table), never from a softmax + nothing binds -> abstain (or the evidence-gathering option, when one is offered) + +Input is Laya's DecisionRequest shape (dict), so callers can swap models without a new contract. +""" +import hashlib +import json +import re + +MODEL = "oracle7-trafficcop" +VERSION = "v0" + +# --- typed detectors ------------------------------------------------------------------------------------- +# Each obligation type has the words that name its SUBJECT. A discrepancy needs a subject word AND a +# failure marker in the same clause; a pass needs a subject word AND a pass marker. Detectors are applied +# identically to observations and to option labels, which is what makes binding order-independent. +SUBJECT = { + "appearance": r"appear\w*|look\w*|layout|colou?rs?|fonts?|typograph\w*|text|shade|style\w*|visual\w*|" + r"screenshot\w*|render\w*|align\w*|misalign\w*|padding|margin|spacing|width|size|pixel\w*|" + r"px|logo|theme|icon\w*|image\w*|weight|overlap\w*", + "behavior": r"behavio\w*|interact\w*|click\w*|press\w*|typ(e|ing)|submit\w*|button\w*|operation\w*|" + r"calculat\w*|produc\w*|return\w*|output\w*|result\w*|state|transition\w*|logic|reload\w*|" + r"persist\w*|edit\w*|retain\w*|loses?|sort\w*|open\w*|dropdown|menu|form|search|input\w*|" + r"navigat\w*|scroll\w*|drag\w*|\d+\s*[+\-*/x]\s*\d+", + "evidence": r"evidence|captur\w*|record\w*|observ\w*|visit\w*|screenshot|login|account|access\w*|" + r"unavailable|available|missing|never|behind", +} +FAIL = (r"differ\w*|different|mismatch\w*|wrong|error\w*|broken|break\w*|fail\w*|overlap\w*|misalign\w*|" + r"loses?|lost|instead|does nothing|nothing happens|blank|not\b|n't\b|heavier|lighter|larger|smaller|" + r"shifted|before|missing") +PASS_ = r"pass(ed|es)?|match(es|ed)?|identical|same|agree\w*|correct\w*|work\w*\s+correctly|no discrepanc\w*" +GAP = (r"only (a |the )?\w+|no \w+( \w+)? (were |was )?(observed|captured|recorded|available|visited)|" + r"never (\w+ ){0,3}(observed|captured|recorded|visited|interacted|opened|tested)|" + r"not (\w+ ){0,2}(observed|captured|recorded|visited|available|opened)|behind (a )?login|" + r"requires? (a )?(paid |logged-in )?(account|login|subscription)|could not (open|access|reach)|" + r"unobserved|unavailable|missing evidence|acquire|collect evidence|no \w+ behavio\w* is available") +NONE_ = (r"no (observed )?discrepanc\w*|no repair|nothing differs|all (\w+ ){0,3}(passed|match\w*|agree\w*)|" + r"both passed|every (\w+ ){0,3}passed|agree on all") + +PRIORITY = ["evidence", "repair", "behavior", "appearance", "none"] # observe before claiming; function before form + + +def _clauses(text): + return [c for c in re.split(r"[.;:!?]|,\s*(?:but|and|while|yet)\b|\bbut\b|\bwhile\b", text.lower()) if c.strip()] + + +def _has(pat, s): + return re.search(r"\b(?:%s)" % pat, s) is not None + + +def facts_of(text): + """Typed facts in a free-text observation or option label. Returns {type: [clause, ...]}.""" + out = {} + for c in _clauses(text): + if _has(GAP, c): + out.setdefault("evidence", []).append(c.strip()) + continue + if _has(NONE_, c): + out.setdefault("none", []).append(c.strip()) + continue + failing = _has(FAIL, c) and not re.search(r"\bnot\s+only\b", c) + for t in ("behavior", "appearance"): + if _has(SUBJECT[t], c): + if failing: + out.setdefault(t, []).append(c.strip()) + break + else: + if not failing and _has(PASS_, c): + out.setdefault("pass", []).append(c.strip()) + # an observation made only of passes, with no gap and no discrepancy, IS the no-repair fact + if "pass" in out and not any(t in out for t in ("evidence", "behavior", "appearance")): + out.setdefault("none", []).extend(out["pass"]) + out.pop("pass", None) + return out + + +def option_discharges(label): + """Which obligation an option label discharges. Uses the same detectors, but a label names a remedy, so a + subject word is enough (no failure marker needed).""" + l = label.lower() + if _has(GAP, l) or _has(r"evidence", l): + return "evidence" + if _has(NONE_, l): + return "none" + hits = [t for t in ("behavior", "appearance") if _has(SUBJECT[t], l)] + if len(hits) == 1: + return hits[0] + if len(hits) == 2: # both named: the one named FIRST is the remedy's object + first = {t: re.search(r"\b(?:%s)" % SUBJECT[t], l).start() for t in hits} + return min(first, key=first.get) + return None + + +# --- admissibility --------------------------------------------------------------------------------------- +# Operator preconditions over structured state. An option whose precondition fails is struck before scoring. +# Named operators discharge a known obligation regardless of label wording (structured MetaFold operators). +OPERATOR_DISCHARGES = {"test_reviewed_repair": "repair", "collect_evidence": "evidence"} + +PRECONDITIONS = { + "test_reviewed_repair": lambda st: st.get("eligible_repair") is not None, +} + + +def _state_text(state): + parts = [] + for k, v in state.items(): + if isinstance(v, str): + parts.append(v) + elif isinstance(v, (list, tuple)): + parts.extend(str(x) for x in v if isinstance(x, str)) + return ". ".join(parts) + + +def _structured_obligations(state): + """Structured MetaFold-style state: failed checks and eligibility are facts, no text needed.""" + obs = [] + checks = state.get("checks") + if isinstance(checks, list) and checks: + failed = [c for c in checks if isinstance(c, dict) and c.get("passed") is False] + if failed: + obs.append(("repair" if state.get("eligible_repair") is not None else "evidence", + "%d failed check(s)" % len(failed))) + elif all(isinstance(c, dict) and c.get("passed") is True for c in checks): + obs.append(("none", "all %d checks passed" % len(checks))) + return obs + + +# --- evidence table (receipts) --------------------------------------------------------------------------- +class EvidenceTable: + """Counts of real outcomes: (obligation, option_kind) -> [successes, trials]. Loaded from receipts JSONL. + Empty table => confidence says 'no receipts', it is never invented.""" + + def __init__(self, path=None): + self.t = {} + if path: + try: + for line in open(path, encoding="utf-8"): + r = json.loads(line) + k = (r["obligation"], r["option_kind"]) + s, n = self.t.get(k, (0, 0)) + self.t[k] = (s + (1 if r["outcome"] == "success" else 0), n + 1) + except FileNotFoundError: + pass + + def rate(self, obligation, kind): + s, n = self.t.get((obligation, kind), (0, 0)) + return ((s + 1) / (n + 2), n) # Laplace: with no receipts this is 0.5 and n=0 says so + + +def _digest(obj): + return hashlib.sha256(json.dumps(obj, sort_keys=True, separators=(",", ":")).encode()).hexdigest() + + +def decide(request, table=None): + """Answer every question in a DecisionRequest-shaped dict. Returns a response with a receipt per answer.""" + table = table or EvidenceTable() + state = request.get("state") or {} + text = _state_text(state) + facts = facts_of(text) + for t, why in _structured_obligations(state): + facts.setdefault(t, []).append(why) + open_obs = [t for t in PRIORITY if t in facts and t != "none"] + if not open_obs and "none" in facts: + open_obs = ["none"] + answers = {} + for qkey, q in (request.get("questions") or {}).items(): + options = q.get("options") or [] + if isinstance(options, dict): + options = list(options.items()) + struck = {k: "precondition_failed" for k, _ in options + if k in PRECONDITIONS and not PRECONDITIONS[k](state)} + live = [(k, lab) for k, lab in options if k not in struck] + binds = {k: OPERATOR_DISCHARGES.get(k) or option_discharges(lab) for k, lab in live} + chosen, served = None, None + for ob in open_obs: + cands = [k for k, _ in live if binds[k] == ob] + if cands: + chosen, served = cands[0], ob # ties impossible in practice; first keeps it deterministic + break + abstained = chosen is None + if abstained: # nothing binds: gather evidence if that remedy is offered, otherwise decline + ev = [k for k, _ in live if binds[k] == "evidence"] + chosen = ev[0] if ev else None + rate, n = table.rate(served or "unbound", binds.get(chosen) or "none") + probs = {} + if chosen is not None: + p_top = rate if n else (0.9 if not abstained else 0.6) + rest = [k for k, _ in options if k != chosen] + probs = {k: (round((1 - p_top) / len(rest), 6) if rest else 0.0) for k in rest} + probs[chosen] = round(1 - sum(probs.values()), 6) + answers[qkey] = { + "type": "choice", + "choice": chosen, + "abstained": abstained, + "probabilities": probs, + "confidence_basis": ("receipts n=%d" % n) if n else "no receipts: structural binding only", + "receipt": { + "open_obligations": open_obs, + "facts": {k: v[:3] for k, v in facts.items()}, + "served_obligation": served, + "option_binding": binds, + "struck": struck, + }, + } + return {"model": MODEL, "version": VERSION, "answers": answers, + "input_hash": _digest(request.get("state") or {})} diff --git a/orbiters/chameleon/packages/core/chameleon_core/twins.py b/orbiters/chameleon/packages/core/chameleon_core/twins.py new file mode 100644 index 0000000000000000000000000000000000000000..f3a1282bfabc47803d81e5327716d27f48e11344 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/twins.py @@ -0,0 +1,432 @@ +"""Local functional table counterparts. Never writes to a source environment.""" + +import copy +import math +from typing import Any, Literal + +from pydantic import Field, model_validator +from sqlalchemy import select + +from .adaptation_contracts import Evidence, Residual +from .contracts import StrictRecord, canonical, digest +from .db import AdaptationJob, LocalTwin, TwinMutation, WebsiteCapture, now, uid +from .form_engine import ProviderRegistry, columns, execute, tables, verify +from .repository_artifact import ( + REPOSITORY_KIND, + checked_files, + file_preview, + manifest_matches, + repository_manifest, + source_zip, +) +from .service import Failure, owned +from .website import WEBSITE_KIND, website_copy, website_manifest + + +class Mutation(StrictRecord): + table: str = Field(min_length=1, max_length=120) + action: Literal["create", "update", "delete"] + expected_revision: int = Field(ge=0, le=100) + row_id: str | None = Field(default=None, pattern=r"^[a-f0-9]{32}$") + values: dict[str, Any] | None = None + + @model_validator(mode="after") + def shape(self): + if self.action == "create" and self.row_id is not None: + raise ValueError("create cannot select an existing identity") + if self.action != "create" and self.row_id is None: + raise ValueError("an existing row identity is required") + if (self.action == "delete") != (self.values is None): + raise ValueError("create/update require values; delete accepts no values") + if self.values is not None and len(self.values) > 40: + raise ValueError("at most 40 fields") + return self + + +class TwinQuery(StrictRecord): + objective: str = Field(min_length=1, max_length=500) + + +class AttachPage(StrictRecord): + job_id: str = Field(pattern=r"^[a-f0-9]{32}$") + expected_revision: int = Field(ge=0, le=100) + + +def scalar_kind(value): + if value is None: + return "null" + if isinstance(value, bool): + return "boolean" + if isinstance(value, str) and len(value) <= 2000: + return "string" + if type(value) in (int, float) and abs(value) <= 1e30 and math.isfinite(value): + return "number" + raise Residual("TWIN_BOUNDED_SCALAR_FIELDS_REQUIRED") + + +def table_copy(rows): + fields = columns(rows) + if not fields: + raise Residual("TWIN_NEEDS_OBSERVED_COLUMNS") + kinds = {key: sorted({scalar_kind(row.get(key)) for row in rows}) for key in fields} + return { + "columns": fields, + "types": kinds, + "rows": [{"id": uid(), "values": copy.deepcopy(row)} for row in rows], + } + + +class Twins: + def __init__(self, sessions): + self.sessions = sessions + + def create(self, owner, job_id): + with self.sessions.begin() as s: + return self.create_in(s, owner, job_id) + + def create_in(self, s, owner, job_id): + job = owned(s, AdaptationJob, job_id, owner, lock=True) + existing = s.scalar(select(LocalTwin).where(LocalTwin.job == job_id)) + if existing: + return existing.id + if job.status != "VERIFIED" or not job.evidence: + raise Failure("TWIN_REQUIRES_VERIFIED_EVIDENCE") + evidence = Evidence.model_validate(job.evidence) + if evidence.kind not in {"dataset", "database_snapshot", "website", "repository"}: + raise Failure("TWIN_BEHAVIOR_NOT_ESTABLISHED_FOR_THIS_SOURCE") + if digest(evidence.payload) != evidence.content_digest: + raise Failure("TWIN_SOURCE_DIGEST_MISMATCH") + if evidence.kind == "repository": + # The immutable payload lives once, in the owning job's evidence. + twin = LocalTwin( + owner=owner, + agent=job.agent, + job=job.id, + source_digest=evidence.content_digest, + data={"source_job": job.id, "package_digest": evidence.content_digest}, + manifest=repository_manifest(evidence), + ) + s.add(twin) + s.flush() + return twin.id + if evidence.kind == "website": + data = {"pages": [website_copy(evidence)]} + manifest = website_manifest(evidence) + if len(canonical(data).encode()) > manifest["data_byte_budget"]: + raise Residual("WEBSITE_DATA_BYTE_BUDGET") + twin = LocalTwin( + owner=owner, + agent=job.agent, + job=job.id, + source_digest=evidence.content_digest, + data=data, + manifest=manifest, + ) + s.add(twin) + s.flush() + return twin.id + data = {name: table_copy(rows) for name, rows in tables(evidence).items()} + if len(canonical(data).encode()) > 524288: + raise Residual("TWIN_DATA_BYTE_BUDGET") + manifest = { + "kind": "local-table-application-v1", + "source": evidence.source, + "source_kind": evidence.kind, + "authority": evidence.authority, + "source_writes": False, + "supported": [ + "browse", + "filter", + "create_local_row", + "replace_local_row", + "delete_local_row", + "count", + "sum", + "mean", + "group_count", + "export_json", + ], + "fidelity": "copied scalar table data and locally defined operations", + "not_reconstructed": [ + "source permissions", + "triggers", + "transactions across tables", + "hidden business rules", + "original layout", + "remote synchronization", + ], + "schema_basis": "observed columns and scalar types, not a recovered database schema", + } + twin = LocalTwin( + owner=owner, + agent=job.agent, + job=job.id, + source_digest=evidence.content_digest, + data=data, + manifest=manifest, + ) + s.add(twin) + s.flush() + return twin.id + + def report(self, owner, ident): + with self.sessions() as s: + # Page state, receipts and consumer status must describe one committed + # snapshot, not different READ COMMITTED snapshots of a racing commit. + s.connection(execution_options={"isolation_level": "REPEATABLE READ"}) + twin = owned(s, LocalTwin, ident, owner) + history = [ + m.receipt + for m in s.scalars( + select(TwinMutation).where(TwinMutation.twin == ident).order_by(TwinMutation.id) + ) + ] + return { + "id": twin.id, + "agent_id": twin.agent, + "job_id": twin.job, + "revision": twin.revision, + "source_digest": twin.source_digest, + "manifest": twin.manifest, + "tables": twin.data if twin.manifest["kind"] == "local-table-application-v1" else {}, + "pages": twin.data["pages"] if twin.manifest["kind"] == WEBSITE_KIND else [], + "history": sorted(history, key=lambda r: r["revision"]), + "captures": [ + { + "id": c.id, + "job_id": c.job, + "request_key": c.creation_key, + "source": c.source, + "status": c.status, + "residual": c.residual, + "receipt": c.receipt, + } + for c in s.scalars( + select(WebsiteCapture) + .where(WebsiteCapture.twin == ident) + .order_by(WebsiteCapture.created) + ) + ], + } + + def list(self, owner): + with self.sessions() as s: + return [ + { + "id": t.id, + "job_id": t.job, + "revision": t.revision, + "source": t.manifest["source"], + "kind": t.manifest["kind"], + } + for t in s.scalars( + select(LocalTwin) + .where(LocalTwin.owner == owner) + .order_by(LocalTwin.created.desc()) + .limit(50) + ) + ] + + def mutate(self, owner, ident, mutation: Mutation, key: str): + if not 1 <= len(key) <= 100 or not key.isascii() or not all(c.isalnum() or c in "-_" for c in key): + raise Failure("INVALID_IDEMPOTENCY_KEY", 400) + request_hash = digest(mutation.model_dump()) + with self.sessions.begin() as s: + twin = owned(s, LocalTwin, ident, owner, lock=True) + if twin.manifest["kind"] != "local-table-application-v1": + raise Failure("TABLE_OPERATION_REQUIRES_TABLE_TWIN") + prior = s.scalar( + select(TwinMutation).where(TwinMutation.twin == ident, TwinMutation.creation_key == key) + ) + if prior: + if prior.request_digest != request_hash: + raise Failure("IDEMPOTENCY_CONFLICT") + return prior.receipt + if twin.revision != mutation.expected_revision: + raise Failure("TWIN_REVISION_CHANGED_RELOAD") + if twin.revision >= 100: + raise Failure("TWIN_MUTATION_BUDGET", 429) + data = copy.deepcopy(twin.data) + table = data.get(mutation.table) + if table is None: + raise Failure("TWIN_TABLE_NOT_FOUND", 404) + values = mutation.values + if values is not None: + if not set(values) <= set(table["columns"]): + raise Failure("TWIN_UNKNOWN_FIELD") + for field, value in values.items(): + if scalar_kind(value) not in table["types"][field]: + raise Failure("TWIN_FIELD_TYPE_MISMATCH") + before = digest(twin.data) + row_id = mutation.row_id + if mutation.action == "create": + if len(table["rows"]) >= 1000: + raise Failure("TWIN_ROW_BUDGET", 429) + row_id = uid() + table["rows"].append({"id": row_id, "values": values}) + else: + row = next((r for r in table["rows"] if r["id"] == row_id), None) + if row is None: + raise Failure("TWIN_ROW_NOT_FOUND", 404) + if mutation.action == "delete": + table["rows"].remove(row) + else: + row["values"] = values + if len(canonical(data).encode()) > 524288: + raise Failure("TWIN_DATA_BYTE_BUDGET", 413) + twin.data = data + twin.revision += 1 + receipt = { + "status": "local_edit_committed", + "revision": twin.revision, + "row_id": row_id, + "table": mutation.table, + "action": mutation.action, + "before_digest": before, + "after_digest": digest(data), + "source_writes": False, + "at": now().isoformat(), + } + s.add( + TwinMutation( + owner=owner, twin=ident, creation_key=key, request_digest=request_hash, receipt=receipt + ) + ) + return receipt + + def query(self, owner, ident, objective): + report = self.report(owner, ident) + if report["manifest"]["kind"] != "local-table-application-v1": + raise Failure("TABLE_OPERATION_REQUIRES_TABLE_TWIN") + payload = { + "tables": { + name: [row["values"] for row in table["rows"]] for name, table in report["tables"].items() + } + } + evidence = Evidence( + source=f"twin://{ident}@{report['revision']}", + kind="database_snapshot", + content_digest=digest(payload), + captured_at=now().isoformat(), + payload=payload, + bytes_received=len(canonical(payload).encode()), + external_reads=0, + authority="user_supplied", + ) + form = ProviderRegistry().compile(evidence, objective, "chameleon-local-v1") + result = execute(form, evidence) + if not verify(form, evidence, result): + raise Failure("TWIN_QUERY_CHECK_FAILED") + return { + "revision": report["revision"], + "result": result, + "form": form.model_dump(), + "verified_against": "local_twin_snapshot", + "external_reads": 0, + "source_writes": False, + } + + def export(self, owner, ident): + report = self.report(owner, ident) + if report["manifest"]["kind"] == REPOSITORY_KIND: + return {key: report[key] for key in ("source_digest", "revision", "manifest")} + if report["manifest"]["kind"] == WEBSITE_KIND: + return { + key: report[key] + for key in ("source_digest", "revision", "manifest", "pages", "history", "captures") + } + return { + "source_digest": report["source_digest"], + "revision": report["revision"], + "manifest": report["manifest"], + "tables": { + name: [row["values"] for row in table["rows"]] for name, table in report["tables"].items() + }, + } + + def repository_evidence(self, owner, ident): + with self.sessions() as s: + twin = owned(s, LocalTwin, ident, owner) + if twin.manifest["kind"] != REPOSITORY_KIND: + raise Failure("REPOSITORY_PACKAGE_REQUIRED", 409) + job = owned(s, AdaptationJob, twin.job, owner) + if job.status != "VERIFIED" or not job.evidence: + raise Failure("TWIN_REQUIRES_VERIFIED_EVIDENCE") + evidence = Evidence.model_validate(job.evidence) + if ( + twin.source_digest != evidence.content_digest + or twin.data != {"source_job": job.id, "package_digest": evidence.content_digest} + or not manifest_matches(twin.manifest, evidence) + ): + raise Failure("REPOSITORY_ARTIFACT_BINDING_MISMATCH") + checked_files(evidence) + return evidence + + def repository_file(self, owner, ident, path): + return file_preview(self.repository_evidence(owner, ident), path) + + def repository_zip(self, owner, ident): + evidence = self.repository_evidence(owner, ident) + return source_zip(evidence), evidence.payload["commit_sha"] + + def attach_page(self, owner, ident, request: AttachPage): + """Attach only independently captured, checked, observed same-origin pages.""" + with self.sessions.begin() as s: + return self.attach_page_in(s, owner, ident, request) + + def attach_page_in(self, s, owner, ident, request: AttachPage): + twin = owned(s, LocalTwin, ident, owner, lock=True) + if twin.manifest["kind"] != WEBSITE_KIND: + raise Failure("WEBSITE_TWIN_REQUIRED") + job = owned(s, AdaptationJob, request.job_id, owner) + if job.status != "VERIFIED" or not job.evidence or job.agent != twin.agent: + raise Failure("TWIN_REQUIRES_VERIFIED_EVIDENCE") + evidence = Evidence.model_validate(job.evidence) + if evidence.kind != "website" or digest(evidence.payload) != evidence.content_digest: + raise Failure("WEBSITE_EVIDENCE_REQUIRED") + if twin.manifest.get("presentation") == "preserve" and not evidence.payload.get("visual"): + raise Failure("SOURCE_STYLE_CAPTURE_REQUIRED") + prior = s.scalar( + select(TwinMutation).where( + TwinMutation.twin == ident, TwinMutation.creation_key == "page-" + job.id + ) + ) + if prior: + return prior.receipt + if twin.revision != request.expected_revision: + raise Failure("TWIN_REVISION_CHANGED_RELOAD") + pages = twin.data["pages"] + page = website_copy(evidence) + if any(p["source"] == page["source"] for p in pages): + raise Failure("WEBSITE_PAGE_ALREADY_CAPTURED") + if not any( + link["url"] == page["source"] and link["same_origin"] for p in pages for link in p["links"] + ): + raise Failure("WEBSITE_OBSERVED_SAME_ORIGIN_LINK_REQUIRED") + if len(pages) >= twin.manifest["page_budget"]: + raise Failure("WEBSITE_PAGE_BUDGET", 429) + data = {"pages": [*pages, page]} + if len(canonical(data).encode()) > twin.manifest["data_byte_budget"]: + raise Failure("WEBSITE_DATA_BYTE_BUDGET", 413) + receipt = { + "status": "verified_page_attached", + "job_id": job.id, + "source": page["source"], + "revision": twin.revision + 1, + "before_digest": digest(twin.data), + "after_digest": digest(data), + "source_writes": False, + "at": now().isoformat(), + } + twin.data = data + twin.revision += 1 + s.add( + TwinMutation( + owner=owner, + twin=ident, + creation_key="page-" + job.id, + request_digest=digest(request.model_dump()), + receipt=receipt, + ) + ) + return receipt diff --git a/orbiters/chameleon/packages/core/chameleon_core/verification_jobs.py b/orbiters/chameleon/packages/core/chameleon_core/verification_jobs.py new file mode 100644 index 0000000000000000000000000000000000000000..d18c2b89eb788e07b1f08604e65ad068f1a0b2e8 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/verification_jobs.py @@ -0,0 +1,382 @@ +"""Queue bookkeeping only: source code never executes inside the API. + +An expired claim is terminal INTERRUPTED, not silently retried. Its bounded +supervisor must terminate independently; a new request is a deliberate retry. +""" + +import hashlib +from datetime import timedelta + +from sqlalchemy import func, select, update + +from .db import BehaviorRecord, CounterpartBundle, LocalTwin, User, VerificationJob, now, uid +from .repository_artifact import REPOSITORY_KIND +from .service import Failure, owned + +PROFILE = "calculator-addition-reviewed-v1" +CONTRACT_PROFILE = "declared-browser-contract-v1" +REPAIR_PROFILE = "arithmetic-compatibility-repair-v1" +MODULE_REPAIR_PROFILE = "relative-module-import-repair-v1" +BUILD_REPAIR_PROFILE = "modern-esm-build-repair-v1" +MOUNT_REPAIR_PROFILE = "entry-mount-relocation-repair-v1" +CONTROL_REPAIR_PROFILE = "documented-input-restoration-repair-v1" +DEFINE_REPAIR_PROFILE = "declared-constant-repair-v1" +REPAIR_PROFILES = {REPAIR_PROFILE, MODULE_REPAIR_PROFILE, BUILD_REPAIR_PROFILE, MOUNT_REPAIR_PROFILE, CONTROL_REPAIR_PROFILE, DEFINE_REPAIR_PROFILE} +CONTRACT_DIGEST = "dc646b4c4887b7c13ec8d612b2f9a2a94367b6cb36cdae0689aab3cd08864871" + + +def public_result(result): + return {k:v for k,v in result.items() if k != 'dependency_artifact'} if result else result + + +def supported(evidence): + files = evidence.payload.get("files", {}) + return ( + files.get("js/calculate.js", {}).get("sha256") + == "14cbdadbbafde29e968c0d05a2851bc399e7beb6429b4a7e97d499755a213a71" + and files.get("index.html", {}).get("sha256") + == "ad2157d4649975da0b8817ca08d834e267f808e1d479f0a6f5c06511d62bcf50" + ) + + +class VerificationJobs: + def __init__(self, sessions, *, limits=None): + from .config import ResourceLimits + self.sessions = sessions + self.limits = limits or ResourceLimits() + + def enqueue( + self, + owner, + twin_id, + key, + profile=PROFILE, + contract=None, + *, + expected_source=None, + assembly=None, + dependency_lock=None, + ): + if profile not in {PROFILE, CONTRACT_PROFILE, *REPAIR_PROFILES} or not isinstance(key, str) or not 1 <= len(key) <= 100: + raise Failure("VERIFICATION_REQUEST_INVALID") + if profile in {CONTRACT_PROFILE, *REPAIR_PROFILES}: + from .browser_contract import validate_contract + + try: + contract, _ = validate_contract(contract) + except ValueError as exc: + raise Failure("VERIFICATION_CONTRACT_INVALID", 422) from exc + elif contract is not None: + raise Failure("VERIFICATION_REQUEST_INVALID") + if dependency_lock is not None: + from .repository_capture import safe_path + from .twins import Twins + + if ( + profile != CONTRACT_PROFILE + or assembly is not None + or not isinstance(dependency_lock, str) + or len(dependency_lock) > 512 + ): + raise Failure("DEPENDENCY_REQUEST_INVALID", 422) + safe_path(dependency_lock) + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + if dependency_lock == 'captured-styles-v1': + from .sass_assembly import linked_sass_entries + + if not linked_sass_entries({'digest': evidence.content_digest, 'repository': evidence.payload}): + raise Failure('DEPENDENCY_STYLES_NOT_CAPTURED', 422) + elif ( + dependency_lock.split("/")[-1] not in {"package-lock.json", "pnpm-lock.yaml"} + or dependency_lock not in evidence.payload["files"] + ): + raise Failure("DEPENDENCY_LOCK_NOT_CAPTURED", 422) + expected_source = evidence.content_digest + with self.sessions.begin() as s: + # Serialize owner budget and idempotency across different twins. + s.scalar(select(User).where(User.id == owner).with_for_update()) + twin = owned(s, LocalTwin, twin_id, owner) + if expected_source is not None and twin.source_digest != expected_source: + raise Failure("REPLAY_SOURCE_CHANGED") + if profile in REPAIR_PROFILES: + from .contracts import digest + + fields = {"failure_record_id", "failure_receipt_digest"} + if profile == DEFINE_REPAIR_PROFILE and isinstance(assembly, dict) and 'dependency_artifact' in assembly: + fields.update({'dependency_artifact', 'dependency_digest'}) + if profile == CONTROL_REPAIR_PROFILE: + fields.add('control_id') + if profile == MOUNT_REPAIR_PROFILE: + fields.add('mount_prefix') + if profile in {MODULE_REPAIR_PROFILE, BUILD_REPAIR_PROFILE}: + fields.add("importer") + if (not isinstance(assembly, dict) + or set(assembly) != fields): + raise Failure("VERIFICATION_REPAIR_EVIDENCE_REQUIRED", 422) + if profile == MOUNT_REPAIR_PROFILE: + import re + if not isinstance(assembly['mount_prefix'], str) or not re.fullmatch(r'[A-Za-z0-9_-]{1,80}', assembly['mount_prefix']): + raise Failure('VERIFICATION_MOUNT_PREFIX_INVALID', 422) + if profile == CONTROL_REPAIR_PROFILE: + import re + if not isinstance(assembly['control_id'], str) or not re.fullmatch(r'[A-Za-z_][\w-]{0,79}', assembly['control_id']): + raise Failure('VERIFICATION_CONTROL_ID_INVALID', 422) + if profile in {MODULE_REPAIR_PROFILE, BUILD_REPAIR_PROFILE}: + from .twins import Twins + + importer = assembly["importer"] + evidence = Twins(self.sessions).repository_evidence(owner, twin_id) + if (not isinstance(importer, str) or not importer.endswith((".js", ".mjs")) + or importer not in evidence.payload["files"]): + raise Failure("VERIFICATION_REPAIR_IMPORTER_INVALID", 422) + if profile == BUILD_REPAIR_PROFILE and any( + name not in evidence.payload['files'] for name in ('package.json', 'rollup.config.js')): + raise Failure('VERIFICATION_BUILD_METADATA_REQUIRED', 422) + failure = owned(s, BehaviorRecord, assembly["failure_record_id"], owner) + if (failure.twin != twin_id or failure.source_digest != twin.source_digest + or failure.receipt_digest != assembly["failure_receipt_digest"] + or digest(failure.receipt) != failure.receipt_digest + or failure.receipt["behavior"]["status"] != "FAIL" + or failure.receipt.get("overlay_digest") + or (failure.receipt.get("dependency_digest") and profile != DEFINE_REPAIR_PROFILE) + or failure.receipt["contract_digest"] != validate_contract(contract)[1]): + raise Failure("VERIFICATION_REPAIR_EVIDENCE_MISMATCH") + if profile == DEFINE_REPAIR_PROFILE: + from .contracts import canonical + artifact = assembly.get('dependency_artifact') + expected = failure.receipt.get('dependency_digest') + if expected is None: + if artifact is not None or assembly.get('dependency_digest') is not None: + raise Failure('VERIFICATION_REPAIR_EVIDENCE_MISMATCH') + elif (not isinstance(artifact, dict) or set(artifact) != {'bundle','digest'} + or len(canonical(artifact).encode()) > 16*1024*1024 + or not isinstance(artifact['bundle'], dict) + or artifact['bundle'].get('source_package_digest') != twin.source_digest + or artifact['digest'] != expected or assembly.get('dependency_digest') != expected + or digest(artifact['bundle']) != expected): + raise Failure('VERIFICATION_REPAIR_EVIDENCE_MISMATCH') + elif assembly is not None: + if ( + profile != CONTRACT_PROFILE + or not isinstance(assembly, dict) + or set(assembly) not in ( + {"bundle_id", "bundle_sha256", "dependency_digest"}, + {"bundle_id", "bundle_sha256", "dependency_digest", "overlay_digest"}) + ): + raise Failure("VERIFICATION_ASSEMBLY_INVALID") + saved = owned(s, CounterpartBundle, assembly["bundle_id"], owner) + record = owned(s, BehaviorRecord, saved.record, owner) + if ( + saved.twin != twin_id + or record.twin != twin_id + or record.source_digest != twin.source_digest + or record.receipt["behavior"]["status"] != "PASS" + or not (assembly["dependency_digest"] or assembly.get("overlay_digest")) + or record.receipt.get("dependency_digest") != assembly["dependency_digest"] + or record.receipt.get("overlay_digest") != assembly.get("overlay_digest") + or saved.sha256 != assembly["bundle_sha256"] + or hashlib.sha256(saved.body).hexdigest() != saved.sha256 + ): + raise Failure("VERIFICATION_ASSEMBLY_MISMATCH") + old = s.scalar( + select(VerificationJob).where( + VerificationJob.owner == owner, VerificationJob.creation_key == key + ) + ) + if old: + if ( + old.twin != twin_id + or old.profile != profile + or old.source_digest != twin.source_digest + or old.contract != contract + or old.assembly != assembly + or old.dependency_lock != dependency_lock + ): + raise Failure("VERIFICATION_KEY_CONFLICT") + return old.id + if twin.manifest.get("kind") != REPOSITORY_KIND: + raise Failure("VERIFICATION_REQUIRES_REPOSITORY") + count = s.scalar( + select(func.count()).select_from(VerificationJob).where(VerificationJob.owner == owner) + ) + if count >= self.limits.max_verification_jobs_per_owner: + raise Failure("VERIFICATION_OWNER_BUDGET", 429) + job = VerificationJob( + owner=owner, + twin=twin_id, + source_digest=twin.source_digest, + creation_key=key, + profile=profile, + contract=contract, + assembly=assembly, + dependency_lock=dependency_lock, + ) + s.add(job) + s.flush() + return job.id + + def claim(self): + with self.sessions.begin() as s: + s.execute( + update(VerificationJob) + .where(VerificationJob.status == "RUNNING", VerificationJob.deadline < now()) + .values(status="INTERRUPTED", token=None) + ) + job = s.scalar( + select(VerificationJob) + .where(VerificationJob.status == "QUEUED") + .order_by(VerificationJob.created) + .with_for_update(skip_locked=True) + .limit(1) + ) + if job is None: + return None + twin = owned(s, LocalTwin, job.twin, job.owner) + if twin.source_digest != job.source_digest: + job.status = "STALE" + return None + job.status, job.token, job.deadline = "RUNNING", uid(), now() + timedelta(seconds=240) + return { + "id": job.id, + "owner": job.owner, + "twin": job.twin, + "source_digest": job.source_digest, + "profile": job.profile, + "contract": job.contract, + "assembly": job.assembly, + "dependency_lock": job.dependency_lock, + "token": job.token, + } + + def bind_dependencies(self, claim, artifact): + from .contracts import canonical + from .locked_assets import verify_locked_assets + from .twins import Twins + + if len(canonical(artifact).encode()) > 16*1024*1024: + raise Failure('VERIFICATION_DEPENDENCY_STORAGE_BUDGET') + evidence = Twins(self.sessions).repository_evidence(claim["owner"], claim["twin"]) + verify_locked_assets(artifact, {"digest": evidence.content_digest, "repository": evidence.payload}) + with self.sessions.begin() as s: + job = owned(s, VerificationJob, claim["id"], claim["owner"], lock=True) + if job.status != "RUNNING" or job.token != claim["token"] or job.deadline < now(): + raise Failure("VERIFICATION_CLAIM_EXPIRED") + if ( + not job.dependency_lock + or artifact["bundle"]["lock_path"] != job.dependency_lock + or evidence.content_digest != job.source_digest + ): + raise Failure("VERIFICATION_ASSEMBLY_MISMATCH") + if job.acquired_digest is not None and job.acquired_digest != artifact["digest"]: + raise Failure("VERIFICATION_ASSEMBLY_MISMATCH") + job.acquired_digest = artifact["digest"] + job.result = {**(job.result or {}), 'dependency_artifact':artifact} + + def failure_dependencies(self, owner, twin_id, record_id): + """Internal recovery of the exact assembly; never recover from a local pathname.""" + from .contracts import digest + with self.sessions() as s: + twin = owned(s, LocalTwin, twin_id, owner) + record = owned(s, BehaviorRecord, record_id, owner) + if (record.twin != twin_id or record.source_digest != twin.source_digest + or digest(record.receipt) != record.receipt_digest + or record.receipt['behavior']['status'] != 'FAIL'): + raise Failure('VERIFICATION_REPAIR_EVIDENCE_MISMATCH') + expected = record.receipt.get('dependency_digest') + if expected is None: + return None + rows = s.scalars(select(VerificationJob).where( + VerificationJob.owner == owner, VerificationJob.twin == twin_id, + VerificationJob.source_digest == twin.source_digest, + VerificationJob.result['record_id'].as_string() == record_id, + VerificationJob.status == 'FAIL')).all() + for job in rows: + artifact = (job.result or {}).get('dependency_artifact') + if (artifact and job.acquired_digest == expected and artifact.get('digest') == expected + and artifact.get('bundle', {}).get('source_package_digest') == twin.source_digest + and digest(artifact['bundle']) == expected): + return artifact + raise Failure('VERIFICATION_DEPENDENCY_EVIDENCE_UNAVAILABLE') + + def finish(self, claim, record_id): + with self.sessions.begin() as s: + job = owned(s, VerificationJob, claim["id"], claim["owner"], lock=True) + if job.status != "RUNNING" or job.token != claim["token"] or job.deadline < now(): + raise Failure("VERIFICATION_CLAIM_EXPIRED") + twin = owned(s, LocalTwin, job.twin, job.owner) + record = owned(s, BehaviorRecord, record_id, job.owner) + expected_digest = CONTRACT_DIGEST + if job.profile in {CONTRACT_PROFILE, *REPAIR_PROFILES}: + from .browser_contract import validate_contract + + _, expected_digest = validate_contract(job.contract) + if ( + twin.source_digest != job.source_digest + or record.source_digest != job.source_digest + or record.twin != job.twin + or record.receipt.get("contract_digest") != expected_digest + or record.receipt.get("dependency_digest") + != (job.assembly.get("dependency_digest") if job.assembly else job.acquired_digest) + or (job.dependency_lock is not None and job.acquired_digest is None) + or (job.profile == CONTRACT_PROFILE and record.receipt.get("overlay_digest") + != (job.assembly or {}).get("overlay_digest")) + or (job.profile in REPAIR_PROFILES and ( + not (job.result or {}).get("overlay_digest") + or record.receipt.get("overlay_digest") != job.result["overlay_digest"])) + ): + raise Failure("VERIFICATION_RESULT_MISMATCH") + job.status = record.receipt["behavior"]["status"] + retained = (job.result or {}).get('dependency_artifact') + job.result, job.token = {"record_id": record.id, **({'dependency_artifact':retained} if retained else {})}, None + + def report(self, owner, ident): + with self.sessions() as s: + job = owned(s, VerificationJob, ident, owner) + return { + "id": job.id, + "twin": job.twin, + "profile": job.profile, + "status": job.status, + "source_digest": job.source_digest, + "result": public_result(job.result), + "dependency_lock": job.dependency_lock, + "dependency_digest": job.assembly.get("dependency_digest") + if job.assembly + else job.acquired_digest, + } + + def bind_overlay(self, claim, overlay_digest): + """Trusted worker pins its constructed candidate before executing it.""" + import re + + if not isinstance(overlay_digest, str) or not re.fullmatch(r"[a-f0-9]{64}", overlay_digest): + raise Failure("VERIFICATION_REPAIR_OVERLAY_INVALID") + with self.sessions.begin() as s: + job = owned(s, VerificationJob, claim["id"], claim["owner"], lock=True) + if (job.status != "RUNNING" or job.token != claim["token"] or job.deadline < now() + or job.profile not in REPAIR_PROFILES): + raise Failure("VERIFICATION_CLAIM_EXPIRED") + if job.result and job.result.get("overlay_digest") != overlay_digest: + raise Failure("VERIFICATION_ASSEMBLY_MISMATCH") + job.result = {"overlay_digest": overlay_digest} + + def list(self, owner, twin_id): + with self.sessions() as s: + owned(s, LocalTwin, twin_id, owner) + rows = s.scalars( + select(VerificationJob) + .where(VerificationJob.owner == owner, VerificationJob.twin == twin_id) + .order_by(VerificationJob.created.desc()) + .limit(20) + ) + return [ + {"id": row.id, "status": row.status, "result": public_result(row.result), "profile": row.profile} + for row in rows + ] + + def fail(self, claim): + with self.sessions.begin() as s: + job = owned(s, VerificationJob, claim["id"], claim["owner"], lock=True) + if job.status == "RUNNING" and job.token == claim["token"]: + job.status, job.token = "ERROR", None + job.result = {"code": "SUPERVISOR_FAILED"} diff --git a/orbiters/chameleon/packages/core/chameleon_core/visual_capture.py b/orbiters/chameleon/packages/core/chameleon_core/visual_capture.py new file mode 100644 index 0000000000000000000000000000000000000000..9763c3e26ee2017aea26212e1cab83f7b1f0d220 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/visual_capture.py @@ -0,0 +1,762 @@ +"""Source-style static counterparts. Captured code is data, never host-executed. + +Styles/images are embedded under a deny-network preview CSP. Only our fixed +navigation bridge executes; source scripts/forms/embeds are not reconstructed. +""" + +import base64 +import hashlib +import html +import json +import os +import re +import subprocess +import sys +from concurrent.futures import ThreadPoolExecutor +from html.parser import HTMLParser +from pathlib import Path +from urllib.parse import unquote_to_bytes + +from . import visual_css +from .image_sources import srcset_candidates +from .script_images import MAX_SCRIPT_BYTES, image_references +from .adaptation_contracts import Residual +from .contracts import digest +from .website import VOID, page_url + +ASSET_COUNT = 32 +ASSET_TOTAL = 4194304 +SCRIPT_COUNT = 8 +SCRIPT_TOTAL = 524288 +ARTIFACT_LIMIT = 8388608 +CSS_URL = re.compile(r"url\(\s*(?:\"([^\"]*)\"|'([^']*)'|([^\s)]*))\s*\)", re.IGNORECASE) +TAGS = { + "html", + "head", + "body", + "title", + "meta", + "style", + "div", + "span", + "p", + "section", + "main", + "article", + "header", + "footer", + "aside", + "nav", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "a", + "ul", + "ol", + "li", + "dl", + "dt", + "dd", + "blockquote", + "pre", + "code", + "em", + "strong", + "b", + "i", + "u", + "s", + "small", + "sub", + "sup", + "br", + "hr", + "img", + "picture", + "figure", + "figcaption", + "table", + "thead", + "tbody", + "tfoot", + "tr", + "td", + "th", + "caption", + "colgroup", + "col", + "button", + "input", + "label", + "select", + "option", + "textarea", + "form", + "details", + "dialog", + "summary", + "time", + "address", + "abbr", + "kbd", + "samp", + "mark", + "wbr", +} +SKIP = { + "script", + "iframe", + "object", + "embed", + "template", + "noscript", + "svg", + "math", + "canvas", + "audio", + "video", +} +ATTRS = { + "data-visible", + "data-hidden", + "data-collapsed", + "data-status", + "data-align", + "data-weight", + "data-size", + "data-level", + "data-loaded", + "data-first", + "data-device", + "data-icon-only", + "data-open", + "data-plus", + "data-secondary", + "data-reveal", + "data-complete", + "data-show-on-focus", + "data-menu", + "data-close", + "data-loading", + "data-alternate", + "data-icon", + "data-navbar-item", + "data-theme", + "data-mui-color-scheme", + "data-joy-color-scheme", + "data-mantine-color-scheme", + "id", + "class", + "title", + "lang", + "dir", + "role", + "style", + "width", + "height", + "alt", + "colspan", + "rowspan", + "rows", + "cols", + "scope", + "type", + "value", + "placeholder", + "checked", + "selected", + "open", + "datetime", + "tabindex", + "hidden", +} + + +def asset_url(base, value): + # Embedded bytes still pass media, signature and byte-budget validation. + if isinstance(value, str) and value.strip().lower().startswith("data:"): + return "data:" + value.strip()[5:] + return page_url(base, value.strip()) if isinstance(value, str) else None + + +def asset_label(url): + return "embedded:sha256:" + hashlib.sha256(url.encode()).hexdigest() if url.startswith("data:") else url + + +def embedded_asset(url): + if len(url) > 360000: + raise Residual("ASSET_BYTE_BUDGET") + try: + header, encoded = url.split(",", 1) + media = header[5:].split(";")[0].lower() + if header.lower().endswith(";base64"): + data = base64.b64decode(re.sub(r"\s", "", encoded), validate=True) + else: + if re.search(r'%(?![0-9a-fA-F]{2})', encoded): + raise ValueError('Malformed percent encoding') + data = unquote_to_bytes(encoded) + except ValueError as exc: + raise Residual("EMBEDDED_ASSET_INVALID") from exc + if len(data) > 262144: + raise Residual("ASSET_BYTE_BUDGET") + return data, media + + +class Document(HTMLParser): + def __init__(self, source): + super().__init__(convert_charrefs=True) + self.source = source + self.tokens = [] + self.resources = [] + self.scripts = [] + self.inline_script_chunks = None + self.inline_script_bytes = 0 + self.skipped = [] + self.style = False + self.title = False + self.depth = 0 + self.omitted = {"scripts": 0, "forms": 0, "embeds": 0} + + def resource(self, raw, kind): + url = asset_url(self.source, raw) + if url and (url, kind) not in self.resources: + if len(self.resources) < 256: + self.resources.append((url, kind)) + else: + self.omitted["resource_reference_budget"] = ( + self.omitted.get("resource_reference_budget", 0) + 1 + ) + return url + + def handle_starttag(self, tag, attrs): + self.depth += tag not in VOID + if self.depth > 128 or len(self.tokens) > 12000: + raise Residual("VISUAL_DOCUMENT_COMPLEXITY_BUDGET") + if self.skipped: + if tag not in VOID: + self.skipped.append(tag) + if tag in SKIP: + self.omitted["scripts" if tag == "script" else "embeds"] += 1 + return + attrs = dict(attrs) + if tag == "script": + self.omitted["scripts"] += 1 + if attrs.get("src"): + self.scripts.append(("external", attrs["src"])) + self.inline_script_chunks = None + else: + self.inline_script_chunks = [] + self.skipped.append(tag) + return + if tag in SKIP: + if tag not in VOID: + self.skipped.append(tag) + self.omitted["embeds"] += 1 + return + if tag == "link": + if "stylesheet" in (attrs.get("rel") or "").lower().split(): + url = self.resource(attrs.get("href"), "style") + if url: + self.tokens.append(("sheet", url, attrs.get("media") or "all")) + return + if tag == "meta": + # Retain only display-related viewport; never refresh, CSP or cookies. + if (attrs.get("name") or "").lower() == "viewport": + self.tokens.append( + ("start", tag, {"name": "viewport", "content": attrs.get("content") or ""}) + ) + return + if tag not in TAGS and tag not in {'picture', 'source'}: + return + if tag == "form": + self.omitted["forms"] += 1 + safe = {k: v or "" for k, v in attrs.items() if k in ATTRS or k.startswith("aria-") or re.fullmatch(r'data-v-[0-9a-f]{6,16}(?:-s)?', k)} + # Inputs never submit, collect credentials or contact the original source. + if tag in {"button", "input", "select", "textarea"}: + safe.update({"disabled": "", "title": "Source action not reconstructed"}) + # Button values are visible labels, unlike user-entered field values. + if tag == "input" and (attrs.get("type") or "text").lower() not in {"button", "submit", "reset"}: + safe.pop("value", None) + if tag == "a" and attrs.get("href"): + href = attrs["href"] + if href.startswith("#"): + safe["data-chameleon-anchor"] = href[1:] + else: + target = page_url(self.source, href) + if target: + safe["data-chameleon-target"] = target + safe.update({"href": "#", "role": "link", "tabindex": "0"}) + if tag == "img": + url = self.resource(attrs.get("data-src") or attrs.get("data-original") or attrs.get("src"), "image") + if url: + safe["data-chameleon-image"] = url + if tag in {'img', 'source'}: + candidates = [] + for raw, descriptor in srcset_candidates(attrs.get('data-srcset') or attrs.get('srcset')): + url = self.resource(raw, 'image') + if url: + candidates.append((url, descriptor)) + if candidates: + safe['data-chameleon-srcset'] = json.dumps(candidates) + for key in ('sizes', 'media', 'type'): + if attrs.get(key): + safe[key] = attrs[key] + if safe.get("style"): + for raw, kind in visual_css.references(safe["style"], inline=True): + self.resource(raw, kind) + self.tokens.append(("start", tag, safe)) + self.style = tag == "style" or self.style + + def handle_endtag(self, tag): + self.depth = max(0, self.depth - 1) + if self.skipped: + if tag in self.skipped: + if tag == "script" and self.inline_script_chunks is not None: + body = "".join(self.inline_script_chunks) + size = len(body.encode("utf-8", errors="ignore")) + if size <= MAX_SCRIPT_BYTES and self.inline_script_bytes + size <= SCRIPT_TOTAL: + self.scripts.append(("inline", body)) + self.inline_script_bytes += size + else: + self.omitted["script_scan_byte_budget"] = ( + self.omitted.get("script_scan_byte_budget", 0) + 1 + ) + self.inline_script_chunks = None + self.skipped = self.skipped[: self.skipped.index(tag)] + return + if tag == "style": + self.style = False + if tag in TAGS and tag not in VOID and tag != "meta": + self.tokens.append(("end", tag)) + + def handle_startendtag(self, tag, attrs): + self.handle_starttag(tag, attrs) + if tag not in VOID: + self.handle_endtag(tag) + + def handle_data(self, data): + if self.skipped: + if self.skipped[-1] == "script" and self.inline_script_chunks is not None: + self.inline_script_chunks.append(data) + return + self.tokens.append(("css" if self.style else "text", data)) + if self.style: + for raw, kind in visual_css.references(data): + self.resource(raw, kind) + + +def capture_direct(source, raw, allow_network=True, fetch=None, asset_writer=None, asset_count=ASSET_COUNT, asset_total=ASSET_TOTAL): + if not isinstance(asset_count, int) or not 1 <= asset_count <= 128: + raise ValueError('asset_count must be 1..128') + if not isinstance(asset_total, int) or not 1 <= asset_total <= 25165824: + raise ValueError('asset_total must be 1..25165824') + if (asset_count > ASSET_COUNT or asset_total > ASSET_TOTAL) and asset_writer is None: + raise ValueError('Expanded acquisition requires sidecar storage') + """Runs in a trusted bounded subprocess in production. fetch is a test seam.""" + if fetch is None: + from .intake import fetch_asset_direct + + fetch_assets = fetch_asset_direct + + def fetch_script(url): + return fetch_asset_direct(url, script_resources=True) + else: + fetch_assets = fetch + fetch_script = fetch + doc = Document(source) + doc.feed(raw) + doc.close() + stored = {} + records = [] + total = 0 + network_bytes = 0 + attempts = 0 + missing = [] + seen = set() + + def fetch_one(item): + url, kind = item + try: + data, media = embedded_asset(url) if url.startswith("data:") else fetch_assets(url) + # Some CDNs serve genuine WebP as generic binary. Identify only + # the bounded RIFF/WebP container, never trust a filename alone. + if media == 'application/octet-stream' and len(data) >= 12 and data[:4] == b'RIFF' and data[8:12] == b'WEBP' and int.from_bytes(data[4:8], 'little') + 8 == len(data): + media = 'image/webp' + valid = ( + media == "text/css" + if kind == "style" + else media + in { + "image/svg+xml", + "image/png", + "image/jpeg", + "image/gif", + "image/webp", + "image/x-icon", + "image/vnd.microsoft.icon", + "font/woff", + "font/woff2", + "application/font-woff", + "application/font-woff2", + "application/x-font-woff", + "application/x-font-ttf", + "font/truetype", + "font/ttf", + "font/otf", + "application/octet-stream", + } + ) + if media == 'image/svg+xml': + from .inert_svg import validate_svg + data = validate_svg(data) + if not valid or (kind == "image" and not media.startswith("image/")): + raise Residual("ASSET_MEDIA_NOT_SUPPORTED") + if media == "application/octet-stream": + if data.startswith(b"wOF2"): + media = "font/woff2" + elif data.startswith(b"wOFF"): + media = "font/woff" + else: + raise Residual("ASSET_MEDIA_NOT_SUPPORTED") + if media in {"application/x-font-woff", "application/font-woff", "font/woff"}: + if not data.startswith(b"wOFF"): + raise Residual("ASSET_FONT_SIGNATURE_INVALID") + media = "font/woff" + if media in {"font/woff2", "application/font-woff2"} and not data.startswith(b"wOF2"): + raise Residual("ASSET_FONT_SIGNATURE_INVALID") + if media in {"application/x-font-ttf", "font/truetype", "font/ttf", "font/otf"}: + if not data.startswith((b"\x00\x01\x00\x00", b"OTTO", b"true")): + raise Residual("ASSET_FONT_SIGNATURE_INVALID") + media = "font/otf" if data.startswith(b"OTTO") else "font/ttf" + return url, kind, data, media, None + except Residual as exc: + return url, kind, b"", "", exc.code + + style_depth = {url: 0 for url, kind in doc.resources if kind == "style"} + pending = [item for item in doc.resources if item[1] == "style"] + binaries = [item for item in doc.resources if item[1] != "style"] + + def load_batch(pending): + nonlocal attempts, total, network_bytes + batch: list[tuple[str, str]] = [] + for item in pending: + if item[0] in seen: + continue + seen.add(item[0]) + if item[1] == "unsupported_import": + missing.append({"url": asset_label(item[0]), "reason": "CSS_IMPORT_CONDITION_NOT_SUPPORTED"}) + continue + if re.search(r"\.eot(?:[?#]|$)", item[0], re.IGNORECASE): + missing.append({"url": asset_label(item[0]), "reason": "ASSET_MEDIA_NOT_SUPPORTED"}) + continue + external = not item[0].startswith("data:") + if external and (not allow_network or attempts >= asset_count): + missing.append( + { + "url": asset_label(item[0]), + "reason": "ASSET_REQUEST_BUDGET" if allow_network else "INLINE_NETWORK_DISABLED", + } + ) + else: + batch.append(item) + attempts += int(external) + discovered = [] + with ThreadPoolExecutor(max_workers=4) as pool: + for url, kind, data, media, error in pool.map(fetch_one, batch): + if error or total + len(data) > asset_total: + missing.append({"url": asset_label(url), "reason": error or "ASSET_TOTAL_BYTE_BUDGET"}) + continue + total += len(data) + network_bytes += 0 if url.startswith("data:") else len(data) + stored[url] = (data, media) + records.append( + { + "url": asset_label(url), + "media": media, + "bytes": len(data), + "sha256": hashlib.sha256(data).hexdigest(), + } + ) + if kind == "style": + css = data.decode("utf-8", errors="replace") + for reference, ref_kind in visual_css.references(css): + target = asset_url(url, reference) + if target: + if ref_kind == "style": + depth = style_depth.get(url, 0) + 1 + if depth > 2: + missing.append( + {"url": asset_label(target), "reason": "CSS_IMPORT_DEPTH_BUDGET"} + ) + continue + style_depth.setdefault(target, depth) + discovered.append((target, ref_kind)) + return discovered + + # Styles first, including bounded imports, then fonts/images. Primary CSS + # cannot be crowded out by legacy font alternatives or decorative assets. + for _depth in range(3): + discovered = load_batch(pending) + pending = [item for item in discovered if item[1] == "style"] + binaries.extend(item for item in discovered if item[1] != "style") + primary_images = set() + responsive_images = set() + hidden_stack = [] + for token in doc.tokens: + if token[0] == 'start': + hidden = 'hidden' in token[2] or any(hidden_stack) + if not hidden: + candidates = json.loads(token[2].get('data-chameleon-srcset', '[]')) + widths = [(url, int(desc[:-1])) for url, desc in candidates if desc.endswith('w') and desc[:-1].isdigit()] + if widths: + responsive_images.add(min(widths, key=lambda item: abs(item[1] - 768))[0]) + if 'data-chameleon-image' in token[2]: + primary_images.add(token[2]['data-chameleon-image']) + for raw, _kind in visual_css.references(token[2].get('style', ''), inline=True): + primary_images.add(asset_url(source, raw)) + if token[1] not in VOID: + hidden_stack.append(hidden) + elif token[0] == 'end' and hidden_stack: + hidden_stack.pop() + binaries.sort(key=lambda item: ( + not item[0].startswith('data:'), + -1 if item[1]=='binary' and re.search(r'\.(?:png|jpe?g|webp)(?:[?#]|$)',item[0],re.I) else 0 if item[0] in responsive_images else 1 if item[0] in primary_images else 2 if item[1] == 'image' else 3, + )) + load_batch(binaries) + + script_bytes = 0 + scanned_scripts = 0 + external_scripts_read = 0 + script_image_candidates = 0 + script_resources = 0 + script_missing = 0 + script_image_urls = [] + for script_kind, value in doc.scripts: + base = source + body = value + if script_kind == "external": + if not allow_network: + missing.append({"url": asset_label(asset_url(source, value) or source), "reason": "INLINE_NETWORK_DISABLED"}) + script_missing += 1 + continue + if script_resources >= SCRIPT_COUNT or attempts >= asset_count: + missing.append({"url": asset_label(asset_url(source, value) or source), "reason": "SCRIPT_REQUEST_BUDGET"}) + script_missing += 1 + continue + target = asset_url(source, value) + if not target or target.startswith("data:"): + missing.append({"url": asset_label(target or source), "reason": "SCRIPT_URL_INVALID"}) + script_missing += 1 + continue + script_resources += 1 + attempts += 1 + try: + encoded, media = fetch_script(target) + media = media.split(";", 1)[0].strip().lower() if isinstance(media, str) else "" + if media not in {"text/javascript", "application/javascript", "application/ecmascript", "text/ecmascript"}: + raise Residual("SCRIPT_MEDIA_NOT_SUPPORTED") + if not isinstance(encoded, bytes) or len(encoded) > MAX_SCRIPT_BYTES or script_bytes + len(encoded) > SCRIPT_TOTAL: + raise Residual("SCRIPT_BYTE_BUDGET") + body = encoded.decode("utf-8") + script_bytes += len(encoded) + external_scripts_read += 1 + base = target + except (Residual, UnicodeError) as exc: + missing.append({"url": asset_label(target), "reason": exc.code if isinstance(exc, Residual) else "SCRIPT_ENCODING_NOT_SUPPORTED"}) + script_missing += 1 + continue + except Exception: + missing.append({"url": asset_label(target), "reason": "SCRIPT_UNAVAILABLE"}) + script_missing += 1 + continue + scanned_scripts += 1 + references = image_references(body) + script_image_candidates += len(references) + for reference in references: + target = asset_url(base, reference) + if target: + binaries.append((target, "image")) + script_image_urls.append(target) + else: + missing.append({"url": asset_label(base), "reason": "SCRIPT_IMAGE_URL_INVALID"}) + # Static script references are fetched like other bounded assets; scripts + # remain inert and are never copied into the rendered document. + load_batch(binaries) + + embedded_urls = set() + + def embedded(url): + if url not in stored or stored[url][1] == "text/css": + return "" + data, media = stored[url] + embedded_urls.add(url) + if asset_writer is not None: + return asset_writer(data,media) + return "data:" + media + ";base64," + base64.b64encode(data).decode() + + def rewrite_css(css, base, chain=(), inline=False): + def include(raw): + target = asset_url(base, raw) + if not target or target not in stored or stored[target][1] != "text/css": + return "" + if target in (*chain, base) or len(chain) >= 2: + missing.append({"url": asset_label(target), "reason": "CSS_IMPORT_CYCLE_OR_DEPTH"}) + return "" + return rewrite_css(stored[target][0].decode("utf-8", errors="replace"), target, (*chain, base)) + + return visual_css.rewrite(css, lambda raw: embedded(asset_url(base, raw)), include, inline) + + parts: list[str] = [] + output_bytes = 0 + for token in doc.tokens: + previous_count = len(parts) + kind = token[0] + if kind == "text": + parts.append(html.escape(token[1])) + elif kind == "css": + parts.append(rewrite_css(token[1], source)) + elif kind == "sheet": + if token[1] in stored: + css = rewrite_css(stored[token[1]][0].decode("utf-8", errors="replace"), token[1]) + parts.append('") + elif kind == "end": + parts.append("") + elif kind == "start": + attrs = dict(token[2]) + if "data-chameleon-image" in attrs: + value = embedded(attrs.pop("data-chameleon-image")) + if value: + attrs["src"] = value + if 'data-chameleon-srcset' in attrs: + candidates = json.loads(attrs.pop('data-chameleon-srcset')) + values = [(embedded(url), descriptor) for url, descriptor in candidates] + resolved = [value + (' ' + descriptor if descriptor else '') for value, descriptor in values if value] + if resolved: + attrs['srcset'] = ', '.join(resolved) + if "style" in attrs: + attrs["style"] = rewrite_css(attrs["style"], source, inline=True) + parts.append( + "<" + + token[1] + + "".join(" " + k + '="' + html.escape(v, quote=True) + '"' for k, v in attrs.items()) + + ">" + ) + if len(parts) > previous_count: + output_bytes += len(parts[-1].encode()) + if output_bytes > ARTIFACT_LIMIT: + raise Residual("VISUAL_ARTIFACT_BYTE_BUDGET") + document = "".join(parts) + if len(document.encode()) > ARTIFACT_LIMIT: + raise Residual("VISUAL_ARTIFACT_BYTE_BUDGET") + script_assets = [] + for url in dict.fromkeys(script_image_urls): + if url not in stored or url in embedded_urls: + continue + data, media = stored[url] + script_assets.append( + { + "url": asset_label(url), + "media": media, + "bytes": len(data), + "sha256": hashlib.sha256(data).hexdigest(), + "data_url": embedded(url), + } + ) + result = { + "version": "source-style-static-v1", + "html": document, + "document_sha256": hashlib.sha256(document.encode()).hexdigest(), + "source_html_sha256": hashlib.sha256(raw.encode()).hexdigest(), + "assets": records, + "script_image_assets": script_assets, + "missing_assets": missing, + "omitted": doc.omitted, + "asset_bytes_stored": total, + "asset_bytes_received": network_bytes, + "asset_fetch_attempts": attempts, + "script_bytes_scanned": script_bytes + doc.inline_script_bytes, + "script_scan": { + "version": "static-image-literals-v1", + "scripts_scanned": scanned_scripts, + "external_sources_read": external_scripts_read, + "image_candidates": script_image_candidates, + "source_scripts_executed": False, + "incomplete_sources": script_missing, + }, + "behavior": [ + "captured_layout", + "captured_styles", + "captured_raster_images", + "mediated_observed_navigation", + "local_fragment_navigation", + "native_details_toggle", + ], + "not_reconstructed": [ + "source JavaScript", + "dynamic and canvas-generated images", + "form submissions and purchases", + "authentication", + "hidden backend behavior", + "live synchronization", + ], + } + from .script_inventory import script_inventory + + result["script_evidence"] = script_inventory(raw) + result["script_evidence"]["external_scripts_fetched"] = external_scripts_read > 0 + result["artifact_digest"] = digest(result) + if len(json.dumps(result).encode()) > ARTIFACT_LIMIT: + raise Residual("VISUAL_ARTIFACT_BYTE_BUDGET") + return result + + +def capture(source, raw, allow_network=True): + environment = dict(os.environ) + environment["PYTHONPATH"] = str(Path(__file__).resolve().parents[1]) + try: + process = subprocess.run( + [sys.executable, "-m", "chameleon_core.visual_capture"], + input=json.dumps({"source": source, "raw": raw, "allow_network": allow_network}), + capture_output=True, + text=True, + timeout=14, + check=False, + env=environment, + ) + except subprocess.TimeoutExpired as exc: + raise Residual("VISUAL_CAPTURE_WALL_BUDGET") from exc + if process.returncode: + raise Residual("VISUAL_CAPTURE_WORKER_FAILED") + result = json.loads(process.stdout) + if "error" in result: + raise Residual(result["error"]) + return result + + +def render_page(artifact, nonce, channel): + if digest({k: v for k, v in artifact.items() if k != "artifact_digest"}) != artifact["artifact_digest"]: + raise Residual("VISUAL_ARTIFACT_DIGEST_MISMATCH") + bridge = """document.addEventListener('click',function(e){var a=e.target.closest('a');if(!a)return;e.preventDefault();if(a.dataset.chameleonAnchor){var t=document.getElementById(a.dataset.chameleonAnchor);if(t)t.scrollIntoView();return;}if(a.dataset.chameleonTarget)parent.postMessage({type:'chameleon.navigate',channel:CHANNEL,url:a.dataset.chameleonTarget},'*');});document.addEventListener('keydown',function(e){if(e.key==='Enter'&&e.target.matches('a[role=link]')){e.preventDefault();e.target.click();}});document.addEventListener('submit',function(e){e.preventDefault();});""".replace( + "CHANNEL", json.dumps(channel) + ) + # The immutable captured artifact contains no nonce-authorized scripts. + return ( + "" + + artifact["html"] + + '" + ) + + +if __name__ == "__main__": + value = json.loads(sys.stdin.read(3145728)) + try: + print(json.dumps(capture_direct(value["source"], value["raw"], value["allow_network"]))) + except Residual as exc: + print(json.dumps({"error": exc.code})) diff --git a/orbiters/chameleon/packages/core/chameleon_core/visual_css.py b/orbiters/chameleon/packages/core/chameleon_core/visual_css.py new file mode 100644 index 0000000000000000000000000000000000000000..ce26a11edc697f4c1bdb6bfed145b5175f551b4d --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/visual_css.py @@ -0,0 +1,147 @@ +"""CSS syntax handling for inert, bounded source-style captures.""" + +import json +import hashlib + +import tinycss2 +from tinycss2.ast import URLToken + +from .adaptation_contracts import Residual + +LIMIT = 2097152 + + +def parse(css, inline=False): + try: + nodes = ( + tinycss2.parse_component_value_list(css, skip_comments=True) + if inline + else tinycss2.parse_stylesheet(css, skip_comments=True) + ) + count = 0 + + def check(items, depth=0): + nonlocal count + if depth > 64: + raise Residual("VISUAL_CSS_COMPLEXITY_BUDGET") + for item in items: + count += 1 + if count > 120000: + raise Residual("VISUAL_CSS_COMPLEXITY_BUDGET") + for attr in ("prelude", "content", "arguments"): + children = getattr(item, attr, None) + if children is not None: + check(children, depth + 1) + + check(nodes) + return nodes + except (RecursionError, ValueError) as exc: + raise Residual("VISUAL_CSS_COMPLEXITY_BUDGET") from exc + + +def url_value(token): + if token.type in {"url", "string"}: + return token.value + if token.type == "function" and token.lower_name == "url": + args = [x for x in token.arguments if x.type != "whitespace"] + if len(args) == 1 and args[0].type == "string": + return args[0].value + return None + + +def imported(rule): + if rule.type != "at-rule" or rule.lower_at_keyword != "import": + return None + values = [x for x in rule.prelude if x.type != "whitespace"] + if not values or url_value(values[0]) is None: + return (None, None) + # Layer/supports import semantics need a separate tested reconstruction. + if any(x.type == "function" and x.lower_name in {"layer", "supports"} for x in values[1:]): + return (url_value(values[0]), None) + if any(x.type == "ident" and x.lower_value == "layer" for x in values[1:]): + return (url_value(values[0]), None) + index = rule.prelude.index(values[0]) + return url_value(values[0]), tinycss2.serialize(rule.prelude[index + 1 :]).strip() + + +def references(css, inline=False): + refs = [] + + def walk(nodes): + for item in nodes: + imp = imported(item) + if imp is not None: + if imp[0]: + refs.append((imp[0], "style" if imp[1] is not None else "unsupported_import")) + continue + value = url_value(item) if item.type != "string" else None + if value is not None: + refs.append((value, "binary")) + continue + for attr in ("prelude", "content", "arguments"): + children = getattr(item, attr, None) + if children is not None: + walk(children) + + walk(parse(css, inline)) + return list(dict.fromkeys(refs)) + + +def rewrite(css, resolve, include, inline=False): + nodes = parse(css, inline) + expanded = 0 + image_variables = {} + + def replace(items): + nonlocal expanded + result = [] + for item in items: + if item.type == "error": + continue + value = url_value(item) if item.type != "string" else None + if value is not None: + target = resolve(value) + representation = "url(" + json.dumps(target) + ")" + if not inline and target.startswith('data:image/') and len(target)>1024: + name='--ditto-image-'+hashlib.sha256(target.encode()).hexdigest()[:24] + if name not in image_variables: + image_variables[name]=representation + expanded+=len(representation) + representation='var('+name+')' + expanded+=len(representation) + if expanded>LIMIT: raise Residual('VISUAL_ARTIFACT_BYTE_BUDGET') + result.extend(tinycss2.parse_component_value_list(representation)) + continue + expanded += len(representation) + if expanded > LIMIT: + raise Residual("VISUAL_ARTIFACT_BYTE_BUDGET") + result.append(URLToken(item.source_line, item.source_column, target, representation)) + continue + for attr in ("prelude", "content", "arguments"): + children = getattr(item, attr, None) + if children is not None: + setattr(item, attr, replace(children)) + result.append(item) + return result + + if inline: + value = tinycss2.serialize(replace(nodes)) + else: + parts = [] + size = 0 + for node in nodes: + imp = imported(node) + if imp is not None: + value = include(imp[0]) if imp[0] and imp[1] is not None else "" + if value and imp[1]: + value = "@media " + imp[1] + "{" + value + "}" + else: + value = tinycss2.serialize(replace([node])) + size += len(value.encode()) + if size > LIMIT: + raise Residual("VISUAL_ARTIFACT_BYTE_BUDGET") + parts.append(value) + value = (':root{'+''.join(k+':'+v+';' for k,v in image_variables.items())+'}' if image_variables else '')+"".join(parts) + if len(value.encode()) > LIMIT: + raise Residual("VISUAL_ARTIFACT_BYTE_BUDGET") + return value.replace("<", "\\3c ") diff --git a/orbiters/chameleon/packages/core/chameleon_core/website.py b/orbiters/chameleon/packages/core/chameleon_core/website.py new file mode 100644 index 0000000000000000000000000000000000000000..5023f66a5424de5a944b51e183e3680abbb7945c --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/website.py @@ -0,0 +1,260 @@ +"""Inert website captures and measured, read-only local website counterparts.""" + +import hashlib +from html.parser import HTMLParser +from urllib.parse import urljoin, urlsplit, urlunsplit + +from .adaptation_contracts import Residual +from .contracts import digest + +WEBSITE_KIND = "local-website-reader-v1" +VOID = { + "area", + "base", + "br", + "col", + "embed", + "hr", + "img", + "input", + "link", + "meta", + "param", + "source", + "track", + "wbr", +} +OMIT = {"script", "style", "template", "noscript", "iframe", "object", "svg", "canvas"} +BREAK = { + "p", + "div", + "section", + "article", + "header", + "footer", + "nav", + "main", + "li", + "ul", + "ol", + "blockquote", + "pre", + "tr", + "td", + "th", + "br", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", +} + + +def page_url(base: str, href: str) -> str | None: + """Syntactic canonicalization only; the reader still checks/pins DNS before GET.""" + try: + if not href or len(href) > 2048 or "\\" in href or any(ord(c) <= 32 for c in href): + return None + u = urlsplit(urljoin(base, href)) + if u.scheme != "https" or not u.hostname or u.username or u.password or u.port not in (None, 443): + return None + host = u.hostname.encode("idna").decode("ascii").lower() + if host.endswith("."): + return None + if ":" in host: + host = "[" + host + "]" + target = urlunsplit(("https", host, u.path or "/", u.query, "")) + return target if len(target) <= 2048 else None + except (ValueError, UnicodeError): + return None + + +class Page(HTMLParser): + """Text and observed link extraction, never executable HTML or remote assets.""" + + def __init__(self): + super().__init__(convert_charrefs=True) + self.stack: list[tuple[str, bool]] = [] + self.title = "" + self.headings: list[str] = [] + self.links: list[str] = [] + self.blocks: list[dict] = [] + self.parts: list[str] = [] + self.characters = 0 + self.truncated = False + self.omitted = {"scripts": 0, "forms": 0, "controls": 0, "images": 0} + + def hidden(self): + return bool(self.stack and self.stack[-1][1]) + + def flush(self): + text = " ".join("".join(self.parts).split()) + self.parts = [] + if not text: + return + if len(self.blocks) >= 800 or self.characters + len(text) > 100000: + self.truncated = True + return + tags = [tag for tag, _ in self.stack] + kind = next( + ( + t + for t in reversed(tags) + if t in {"h1", "h2", "h3", "h4", "h5", "h6", "li", "pre", "blockquote"} + ), + "p", + ) + self.blocks.append({"id": len(self.blocks), "kind": kind, "text": text}) + self.characters += len(text) + if kind in {"h1", "h2", "h3"} and len(self.headings) < 50: + self.headings.append(text[:300]) + + def handle_starttag(self, tag, attrs): + attrs = dict(attrs) + if tag in BREAK: + self.flush() + suppressed = self.hidden() or tag in OMIT or "hidden" in attrs or attrs.get("aria-hidden") == "true" + if tag == "script": + self.omitted["scripts"] += 1 + if not suppressed: + if tag == "form": + self.omitted["forms"] += 1 + if tag in {"input", "button", "select", "textarea"}: + self.omitted["controls"] += 1 + if tag == "img": + self.omitted["images"] += 1 + if tag == "a": + href = attrs.get("href") or "" + if ( + href + and len(href) <= 2048 + and href not in self.links + and not href.lower().startswith(("javascript:", "data:", "file:", "vbscript:")) + ): + if len(self.links) < 400: + self.links.append(href) + else: + self.truncated = True + if tag not in VOID: + if len(self.stack) >= 128: + raise Residual("SOURCE_HTML_NESTING_EXCEEDED") + self.stack.append((tag, suppressed)) + + def handle_startendtag(self, tag, attrs): + self.handle_starttag(tag, attrs) + if tag not in VOID: + self.handle_endtag(tag) + + def handle_endtag(self, tag): + if tag in BREAK: + self.flush() + for i in range(len(self.stack) - 1, -1, -1): + if self.stack[i][0] == tag: + del self.stack[i:] + break + + def handle_data(self, data): + if self.hidden(): + return + tags = [tag for tag, _ in self.stack] + if "title" in tags: + self.title = (self.title + data)[:300] + elif "head" not in tags: + self.parts.append(data) + + def result(self, raw: str): + self.close() + self.flush() + return { + "title": " ".join(self.title.split()), + "headings": self.headings, + "links": self.links, + "capture_version": "website-snapshot-v2", + "blocks": self.blocks, + "omitted": self.omitted, + "truncated": self.truncated, + "raw_document_sha256": hashlib.sha256(raw.encode()).hexdigest(), + } + + +def website_copy(evidence): + p = evidence.payload + if p.get("capture_version") != "website-snapshot-v2": + raise Residual("WEBSITE_RECAPTURE_REQUIRED") + source = page_url(evidence.source, evidence.source) or evidence.source + base = p.get("document_base_url", source) + links: list[dict] = [] + for href in p["links"]: + target = page_url(base, href) + if target and target not in [x["url"] for x in links]: + links.append({"url": target, "same_origin": urlsplit(target).netloc == urlsplit(source).netloc}) + page = { + "source": source, + "source_digest": evidence.content_digest, + "captured_at": evidence.captured_at, + "title": p["title"], + "blocks": p["blocks"], + "links": links, + "truncated": p["truncated"], + "omitted": p["omitted"], + "raw_document_sha256": p["raw_document_sha256"], + } + if p.get("visual"): + page["visual"] = p["visual"] + if p.get("document_base_url"): + page["document_base_url"] = p["document_base_url"] + page["fetch_redirects"] = p.get("fetch_redirects", []) + # Exact projection checks. These establish capture fidelity, not backend equivalence. + assert page["blocks"] == p["blocks"] and page["title"] == p["title"] + page["projection_digest"] = digest(page) + return page + + +def website_manifest(evidence): + manifest = { + "kind": WEBSITE_KIND, + "source": evidence.source, + "source_kind": "website", + "authority": evidence.authority, + "source_writes": False, + "supported": [ + "read_captured_content", + "search_captured_pages", + "navigate_saved_pages", + "capture_observed_same_origin_link", + "export_json", + ], + "fidelity": "captured text order, title and canonical observed links; Chameleon reader layout", + "not_reconstructed": [ + "original styling", + "scripts and dynamic content", + "images and media", + "logins", + "forms and purchases", + "hidden backend behavior", + "remote synchronization", + ], + "page_budget": 10, + "data_byte_budget": 1048576, + } + if evidence.payload.get("visual"): + manifest.update( + { + "presentation": "preserve", + "page_budget": 10, + "data_byte_budget": 16777216, + "fidelity": "captured static DOM, CSS and available raster/font assets; no claim of backend equivalence", + "supported": [ + *manifest["supported"], + "source_style_preview", + "mediated_observed_navigation", + "native_details_toggle", + ], + "not_reconstructed": evidence.payload["visual"]["not_reconstructed"], + } + ) + else: + manifest["presentation"] = "reader" + return manifest diff --git a/orbiters/chameleon/packages/core/chameleon_core/website_bundle.py b/orbiters/chameleon/packages/core/chameleon_core/website_bundle.py new file mode 100644 index 0000000000000000000000000000000000000000..045e782b4d32f82606b1491adb47243084034cef --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/website_bundle.py @@ -0,0 +1,76 @@ +"""Inert URL-keyed website evidence. No Git identity, network or execution.""" +import base64 +from hashlib import sha256 +from urllib.parse import urlsplit + +from .contracts import digest + +MAX_FILES = 128 +MAX_FILE_BYTES = 512 * 1024 +MAX_TOTAL_BYTES = 4 * 1024 * 1024 + + +def _url(value): + if not isinstance(value, str) or len(value) > 4096: + raise ValueError('WEBSITE_BUNDLE_URL') + parsed = urlsplit(value) + if (parsed.scheme != 'https' or not parsed.hostname or parsed.username or parsed.password + or parsed.fragment or any(ord(c) < 33 for c in value)): + raise ValueError('WEBSITE_BUNDLE_URL') + return value + + +def create_bundle(entry, resources): + """resources: captured URL -> (exact bytes, observed content type). + + Callers are responsible for acquisition authorization. Digests prove retained + byte identity, not remote authorship, functionality or completeness. + """ + _url(entry) + if not isinstance(resources, dict) or not 1 <= len(resources) <= MAX_FILES: + raise ValueError('WEBSITE_BUNDLE_FILE_BUDGET') + files, total = {}, 0 + for url, resource in resources.items(): + _url(url) + body, media = resource + if not isinstance(body, bytes) or len(body) > MAX_FILE_BYTES: + raise ValueError('WEBSITE_BUNDLE_BYTE_BUDGET') + if (not isinstance(media, str) or not 1 <= len(media) <= 200 + or any(ord(c) < 32 or ord(c) == 127 for c in media)): + raise ValueError('WEBSITE_BUNDLE_MEDIA') + total += len(body) + if total > MAX_TOTAL_BYTES: + raise ValueError('WEBSITE_BUNDLE_BYTE_BUDGET') + files[url] = {'base64': base64.b64encode(body).decode('ascii'), 'bytes': len(body), + 'sha256': sha256(body).hexdigest(), 'content_type': media} + if entry not in files or files[entry]['content_type'].split(';')[0].strip().lower() != 'text/html': + raise ValueError('WEBSITE_BUNDLE_HTML_ENTRY_REQUIRED') + data = {'version': 'captured-website-bundle-v1', 'entry': entry, 'resources': files, + 'provenance': 'supplied-capture-bytes', 'behavior_verified': False} + return {'website': data, 'digest': digest(data)} + + +def verify_bundle(package): + try: + if set(package) != {'website', 'digest'}: + raise ValueError('WEBSITE_BUNDLE_INVALID') + data = package['website'] + if package['digest'] != digest(data): + raise ValueError('WEBSITE_BUNDLE_DIGEST') + records = data['resources'] + if not isinstance(records, dict) or not 1 <= len(records) <= MAX_FILES: + raise ValueError('WEBSITE_BUNDLE_FILE_BUDGET') + decoded = {} + for url, record in records.items(): + if len(record['base64']) > (MAX_FILE_BYTES + 2) // 3 * 4: + raise ValueError('WEBSITE_BUNDLE_BYTE_BUDGET') + body = base64.b64decode(record['base64'], validate=True) + if type(record['bytes']) is not int or len(body) != record['bytes'] or sha256(body).hexdigest() != record['sha256']: + raise ValueError('WEBSITE_BUNDLE_BLOB_DIGEST') + decoded[url] = (body, record['content_type']) + # Canonical rebuild validates all fields and rejects undeclared claims. + if create_bundle(data['entry'], decoded) != package: + raise ValueError('WEBSITE_BUNDLE_INVALID') + return decoded + except (KeyError, TypeError, AttributeError) as exc: + raise ValueError('WEBSITE_BUNDLE_INVALID') from exc diff --git a/orbiters/chameleon/packages/core/chameleon_core/website_bundle_capture.py b/orbiters/chameleon/packages/core/chameleon_core/website_bundle_capture.py new file mode 100644 index 0000000000000000000000000000000000000000..9d27672f6ed5a1627848fe029bc722375bb98e07 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/website_bundle_capture.py @@ -0,0 +1,115 @@ +"""Collect available same-origin scripts/styles without executing source code. + +The caller supplies the existing authorized, bounded fetch function. This is +source replay acquisition, not missing-code synthesis or a completeness claim. +""" +from html.parser import HTMLParser +from urllib.parse import urljoin, urlsplit, urldefrag + +from .website_bundle import create_bundle, MAX_FILE_BYTES, MAX_TOTAL_BYTES, MAX_FILES +from .image_sources import srcset_candidates +from .script_images import MAX_SCRIPT_BYTES, image_references + + +class References(HTMLParser): + def __init__(self): + super().__init__() + self.refs = [] + self.inline_script = None + self.inline_script_bytes = 0 + + def handle_starttag(self, tag, attrs): + attrs = dict(attrs) + if tag == 'script': + if attrs.get('src'): + self.refs.append((attrs['src'], None, True)) + else: + self.inline_script = [] + return + if tag == 'img': + for key in ('src', 'data-src', 'data-original'): + if attrs.get(key): + self.refs.append((attrs[key], None, False)) + if tag in {'img', 'source'}: + self.refs.extend((url, None, False) for url, _ in srcset_candidates(attrs.get('data-srcset') or attrs.get('srcset'))) + if tag == 'link' and 'stylesheet' in attrs.get('rel', '').lower().split() and attrs.get('href'): + self.refs.append((attrs['href'], None, False)) + + def handle_data(self, data): + if self.inline_script is not None: + self.inline_script.append(data) + + def handle_endtag(self, tag): + if tag == 'script' and self.inline_script is not None: + body = ''.join(self.inline_script) + size = len(body.encode('utf-8', errors='ignore')) + if size <= MAX_SCRIPT_BYTES and self.inline_script_bytes + size <= 524288: + self.refs.extend((url, None, False) for url in image_references(body)) + self.inline_script_bytes += size + self.inline_script = None + + +def capture_bundle(entry, raw_html, fetch): + resources = {entry: (raw_html, 'text/html')} + # Validate input before allocating a parser or invoking any fetch. + create_bundle(entry, resources) + parser = References() + parser.feed(raw_html.decode('utf-8', errors='replace')) + origin = urlsplit(entry) + total = len(raw_html) + attempts = 0 + seen = set() + residuals = [] + queue = list(parser.refs) + external_scripts = 0 + script_bytes = 0 + cursor = 0 + while cursor < len(queue): + ref, base, is_script = queue[cursor] + cursor += 1 + base = base or entry + url = urldefrag(urljoin(base, ref))[0] + if url in seen or url == entry: + continue + seen.add(url) + target = urlsplit(url) + if (target.scheme, target.netloc) != (origin.scheme, origin.netloc): + residuals.append({'url': url, 'code': 'CROSS_ORIGIN_NOT_CAPTURED'}) + continue + if attempts >= MAX_FILES - 1: + residuals.append({'url': url, 'code': 'RESOURCE_BUDGET'}) + continue + if is_script and external_scripts >= 8: + residuals.append({'url': url, 'code': 'SCRIPT_REQUEST_BUDGET'}) + continue + if is_script: + external_scripts += 1 + attempts += 1 + try: + body, media = fetch(url) + if not isinstance(body, bytes) or len(body) > MAX_FILE_BYTES or total + len(body) > MAX_TOTAL_BYTES: + residuals.append({'url': url, 'code': 'BYTE_BUDGET'}) + continue + candidate = {**resources, url: (body, media)} + create_bundle(entry, candidate) + resources = candidate + total += len(body) + if is_script: + normalized_media = media.split(';', 1)[0].strip().lower() if isinstance(media, str) else '' + if normalized_media not in {'text/javascript', 'application/javascript', 'application/ecmascript', 'text/ecmascript'}: + residuals.append({'url': url, 'code': 'SCRIPT_MEDIA_NOT_SUPPORTED'}) + continue + if len(body) > MAX_SCRIPT_BYTES or script_bytes + len(body) > 524288: + residuals.append({'url': url, 'code': 'SCRIPT_SCAN_BYTE_BUDGET'}) + continue + try: + script_text = body.decode('utf-8') + except UnicodeError: + residuals.append({'url': url, 'code': 'SCRIPT_ENCODING_NOT_SUPPORTED'}) + continue + script_bytes += len(body) + queue.extend((image_url, url, False) for image_url in image_references(script_text)) + except Exception: + residuals.append({'url': url, 'code': 'RESOURCE_UNAVAILABLE'}) + return {'package': create_bundle(entry, resources), 'residuals': residuals, + 'fetch_attempts': attempts, 'coverage': 'bounded-html-css-and-static-script-image-references'} diff --git a/orbiters/chameleon/packages/core/chameleon_core/website_bundle_worker.py b/orbiters/chameleon/packages/core/chameleon_core/website_bundle_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..62380588df8280019e77f6d8c23ffbd7ae937671 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/website_bundle_worker.py @@ -0,0 +1,53 @@ +"""Trusted acquisition helper. Captured target code is never host-executed.""" +import base64 +import json +import os +from pathlib import Path +import subprocess +import sys + +from .adaptation_contracts import Residual +from .website_bundle import MAX_FILE_BYTES, create_bundle, verify_bundle + + +def acquire(entry, raw_html): + create_bundle(entry, {entry: (raw_html, 'text/html')}) + environment = dict(os.environ) + environment['PYTHONPATH'] = str(Path(__file__).resolve().parents[1]) + try: + result = subprocess.run( + [sys.executable, '-m', 'chameleon_core.website_bundle_worker'], + input=json.dumps({'entry': entry, 'html': base64.b64encode(raw_html).decode('ascii')}), + text=True, capture_output=True, timeout=20, check=False, env=environment) + except subprocess.TimeoutExpired as exc: + raise Residual('WEBSITE_ACQUISITION_TIMEOUT') from exc + if result.returncode: + raise Residual('WEBSITE_ACQUISITION_WORKER_FAILED') + try: + value = json.loads(result.stdout) + verify_bundle(value['package']) + if value['package']['website']['entry'] != entry: + raise ValueError('entry mismatch') + if verify_bundle(value['package'])[entry][0] != raw_html: + raise ValueError('source mismatch') + return value + except (ValueError, KeyError, TypeError) as exc: + raise Residual('WEBSITE_ACQUISITION_INVALID_RESULT') from exc + + +def main(): + from .intake import fetch_asset_direct + from .website_bundle_capture import capture_bundle + limit = MAX_FILE_BYTES * 2 + 8192 + raw = sys.stdin.read(limit + 1) + if len(raw) > limit: + raise ValueError('input budget') + value = json.loads(raw) + html = base64.b64decode(value['html'], validate=True) + result = capture_bundle(value['entry'], html, + lambda url: fetch_asset_direct(url, script_resources=True)) + print(json.dumps(result)) + + +if __name__ == '__main__': + main() diff --git a/orbiters/chameleon/packages/core/chameleon_core/website_captures.py b/orbiters/chameleon/packages/core/chameleon_core/website_captures.py new file mode 100644 index 0000000000000000000000000000000000000000..a0a609c08c24920dc7adc6ff4047938fe8744c3a --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/website_captures.py @@ -0,0 +1,182 @@ +"""Durable capture-to-counterpart completion, independent of any open browser.""" + +from pydantic import Field +from sqlalchemy import select, text + +from .adaptation_contracts import Intake, Residual +from .adaptation_service import Adaptations, append +from .contracts import StrictRecord, digest +from .db import AdaptationJob, LocalTwin, WebsiteCapture, uid +from .service import Failure, owned +from .twins import AttachPage, Twins +from .website import WEBSITE_KIND, page_url + + +class CaptureRequest(StrictRecord): + source: str = Field(min_length=1, max_length=2048) + expected_revision: int = Field(ge=0, le=100) + expected_surface_digest: str | None = Field(default=None, pattern=r"^[a-f0-9]{64}$") + + +class WebsiteCaptures: + def __init__(self, sessions, limits=None): + self.sessions = sessions + self.adaptations = Adaptations(sessions, limits=limits) + self.twins = Twins(sessions) + + @staticmethod + def view(row): + return { + "id": row.id, + "job_id": row.job, + "request_key": row.creation_key, + "source": row.source, + "status": row.status, + "residual": row.residual, + "receipt": row.receipt, + } + + def start(self, owner, twin_id, request: CaptureRequest, key: str): + if not 1 <= len(key) <= 100 or not key.isascii() or not all(c.isalnum() or c in "-_" for c in key): + raise Failure("INVALID_IDEMPOTENCY_KEY", 400) + request_hash = digest(request.model_dump(exclude_none=True)) + with self.sessions.begin() as s: + # Match global-before-owner-before-twin admission order. Job and consumer commit atomically. + s.execute(text("SELECT pg_advisory_xact_lock(7162101)")) + s.execute(text("SELECT pg_advisory_xact_lock(hashtext(:owner))"), {"owner": owner}) + twin = owned(s, LocalTwin, twin_id, owner, lock=True) + if twin.manifest["kind"] != WEBSITE_KIND: + raise Failure("WEBSITE_TWIN_REQUIRED") + prior = s.scalar( + select(WebsiteCapture).where( + WebsiteCapture.twin == twin_id, WebsiteCapture.creation_key == key + ) + ) + if prior: + if prior.request_digest != request_hash: + raise Failure("IDEMPOTENCY_CONFLICT") + return self.view(prior) + if request.expected_surface_digest is not None: + from .surface_graph import SurfaceGraphs + + graph = SurfaceGraphs.build_in(s, owner, twin) + if graph["surface_digest"] != request.expected_surface_digest: + raise Failure("SURFACE_EVIDENCE_CHANGED_RELOAD") + if not any(a["source"] == request.source for a in graph["actions"]): + raise Failure("SURFACE_CAPTURE_ACTION_NOT_ELIGIBLE") + if twin.revision != request.expected_revision: + raise Failure("TWIN_REVISION_CHANGED_RELOAD") + if s.scalar( + select(WebsiteCapture.id).where( + WebsiteCapture.twin == twin_id, WebsiteCapture.status == "PENDING" + ) + ): + raise Failure("WEBSITE_CAPTURE_ALREADY_PENDING") + target = page_url(twin.manifest["source"], request.source) + if target != request.source or not any( + link["same_origin"] and link["url"] == target + for p in twin.data["pages"] + for link in p["links"] + ): + raise Failure("WEBSITE_OBSERVED_SAME_ORIGIN_LINK_REQUIRED") + if any(p["source"] == target for p in twin.data["pages"]): + raise Failure("WEBSITE_PAGE_ALREADY_CAPTURED") + if len(twin.data["pages"]) >= twin.manifest["page_budget"]: + raise Failure("WEBSITE_PAGE_BUDGET", 429) + job_id = self.adaptations.create_in( + s, owner, Intake(source=target, presentation=twin.manifest.get("presentation", "reader")) + ) + if s.get(AdaptationJob, job_id).agent != twin.agent: + raise Failure("WEBSITE_AGENT_IDENTITY_CHANGED") + capture = WebsiteCapture( + owner=owner, + twin=twin_id, + job=job_id, + source=target, + creation_key=key, + request_digest=request_hash, + ) + s.add(capture) + s.flush() + return self.view(capture) + + def coverage(self, owner, twin_id): + """Read-only frontier from held evidence, not inferred or automatically fetched URLs.""" + with self.sessions() as s: + twin = owned(s, LocalTwin, twin_id, owner) + if twin.manifest["kind"] != WEBSITE_KIND: + raise Failure("WEBSITE_TWIN_REQUIRED") + pages = twin.data["pages"] + captured = {p["source"] for p in pages} + attempts = s.scalars(select(WebsiteCapture).where( + WebsiteCapture.twin == twin_id, WebsiteCapture.owner == owner + ).order_by(WebsiteCapture.created, WebsiteCapture.id)).all() + latest = {row.source: row for row in attempts} + discovered = {} + for page in pages: + for link in page["links"]: + if link["same_origin"] and link["url"] not in captured: + discovered.setdefault(link["url"], []).append(page["source"]) + remaining = max(0, min(10, twin.manifest["page_budget"]) - len(pages)) + pending = any(row.status == "PENDING" for row in attempts) + frontier = [] + for url, parents in discovered.items(): + prior = latest.get(url) + status = prior.status if prior else "DISCOVERED" + frontier.append({"source": url, "observed_on": sorted(set(parents)), + "status": status, "residual": prior.residual if prior else None, + "eligible": remaining > 0 and not pending and prior is None}) + return {"twin_id": twin_id, "revision": twin.revision, + "page_budget": min(10, twin.manifest["page_budget"]), + "remaining_pages": remaining, "data_byte_budget": twin.manifest["data_byte_budget"], + "pages": [{"source": p["source"], "coverage": "STATIC_CAPTURE", + "behavior": "NOT_VERIFIED"} for p in pages], + "frontier": frontier, "pending": pending, + "next_source": next((p["source"] for p in frontier if p["eligible"]), None), + "scope": "Observed static pages and links; not a complete executable site clone"} + + def cancel(self, owner, ident): + with self.sessions.begin() as s: + capture = owned(s, WebsiteCapture, ident, owner, lock=True) + if capture.status != "PENDING": + return self.view(capture) + job = owned(s, AdaptationJob, capture.job, owner, lock=True) + if job.status in {"QUEUED", "RUNNING"}: + job.status, job.lease_token = "CANCELLED", uid() + append(job, "job.cancelled", {"consumer_cancelled": True, "inflight_read_may_finish": True}) + capture.status = "CANCELLED" + capture.residual = "CAPTURE_CANCELLED_BEFORE_ATTACHMENT" + return self.view(capture) + + def reconcile(self): + """One terminal job attachment and its completion marker share a transaction. + + No external calls occur here. A process exit rolls back both; the next worker + can retry. Cancellation and competing workers serialize on the capture row. + """ + with self.sessions.begin() as s: + capture = s.scalar( + select(WebsiteCapture) + .join(AdaptationJob, WebsiteCapture.job == AdaptationJob.id) + .where(WebsiteCapture.status == "PENDING", AdaptationJob.status.notin_(["QUEUED", "RUNNING"])) + .order_by(WebsiteCapture.created) + .with_for_update(skip_locked=True, of=WebsiteCapture) + .limit(1) + ) + if capture is None: + return False + job = owned(s, AdaptationJob, capture.job, capture.owner, lock=True) + if job.status != "VERIFIED": + capture.status = "CANCELLED" if job.status == "CANCELLED" else "FAILED" + capture.residual = job.residual or job.status + return True + twin = owned(s, LocalTwin, capture.twin, capture.owner, lock=True) + try: + receipt = self.twins.attach_page_in( + s, capture.owner, twin.id, AttachPage(job_id=job.id, expected_revision=twin.revision) + ) + except (Failure, Residual) as exc: + capture.status, capture.residual = "FAILED", exc.code + else: + capture.status, capture.receipt = "COMPLETE", receipt + return True diff --git a/orbiters/chameleon/packages/core/chameleon_core/windows_job.py b/orbiters/chameleon/packages/core/chameleon_core/windows_job.py new file mode 100644 index 0000000000000000000000000000000000000000..d6b48854f7e80ae3fd4091a78aa6faddd6f4fb77 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/windows_job.py @@ -0,0 +1,276 @@ +"""Resource accounting for a trusted browser driver and only its process tree. + +This is not a filesystem or network sandbox. Chromium's OS sandbox, separate +profile, offline routing and CSP are additional independent browser boundaries. +The trusted child must wait on stdin before launching any descendant process. +""" + +import ctypes +import os +import subprocess +import threading +import time +from ctypes import wintypes + + +class BasicLimits(ctypes.Structure): + _fields_ = [ + ("PerProcessUserTimeLimit", ctypes.c_longlong), + ("PerJobUserTimeLimit", ctypes.c_longlong), + ("LimitFlags", wintypes.DWORD), + ("MinimumWorkingSetSize", ctypes.c_size_t), + ("MaximumWorkingSetSize", ctypes.c_size_t), + ("ActiveProcessLimit", wintypes.DWORD), + ("Affinity", ctypes.c_size_t), + ("PriorityClass", wintypes.DWORD), + ("SchedulingClass", wintypes.DWORD), + ] + + +class IOCounts(ctypes.Structure): + _fields_ = [ + (name, ctypes.c_ulonglong) + for name in ( + "ReadOperationCount", + "WriteOperationCount", + "OtherOperationCount", + "ReadTransferCount", + "WriteTransferCount", + "OtherTransferCount", + ) + ] + + +class ExtendedLimits(ctypes.Structure): + _fields_ = [ + ("BasicLimitInformation", BasicLimits), + ("IoInfo", IOCounts), + ("ProcessMemoryLimit", ctypes.c_size_t), + ("JobMemoryLimit", ctypes.c_size_t), + ("PeakProcessMemoryUsed", ctypes.c_size_t), + ("PeakJobMemoryUsed", ctypes.c_size_t), + ] + + +class Accounting(ctypes.Structure): + _fields_ = [ + (name, ctypes.c_longlong) + for name in ( + "TotalUserTime", + "TotalKernelTime", + "ThisPeriodTotalUserTime", + "ThisPeriodTotalKernelTime", + ) + ] + [ + (name, wintypes.DWORD) + for name in ( + "TotalPageFaultCount", + "TotalProcesses", + "ActiveProcesses", + "TotalTerminatedProcesses", + ) + ] + + +def run_bounded(command, payload, cwd, *, wall_seconds=35, cpu_seconds=25, + memory_bytes=1073741824, max_output_bytes=8 * 1024 * 1024): + import sys + if sys.platform == 'linux': + from .linux_job import run_bounded as linux_run + return linux_run(command, payload, cwd, wall_seconds=wall_seconds, + cpu_seconds=cpu_seconds, memory_bytes=memory_bytes, + max_output_bytes=max_output_bytes) + if os.name != "nt": + raise RuntimeError("WINDOWS_JOB_RUNTIME_REQUIRED; no unbounded fallback") + if not 0 < wall_seconds <= 60 or not 0 < cpu_seconds <= 40 or not 0 < memory_bytes <= 1073741824: + raise ValueError("Invalid browser process budget") + if type(max_output_bytes) is not int or not 0 < max_output_bytes <= 8 * 1024 * 1024: + raise ValueError("Invalid process output budget") + kernel = ctypes.WinDLL("kernel32", use_last_error=True) + kernel.CreateJobObjectW.argtypes = [ctypes.c_void_p, wintypes.LPCWSTR] + kernel.CreateJobObjectW.restype = wintypes.HANDLE + kernel.SetInformationJobObject.argtypes = [wintypes.HANDLE, ctypes.c_int, ctypes.c_void_p, wintypes.DWORD] + kernel.SetInformationJobObject.restype = wintypes.BOOL + kernel.QueryInformationJobObject.argtypes = [ + wintypes.HANDLE, + ctypes.c_int, + ctypes.c_void_p, + wintypes.DWORD, + ctypes.c_void_p, + ] + kernel.QueryInformationJobObject.restype = wintypes.BOOL + kernel.AssignProcessToJobObject.argtypes = [wintypes.HANDLE, wintypes.HANDLE] + kernel.AssignProcessToJobObject.restype = wintypes.BOOL + kernel.OpenProcess.argtypes = [wintypes.DWORD, wintypes.BOOL, wintypes.DWORD] + kernel.OpenProcess.restype = wintypes.HANDLE + kernel.TerminateJobObject.argtypes = [wintypes.HANDLE, wintypes.UINT] + kernel.TerminateJobObject.restype = wintypes.BOOL + kernel.CloseHandle.argtypes = [wintypes.HANDLE] + kernel.CloseHandle.restype = wintypes.BOOL + handle = kernel.CreateJobObjectW(None, None) + if not handle: + raise OSError("Cannot create dedicated browser job") + process = None + started = time.monotonic() + try: + limits = ExtendedLimits() + limits.BasicLimitInformation.LimitFlags = 0x2000 | 0x200 | 0x8 | 0x4 | 0x400 + limits.BasicLimitInformation.ActiveProcessLimit = 24 + limits.BasicLimitInformation.PerJobUserTimeLimit = int(cpu_seconds * 10000000) + limits.JobMemoryLimit = memory_bytes + if not kernel.SetInformationJobObject(handle, 9, ctypes.byref(limits), ctypes.sizeof(limits)): + raise OSError("Cannot set dedicated browser job limits") + env = { + key: os.environ[key] + for key in ( + "SystemRoot", + "WINDIR", + "PATH", + "TEMP", + "TMP", + "LOCALAPPDATA", + "USERPROFILE", + ) + if key in os.environ + } + env["NODE_NO_WARNINGS"] = "1" + process = subprocess.Popen( + command, + cwd=cwd, + env=env, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + creationflags=subprocess.CREATE_NO_WINDOW, + ) + process_handle = kernel.OpenProcess(0x0100 | 0x0001, False, process.pid) + assigned = process_handle and kernel.AssignProcessToJobObject(handle, process_handle) + if process_handle: + kernel.CloseHandle(process_handle) + if not assigned: + process.kill() + raise OSError("Cannot isolate browser process tree; no fallback") + timed_out, cpu_exhausted = False, False + streams = [bytearray(), bytearray()] + errors: list[Exception] = [] + output_exhausted = threading.Event() + output_lock = threading.Lock() + captured_bytes = 0 + + def write_input(): + assert process.stdin is not None + try: + process.stdin.write(payload.encode("utf-8")) + process.stdin.flush() + except BrokenPipeError: + pass # Early child exit is represented by its exit status. + except (OSError, ValueError) as exc: + errors.append(exc) + finally: + try: + process.stdin.close() + except BrokenPipeError: + pass + + def read_output(pipe, index): + nonlocal captured_bytes + try: + while chunk := pipe.read1(4096): + with output_lock: + remaining = max_output_bytes - captured_bytes + streams[index].extend(chunk[:remaining]) + captured_bytes += min(remaining, len(chunk)) + if len(chunk) > remaining: + output_exhausted.set() + return + except (OSError, ValueError) as exc: + errors.append(exc) + finally: + pipe.close() + + readers = [threading.Thread(target=write_input, daemon=True)] + [ + threading.Thread(target=read_output, args=(pipe, index), daemon=True) + for index, pipe in enumerate((process.stdout, process.stderr)) + ] + for reader in readers: + reader.start() + # The native CPU limit is periodically enforced, not an immediate timer. + # Observe the complete job and enforce it here as well as in the kernel. + while any(reader.is_alive() for reader in readers) or process.poll() is None: + if output_exhausted.is_set(): + kernel.TerminateJobObject(handle, 143) + break + accounting = Accounting() + if not kernel.QueryInformationJobObject( + handle, 1, ctypes.byref(accounting), ctypes.sizeof(accounting), None + ): + raise OSError("Cannot monitor dedicated browser CPU") + if accounting.TotalUserTime >= cpu_seconds * 10000000: + cpu_exhausted = True + kernel.TerminateJobObject(handle, 142) + break + if time.monotonic() - started >= wall_seconds: + timed_out = True + kernel.TerminateJobObject(handle, 124) + break + time.sleep(0.02) + # Even when the child exits immediately after overflowing, retain failure. + if output_exhausted.is_set(): + kernel.TerminateJobObject(handle, 143) + for reader in readers: + reader.join(timeout=5) + process.wait(timeout=5) + if any(reader.is_alive() for reader in readers) or errors: + raise OSError("Cannot collect dedicated browser process output") + stdout, stderr = (bytes(stream).decode("utf-8", errors="replace") for stream in streams) + # Kill descendants of this dedicated job even if its driver already exited. + if not kernel.TerminateJobObject(handle, 0): + raise OSError("Cannot terminate dedicated browser process tree") + accounting, measured = Accounting(), ExtendedLimits() + if not kernel.QueryInformationJobObject( + handle, 1, ctypes.byref(accounting), ctypes.sizeof(accounting), None + ): + raise OSError("Cannot account dedicated browser job") + cleanup_deadline = time.monotonic() + 5 + while accounting.ActiveProcesses: + if time.monotonic() >= cleanup_deadline: + raise OSError("Dedicated browser descendants remain active") + time.sleep(0.02) + if not kernel.QueryInformationJobObject( + handle, 1, ctypes.byref(accounting), ctypes.sizeof(accounting), None + ): + raise OSError("Cannot verify browser process cleanup") + if not kernel.QueryInformationJobObject( + handle, 9, ctypes.byref(measured), ctypes.sizeof(measured), None + ): + raise OSError("Cannot account dedicated browser memory") + return { + "returncode": process.returncode, + "timed_out": timed_out, + "cpu_budget_exhausted": cpu_exhausted, + "output_budget_exhausted": output_exhausted.is_set(), + "captured_output_bytes": captured_bytes, + "stdout": stdout, + "stderr": stderr, + "wall_seconds": round(time.monotonic() - started, 6), + "job_cpu_seconds": (accounting.TotalUserTime + accounting.TotalKernelTime) / 10000000, + "reported_peak_job_memory_bytes": measured.PeakJobMemoryUsed, + "memory_counter_note": "Native Job Object peak counter, not resident memory; the limit control observed an over-limit peak on a rejected allocation.", + "configured_job_memory_bytes": measured.JobMemoryLimit, + "configured_limit_flags": measured.BasicLimitInformation.LimitFlags, + "job_processes": accounting.TotalProcesses, + "remaining_job_processes": accounting.ActiveProcesses, + "limits": { + "wall_seconds": wall_seconds, + "user_cpu_seconds": cpu_seconds, + "memory_bytes": memory_bytes, + "processes": 24, + "output_bytes": max_output_bytes, + }, + "process_tree_terminated": True, + } + finally: + if process and process.poll() is None: + kernel.TerminateJobObject(handle, 125) + process.wait(timeout=5) + kernel.CloseHandle(handle) diff --git a/orbiters/chameleon/packages/core/chameleon_core/worker_health.py b/orbiters/chameleon/packages/core/chameleon_core/worker_health.py new file mode 100644 index 0000000000000000000000000000000000000000..103dcffb5baada04dc26b0f923a0eb1553c2bda1 --- /dev/null +++ b/orbiters/chameleon/packages/core/chameleon_core/worker_health.py @@ -0,0 +1,110 @@ +"""Recent worker reports, not a claim that a process is presently alive.""" + +from dataclasses import asdict +from datetime import timedelta + +from sqlalchemy import func, select, update +from sqlalchemy.dialects.postgresql import insert +from sqlalchemy.exc import SQLAlchemyError + +from .contracts import digest +from .db import WorkerPulse, uid + +FRESH_SECONDS = 30 + + +def configuration(settings): + return digest( + { + "contract": "worker-health-v1", + "profile": settings.profile, + "origin": settings.origin, + "base_path": settings.base_path, + "limits": asdict(settings.limits), + } + ) + + +class WorkerSuperseded(RuntimeError): + pass + + +class WorkerHealth: + def __init__(self, sessions, settings): + self.sessions = sessions + self.slot = settings.worker_slot + self.configuration = configuration(settings) + self.generation = uid() + + def register(self): + with self.sessions.begin() as s: + values = { + "slot": self.slot, + "generation": self.generation, + "configuration": self.configuration, + "state": "starting", + "seen": func.clock_timestamp(), + } + s.execute( + insert(WorkerPulse) + .values(**values) + .on_conflict_do_update(index_elements=[WorkerPulse.slot], set_=values) + ) + + def publish(self, state): + if state not in {"working", "idle", "retrying", "stopped", "failed"}: + raise ValueError("Invalid worker state") + with self.sessions.begin() as s: + result = s.execute( + update(WorkerPulse) + .where(WorkerPulse.slot == self.slot, WorkerPulse.generation == self.generation) + .values(state=state, seen=func.clock_timestamp()) + ) + if result.rowcount != 1: + raise WorkerSuperseded("WORKER_SLOT_REPLACED") + + def best_effort(self, state): + try: + self.publish(state) + except (SQLAlchemyError, WorkerSuperseded): + pass + + def report(self): + try: + with self.sessions() as s: + s.connection(execution_options={"isolation_level": "REPEATABLE READ"}) + timestamp = s.scalar(select(func.now())) + recent = list( + s.scalars( + select(WorkerPulse).where( + WorkerPulse.seen > timestamp - timedelta(seconds=FRESH_SECONDS) + ) + ) + ) + active = [r for r in recent if r.state not in {"stopped", "failed"}] + mismatched = any(r.configuration != self.configuration for r in active) + matching = [ + r for r in active if r.configuration == self.configuration and r.state in {"working", "idle"} + ] + code = ( + "WORKER_CONFIGURATION_MISMATCH" + if mismatched + else "RECENT_WORKER_REPORT" + if matching + else "NO_RECENT_WORKER_REPORT" + ) + return { + "status": "ready" if matching and not mismatched else "not_ready", + "code": code, + "recent_compatible_workers": len(matching), + "freshness_seconds": FRESH_SECONDS, + "process_liveness_proven": False, + } + except SQLAlchemyError: + return { + "status": "not_ready", + "code": "HEALTH_STORE_UNAVAILABLE", + "recent_compatible_workers": 0, + "freshness_seconds": FRESH_SECONDS, + "process_liveness_proven": False, + } diff --git a/orbiters/chameleon/pnpm-lock.yaml b/orbiters/chameleon/pnpm-lock.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ed31f9a5943a8c0a0549458e0f1e3336891ed2f4 --- /dev/null +++ b/orbiters/chameleon/pnpm-lock.yaml @@ -0,0 +1,758 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + react: + specifier: 19.3.0 + version: 19.3.0 + react-dom: + specifier: 19.3.0 + version: 19.3.0(react@19.3.0) + devDependencies: + '@playwright/test': + specifier: 1.63.0 + version: 1.63.0 + '@types/react': + specifier: 19.3.0 + version: 19.3.0 + '@types/react-dom': + specifier: 19.3.0 + version: 19.3.0(@types/react@19.3.0) + '@vitejs/plugin-react': + specifier: 6.1.1 + version: 6.1.1(vite@8.3.0) + typescript: + specifier: 7.0.2 + version: 7.0.2 + vite: + specifier: 8.3.0 + version: 8.3.0 + +packages: + + '@oxc-project/types@0.150.0': + resolution: {integrity: sha512-rDS5/31E9HfPl/CIzGrn0DOlvBbXFseQ5URJ9sYMfstbKLD/c6Gm9vmRzRGDdAXyOIL4zmO37lc9RIwYqVruZw==} + + '@playwright/test@1.63.0': + resolution: {integrity: sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==} + engines: {node: '>=20'} + hasBin: true + + '@rolldown/binding-android-arm-eabi@1.2.9': + resolution: {integrity: sha512-tNISae1QEf/vkb3xkRcjV5SEdzPE97We5IVaa2Z8jSszQPZ8U60B/YCYpw4QI7VidYsBtKavczXf+DyDs9WGxw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.2.9': + resolution: {integrity: sha512-YC8YsI30o606GTZi0VyzYlsDKFP8W61i/QzayHDkLbNEz/IShqAmTa+hsJRj13xTHA0H+6fk4b2UmGn+Q/cMlg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.2.9': + resolution: {integrity: sha512-IwhlH3qK5urrY8hZiEgGkHKEFN901p/p2bjxCxJlr4GyNnF7wYpUvK+Y43uaRYuC4hpfjzbR3SJC3arX1jGvmw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.2.9': + resolution: {integrity: sha512-XxpJfVzFh+jilRxIXUqcfYAYcunIc/XEzIizsOL1fcJee5Sf7H3mH8WlLmfHfluz5amqR88QQo9izKtmMlavAw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.2.9': + resolution: {integrity: sha512-kSfvhmgeWyfkbT3p/1s5vSgboogoah2zkm9fX2zjg2hHxSV7T4KhMWRUUaRk4OXNqoD3QAUeRqLcs1aZOK4U1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.2.9': + resolution: {integrity: sha512-1RVzG17pxqbTfYLC352JlLt6kKLG+6Hr30n8DlIJqsnV5luUDd2Qdx9Ayw1Cabfyb1K9k0jXEZ7evxkRoT+uiw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.2.9': + resolution: {integrity: sha512-BXqPvZ2drqVD+/Z8UpKwcs4Mp7grM+eGFku4CAEKrEtcbAsUpzREphK1sogCRZGreVPiMkiiBtw0n3TPteuqvw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.2.9': + resolution: {integrity: sha512-11vWvo8YDwLzukt27J3aYDWU+gg2P7J+ZOmiJ0hkF5BXZDW7pVya7r40MXDy6ya0i9KamoENSVKIugvJNgFXIA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.2.9': + resolution: {integrity: sha512-a1tijMkdwsIARtc0F39ApURROkf3NwqinI6TOiSSWCTR7dT96dffNvMUtDHnq64wKNTIZOIlzKrFvvFUznJiyw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.2.9': + resolution: {integrity: sha512-x6SQNdAvv4c3hWqTMaWuawzMX9myaCs/yEmlGsxJzkdClnHW7FbrjQuSiRDhuSYzEYoEMhsaJy9qHG/XNemJPQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.2.9': + resolution: {integrity: sha512-9s0AZ8BFK5/n7B/TBoa2yJE3gI3KURrbXcPBlsAsvjU4VeJKgE90y1YtNxyEUIcHPQkg6/yfF3qihUrcM/Kf0Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.2.9': + resolution: {integrity: sha512-P7VWAmV+WdJluH7ovnRGoiv2i8To7GAZ+kGzfGup635cyL7SyYl3lSUaA3Gp5THf0n/Co5EyEqb2zbqq+nMOHQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.2.9': + resolution: {integrity: sha512-1qixtsE4BK8h+yS3BfmZ09UhA7O/N4IACva6YBr7EBvCJraByTuRcgOTaiA62Tm0vey3UcKXLOaoGHtYmNGEVg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-win32-arm64-msvc@1.2.9': + resolution: {integrity: sha512-ok8IQjcEPs1AKZfuEUznVBrJw+gK4soq+bx8b1X2XoMqVClarc1q5JDmVtWXY1xfr6ZuHTAsPXHTgTrqKTZeww==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.2.9': + resolution: {integrity: sha512-Ip2mXoU0hM0boq3Rf+ekuT653OROSo6aSYcPT1VHE4q52KvyxgFkQgrgb/IEsxOuvQ2fZZbs8khJAyCEPM24/g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@types/react-dom@19.3.0': + resolution: {integrity: sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==} + peerDependencies: + '@types/react': ^19.3.0 + + '@types/react@19.3.0': + resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==} + + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + + '@vitejs/plugin-react@6.1.1': + resolution: {integrity: sha512-yxLaQV9gkhS8ezJqCM6+ndU7mDY6gqAg75NQ+0IjwEI8IYOmQCgkRwHKVSfWXW076DsqMo0Dk+0FK1U+M5RgFw==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@rolldown/plugin-babel': ^0.1.7 || ^0.2.0 + babel-plugin-react-compiler: ^1.0.0 + oxc-transform-react: ^0.145.0 + vite: ^8.0.0 + peerDependenciesMeta: + '@rolldown/plugin-babel': + optional: true + babel-plugin-react-compiler: + optional: true + oxc-transform-react: + optional: true + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + + nanoid@3.3.19: + resolution: {integrity: sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + playwright-core@1.63.0: + resolution: {integrity: sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==} + engines: {node: '>=20'} + hasBin: true + + playwright@1.63.0: + resolution: {integrity: sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==} + engines: {node: '>=20'} + hasBin: true + + postcss@8.5.28: + resolution: {integrity: sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==} + engines: {node: ^10 || ^12 || >=14} + + react-dom@19.3.0: + resolution: {integrity: sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==} + peerDependencies: + react: ^19.3.0 + + react@19.3.0: + resolution: {integrity: sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==} + engines: {node: '>=0.10.0'} + + rolldown@1.2.9: + resolution: {integrity: sha512-hx/Pv0N1haXRb11qkfnK5MXB/iqr7i0yjWQqmO9uHqZpBgQSqzc8UsSnEpalsh+j1I8qQ2CkXAkJC8Br3dKSlg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + scheduler@0.28.0: + resolution: {integrity: sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true + + vite@8.3.0: + resolution: {integrity: sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.7.1 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + +snapshots: + + '@oxc-project/types@0.150.0': {} + + '@playwright/test@1.63.0': + dependencies: + playwright: 1.63.0 + + '@rolldown/binding-android-arm-eabi@1.2.9': + optional: true + + '@rolldown/binding-android-arm64@1.2.9': + optional: true + + '@rolldown/binding-darwin-arm64@1.2.9': + optional: true + + '@rolldown/binding-darwin-x64@1.2.9': + optional: true + + '@rolldown/binding-freebsd-x64@1.2.9': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.2.9': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.2.9': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.2.9': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.2.9': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.2.9': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.2.9': + optional: true + + '@rolldown/binding-linux-x64-musl@1.2.9': + optional: true + + '@rolldown/binding-openharmony-arm64@1.2.9': + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.2.9': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.2.9': + optional: true + + '@rolldown/pluginutils@1.0.1': {} + + '@types/react-dom@19.3.0(@types/react@19.3.0)': + dependencies: + '@types/react': 19.3.0 + + '@types/react@19.3.0': + dependencies: + csstype: 3.2.3 + + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + + '@vitejs/plugin-react@6.1.1(vite@8.3.0)': + dependencies: + '@rolldown/pluginutils': 1.0.1 + vite: 8.3.0 + + csstype@3.2.3: {} + + detect-libc@2.1.2: {} + + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + + fsevents@2.3.3: + optional: true + + lightningcss-android-arm64@1.33.0: + optional: true + + lightningcss-darwin-arm64@1.33.0: + optional: true + + lightningcss-darwin-x64@1.33.0: + optional: true + + lightningcss-freebsd-x64@1.33.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + + lightningcss-linux-arm64-musl@1.33.0: + optional: true + + lightningcss-linux-x64-gnu@1.33.0: + optional: true + + lightningcss-linux-x64-musl@1.33.0: + optional: true + + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + + lightningcss-win32-x64-msvc@1.33.0: + optional: true + + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + + nanoid@3.3.19: {} + + picocolors@1.1.1: {} + + picomatch@4.0.7: {} + + playwright-core@1.63.0: {} + + playwright@1.63.0: + dependencies: + playwright-core: 1.63.0 + + postcss@8.5.28: + dependencies: + nanoid: 3.3.19 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + react-dom@19.3.0(react@19.3.0): + dependencies: + react: 19.3.0 + scheduler: 0.28.0 + + react@19.3.0: {} + + rolldown@1.2.9: + dependencies: + '@oxc-project/types': 0.150.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.2.9 + '@rolldown/binding-android-arm64': 1.2.9 + '@rolldown/binding-darwin-arm64': 1.2.9 + '@rolldown/binding-darwin-x64': 1.2.9 + '@rolldown/binding-freebsd-x64': 1.2.9 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.9 + '@rolldown/binding-linux-arm64-gnu': 1.2.9 + '@rolldown/binding-linux-arm64-musl': 1.2.9 + '@rolldown/binding-linux-ppc64-gnu': 1.2.9 + '@rolldown/binding-linux-s390x-gnu': 1.2.9 + '@rolldown/binding-linux-x64-gnu': 1.2.9 + '@rolldown/binding-linux-x64-musl': 1.2.9 + '@rolldown/binding-openharmony-arm64': 1.2.9 + '@rolldown/binding-win32-arm64-msvc': 1.2.9 + '@rolldown/binding-win32-x64-msvc': 1.2.9 + + scheduler@0.28.0: {} + + source-map-js@1.2.1: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 + + vite@8.3.0: + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.28 + rolldown: 1.2.9 + tinyglobby: 0.2.17 + optionalDependencies: + fsevents: 2.3.3 diff --git a/orbiters/chameleon/results/metafold-tingle-heldout-audit-20260921.json b/orbiters/chameleon/results/metafold-tingle-heldout-audit-20260921.json new file mode 100644 index 0000000000000000000000000000000000000000..87f19da17f7041dbdaada1f2739304ae9fbf3880 --- /dev/null +++ b/orbiters/chameleon/results/metafold-tingle-heldout-audit-20260921.json @@ -0,0 +1,34 @@ +{ + "run_id": "275353cdf0ec44c88036656a74de1cec", + "status": "PASS", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "dependency_digest": null, + "overlay_digest": null, + "contracts": [ + { + "contract_digest": "505dab44dc387e1c9fb9ebee84d6b49c7cd488e59a230976a3496f591ce37146", + "bundle_sha256": "a7c9af78efde20db9fdde91ab0f89dc5078b7a493e8345b24cdcf891279e48e8", + "status": "PASS", + "files_checked": 13, + "dependency_digest": null, + "scope": "Exact delivery correspondence to supplied frozen package and recorded checks; not independent provenance" + }, + { + "contract_digest": "3ae36b47724cc62bd03abe11387aecdcb715202e0ce83d623da4443de24dd683", + "bundle_sha256": "540c39db9ff82bd1ec15cb66fff654ccce622ecd4f4196858e5174d16b722bb2", + "status": "PASS", + "files_checked": 13, + "dependency_digest": null, + "scope": "Exact delivery correspondence to supplied frozen package and recorded checks; not independent provenance" + }, + { + "contract_digest": "0f601652b8862bb322f1f9b5e25887dcff1a25c8252d7466fb2267d4bc23e88c", + "bundle_sha256": "23b5a39afbce6e24f48a1ddb2882e858b003f381834e43488c134a21dfc9bdb8", + "status": "PASS", + "files_checked": 13, + "dependency_digest": null, + "scope": "Exact delivery correspondence to supplied frozen package and recorded checks; not independent provenance" + } + ], + "public_changes": false +} \ No newline at end of file diff --git a/orbiters/chameleon/results/metafold-tingle-heldout-first-pass-20260921.json b/orbiters/chameleon/results/metafold-tingle-heldout-first-pass-20260921.json new file mode 100644 index 0000000000000000000000000000000000000000..b3cf1a03576413d63dff9286cf6a81405b8f8cfa --- /dev/null +++ b/orbiters/chameleon/results/metafold-tingle-heldout-first-pass-20260921.json @@ -0,0 +1,662 @@ +{ + "id": "275353cdf0ec44c88036656a74de1cec", + "status": "COMPLETE", + "state": { + "version": "metafold-step-engine-v1", + "goal": { + "source": "https://github.com/robinparisi/tingle/tree/9eadca70c72ef9adb9144cc23a4104978d3bc63b", + "source_type": "repository", + "repository_scope": "entry", + "repository_entry": "doc/index.html", + "max_steps": 10, + "contracts": [ + { + "name": "Unfamiliar modal opens and closes by button", + "steps": [ + { + "op": "click", + "selector": ".js-tingle-modal-1" + }, + { + "op": "visible", + "selector": ".tingle-modal--visible .tingle-modal-box" + }, + { + "op": "click", + "selector": ".tingle-modal--visible .tingle-modal__close" + }, + { + "equals": 0, + "op": "count", + "selector": ".tingle-modal--visible" + } + ], + "version": "browser-contract-v1" + }, + { + "name": "Unfamiliar modal closes by escape", + "steps": [ + { + "op": "click", + "selector": ".js-tingle-modal-1" + }, + { + "op": "visible", + "selector": ".tingle-modal--visible .tingle-modal-box" + }, + { + "key": "Escape", + "op": "press", + "selector": "body" + }, + { + "equals": 0, + "op": "count", + "selector": ".tingle-modal--visible" + } + ], + "version": "browser-contract-v1" + }, + { + "name": "Unfamiliar modal footer cancel works", + "steps": [ + { + "op": "click", + "selector": ".js-tingle-modal-2" + }, + { + "op": "visible", + "selector": ".tingle-modal--visible .tingle-modal-box" + }, + { + "op": "click", + "selector": ".tingle-modal--visible .tingle-btn--default" + }, + { + "equals": 0, + "op": "count", + "selector": ".tingle-modal--visible" + } + ], + "version": "browser-contract-v1" + } + ], + "complete_assets": true, + "locked_assets": true, + "repository_assets": [] + }, + "goal_digest": "7bb5e050020e5fec5546d228583020cf3d5662c315b99003971d309ebdbc80f6", + "contract_digests": [ + "505dab44dc387e1c9fb9ebee84d6b49c7cd488e59a230976a3496f591ce37146", + "3ae36b47724cc62bd03abe11387aecdcb715202e0ce83d623da4443de24dd683", + "0f601652b8862bb322f1f9b5e25887dcff1a25c8252d7466fb2267d4bc23e88c" + ], + "sequence": 5, + "status": "COMPLETE", + "current": { + "twin_id": "5fc44870bbe343a598f1d6751db961de", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "dependency_digest": null, + "overlay_digest": null, + "assembly": null, + "lock_path": null, + "metadata_missing": false, + "bundle": { + "id": "4ac230a8a1944be4b2832dab84c51efd", + "sha256": "23b5a39afbce6e24f48a1ddb2882e858b003f381834e43488c134a21dfc9bdb8" + } + }, + "checks": { + "505dab44dc387e1c9fb9ebee84d6b49c7cd488e59a230976a3496f591ce37146": { + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "dependency_digest": null, + "overlay_digest": null, + "record_id": "d202aeddd71e40dca2cc1af906894a2d", + "bundle": { + "id": "cefb8e88a41d439cbae60208a86865ad", + "sha256": "a7c9af78efde20db9fdde91ab0f89dc5078b7a493e8345b24cdcf891279e48e8" + }, + "receipt_digest": "f26dadbd8f8c777c5c730b26bb1fb0321b2de0ba04b0fc2019287f24326ec847" + }, + "3ae36b47724cc62bd03abe11387aecdcb715202e0ce83d623da4443de24dd683": { + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "dependency_digest": null, + "overlay_digest": null, + "record_id": "5059f7b1f91e44f69939ea0883bc6a6a", + "bundle": { + "id": "c70125d15b874c929b77ef70a4f80bc7", + "sha256": "540c39db9ff82bd1ec15cb66fff654ccce622ecd4f4196858e5174d16b722bb2" + }, + "receipt_digest": "36d6a21758cbf6f6411355e7619ca2e5fdc25c45ccd0e213b8135171a266adbc" + }, + "0f601652b8862bb322f1f9b5e25887dcff1a25c8252d7466fb2267d4bc23e88c": { + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "dependency_digest": null, + "overlay_digest": null, + "record_id": "057bbc8ba40e41eca34f7881d337aa3d", + "bundle": { + "id": "4ac230a8a1944be4b2832dab84c51efd", + "sha256": "23b5a39afbce6e24f48a1ddb2882e858b003f381834e43488c134a21dfc9bdb8" + }, + "receipt_digest": "3e88bb7031fcb7eaf20ffd2173b312378db3b370fbaee722a0dfa94be6179d71" + } + }, + "history": [ + { + "step": { + "kind": "ACQUIRE", + "sequence": 1, + "inputs": { + "source": "https://github.com/robinparisi/tingle/tree/9eadca70c72ef9adb9144cc23a4104978d3bc63b", + "source_type": "repository", + "repository_entry": "doc/index.html", + "repository_scope": "entry", + "repository_assets": [] + }, + "id": "c489613fdc8ab52ff554e305dc1626eb22fe1c8386119d9afe6426d1b8ceaaf8" + }, + "result": { + "status": "PASS", + "twin_id": "5fc44870bbe343a598f1d6751db961de", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "lock_path": null, + "metadata_missing": false + }, + "planning": { + "version": "metafold-lookahead-v1", + "state_digest": "17e4cd157cbb338372c25fab9649545da60bd943d04f9d09b0515747b49e122b", + "next_step_id": "c489613fdc8ab52ff554e305dc1626eb22fe1c8386119d9afe6426d1b8ceaaf8", + "next_kind": "ACQUIRE", + "external_steps": 0, + "prediction": { + "version": "microfold-search-v1", + "status": "PLAN_FOUND", + "model_digest": "f50476b34de9c7e437f509b98a8054c8cb4167e822772e0be251aa16e70309bc", + "evidence_digest": "17e4cd157cbb338372c25fab9649545da60bd943d04f9d09b0515747b49e122b", + "plan": [ + "NEXT/ACQUIRE", + "VERIFY:0", + "VERIFY:1", + "VERIFY:2", + "FINALIZE" + ], + "predicted_cost": 5, + "predicted_state": 959, + "backend": "python", + "rounds": 5, + "microsteps": 81, + "applicable_transitions": 42, + "expanded_states": 9, + "unique_states": 10, + "round_trace": [ + { + "microsteps": 9, + "applicable": 1, + "frontier": 1 + }, + { + "microsteps": 9, + "applicable": 3, + "frontier": 3 + }, + { + "microsteps": 27, + "applicable": 18, + "frontier": 3 + }, + { + "microsteps": 27, + "applicable": 15, + "frontier": 1 + }, + { + "microsteps": 9, + "applicable": 5, + "frontier": 1 + } + ], + "wall_ns": 407300, + "budget": { + "rounds": 10, + "batch_size": 1000, + "microsteps": 10000 + }, + "external_steps": 0, + "verified_application": false, + "scope": "Conditional plan under supplied transition model; external outcomes must be observed", + "model_witness_validated": true + }, + "assumptions": [ + "Proposed operations succeed and reveal no new gaps; actual results may invalidate the entire tail", + "Only the next kernel-authorized operation may execute; no predicted check counts as a pass" + ], + "planning_wall_ns": 914700 + } + }, + { + "step": { + "kind": "VERIFY", + "sequence": 2, + "inputs": { + "twin_id": "5fc44870bbe343a598f1d6751db961de", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "assembly": null, + "contract": { + "name": "Unfamiliar modal opens and closes by button", + "steps": [ + { + "op": "click", + "selector": ".js-tingle-modal-1" + }, + { + "op": "visible", + "selector": ".tingle-modal--visible .tingle-modal-box" + }, + { + "op": "click", + "selector": ".tingle-modal--visible .tingle-modal__close" + }, + { + "equals": 0, + "op": "count", + "selector": ".tingle-modal--visible" + } + ], + "version": "browser-contract-v1" + }, + "contract_digest": "505dab44dc387e1c9fb9ebee84d6b49c7cd488e59a230976a3496f591ce37146" + }, + "id": "763f53f03832c8ae62227f5f5e34a087fa607ac02190343106013eb24268a4bb" + }, + "result": { + "status": "PASS", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "contract_digest": "505dab44dc387e1c9fb9ebee84d6b49c7cd488e59a230976a3496f591ce37146", + "record_id": "d202aeddd71e40dca2cc1af906894a2d", + "bundle": { + "id": "cefb8e88a41d439cbae60208a86865ad", + "sha256": "a7c9af78efde20db9fdde91ab0f89dc5078b7a493e8345b24cdcf891279e48e8" + }, + "dependency_digest": null, + "overlay_digest": null, + "assembly": null, + "missing_assets": false, + "lock_path": null, + "error": null, + "receipt_digest": "f26dadbd8f8c777c5c730b26bb1fb0321b2de0ba04b0fc2019287f24326ec847" + }, + "planning": { + "version": "metafold-lookahead-v1", + "state_digest": "81417ef4d8d943160691d5244f022a7deb674b138d3a94e7317e0c934dc42a8e", + "next_step_id": "763f53f03832c8ae62227f5f5e34a087fa607ac02190343106013eb24268a4bb", + "next_kind": "VERIFY", + "external_steps": 0, + "prediction": { + "version": "microfold-search-v1", + "status": "PLAN_FOUND", + "model_digest": "bfacc410ab62c99b08e6ac9bb064c2a05bb7ddd331a6aa771ddba366991ce9d4", + "evidence_digest": "81417ef4d8d943160691d5244f022a7deb674b138d3a94e7317e0c934dc42a8e", + "plan": [ + "NEXT/VERIFY:0", + "VERIFY:1", + "VERIFY:2", + "FINALIZE" + ], + "predicted_cost": 4, + "predicted_state": 959, + "backend": "python", + "rounds": 4, + "microsteps": 72, + "applicable_transitions": 37, + "expanded_states": 8, + "unique_states": 10, + "round_trace": [ + { + "microsteps": 9, + "applicable": 1, + "frontier": 1 + }, + { + "microsteps": 9, + "applicable": 6, + "frontier": 3 + }, + { + "microsteps": 27, + "applicable": 13, + "frontier": 3 + }, + { + "microsteps": 27, + "applicable": 17, + "frontier": 2 + } + ], + "wall_ns": 351000, + "budget": { + "rounds": 10, + "batch_size": 1000, + "microsteps": 10000 + }, + "external_steps": 0, + "verified_application": false, + "scope": "Conditional plan under supplied transition model; external outcomes must be observed", + "model_witness_validated": true + }, + "assumptions": [ + "Proposed operations succeed and reveal no new gaps; actual results may invalidate the entire tail", + "Only the next kernel-authorized operation may execute; no predicted check counts as a pass" + ], + "planning_wall_ns": 878000 + } + }, + { + "step": { + "kind": "VERIFY", + "sequence": 3, + "inputs": { + "twin_id": "5fc44870bbe343a598f1d6751db961de", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "assembly": null, + "contract": { + "name": "Unfamiliar modal closes by escape", + "steps": [ + { + "op": "click", + "selector": ".js-tingle-modal-1" + }, + { + "op": "visible", + "selector": ".tingle-modal--visible .tingle-modal-box" + }, + { + "key": "Escape", + "op": "press", + "selector": "body" + }, + { + "equals": 0, + "op": "count", + "selector": ".tingle-modal--visible" + } + ], + "version": "browser-contract-v1" + }, + "contract_digest": "3ae36b47724cc62bd03abe11387aecdcb715202e0ce83d623da4443de24dd683" + }, + "id": "4110520430518ec1b34d0cda983b35048140170eb461e20ac4eaf60d96fb938e" + }, + "result": { + "status": "PASS", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "contract_digest": "3ae36b47724cc62bd03abe11387aecdcb715202e0ce83d623da4443de24dd683", + "record_id": "5059f7b1f91e44f69939ea0883bc6a6a", + "bundle": { + "id": "c70125d15b874c929b77ef70a4f80bc7", + "sha256": "540c39db9ff82bd1ec15cb66fff654ccce622ecd4f4196858e5174d16b722bb2" + }, + "dependency_digest": null, + "overlay_digest": null, + "assembly": null, + "missing_assets": false, + "lock_path": null, + "error": null, + "receipt_digest": "36d6a21758cbf6f6411355e7619ca2e5fdc25c45ccd0e213b8135171a266adbc" + }, + "planning": { + "version": "metafold-lookahead-v1", + "state_digest": "411101509f82a23acfd9e4c079f4558379ed5f615e120f295df64b503434042d", + "next_step_id": "4110520430518ec1b34d0cda983b35048140170eb461e20ac4eaf60d96fb938e", + "next_kind": "VERIFY", + "external_steps": 0, + "prediction": { + "version": "microfold-search-v1", + "status": "PLAN_FOUND", + "model_digest": "ae335c94f2db4951526618c416ad05e97521bc32a0125354913578840c773d79", + "evidence_digest": "411101509f82a23acfd9e4c079f4558379ed5f615e120f295df64b503434042d", + "plan": [ + "NEXT/VERIFY:1", + "VERIFY:2", + "FINALIZE" + ], + "predicted_cost": 3, + "predicted_state": 959, + "backend": "python", + "rounds": 3, + "microsteps": 36, + "applicable_transitions": 14, + "expanded_states": 4, + "unique_states": 8, + "round_trace": [ + { + "microsteps": 9, + "applicable": 1, + "frontier": 1 + }, + { + "microsteps": 9, + "applicable": 5, + "frontier": 2 + }, + { + "microsteps": 18, + "applicable": 8, + "frontier": 4 + } + ], + "wall_ns": 307100, + "budget": { + "rounds": 10, + "batch_size": 1000, + "microsteps": 10000 + }, + "external_steps": 0, + "verified_application": false, + "scope": "Conditional plan under supplied transition model; external outcomes must be observed", + "model_witness_validated": true + }, + "assumptions": [ + "Proposed operations succeed and reveal no new gaps; actual results may invalidate the entire tail", + "Only the next kernel-authorized operation may execute; no predicted check counts as a pass" + ], + "planning_wall_ns": 898900 + } + }, + { + "step": { + "kind": "VERIFY", + "sequence": 4, + "inputs": { + "twin_id": "5fc44870bbe343a598f1d6751db961de", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "assembly": null, + "contract": { + "name": "Unfamiliar modal footer cancel works", + "steps": [ + { + "op": "click", + "selector": ".js-tingle-modal-2" + }, + { + "op": "visible", + "selector": ".tingle-modal--visible .tingle-modal-box" + }, + { + "op": "click", + "selector": ".tingle-modal--visible .tingle-btn--default" + }, + { + "equals": 0, + "op": "count", + "selector": ".tingle-modal--visible" + } + ], + "version": "browser-contract-v1" + }, + "contract_digest": "0f601652b8862bb322f1f9b5e25887dcff1a25c8252d7466fb2267d4bc23e88c" + }, + "id": "0d80c273b3aff10c3945d1a83f63ed7f3b8fcf9f29be62d7e4897db9d0c61a19" + }, + "result": { + "status": "PASS", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "contract_digest": "0f601652b8862bb322f1f9b5e25887dcff1a25c8252d7466fb2267d4bc23e88c", + "record_id": "057bbc8ba40e41eca34f7881d337aa3d", + "bundle": { + "id": "4ac230a8a1944be4b2832dab84c51efd", + "sha256": "23b5a39afbce6e24f48a1ddb2882e858b003f381834e43488c134a21dfc9bdb8" + }, + "dependency_digest": null, + "overlay_digest": null, + "assembly": null, + "missing_assets": false, + "lock_path": null, + "error": null, + "receipt_digest": "3e88bb7031fcb7eaf20ffd2173b312378db3b370fbaee722a0dfa94be6179d71" + }, + "planning": { + "version": "metafold-lookahead-v1", + "state_digest": "16d9785005192a8036cd88ccbd90ea4d3837e8982d17fa32b9f013c5564fb297", + "next_step_id": "0d80c273b3aff10c3945d1a83f63ed7f3b8fcf9f29be62d7e4897db9d0c61a19", + "next_kind": "VERIFY", + "external_steps": 0, + "prediction": { + "version": "microfold-search-v1", + "status": "PLAN_FOUND", + "model_digest": "a53541f59ecbdc679a4915fa5ec3ff96d43162c29250efc355f52154c8e43bae", + "evidence_digest": "16d9785005192a8036cd88ccbd90ea4d3837e8982d17fa32b9f013c5564fb297", + "plan": [ + "NEXT/VERIFY:2", + "FINALIZE" + ], + "predicted_cost": 2, + "predicted_state": 959, + "backend": "python", + "rounds": 2, + "microsteps": 18, + "applicable_transitions": 6, + "expanded_states": 2, + "unique_states": 4, + "round_trace": [ + { + "microsteps": 9, + "applicable": 1, + "frontier": 1 + }, + { + "microsteps": 9, + "applicable": 5, + "frontier": 2 + } + ], + "wall_ns": 336200, + "budget": { + "rounds": 10, + "batch_size": 1000, + "microsteps": 10000 + }, + "external_steps": 0, + "verified_application": false, + "scope": "Conditional plan under supplied transition model; external outcomes must be observed", + "model_witness_validated": true + }, + "assumptions": [ + "Proposed operations succeed and reveal no new gaps; actual results may invalidate the entire tail", + "Only the next kernel-authorized operation may execute; no predicted check counts as a pass" + ], + "planning_wall_ns": 985800 + } + }, + { + "step": { + "kind": "FINALIZE", + "sequence": 5, + "inputs": { + "twin_id": "5fc44870bbe343a598f1d6751db961de", + "source_digest": "ae87310358fe4757517f4db9b285f68c8902269785f82ea6c3342fc1b371388c", + "dependency_digest": null, + "bundle": { + "id": "4ac230a8a1944be4b2832dab84c51efd", + "sha256": "23b5a39afbce6e24f48a1ddb2882e858b003f381834e43488c134a21dfc9bdb8" + }, + "contract_digests": [ + "505dab44dc387e1c9fb9ebee84d6b49c7cd488e59a230976a3496f591ce37146", + "3ae36b47724cc62bd03abe11387aecdcb715202e0ce83d623da4443de24dd683", + "0f601652b8862bb322f1f9b5e25887dcff1a25c8252d7466fb2267d4bc23e88c" + ] + }, + "id": "1b236725be62caac654ef566dacbf3be9ca86d4eb3fd844b2932eab0170b3132" + }, + "result": { + "status": "PASS" + }, + "planning": { + "version": "metafold-lookahead-v1", + "state_digest": "30f538fcd16a014614bcc478b8ad04882be62b3e6fcf707a9bb0f315f9e45030", + "next_step_id": "1b236725be62caac654ef566dacbf3be9ca86d4eb3fd844b2932eab0170b3132", + "next_kind": "FINALIZE", + "external_steps": 0, + "prediction": { + "version": "microfold-search-v1", + "status": "PLAN_FOUND", + "model_digest": "9861c8e1daf0da3d51b621c7c0cfee976c90c0138265709b4644a0d7cb7e8158", + "evidence_digest": "30f538fcd16a014614bcc478b8ad04882be62b3e6fcf707a9bb0f315f9e45030", + "plan": [ + "NEXT/FINALIZE" + ], + "predicted_cost": 1, + "predicted_state": 959, + "backend": "python", + "rounds": 1, + "microsteps": 9, + "applicable_transitions": 1, + "expanded_states": 1, + "unique_states": 2, + "round_trace": [ + { + "microsteps": 9, + "applicable": 1, + "frontier": 1 + } + ], + "wall_ns": 259700, + "budget": { + "rounds": 10, + "batch_size": 1000, + "microsteps": 10000 + }, + "external_steps": 0, + "verified_application": false, + "scope": "Conditional plan under supplied transition model; external outcomes must be observed", + "model_witness_validated": true + }, + "assumptions": [ + "Proposed operations succeed and reveal no new gaps; actual results may invalidate the entire tail", + "Only the next kernel-authorized operation may execute; no predicted check counts as a pass" + ], + "planning_wall_ns": 837800 + } + } + ], + "budget": { + "limit": 10, + "used": 4 + }, + "state_digest": "be0f13db83b9f6699afff49e531ffed0072732c99e19a2d8e8b6619c65734a94" + }, + "pending": null, + "next_step": { + "kind": "COMPLETE", + "sequence": 6, + "inputs": { + "bundle": { + "id": "4ac230a8a1944be4b2832dab84c51efd", + "sha256": "23b5a39afbce6e24f48a1ddb2882e858b003f381834e43488c134a21dfc9bdb8" + }, + "reason": "ALL_CONTRACTS_VERIFIED" + }, + "id": "298a33ac315ff1343d84e2a7727b6cdbf6babd9da9e3f96229287c1b0cd62a06" + }, + "request_digest": "7bb5e050020e5fec5546d228583020cf3d5662c315b99003971d309ebdbc80f6", + "scope": "Recorded acceptance contracts on one source and dependency assembly" +} \ No newline at end of file diff --git a/orbiters/chameleon/results/release-panel-current-20260921b.json b/orbiters/chameleon/results/release-panel-current-20260921b.json new file mode 100644 index 0000000000000000000000000000000000000000..03809dbd766fe5d3799a3916f1f24ac1ac32b577 --- /dev/null +++ b/orbiters/chameleon/results/release-panel-current-20260921b.json @@ -0,0 +1,504 @@ +{ + "summary": { + "registered_targets": 10, + "registered_families": 7, + "first_pass_complete_targets": 3, + "latest_complete_targets": 7, + "held_out_targets": 4, + "held_out_completion_fraction": 0.25, + "release_gate": "NOT_ESTABLISHED", + "scope": "Registered trials only. Completion fraction is not a behavior-check score; independent visual, isolation and delivery gates remain required." + }, + "required_targets": 24, + "required_families": 6, + "targets": [ + { + "id": "pickr", + "family": "color_picker", + "split": "held_out", + "attempts": [ + { + "run_id": "ba63c53e796d46f4bd3e547ff476266e", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 1, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 2, + "job_cpu_seconds": 2.609375, + "summed_supervised_wall_seconds": 1.672, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "yaireo-validator", + "family": "form_validation", + "split": "held_out", + "attempts": [ + { + "run_id": "ef572c196b9443f6ace584836bee0616", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 0, + "current_passed": 0, + "current_failed": 0, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 0, + "job_cpu_seconds": 0.0, + "summed_supervised_wall_seconds": 0.0, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "pixabay-autocomplete", + "family": "autocomplete", + "split": "held_out", + "attempts": [ + { + "run_id": "b617c79fe90340cab1800eece8849d13", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 0, + "current_passed": 0, + "current_failed": 0, + "current_untested": 3, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 0, + "job_cpu_seconds": 0.0, + "summed_supervised_wall_seconds": 0.0, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "tingle", + "family": "modal_dialog", + "split": "held_out", + "attempts": [ + { + "run_id": "275353cdf0ec44c88036656a74de1cec", + "phase": "first_pass", + "status": "COMPLETE", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 3, + "current_passed": 3, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 3, + "job_cpu_seconds": 5.5, + "summed_supervised_wall_seconds": 3.782, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "nouislider", + "family": "range_slider", + "split": "development", + "attempts": [ + { + "run_id": "434e8ebaacdb4d1e8621823f7d00bbd9", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 0, + "current_passed": 0, + "current_failed": 0, + "current_untested": 3, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 0, + "job_cpu_seconds": 0.0, + "summed_supervised_wall_seconds": 0.0, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "70f9759524f14f6fa630c7ebb645a673", + "phase": "mount_repair_acquisition_rate_limited", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 1.1875, + "summed_supervised_wall_seconds": 0.844, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "c3416a1008a145aca163d5f5f499c2ab", + "phase": "mount_retry_repository_capacity_limit", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 1.40625, + "summed_supervised_wall_seconds": 0.938, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "e389b3f22d874b29becb5c2eab4d62f4", + "phase": "fresh_assets_acquired_verification_capacity_limit", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 2, + "job_cpu_seconds": 2.5625, + "summed_supervised_wall_seconds": 1.656, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "afad05850c3649d0a72283f43b57afc8", + "phase": "held_fresh_source_mount_repair_complete", + "status": "COMPLETE", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 3, + "current_passed": 3, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 4, + "job_cpu_seconds": 5.515625, + "summed_supervised_wall_seconds": 3.906, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "bouncer", + "family": "form_validation", + "split": "development", + "attempts": [ + { + "run_id": "88f208824c2841d09cc302a577d1e69c", + "phase": "first_pass", + "status": "COMPLETE", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 3, + "current_passed": 3, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 3, + "job_cpu_seconds": 4.890625, + "summed_supervised_wall_seconds": 3.266, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "tabby", + "family": "tabbed_navigation", + "split": "development", + "attempts": [ + { + "run_id": "b027ba951b6c43d99db3062c3f176903", + "phase": "first_pass", + "status": "COMPLETE", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 3, + "current_passed": 3, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 3, + "job_cpu_seconds": 5.15625, + "summed_supervised_wall_seconds": 3.4699999999999998, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "awesomplete", + "family": "autocomplete", + "split": "development", + "attempts": [ + { + "run_id": "ed038a1eecb84e67a80a6044ba8bc589", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 0, + "current_passed": 0, + "current_failed": 0, + "current_untested": 3, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 0, + "job_cpu_seconds": 0.0, + "summed_supervised_wall_seconds": 0.0, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "0cc23f4fb37d4a479944278753092cb6", + "phase": "canonical_address_retry", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 2.03125, + "summed_supervised_wall_seconds": 1.266, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "23e2b761c5cc4b07a5020c8d2debf5d0", + "phase": "documented_control_repair_scoped_development_contracts", + "status": "COMPLETE", + "declared_contracts": 4, + "behavior_checks": { + "declared": 4, + "ever_attempted": 4, + "current_passed": 4, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 5, + "job_cpu_seconds": 8.796875, + "summed_supervised_wall_seconds": 7.468, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "micromodal", + "family": "modal_dialog", + "split": "development", + "attempts": [ + { + "run_id": "5cc18951a42e4c61be68fa58343bb4c9", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 0, + "current_passed": 0, + "current_failed": 0, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 0, + "job_cpu_seconds": 0.0, + "summed_supervised_wall_seconds": 0.0, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "2d186ca2c672467aa680a42f03b6e793", + "phase": "canonical_address_retry", + "status": "BLOCKED", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 1, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 1.734375, + "summed_supervised_wall_seconds": 3.235, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "cdcf5e7b93c04ff9bad2c90232bacf70", + "phase": "module_policy_inventory_failure", + "status": "BLOCKED", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 1, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 1.5, + "summed_supervised_wall_seconds": 2.984, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "894af6be994f49429c3d0e47522a57a3", + "phase": "module_policy_missing_build_output", + "status": "BLOCKED", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 1, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 1.65625, + "summed_supervised_wall_seconds": 2.969, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "08b88a07fa65422aa1014ac1b52af12c", + "phase": "corrected_development_contracts_generated_build_discovery", + "status": "COMPLETE", + "declared_contracts": 2, + "behavior_checks": { + "declared": 2, + "ever_attempted": 2, + "current_passed": 2, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 4, + "job_cpu_seconds": 7.71875, + "summed_supervised_wall_seconds": 8.781, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + }, + { + "id": "pikaday", + "family": "date_picker", + "split": "development", + "attempts": [ + { + "run_id": "f516fce460dc4827b62a6df64555ae2c", + "phase": "first_pass", + "status": "BLOCKED", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 1, + "current_passed": 0, + "current_failed": 1, + "current_untested": 2, + "current_pass_fraction": 0.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 1, + "job_cpu_seconds": 1.53125, + "summed_supervised_wall_seconds": 1.11, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "b56de18f4c2d4a3da219078a106e88cc", + "phase": "corrected_contracts", + "status": "COMPLETE", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 3, + "current_passed": 3, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 3, + "job_cpu_seconds": 4.84375, + "summed_supervised_wall_seconds": 3.5140000000000002, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + }, + { + "run_id": "b2408af145bf4c87886a22f9d1da1ef2", + "phase": "post_module_regression", + "status": "COMPLETE", + "declared_contracts": 3, + "behavior_checks": { + "declared": 3, + "ever_attempted": 3, + "current_passed": 3, + "current_failed": 0, + "current_untested": 0, + "current_pass_fraction": 1.0, + "scope": "Current source/dependency/overlay only; latest receipt per contract; untested checks included; not a delivery or visual score" + }, + "verification_records": 3, + "job_cpu_seconds": 4.96875, + "summed_supervised_wall_seconds": 3.6710000000000003, + "cost_scope": "Browser receipts referenced by this registered run, including failures; excludes separate diagnostic runs, acquisition, queue delay, host overhead and electricity measurement" + } + ] + } + ] +} \ No newline at end of file diff --git a/orbiters/chameleon/results/trafficcop-capture-triage.json b/orbiters/chameleon/results/trafficcop-capture-triage.json new file mode 100644 index 0000000000000000000000000000000000000000..9f0b16b9ff0015e216b8f7c6452789bcc21a71ab --- /dev/null +++ b/orbiters/chameleon/results/trafficcop-capture-triage.json @@ -0,0 +1,4849 @@ +{ + "model": "oracle7-trafficcop/chameleon-capture-v0", + "status": "failed", + "effect": "shadow_only", + "counts": { + "retry_later_unreachable": 65, + "exclude_access_disallowed": 26, + "fix_capture_tool": 64, + "collect_full_evidence": 1 + }, + "items": [ + { + "url": "https://aalahyan3.tech/", + "primary": "collect_full_evidence", + "plan": [ + [ + "collect_full_evidence", + "approval evidence missing: source.png, review.png, source-full.png, review-full.png, capture.json, observation.json" + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aarav-sharma-liart.vercel.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://abdenassar-portfolio-4smfcqph6-abdenassaramimi99-gmailcom.vercel.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://akshaysanthoshkumar.vercel.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://alexandrefernandes.dev/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://anikahammedkhan.com/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://args.tech/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://az-dev.vercel.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://datasciencefolio.streamlit.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://dinq.me/elonfeng", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://dub.sh/ananyabiswas", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://dub.sh/ankitdey", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://grazziotti-portfolio.vercel.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://juanbenito.vercel.app/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://kodr.pro/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://linktr.ee/abdullahahsan", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://linktr.ee/drepin", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://linktr.ee/syedsyab", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://lwjerri.dev/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://nader.run/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://portfolio.denil-dominic.com/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sanajitjana.github.io/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sdsanchezm.github.io/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://swaroop.codes/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://thinh.io.vn/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.chicagoitsystems.com/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.nyambogahezron.dev/", + "primary": "exclude_access_disallowed", + "plan": [ + [ + "exclude_access_disallowed", + "recorded failure: ROBOTS_OR_ACCESS_DISALLOWED" + ] + ], + "receipt": { + "failure": "ROBOTS_OR_ACCESS_DISALLOWED", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://0xparthdev.netlify.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://3d-portfolio-orpin-one.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nlocator.elementHandles: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:252:49 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://abdullahw-portfolio.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://abinash-sharma.pages.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nelementHandle.boundingBox: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:50:25 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aboutzahin.pages.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:56\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:56:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://adityathakur.me/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://andredfaria.github.io/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aquarifolio.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: e.screenshot: Timeout 10000ms exceeded.\nCall log:\n\u001b[2m - taking " + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: e.screenshot: Timeout 10000ms exceeded.\nCall log:\n\u001b[2m - taking page screenshot\u001b[22m\n\u001b[2m - disabled all CSS animations\u001b[22m\n\u001b[2m - waiting for fonts to load...\u001b[22m\n\u001b[2m - fonts loaded\u001b[22m\n\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:134:14 {\n log: [\n ' - taking page screenshot',\n ' - disabled all CSS animations',\n ' - waiting for fonts to load...',\n ' - fonts loaded'\n ],\n name: 'TimeoutError'\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://balakekarbon.github.io/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41:30\n at runNextTicks (node:internal/process/task_queues:65:5)\n at process.processImmediate (node:internal/timers:502:9)\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://bruno-simon.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:57\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:57:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://chunhthanhde.github.io/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:57\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:57:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://colinlord.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 403\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://collinskoechportfolio.web.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:57\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:57:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://dheerajgupta.netlify.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:59\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:59:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://dorlugasigal.netlify.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nlocator.elementHandles: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:187:47 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://ghomkrosmonaute.github.io/?game", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:63\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:63:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://hiteshsahu.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:63\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:63:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://iammuhammadfurqan.github.io/portfolio/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://igorclauss.de/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_1_FAILED: elf.parse_starttag(i)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\U" + ] + ], + "receipt": { + "failure": "STEP_1_FAILED: elf.parse_starttag(i)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\BenHo\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\Lib\\html\\parser.py\", line 475, in parse_starttag\n self.handle_starttag(tag, attrs)\n File \"C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\packages\\core\\chameleon_core\\visual_capture.py\", line 208, in handle_starttag\n raise Residual(\"VISUAL_DOCUMENT_COMPLEXITY_BUDGET\")\nchameleon_core.adaptation_contracts.Residual: VISUAL_DOCUMENT_COMPLEXITY_BUDGET\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://ilkeozs.info/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://itsnilesh.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://jithin.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://jonaswerner.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://jsn.cam/repo", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:69:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://kenfack-me.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:51\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:51:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://kritan560.github.io/portfolio/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:51\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:51:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://lalith-d-portfolio.netlify.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:52\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:52:30\n at runNextTicks (node:internal/process/task_queues:65:5)\n at process.processImmediate (node:internal/timers:502:9)\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://lisablunt.github.io/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:70\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:70:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://maggioni.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:63\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:63:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://mahatosunil.com.np/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\npage.evaluate: JSHandles can be evaluated only in the context they were created!\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:279:36 {\n log: [],\n name: 'Error'\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://manish-dholpuriya.netlify.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:70\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:70:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://manojhankare.in/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\npage.goto: Timeout 30000ms exceeded.\nCall log:\n\u001b[2m - navigating to \"https://manojhankare.in/\", waiting until \"domcontentloaded\"\u001b[22m\n\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:51:31 {\n log: [\n ' - navigating to \"https://manojhankare.in/\", waiting until \"domcontentloaded\"'\n ],\n name: 'TimeoutError'\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://matvey.codes/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://medium.com/@karboncodes/writing-web-apps-in-cobol-a18f74dc44f5", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 403\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41:30\n at runNextTicks (node:internal/process/task_queues:65:5)\n at process.processImmediate (node:internal/timers:502:9)\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://mohitjoe.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://mrepol742.github.io/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://my-portfolio-beryl-xi-81.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\npage.evaluate: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:286:31 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://n-cv.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://niresh.com.np/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://nitishkr.fun/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_1_FAILED: elf.parse_starttag(i)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\U" + ] + ], + "receipt": { + "failure": "STEP_1_FAILED: elf.parse_starttag(i)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\BenHo\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\Lib\\html\\parser.py\", line 475, in parse_starttag\n self.handle_starttag(tag, attrs)\n File \"C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\packages\\core\\chameleon_core\\visual_capture.py\", line 237, in handle_starttag\n raise Residual(\"VISUAL_DOCUMENT_COMPLEXITY_BUDGET\")\nchameleon_core.adaptation_contracts.Residual: VISUAL_DOCUMENT_COMPLEXITY_BUDGET\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://orazgulcayew.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nlocator.elementHandles: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:204:47 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://parinithmavurapu.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://portfolio-syauqi.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://portfolio.lewishadden.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:70\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:70:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://portoku0091.dpdns.org/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://praveen.science/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://purnendusamanta.github.io/MyPortfolio/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://rajs.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nlocator.elementHandles: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:252:49 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://remcostoeten.nl/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://rohitsoni007.github.io/portfolio", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://ronnycoste.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: age.screenshot: Target page, context or browser has been closed\nC" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: age.screenshot: Target page, context or browser has been closed\nCall log:\n\u001b[2m - taking page screenshot\u001b[22m\n\u001b[2m - disabled all CSS animations\u001b[22m\n\u001b[2m - waiting for fonts to load...\u001b[22m\n\u001b[2m - fonts loaded\u001b[22m\n\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:134:14 {\n log: [\n ' - taking page screenshot',\n ' - disabled all CSS animations',\n ' - waiting for fonts to load...',\n ' - fonts loaded'\n ]\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sayyedrabeeh.github.io/portfoliyo/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://shalon.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:54:30\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sharapov.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://silasrodrigues.vercel.app/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://suhailroushan.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://wahab-khan.github.io/Abdul-Wahab-Khan", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:45:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.caiovisuals.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41\n if (!response?.ok()) throw Error(`HTTP ${response?.status()}`);\n ^\n\nError: HTTP 404\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:41:30\n at runNextTicks (node:internal/process/task_queues:65:5)\n at process.processImmediate (node:internal/timers:502:9)\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.dilipmaurya.in/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\npage.goto: Timeout 30000ms exceeded.\nCall log:\n\u001b[2m - navigating to \"https://www.dilipmaurya.in/\", waiting until \"domcontentloaded\"\u001b[22m\n\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:42:31 {\n log: [\n ' - navigating to \"https://www.dilipmaurya.in/\", waiting until \"domcontentloaded\"'\n ],\n name: 'TimeoutError'\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.erikunha.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:62\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:62:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.michaellalavedra.com/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.rajsh.in/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: node:internal/modules/run_main:107\n triggerUncaughtException(\n ^\n\nlocator.elementHandles: Target page, context or browser has been closed\n at C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\scripts\\capture_rendered_catalogue.mjs:252:49 {\n log: []\n}\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.razielrodrigues.dev/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scrip" + ] + ], + "receipt": { + "failure": "STEP_0_FAILED: file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72\n throw Error('PAGE_NOT_READY: loading or empty after bounded observation');\n ^\n\nError: PAGE_NOT_READY: loading or empty after bounded observation\n at file:///C:/Users/BenHo/Desktop/ClaudeCode/project-chameleon/scripts/capture_rendered_catalogue.mjs:72:11\n\nNode.js v24.19.0\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://zalt.me/", + "primary": "fix_capture_tool", + "plan": [ + [ + "fix_capture_tool", + "recorded failure: STEP_1_FAILED: elf.parse_starttag(i)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\U" + ] + ], + "receipt": { + "failure": "STEP_1_FAILED: elf.parse_starttag(i)\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\BenHo\\.cache\\codex-runtimes\\codex-primary-runtime\\dependencies\\python\\Lib\\html\\parser.py\", line 475, in parse_starttag\n self.handle_starttag(tag, attrs)\n File \"C:\\Users\\BenHo\\Desktop\\ClaudeCode\\project-chameleon\\packages\\core\\chameleon_core\\visual_capture.py\", line 237, in handle_starttag\n raise Residual(\"VISUAL_DOCUMENT_COMPLEXITY_BUDGET\")\nchameleon_core.adaptation_contracts.Residual: VISUAL_DOCUMENT_COMPLEXITY_BUDGET\n", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aabu-sayed-portfolio.vercel.app/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: Command '['node', 'scripts/capture_rendered_catalogue.mjs', 'https://aabu-sayed-" + ] + ], + "receipt": { + "failure": "Command '['node', 'scripts/capture_rendered_catalogue.mjs', 'https://aabu-sayed-portfolio.vercel.app/', '.local\\\\catalogue-captures\\\\8b526272232e89c34b5e']' timed out after 90 seconds", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aayush-mishra.xyz/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://abdallaahmed.icu/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://adityacodes.in/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://adityanamdeo.qzz.io/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aelradi.engineer/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: Command '['node', 'scripts/capture_rendered_catalogue.mjs', 'https://aelradi.eng" + ] + ], + "receipt": { + "failure": "Command '['node', 'scripts/capture_rendered_catalogue.mjs', 'https://aelradi.engineer/', '.local\\\\catalogue-captures\\\\0748e0702c5d8917dab5']' timed out after 90 seconds", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aj7.is-a.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://aliahtisham.pro/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://amruthpillai.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://arbazansari.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://asifjaved.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: The read operation timed out" + ] + ], + "receipt": { + "failure": "The read operation timed out", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://balkrishnabk.com.np/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://briha.xyz/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://ccm.securityops.com.br/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://chickyhuynhprojects.xo.je/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://chosensoul.kesug.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://ciangoon.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://cyrilaguvasu.tech/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://datpham.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://delwer.live/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://devlucas.website/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://eharshit.cfd/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://faisalsaifi.tech/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://gaspavar.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://gilitz.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://haffee.vercel.app/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://hafiq.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://hanumantjain.tech/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://hassanx.tech/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://hozi-web3.site/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://indrajeet.me/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://jpdiaz.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://karrarnazim.space/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://karunika.work/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://krushna.gridly.xyz/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://kuldeepjadeja.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://lamine.cc/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://lugotech.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://main.dodjas56cfa3.amplifyapp.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://manojmandal.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://mdkhalidmahmud.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://melvinprince.io/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://naveenkumarm.space/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://pradhansaroj.com.np/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://rakesh.arcavio.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sabbirahmed.net/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://saitheja20.github.io/Portfolio", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://saswatamondal.me/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sawin.com.np/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://sitham.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://subratdwivedi.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://syedomer.me/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://talhakilic.com.tr/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://tejafolio.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.bechirlahoueg.tech/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.daljeetsingh.me/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: ", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.hafidziti.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.jeremyerikleong.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.johnsonsiziba.com/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.kumar-nishant.me/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.saakethj.in/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.sathwiky.dev/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.thenicedev.xyz/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://www.trixum.net/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + }, + { + "url": "https://xamarth.pp.ua/", + "primary": "retry_later_unreachable", + "plan": [ + [ + "retry_later_unreachable", + "recorded failure: " + ] + ], + "receipt": { + "failure": "", + "evidence_missing": [ + "source.png", + "review.png", + "source-full.png", + "review-full.png", + "capture.json", + "observation.json" + ], + "visual_missing": 0, + "visual_missing_offsite": 0, + "redirected_site": false, + "svg_omissions": 0, + "loading": false, + "empty": false, + "text_length": 0, + "image": { + "available": false + } + } + } + ] +} \ No newline at end of file diff --git a/orbiters/chameleon/scripts/accept_saved_behavior_ui.mjs b/orbiters/chameleon/scripts/accept_saved_behavior_ui.mjs new file mode 100644 index 0000000000000000000000000000000000000000..dda99f02ad14d849347a5925149f507e53ad0dc9 --- /dev/null +++ b/orbiters/chameleon/scripts/accept_saved_behavior_ui.mjs @@ -0,0 +1,84 @@ +/** Real public-source/local private-counterpart acceptance, not a unit fixture. */ +import {chromium,expect} from '@playwright/test'; +import {readFile,writeFile,mkdir} from 'node:fs/promises'; +import {execFile} from 'node:child_process'; +import {promisify} from 'node:util'; +import path from 'node:path'; +import {createHash} from 'node:crypto'; +const run=promisify(execFile),root=process.cwd(); +const output=path.join(root,'.local/repository-pilot','ui-acceptance-'+Date.now()); +await mkdir(output); +const frozen=JSON.parse(await readFile('.local/repository-pilot/calculator/frozen.json','utf8')); +const source=frozen.repository.source+'/tree/'+frozen.repository.commit_sha; +const contract=JSON.parse(await readFile('docs/contracts/calculator-repair-suite.json','utf8'))[0]; +await writeFile(path.join(output,'contract.json'),JSON.stringify(contract)); +const browser=await chromium.launch(); +let page; +try{ + const context=await browser.newContext();page=await context.newPage(); + page.setDefaultTimeout(15000); + const errors=[];page.on('pageerror',e=>errors.push(e.message)); + await page.goto('http://127.0.0.1:8120/'); + await expect(page.getByText('YOUR PRIVATE GUEST SESSION')).toBeVisible(); + const auth=await context.request.post('http://127.0.0.1:8120/api/v1/auth/guest',{headers:{Origin:'http://127.0.0.1:8120'}}); + const owner=(await auth.json()).owner_id; + const csrf=(await context.cookies()).find(c=>c.name==='chameleon_csrf').value; + const response=await context.request.post('http://127.0.0.1:8120/api/v1/adaptations',{headers:{Origin:'http://127.0.0.1:8120','X-CSRF-Token':csrf,'Idempotency-Key':crypto.randomUUID()},data:{source,source_type:'repository',build_counterpart:true}}); + if(response.status()!==202)throw Error('Intake rejected: '+await response.text()); + let job=await response.json(); + const deadline=Date.now()+60000; + while(job.counterpart?.status!=='READY'&&Date.now()setTimeout(resolve,500)); + job=await (await context.request.get(`http://127.0.0.1:8120/api/v1/adaptations/${job.id}`)).json(); + } + if(job.counterpart?.status!=='READY')throw Error('Capture timeout'); + const twin=job.counterpart.twin_id; + const base=['scripts/verify_saved_repository.py','--owner',owner,'--twin',twin,'--contract',path.join(output,'contract.json')]; + const original=await run('.venv/Scripts/python.exe',[...base,'--output',path.join(output,'original')],{cwd:root,timeout:90000,windowsHide:true}); + await run('node',['scripts/build_calculator_overlay.mjs',path.join(output,'original/package.json'),path.join(output,'overlay.json')],{cwd:root,timeout:10000,windowsHide:true}); + const repaired=await run('.venv/Scripts/python.exe',[...base,'--output',path.join(output,'repaired'),'--overlay',path.join(output,'overlay.json')],{cwd:root,timeout:90000,windowsHide:true}); + await page.reload(); + // API-created jobs do not update the browser's remembered conversation. + // Reopen through the actual saved-conversation control, as a returning user does. + await page.locator('.saved-menu summary').click(); + await page.locator('.saved-conversations button').filter({hasText:source.replace(/^https?:\/\//,'')}).click(); + const saved=await (await context.request.get('http://127.0.0.1:8120/api/v1/twins')).json(); + const artifact=saved.find(item=>item.id===twin); + if(!artifact)throw Error('Saved counterpart missing from owner list'); + await page.getByRole('button',{name:artifact.source+' / open source package',exact:true}).click(); + const panel=page.getByRole('region',{name:'Recorded behavior checks'}); + await expect(panel.getByText('Contract passed',{exact:true})).toBeVisible(); + await expect(panel.getByText('Contract failed',{exact:true})).toBeVisible(); + await expect(panel.getByText('Repaired copy',{exact:true})).toBeVisible(); + await expect(panel.getByText('Original source',{exact:true})).toBeVisible(); + const downloadEvent=page.waitForEvent('download'); + await panel.getByRole('link',{name:'Download tested counterpart ZIP'}).click(); + const download=await downloadEvent; + await download.saveAs(path.join(output,'downloaded-counterpart.zip')); + const downloadHash=createHash('sha256').update(await readFile(path.join(output,'downloaded-counterpart.zip'))).digest('hex'); + expect(downloadHash).toBe(JSON.parse(repaired.stdout).counterpart.sha256); + await panel.getByRole('button',{name:'Open repaired counterpart',exact:true}).click(); + const app=page.frameLocator('iframe[title="Your isolated repaired counterpart"]'); + for(const key of ['2','+','3','='])await app.getByText(key,{exact:true}).click(); + await expect(app.locator('#display')).toHaveText('5'); + const isolated=await app.locator('body').evaluate(async()=>{ + let parentDenied=false,fetchDenied=false; + try{void parent.document.body}catch{parentDenied=true} + try{await fetch('/api/v1/session')}catch{fetchDenied=true} + return {parentDenied,fetchDenied}; + }); + expect(isolated).toEqual({parentDenied:true,fetchDenied:true}); + await page.screenshot({path:path.join(output,'desktop.png'),fullPage:true}); + await page.setViewportSize({width:390,height:844}); + await page.screenshot({path:path.join(output,'mobile.png'),fullPage:true}); + expect(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth)).toBe(true); + expect(errors).toEqual([]); + const report={status:'PASS',source,job:job.id,twin,original:JSON.parse(original.stdout),repaired:JSON.parse(repaired.stdout),download_sha256:downloadHash,interactive:{addition:'PASS',...isolated},source_writes:false,public_deployment:false}; + await writeFile(path.join(output,'report.json'),JSON.stringify(report,null,2)); + console.log(JSON.stringify({status:'PASS',output})); +}catch(error){ + await writeFile(path.join(output,'failure.json'),JSON.stringify({status:'FAIL',message:String(error),public_deployment:false},null,2)); + if(page)await page.screenshot({path:path.join(output,'failure.png'),fullPage:true}).catch(()=>{}); + throw error; +}finally{await browser.close();} diff --git a/orbiters/chameleon/scripts/activate_ditto_verifier_worker.py b/orbiters/chameleon/scripts/activate_ditto_verifier_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..a3facbf96046aea035d8cd471bdd80735f36fe4b --- /dev/null +++ b/orbiters/chameleon/scripts/activate_ditto_verifier_worker.py @@ -0,0 +1,7 @@ +from pathlib import Path +import subprocess +p = Path('/etc/ditto-verifier.env') +s = p.read_text() +assert 'CHAMELEON_VERIFICATION_ENABLED=0' in s +p.write_text(s.replace('CHAMELEON_VERIFICATION_ENABLED=0','CHAMELEON_VERIFICATION_ENABLED=1')) +subprocess.run(['systemctl','restart','chameleon-verifier-ditto'],check=True) diff --git a/orbiters/chameleon/scripts/archive-nav.js b/orbiters/chameleon/scripts/archive-nav.js new file mode 100644 index 0000000000000000000000000000000000000000..8e9b985a64521bb047d8d97d27ff3282b69b3ef7 --- /dev/null +++ b/orbiters/chameleon/scripts/archive-nav.js @@ -0,0 +1 @@ +(()=>{function mount(){const nav=document.querySelector('.session-sidebar');if(!nav||nav.querySelector('[data-archive-link]'))return;const a=document.createElement('a');a.href='/archive/';a.textContent='Archive';a.dataset.archiveLink='true';a.className='ditto-social';const examples=[...nav.querySelectorAll('button')].find(e=>e.textContent==='Examples');if(examples)examples.after(a);else nav.append(a)}new MutationObserver(mount).observe(document.documentElement,{childList:true,subtree:true});mount()})(); diff --git a/orbiters/chameleon/scripts/archive_thumbnails.mjs b/orbiters/chameleon/scripts/archive_thumbnails.mjs new file mode 100644 index 0000000000000000000000000000000000000000..78b57ee383176e5db559ca11bc095670153823a3 --- /dev/null +++ b/orbiters/chameleon/scripts/archive_thumbnails.mjs @@ -0,0 +1,3 @@ +import sharp from 'sharp'; +let input='';for await(const chunk of process.stdin)input+=chunk; +for(const row of JSON.parse(input))await sharp(row.source).resize({width:640,withoutEnlargement:true}).webp({quality:72}).toFile(row.target); diff --git a/orbiters/chameleon/scripts/arithmetic_expression.mjs b/orbiters/chameleon/scripts/arithmetic_expression.mjs new file mode 100644 index 0000000000000000000000000000000000000000..33a0ba1f4bf8773c5ad476f6cabcd6a14366b5e0 --- /dev/null +++ b/orbiters/chameleon/scripts/arithmetic_expression.mjs @@ -0,0 +1,35 @@ +/** Bounded arithmetic grammar, never JavaScript evaluation. IEEE-754 semantics. */ +export function arithmeticExpression(input) { + if(typeof input!=='string'||input.length>1000)throw Error('EXPRESSION_BUDGET'); + const tokens=input.match(/Infinity|NaN|(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?|\*\*|[()+*/%-]|\S/g)||[]; + if(tokens.length>256)throw Error('TOKEN_BUDGET'); + let at=0,depth=0; + const take=()=>tokens[at++]; + function atom(){ + if(++depth>32)throw Error('DEPTH_BUDGET'); + let value; + if(tokens[at]==='('){take();value=sum();if(take()!==')')throw Error('MISSING_PAREN');} + else { + const token=take(); + if(!token||! /^(?:Infinity|NaN|(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)$/.test(token))throw Error('EXPECTED_NUMBER'); + value=Number(token); + } + depth--;return value; + } + function power(){let v=atom();if(tokens[at]==='**'){take();v=v**unary();}return v;} + function unary(){ + if(tokens[at]==='+'||tokens[at]==='-'){ + const sign=take(); + if(tokens[at]===sign)throw Error('INCREMENT_NOT_ARITHMETIC'); + // JavaScript forbids a unary expression as the unparenthesized left of **. + if(tokens[at]!=='(' && tokens[at+1]==='**')throw Error('UNARY_EXPONENT_BASE'); + if(++depth>32)throw Error('DEPTH_BUDGET'); + const value=unary();depth--; + return sign==='-'?-value:value; + } + return power(); + } + function product(){let v=unary();while(['*','/','%'].includes(tokens[at])){const op=take(),r=unary();v=op==='*'?v*r:op==='/'?v/r:v%r;}return v;} + function sum(){let v=product();while(['+','-'].includes(tokens[at])){const op=take();if(tokens[at]===op)throw Error('INCREMENT_NOT_ARITHMETIC');const r=product();v=op==='+'?v+r:v-r;}return v;} + const value=sum();if(at!==tokens.length)throw Error('UNSUPPORTED_EXPRESSION');return value; +} diff --git a/orbiters/chameleon/scripts/audit_catalogue_revisions.py b/orbiters/chameleon/scripts/audit_catalogue_revisions.py new file mode 100644 index 0000000000000000000000000000000000000000..c3f187a4e26bca70310f537b3bb5dabd3b75d7ec --- /dev/null +++ b/orbiters/chameleon/scripts/audit_catalogue_revisions.py @@ -0,0 +1,21 @@ +"""Verify offline revision provenance, not appearance or functionality.""" +import hashlib +import json +from pathlib import Path + +digest=lambda p:hashlib.sha256(p.read_bytes()).hexdigest() +results=[] +for receipt in Path('.local/standards-revisions').glob('*/doctype-repair.json'): + try: + row=json.loads(receipt.read_text(encoding='utf8')) + source=Path(row['source']);target=receipt.parent + assert digest(source/'preview.html')==row['before_sha256'],'Original preview changed' + assert digest(target/'preview.html')==row['after_sha256'],'Revision preview changed' + assert (target/'preview.html').read_bytes()==b'\n'+(source/'preview.html').read_bytes(),'Unexpected rewrite' + for name in ['source.png','source-full.png','observation.json','capture.json']: + assert digest(source/name)==digest(target/name),f'Source evidence differs: {name}' + results.append({'directory':str(target),'provenance_verified':True}) + except Exception as exc: + results.append({'directory':str(receipt.parent),'provenance_verified':False,'error':str(exc)}) +Path('.local/standards-revision-audit.json').write_text(json.dumps(results,indent=2),encoding='utf8') +print(json.dumps({'verified':sum(r['provenance_verified'] for r in results),'failed':sum(not r['provenance_verified'] for r in results)})) diff --git a/orbiters/chameleon/scripts/audit_metafold_local.py b/orbiters/chameleon/scripts/audit_metafold_local.py new file mode 100644 index 0000000000000000000000000000000000000000..6c18ad0206fc5610af9b97444cd9228a6b7eee90 --- /dev/null +++ b/orbiters/chameleon/scripts/audit_metafold_local.py @@ -0,0 +1,87 @@ +"""Read-only independent delivery audit of a completed normal-local MetaFold run.""" + +import argparse +import io +import json +import sys +import zipfile +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "packages/core")) +from chameleon_core.browser_contract import validate_contract +from chameleon_core.config import load_settings +from chameleon_core.contracts import digest +from chameleon_core.counterpart_bundles import CounterpartBundles +from chameleon_core.db import BehaviorRecord, MetaFoldRun, database +from chameleon_core.recovery import local_source +from chameleon_core.twins import Twins +from verified_counterpart import verify_delivery + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("run_id") + parser.add_argument("--contracts", required=True) + parser.add_argument("--output", required=True) + args = parser.parse_args() + output = Path(args.output).resolve() + if not output.is_relative_to(ROOT / ".local") or output.exists(): + raise ValueError("Fresh local output required") + cfg = load_settings() + if local_source(cfg.database_url).database != "chameleon": + raise ValueError("Normal local database required") + contracts = json.loads(Path(args.contracts).read_text()) + if isinstance(contracts, dict): + contracts = contracts["contracts"] + expected = {validate_contract(c)[1] for c in contracts} + engine, sessions = database(cfg.database_url) + try: + with sessions() as session: + run = session.get(MetaFoldRun, args.run_id) + assert run is not None and run.status == "COMPLETE" + current, checks = run.state["current"], run.state["checks"] + assert set(checks) == expected + evidence = Twins(sessions).repository_evidence(run.owner, current["twin_id"]) + assert evidence.content_digest == current["source_digest"] + package = {"digest": evidence.content_digest, "repository": evidence.payload} + verified = [] + for contract_hash, check in checks.items(): + record = session.get(BehaviorRecord, check["record_id"]) + assert record.owner == run.owner and record.twin == current["twin_id"] + receipt = record.receipt + assert record.receipt_digest == digest(receipt) == check["receipt_digest"] + assert receipt["contract_digest"] == contract_hash + assert receipt["source_digest"] == current["source_digest"] + assert receipt.get("dependency_digest") == current["dependency_digest"] + assert receipt.get("overlay_digest") == current.get("overlay_digest") == check.get("overlay_digest") + body, fingerprint = CounterpartBundles(sessions).download( + run.owner, current["twin_id"], check["bundle"]["id"] + ) + assert fingerprint == check["bundle"]["sha256"] + delivery = verify_delivery(body, package) + assert delivery["dependency_digest"] == current["dependency_digest"] + with zipfile.ZipFile(io.BytesIO(body)) as archive: + overlay_path = "evidence/overlay.json" + if current.get("overlay_digest"): + assert digest(json.loads(archive.read(overlay_path))) == current["overlay_digest"] + else: + assert overlay_path not in archive.namelist() + verified.append({"contract_digest": contract_hash, "bundle_sha256": fingerprint, **delivery}) + result = { + "run_id": run.id, + "status": "PASS", + "source_digest": evidence.content_digest, + "dependency_digest": current["dependency_digest"], + "overlay_digest": current.get("overlay_digest"), + "contracts": verified, + "public_changes": False, + } + output.write_text(json.dumps(result, indent=2)) + print(json.dumps(result)) + finally: + engine.dispose() + + +if __name__ == "__main__": + main() diff --git a/orbiters/chameleon/scripts/audit_repository_catalogue.py b/orbiters/chameleon/scripts/audit_repository_catalogue.py new file mode 100644 index 0000000000000000000000000000000000000000..c01b87fc41e80fa341f006c8a5eba4737d27ce44 --- /dev/null +++ b/orbiters/chameleon/scripts/audit_repository_catalogue.py @@ -0,0 +1,22 @@ +"""Independently verify saved repository archives against their receipts.""" +import hashlib,json,zipfile +from pathlib import Path +from clone_catalogue import connect + +def main(): + db=connect('.local/clone-catalogue.sqlite3');results=[] + for url,evidence_path in db.execute("SELECT url,review FROM sites WHERE kind='repository' AND status='captured'"): + try: + receipt=Path(evidence_path);e=json.loads(receipt.read_text(encoding='utf8'));archive=receipt.with_name('source.zip') + data=archive.read_bytes() + assert e['url']==url and len(data)==e['bytes'],'Receipt mismatch' + assert hashlib.sha256(data).hexdigest()==e['archive_sha256'],'Digest mismatch' + with zipfile.ZipFile(archive) as z: + assert len(z.infolist())==e['files'],'Inventory mismatch' + assert all(e['commit'] in n.split('/')[0] for n in z.namelist()),'Unpinned archive root' + assert z.testzip() is None,'CRC failure' + results.append({'url':url,'archive_verified':True,'commit':e['commit'],'build_verified':False}) + except Exception as exc:results.append({'url':url,'archive_verified':False,'failure':str(exc)}) + output=Path('.local/repository-archive-audit.json');output.write_text(json.dumps(results,indent=2),encoding='utf8') + print(json.dumps({'verified':sum(r['archive_verified'] for r in results),'failed':sum(not r['archive_verified'] for r in results),'report':str(output)}));db.close() +if __name__=='__main__':main() diff --git a/orbiters/chameleon/scripts/audit_website_catalogue.py b/orbiters/chameleon/scripts/audit_website_catalogue.py new file mode 100644 index 0000000000000000000000000000000000000000..73f149cd6a1ad3ffae55d9a6c1faea8574aa2ce6 --- /dev/null +++ b/orbiters/chameleon/scripts/audit_website_catalogue.py @@ -0,0 +1,51 @@ +"""Check evidence completeness. This does not certify visual quality.""" +import hashlib,json,struct +from pathlib import Path +from clone_catalogue import connect,normalize + +def png_dimensions(path): + data=path.read_bytes() + if data[:8]!=b'\x89PNG\r\n\x1a\n' or data[12:16]!=b'IHDR': raise ValueError('Invalid PNG header') + return struct.unpack('>II',data[16:24]) + +def audit(url,screenshot): + directory=Path(screenshot).parent + observation=json.loads((directory/'observation.json').read_text(encoding='utf8')) + capture=json.loads((directory/'capture.json').read_text(encoding='utf8')) + if normalize(observation['source'])!=normalize(url): raise ValueError('Source mismatch') + if not capture.get('html'): raise ValueError('Empty capture') + files={} + for name in ['observation.json','capture.json','preview.html','source.png','review.png']: + data=(directory/name).read_bytes() + files[name]={'bytes':len(data),'sha256':hashlib.sha256(data).hexdigest()} + if png_dimensions(directory/'source.png')!=(1440,900) or png_dimensions(directory/'review.png')!=(1440,900): raise ValueError('Unexpected viewport') + manifest=directory/'asset-manifest.json' + if manifest.exists(): + for name,record in json.loads(manifest.read_text(encoding='utf8')).items(): + path=(directory/name).resolve() + if not path.is_relative_to(directory.resolve()): raise ValueError('Asset escapes capture directory') + data=path.read_bytes() + if len(data)!=record['bytes'] or hashlib.sha256(data).hexdigest()!=record['sha256']: raise ValueError('Asset hash mismatch') + full_page={} + for name in ['source-full.png','review-full.png']: + path=directory/name + if path.exists(): + width,height=png_dimensions(path) + if width<1 or height<1: raise ValueError('Invalid full-page dimensions') + data=path.read_bytes() + full_page[name]={'width':width,'height':height,'bytes':len(data),'sha256':hashlib.sha256(data).hexdigest()} + traversal_path=directory/'traversal.json' + traversal=json.loads(traversal_path.read_text(encoding='utf8')) if traversal_path.exists() else {} + standards_declared=(directory/'preview.html').read_bytes().lstrip().lower().startswith(b'') + return {'url':url,'directory':str(directory),'evidence_complete':True,'standards_doctype_declared':standards_declared,'full_page_evidence_complete':len(full_page)==2,'traversal_complete':traversal.get('complete'),'full_page':full_page,'visual_quality_approved':False,'missing_assets':len(capture.get('missing_assets',[])),'files':files} + +def main(): + db=connect('.local/clone-catalogue.sqlite3');results=[] + rows=db.execute("SELECT url,screenshot FROM sites WHERE kind='website' AND screenshot IS NOT NULL").fetchall() + db.close() # Do not retain a read lock while hashing large evidence bundles. + for url,screenshot in rows: + try: results.append(audit(url,screenshot)) + except Exception as exc: results.append({'url':url,'evidence_complete':False,'failure':str(exc)}) + Path('.local/website-evidence-audit.json').write_text(json.dumps(results,indent=2),encoding='utf8') + print(json.dumps({'basic_complete':sum(r['evidence_complete'] for r in results),'incomplete':sum(not r['evidence_complete'] for r in results),'full_page_complete':sum(r.get('full_page_evidence_complete',False) for r in results),'traversal_complete':sum(r.get('traversal_complete') is True for r in results)}));db.close() +if __name__=='__main__':main() diff --git a/orbiters/chameleon/scripts/benchmark_microfold.py b/orbiters/chameleon/scripts/benchmark_microfold.py new file mode 100644 index 0000000000000000000000000000000000000000..0e0e5644221fbc848d511494312356c0547d5f8d --- /dev/null +++ b/orbiters/chameleon/scripts/benchmark_microfold.py @@ -0,0 +1,96 @@ +"""Measured scalar/NumPy CPU work; no target execution, providers or network.""" + +import argparse +import json +import platform +import random +import statistics +import sys +import time +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "packages/core")) +from chameleon_core.microfold import compile_model, search, transition_batch, validate_plan + + +def branching_model(seed): + rng = random.Random(seed) + facts = ["f" + str(i) for i in range(17)] + operations = [] + for i in range(40): + add = rng.randrange(16) + remove = (add + rng.randrange(1, 16)) % 16 + operations.append({"id": "operation:" + str(i), "requires": [], "forbids": [], + "adds": [facts[add]], "removes": [facts[remove]], "cost": 1 + i % 3}) + return {"version": "microfold-model-v1", "evidence_digest": "b" * 64, "facts": facts, + "initial": [], "goal": {"all": [facts[16]], "none": []}, "operators": operations} + + +def measure(work, repeats): + timings = [] + for _ in range(repeats): + start = time.perf_counter_ns() + work() + timings.append((time.perf_counter_ns() - start) / 1_000_000) + ordered = sorted(timings) + return {"median_ms": statistics.median(timings), "p95_ms": ordered[int((len(ordered)-1)*.95)], + "min_ms": min(timings), "repeats": repeats} + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--output", required=True) + parser.add_argument("--repeats", type=int, default=31) + args = parser.parse_args() + if not 3 <= args.repeats <= 101: + raise ValueError("BENCHMARK_REPEAT_BUDGET") + destination = Path(args.output).resolve() + if destination.exists() or not destination.is_relative_to(ROOT / ".local"): + raise ValueError("FRESH_LOCAL_REPORT_REQUIRED") + started = time.perf_counter_ns() + import numpy as np + + cold_ms = (time.perf_counter_ns() - started) / 1_000_000 + model = branching_model(20260921) + _, _, _, operations = compile_model(model) + rng = random.Random(27) + batches = [[rng.randrange(1 << 16) for _ in range(25)] for _ in range(10)] + # Ten different 25-state x 40-operator batches: exactly 10,000 pair checks. + for states in batches: + assert transition_batch(states, operations, "python") == transition_batch(states, operations, "numpy") + parity = 0 + for seed in range(25): + source = branching_model(seed) + if seed % 2: + source["goal"]["all"] = ["f1", "f2", "f3"] + scalar, vector = search(source, backend="python"), search(source, backend="numpy") + assert {k: v for k, v in scalar.items() if k not in {"backend", "wall_ns"}} == { + k: v for k, v in vector.items() if k not in {"backend", "wall_ns"}} + if scalar["status"] == "PLAN_FOUND": + assert validate_plan(source, scalar) and validate_plan(source, vector) + parity += 1 + reports = {} + for backend in ("python", "numpy"): + def kernel(backend=backend): + return [transition_batch(states, operations, backend) for states in batches] + + kernel() # Warm runtime separately from measured iterations. + full = search(model, backend=backend) + reports[backend] = {"kernel_10000": measure(kernel, args.repeats), + "full_search": measure(lambda backend=backend: search(model, backend=backend), args.repeats), + "full_search_example": full} + result = {"version": "microfold-benchmark-v1", "python": platform.python_version(), + "platform": platform.platform(), "numpy": np.__version__, "numpy_import_ms": cold_ms, + "parity_models": parity, "kernel_microsteps_per_sample": 10000, "backends": reports, + "external_steps": 0, + "scope": "Synthetic explicit transition search; timings exclude browser, acquisition, model inference and network"} + destination.write_text(json.dumps(result, indent=2), encoding="utf-8") + print(json.dumps({"report": str(destination), "numpy_import_ms": cold_ms, + "parity_models": parity, "backends": { + backend: {key: value for key, value in row.items() if key != "full_search_example"} + for backend, row in reports.items()}}, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/orbiters/chameleon/scripts/bootstrap_uv_linux.py b/orbiters/chameleon/scripts/bootstrap_uv_linux.py new file mode 100644 index 0000000000000000000000000000000000000000..31698fec9fac6f29280a4a8a3ef0395636130304 --- /dev/null +++ b/orbiters/chameleon/scripts/bootstrap_uv_linux.py @@ -0,0 +1,31 @@ +"""Install only the pinned uv executable from a hash-checked official PyPI wheel.""" +import hashlib +import io +import json +import urllib.request +import zipfile +from pathlib import Path + +with urllib.request.urlopen("https://pypi.org/pypi/uv/0.12.17/json", timeout=30) as r: + metadata = json.load(r) +choices = [f for f in metadata["urls"] if f["filename"].endswith("manylinux_2_17_x86_64.manylinux2014_x86_64.whl")] +if len(choices) != 1: + raise RuntimeError("Expected one Linux x86_64 wheel") +item = choices[0] +if item["size"] > 40_000_000 or not item["url"].startswith("https://files.pythonhosted.org/"): + raise RuntimeError("Wheel boundary") +with urllib.request.urlopen(item["url"], timeout=60) as r: + body = r.read(40_000_001) +if len(body) != item["size"] or hashlib.sha256(body).hexdigest() != item["digests"]["sha256"]: + raise RuntimeError("Wheel digest mismatch") +destination = Path("/opt/chameleon-laya/bootstrap-uv") +destination.mkdir(exist_ok=True) +with zipfile.ZipFile(io.BytesIO(body)) as archive: + names = [name for name in archive.namelist() if name.endswith("/uv")] + if len(names) != 1: + raise RuntimeError("Executable member mismatch") + target = destination / "uv" + target.write_bytes(archive.read(names[0])) + target.chmod(0o750) +(destination / "receipt.json").write_text(json.dumps({"version": "0.12.17", "url": item["url"], "sha256": item["digests"]["sha256"]})) +print("Pinned uv bootstrap verified") diff --git a/orbiters/chameleon/scripts/browser_contract.mjs b/orbiters/chameleon/scripts/browser_contract.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d45ed652e93049ac37ae987e8035cc07bbd315df --- /dev/null +++ b/orbiters/chameleon/scripts/browser_contract.mjs @@ -0,0 +1,58 @@ +/** Trusted declarative checks. No supplied JavaScript, URLs, network or host actions. */ +const shapes={click:['op','selector'],fill:['op','selector','value'],press:['op','selector','key'],reload:['op'],visible:['op','selector'],text:['op','selector','equals'],value:['op','selector','equals'],count:['op','selector','equals'],location:['op','equals']}; +shapes.wait_count=['op','selector','equals']; +shapes.dblclick=['op','selector']; +shapes.type=['op','selector','value']; +export function validateContract(value){ + if(!value||typeof value!=='object'||Array.isArray(value)||Object.keys(value).sort().join()!=='name,steps,version'||!['browser-contract-v1','browser-contract-v2'].includes(value.version)||typeof value.name!=='string'||value.name.length<1||value.name.length>120||!Array.isArray(value.steps)||value.steps.length<1||value.steps.length>(value.version==='browser-contract-v2'?80:12))throw Error('INVALID_BROWSER_CONTRACT'); + let assertions=0; + for(const s of value.steps){ + if(!s||typeof s!=='object'||Array.isArray(s)||!Object.hasOwn(shapes,s.op)||Object.keys(s).sort().join()!==[...shapes[s.op]].sort().join())throw Error('INVALID_BROWSER_STEP'); + if('selector'in s&&(typeof s.selector!=='string'||!s.selector.length||s.selector.length>200||s.selector.includes('>>')||/^(xpath|text|internal|role)=/.test(s.selector)))throw Error('INVALID_CSS_SELECTOR'); + if(s.op==='press'&&!['Enter','Tab','Space','ArrowUp','ArrowDown','ArrowLeft','ArrowRight','Escape','Backspace'].includes(s.key))throw Error('INVALID_BROWSER_KEY'); + if(s.op==='fill'&&(typeof s.value!=='string'||s.value.length>1000))throw Error('INVALID_FILL_VALUE'); + if(s.op==='type'&&(value.version!=='browser-contract-v2'||typeof s.value!=='string'||!/^[\x20-\x7e]{1,256}$/.test(s.value)))throw Error('INVALID_TYPE_VALUE'); + if(['text','value'].includes(s.op)&&(typeof s.equals!=='string'||s.equals.length>1000))throw Error('INVALID_EXPECTED_TEXT'); + if(['count','wait_count'].includes(s.op)&&(!Number.isInteger(s.equals)||s.equals<0||s.equals>1000))throw Error('INVALID_EXPECTED_COUNT'); + if(s.op==='wait_count'&&value.version!=='browser-contract-v2')throw Error('WAIT_COUNT_REQUIRES_V2'); + if(s.op==='dblclick'&&value.version!=='browser-contract-v2')throw Error('DBLCLICK_REQUIRES_V2'); + if(s.op==='location'&&(value.version!=='browser-contract-v2'||typeof s.equals!=='string'||s.equals.length>500||!s.equals.startsWith('/')||s.equals.startsWith('//')||/[\\\s]/.test(s.equals)))throw Error('INVALID_EXPECTED_LOCATION'); + if(['visible','text','value','count','wait_count','location'].includes(s.op))assertions++; + } + if(!assertions)throw Error('ASSERTION_REQUIRED'); + return structuredClone(value); +} +export async function evaluateContract(page, raw){ + const contract=validateContract(raw),results=[]; + const initialOrigin=contract.version==='browser-contract-v2'?new URL(page.url()).origin:null; + const mismatch=(kind,index,expected,actual)=>{const error=Error(kind+':'+index);error.assertion={step:index,expected,actual:typeof actual==='string'?actual.slice(0,1000):actual};throw error;}; + for(const [index,s] of contract.steps.entries()){ + const locator=s.selector?page.locator('css='+s.selector):null; + if(s.op==='reload')await page.reload({waitUntil:'load',timeout:4000}); + else if(s.op==='click')await locator.click({timeout:2000}); + else if(s.op==='dblclick')await locator.dblclick({timeout:2000}); + else if(s.op==='fill')await locator.fill(s.value,{timeout:2000}); + else if(s.op==='type')await locator.pressSequentially(s.value,{timeout:2000}); + else if(s.op==='press')await locator.press(s.key,{timeout:2000}); + else if(s.op==='visible')await locator.waitFor({state:'visible',timeout:2000}); + else if(s.op==='text'){const actual=await locator.innerText({timeout:2000});if(actual!==s.equals)mismatch('TEXT_ASSERTION_FAILED',index,s.equals,actual);} + else if(s.op==='value'){const actual=await locator.inputValue({timeout:2000});if(actual!==s.equals)mismatch('VALUE_ASSERTION_FAILED',index,s.equals,actual);} + else if(s.op==='count'){const actual=await locator.count();if(actual!==s.equals)mismatch('COUNT_ASSERTION_FAILED',index,s.equals,actual);} + else if(s.op==='wait_count'){ + const deadline=performance.now()+2000; + let actual=await locator.count(); + while(actual!==s.equals&&performance.now()setTimeout(resolve,25)); + actual=await locator.count(); + } + if(actual!==s.equals)mismatch('WAIT_COUNT_ASSERTION_FAILED',index,s.equals,actual); + } + else if(s.op==='location'){ + const current=new URL(page.url()),actual=current.pathname+current.search+current.hash; + if(current.origin!==initialOrigin)mismatch('ORIGIN_ASSERTION_FAILED',index,initialOrigin,current.origin); + if(actual!==s.equals)mismatch('LOCATION_ASSERTION_FAILED',index,s.equals,actual); + } + results.push({step:index,op:s.op,status:'PASS'}); + } + return {name:contract.name,contract_version:contract.version,steps:results,status:'PASS',scope:'Only the declared interactions and assertions; not whole-application equivalence.'}; +} diff --git a/orbiters/chameleon/scripts/browser_contract.test.mjs b/orbiters/chameleon/scripts/browser_contract.test.mjs new file mode 100644 index 0000000000000000000000000000000000000000..412d38aef002f734c35a596b929d39e0572c9b5e --- /dev/null +++ b/orbiters/chameleon/scripts/browser_contract.test.mjs @@ -0,0 +1,47 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import {validateContract,evaluateContract} from './browser_contract.mjs'; +const wrap=steps=>({version:'browser-contract-v1',name:'control',steps}); +test('typing is bounded v2, appends through keyboard API and never invokes fill',async()=>{ + const raw={...wrap([{op:'type',selector:'input',value:'ython'},{op:'value',selector:'input',equals:'Python'}]),version:'browser-contract-v2'}; + let value='P';const page={url:()=> 'https://local.invalid/',locator:()=>({ + pressSequentially:async(text,opts)=>{assert.equal(opts.timeout,2000);value+=text;}, + fill:()=>{throw Error('must not fill');},inputValue:async()=>value})}; + assert.equal((await evaluateContract(page,raw)).status,'PASS'); + for(const bad of ['', 'x'.repeat(257),'x\n','é',null]) + assert.throws(()=>validateContract({...raw,steps:[{...raw.steps[0],value:bad},raw.steps[1]]})); + assert.throws(()=>validateContract({...raw,version:'browser-contract-v1'})); +}); +test('double click requires v2 and uses bounded native browser action',async()=>{ + const raw=wrap([{op:'dblclick',selector:'label'},{op:'count',selector:'label',equals:1}]); + assert.throws(()=>validateContract(raw),/DBLCLICK_REQUIRES_V2/); + let clicks=0;const page={url:()=> 'https://local.invalid/',locator:()=>({dblclick:async options=>{assert.equal(options.timeout,2000);clicks++;},count:async()=>1})}; + assert.equal((await evaluateContract(page,{...raw,version:'browser-contract-v2'})).status,'PASS'); + assert.equal(clicks,1); +}); + +test('eventual count is explicit v2; delayed rendering passes, permanent mismatch fails',async()=>{ + const input={...wrap([{op:'wait_count',selector:'.tile',equals:2}]),version:'browser-contract-v2'}; + assert.throws(()=>validateContract({...input,version:'browser-contract-v1'}),/WAIT_COUNT_REQUIRES_V2/); + let reads=0; + const page={url:()=> 'https://local.invalid/',locator:()=>({count:async()=>++reads<3?0:2})}; + assert.equal((await evaluateContract(page,input)).status,'PASS'); + assert.equal(reads,3); + const wrong={url:page.url,locator:()=>({count:async()=>0})}; + await assert.rejects(evaluateContract(wrong,input),/WAIT_COUNT_ASSERTION_FAILED/); + // Original immediate contract semantics stay immediate. + reads=0; + await assert.rejects(evaluateContract(page,wrap([{op:'count',selector:'.tile',equals:2}])),/COUNT_ASSERTION_FAILED/); + assert.equal(reads,1); +}); +test('rejects executable and unbounded contracts',()=>{ + for(const steps of [[{op:'evaluate',code:'process.exit()'}],[{op:'click',selector:'button'}],Array(13).fill({op:'visible',selector:'body'}),[{op:'visible',selector:'xpath=//body'}],[{op:'count',selector:'body',equals:-1}],[{op:'visible',selector:'body',url:'https://example.com'}]])assert.throws(()=>validateContract(wrap(steps))); +}); +test('contract is copied and requires explicit assertions',()=>{ + const input=wrap([{op:'visible',selector:'body'}]);const copy=validateContract(input);copy.steps[0].selector='button';assert.equal(input.steps[0].selector,'body'); +}); +test('evaluator executes declared operations and catches wrong output',async()=>{ + let value='';const page={locator:selector=>{assert.equal(selector,'css=input');return {fill:async v=>{value=v;},inputValue:async()=>value};}}; + const result=await evaluateContract(page,wrap([{op:'fill',selector:'input',value:'hello'},{op:'value',selector:'input',equals:'hello'}]));assert.equal(result.steps.length,2); + await assert.rejects(evaluateContract(page,wrap([{op:'value',selector:'input',equals:'wrong'}])),/VALUE_ASSERTION_FAILED/); +}); diff --git a/orbiters/chameleon/scripts/browser_result_gate.py b/orbiters/chameleon/scripts/browser_result_gate.py new file mode 100644 index 0000000000000000000000000000000000000000..7a10f12df48586bf2d9a432c6e87547f474cf4f0 --- /dev/null +++ b/orbiters/chameleon/scripts/browser_result_gate.py @@ -0,0 +1,40 @@ +"""Bind bounded-browser results to the exact requested package and contract.""" + + +def failure_class(runtime, behavior): + """Classify failures for diagnosis only; never authorize a passing receipt.""" + if any(runtime.get(key) is True for key in ( + 'timed_out', 'cpu_budget_exhausted', 'output_budget_exhausted', 'memory_budget_exhausted' + )): + return 'EXECUTION_BUDGET_EXHAUSTED' + if (not isinstance(behavior, dict) + or behavior.get('error') == 'BROWSER_DRIVER_DID_NOT_REPORT'): + return 'BROWSER_DRIVER_FAILURE' + if runtime.get('remaining_job_processes') != 0: + return 'BROWSER_RUNTIME_FAILURE' + # The driver deliberately exits 1 for a reported failed assertion. + if (runtime.get('returncode') in (0, 1) + and behavior.get('status') == 'FAIL' + and isinstance(behavior.get('assertion_failure'), dict)): + return 'BEHAVIOR_CHECK_FAILED' + if runtime.get('returncode') != 0: + return 'BROWSER_RUNTIME_FAILURE' + if behavior.get('status') == 'FAIL': + return 'BEHAVIOR_CHECK_FAILED' + return 'EVIDENCE_BINDING_FAILURE' + + +def accepted(runtime, behavior, package_digest, contract_digest, overlay_digest=None, dependency_digest=None): + return ( + runtime.get("returncode") == 0 + and runtime.get("timed_out") is False + and runtime.get("cpu_budget_exhausted") is False + and runtime.get("output_budget_exhausted") is False + and runtime.get("memory_budget_exhausted", False) is False + and runtime.get("remaining_job_processes") == 0 + and behavior.get("status") == "PASS" + and behavior.get("package_digest") == package_digest + and behavior.get("contract_digest") == contract_digest + and behavior.get("overlay_digest") == overlay_digest + and behavior.get("dependency_digest") == dependency_digest + ) diff --git a/orbiters/chameleon/scripts/build_artifact_plan.mjs b/orbiters/chameleon/scripts/build_artifact_plan.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1af62cfa6681f8e6793fb374b2f42d963a4ae50e --- /dev/null +++ b/orbiters/chameleon/scripts/build_artifact_plan.mjs @@ -0,0 +1,81 @@ +/** Inspect build declarations as syntax/data. Never import or execute target config. */ +import {createHash} from 'node:crypto'; +import {createRequire} from 'node:module'; +import {pathToFileURL} from 'node:url'; +import path from 'node:path'; +const require=createRequire(import.meta.url); +const viteRequire=createRequire(require.resolve('vite/package.json')); +const {parseAst}=await import(pathToFileURL(viteRequire.resolve('rolldown/parseAst')).href); +const sha=s=>createHash('sha256').update(s).digest('hex'); +const fail=code=>{throw Error(code);}; +function safe(value){ + if(typeof value!=='string'||value.length>512||!value||value.startsWith('/')|| + /[\\\s%?#:$;&|`<>"']/.test(value)||value.split('/').some(p=>!p||p==='.'||p==='..'))fail('BUILD_PATH_UNSUPPORTED'); + return value; +} +function fields(node){ + if(node?.type!=='ObjectExpression')fail('BUILD_OBJECT_REQUIRED'); + const result=new Map(); + for(const p of node.properties){ + if(p.type!=='Property'||p.computed||p.kind!=='init'||p.method||p.shorthand)fail('BUILD_PROPERTY_UNSUPPORTED'); + const key=p.key.name??p.key.value; + if(typeof key!=='string'||result.has(key))fail('BUILD_DUPLICATE_PROPERTY'); + result.set(key,p.value); + } + return result; +} +export function buildArtifactPlan(config,packageText){ + if(typeof config!=='string'||typeof packageText!=='string'||Buffer.byteLength(config)>65536||Buffer.byteLength(packageText)>65536)fail('BUILD_METADATA_BUDGET'); + const pkg=JSON.parse(packageText),ast=parseAst(config),stack=[ast];let nodes=0; + // Keep this a declaration recognizer, not an evaluator or config interpreter. + while(stack.length){ + const n=stack.pop();if(!n||typeof n!=='object')continue; + if(++nodes>20000)fail('BUILD_AST_BUDGET'); + if(['AssignmentExpression','UpdateExpression','UnaryExpression'].includes(n.type)){ + if(n.type!=='UnaryExpression'||n.operator==='delete')fail('BUILD_MUTABLE_CONFIG_UNSUPPORTED'); + } + for(const v of Object.values(n))if(v&&typeof v==='object')Array.isArray(v)?stack.push(...v):stack.push(v); + } + const defaults=ast.body.filter(n=>n.type==='ExportDefaultDeclaration'); + if(defaults.length!==1)fail('BUILD_DEFAULT_REQUIRED'); + const bindings=ast.body.filter(n=>n.type==='VariableDeclaration').flatMap(n=>n.declarations.map(d=>({kind:n.kind,...d}))) + .filter(d=>d.id?.name==='pkg'); + if(bindings.length!==1||bindings[0].kind!=='const'||bindings[0].init?.type!=='CallExpression'|| + bindings[0].init.callee?.name!=='require'||bindings[0].init.arguments.length!==1|| + bindings[0].init.arguments[0].value!=='./package.json')fail('BUILD_PACKAGE_BINDING_UNSUPPORTED'); + const obj=fields(defaults[0].declaration); + const literal=n=>n?.type==='Literal'&&typeof n.value==='string'?n.value:fail('BUILD_LITERAL_REQUIRED'); + const input=safe(literal(obj.get('input'))); + const outputNode=obj.get('output'); + const outputs=outputNode?.type==='ArrayExpression'?outputNode.elements:[outputNode]; + if(outputs.length>16)fail('BUILD_OUTPUT_BUDGET'); + const declarations=[]; + for(const output of outputs){ + const f=fields(output),n=f.get('file');let file; + if(n?.type==='Literal')file=literal(n); + else if(n?.type==='MemberExpression'&&!n.computed&&n.object?.name==='pkg'&&n.property?.type==='Identifier')file=pkg[n.property.name]; + else fail('BUILD_DYNAMIC_OUTPUT_UNSUPPORTED'); + declarations.push({input,output:safe(file),format:literal(f.get('format'))}); + } + const mappings=[]; + const scripts=pkg.scripts??{}; + if(!scripts||typeof scripts!=='object'||Array.isArray(scripts)||Object.keys(scripts).length>100)fail('BUILD_SCRIPT_BUDGET'); + for(const [name,command] of Object.entries(scripts)){ + if(typeof command!=='string')continue; + const match=/^cp ([^ ]+) ([^ ]+)$/.exec(command); + if(!match)continue; + const from=safe(match[1]),to=safe(match[2]); + for(const declaration of declarations)if(declaration.output===from) + mappings.push({...declaration,destination:to,copy_script:name,command_executed:false}); + } + return {version:'declared-build-artifact-plan-v1',config_sha256:sha(config),package_sha256:sha(packageText), + declarations,mappings,plugins_declared:obj.has('plugins'), + status:'DECLARATIONS_ONLY',verified_application:false, + scope:'Observed source-to-output declarations; plugins, build semantics and runtime equivalence are not verified; no scripts executed'}; +} +if(process.argv[1]&&import.meta.url===pathToFileURL(path.resolve(process.argv[1])).href){ + const chunks=[];let size=0; + for await(const chunk of process.stdin){size+=chunk.length;if(size>262144)fail('BUILD_METADATA_BUDGET');chunks.push(chunk);} + const request=JSON.parse(new TextDecoder('utf-8',{fatal:true}).decode(Buffer.concat(chunks))); + process.stdout.write(JSON.stringify(buildArtifactPlan(request.config,request.package))); +} diff --git a/orbiters/chameleon/scripts/build_artifact_plan.test.mjs b/orbiters/chameleon/scripts/build_artifact_plan.test.mjs new file mode 100644 index 0000000000000000000000000000000000000000..78a646dc87f9dce8ee9755b751e4e779befd6558 --- /dev/null +++ b/orbiters/chameleon/scripts/build_artifact_plan.test.mjs @@ -0,0 +1,20 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import {buildArtifactPlan} from './build_artifact_plan.mjs'; +const config=`const pkg=require('./package.json'); export default {input:'src/index.js',output:[{file:pkg.module,format:'es'}],plugins:[anything()]}`; +const pkg=JSON.stringify({module:'dist/library.js',scripts:{'docs:sync':'cp dist/library.js docs/library.js',deploy:'npm publish'}}); +test('source-output-copy mapping without config or script execution',()=>{ + const p=buildArtifactPlan(config,pkg); + assert.deepEqual(p.mappings,[{input:'src/index.js',output:'dist/library.js',format:'es',destination:'docs/library.js',copy_script:'docs:sync',command_executed:false}]); + assert.equal(p.plugins_declared,true);assert.equal(p.verified_application,false); +}); +test('comments do not create mappings; shell chains are not recognized',()=>{ + const p=buildArtifactPlan('// cp dist/library.js fake.js\n'+config,JSON.stringify({module:'dist/library.js',scripts:{sync:'cp dist/library.js docs/library.js && npm publish'}})); + assert.equal(p.mappings.length,0); +}); +test('reject dynamic output, mutation, duplicates and unsafe paths',()=>{ + assert.throws(()=>buildArtifactPlan(config.replace('pkg.module','calculate()'),pkg),/DYNAMIC_OUTPUT/); + assert.throws(()=>buildArtifactPlan('pkg.module="evil.js";'+config,pkg),/MUTABLE/); + assert.throws(()=>buildArtifactPlan(config.replace("input:'src/index.js'","input:'a.js',input:'b.js'"),pkg),/DUPLICATE/); + assert.throws(()=>buildArtifactPlan(config,pkg.replace('docs/library.js','../library.js')),/PATH_UNSUPPORTED/); +}); diff --git a/orbiters/chameleon/scripts/build_calculator_overlay.mjs b/orbiters/chameleon/scripts/build_calculator_overlay.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3fb22ab1ee0f52360fe26f9084470e3d2160dc5d --- /dev/null +++ b/orbiters/chameleon/scripts/build_calculator_overlay.mjs @@ -0,0 +1,15 @@ +/** Explicit authored repair artifact; not source capture or automatic synthesis. */ +import {readFile,writeFile} from 'node:fs/promises'; +import {createHash} from 'node:crypto'; +import {arithmeticExpression} from './arithmetic_expression.mjs'; +const [input,output]=process.argv.slice(2); +if(!input||!output)throw Error('PACKAGE OUTPUT required'); +const pkg=JSON.parse(await readFile(input,'utf8')); +const name='js/calculate.js',file=pkg.repository.files[name]; +const source=Buffer.from(file.base64,'base64').toString('utf8'); +const needle='eval(displaySection.innerText)'; +if(source.split(needle).length!==2)throw Error('REPAIR_PRECONDITION'); +const after=Buffer.from(arithmeticExpression.toString()+'\n'+source.replace(needle,'arithmeticExpression(displaySection.innerText)')); +await writeFile(output,JSON.stringify({version:'derived-file-v1',source_digest:pkg.digest,path:name, + before_sha256:file.sha256,after_base64:after.toString('base64'),after_sha256:createHash('sha256').update(after).digest('hex'), + operator:'authored-calculator-arithmetic-parser-v1'},null,2),{flag:'wx'}); diff --git a/orbiters/chameleon/scripts/build_declared_module.mjs b/orbiters/chameleon/scripts/build_declared_module.mjs new file mode 100644 index 0000000000000000000000000000000000000000..db79890ae5e555f36d8940cc3146a15efbf6f5e3 --- /dev/null +++ b/orbiters/chameleon/scripts/build_declared_module.mjs @@ -0,0 +1,73 @@ +/** Offline modern-ESM reconstruction. Only trusted virtual-file plugin executes. */ +import {createHash} from 'node:crypto'; +import {createRequire} from 'node:module'; +import {pathToFileURL} from 'node:url'; +import path from 'node:path'; +import {buildArtifactPlan} from './build_artifact_plan.mjs'; +import {moduleReferences} from './module_references.mjs'; +const require=createRequire(import.meta.url); +const viteRequire=createRequire(require.resolve('vite/package.json')); +const {rolldown,VERSION}=await import(pathToFileURL(viteRequire.resolve('rolldown')).href); +const sha=b=>createHash('sha256').update(b).digest('hex'); +const fail=s=>{throw Error(s);}; +const safe=s=>typeof s==='string'&&s.length<=512&&!s.startsWith('/')&&!/[\\%?#:\s]/.test(s)&&s.split('/').every(x=>x&&x!=='.'&&x!=='..'); + +export async function buildDeclaredModule(pkg,importer,policy){ + if(policy!=='modern-esm-bundle-v1')fail('EXPLICIT_BUILD_POLICY_REQUIRED'); + const records=pkg?.repository?.files; + if(!records||Object.keys(records).length>64||!safe(importer))fail('BUILD_PACKAGE_BUDGET'); + const files=new Map();let total=0; + for(const [name,r] of Object.entries(records)){ + const body=Buffer.from(r.base64,'base64');total+=body.length; + if(!safe(name)||body.length!==r.bytes||sha(body)!==r.sha256||total>2097152)fail('BUILD_SOURCE_BINDING'); + files.set(name,body); + } + const text=name=>{if(!files.has(name))fail('BUILD_INPUT_MISSING');return new TextDecoder('utf-8',{fatal:true}).decode(files.get(name));}; + const plan=buildArtifactPlan(text('rollup.config.js'),text('package.json')); + const aliases=new Map(); + for(const m of plan.mappings.filter(m=>m.format==='es')){ + if(aliases.has(m.destination)||files.has(m.destination))fail('BUILD_MAPPING_AMBIGUOUS'); + aliases.set(m.destination,m.input); + } + if(!aliases.size)fail('BUILD_ES_MAPPING_REQUIRED'); + const used=new Map(); + const resolve=name=>{ + if(!safe(name))fail('BUILD_PATH_DENIED'); + const candidates=path.posix.extname(name)?[name]:[name,name+'.js',name+'.mjs',name+'/index.js',name+'/index.mjs']; + const found=candidates.filter(n=>files.has(n)||aliases.has(n)); + if(found.length!==1)fail('BUILD_MODULE_MISSING_OR_AMBIGUOUS'); + const chosen=found[0];if(!/\.(m?js)$/.test(chosen))fail('BUILD_MODULE_TYPE'); + return chosen; + }; + const prefix='\0chameleon:'; + const bundle=await rolldown({input:importer,treeshake:false,plugins:[{ + name:'captured-files-only', + resolveId(specifier,from){ + if(!from)return prefix+resolve(specifier); + if(!from.startsWith(prefix)||!specifier.startsWith('./')&&!specifier.startsWith('../'))fail('BUILD_EXTERNAL_IMPORT_DENIED'); + const logical=from.slice(prefix.length),source=aliases.get(logical)??logical; + return prefix+resolve(path.posix.normalize(path.posix.join(path.posix.dirname(source),specifier))); + }, + load(id){ + if(!id.startsWith(prefix))fail('BUILD_HOST_READ_DENIED'); + const logical=id.slice(prefix.length),source=aliases.get(logical)??logical; + const body=text(source);if(moduleReferences(body).dynamic_imports)fail('BUILD_DYNAMIC_IMPORT_DENIED'); + used.set(logical,{source,sha256:sha(files.get(source))});return body; + } + }]}); + let generated; + try{generated=await bundle.generate({format:'es',minify:true,sourcemap:false});}finally{await bundle.close();} + if(generated.output.length!==1||generated.output[0].type!=='chunk')fail('BUILD_OUTPUT_SHAPE'); + const body=Buffer.from(generated.output[0].code); + if(body.length>65536)fail('BUILD_OUTPUT_BUDGET'); + return {version:'modern-esm-build-candidate-v1',status:'UNVERIFIED_CANDIDATE',source_digest:pkg.digest, + importer,policy,tool:{name:'rolldown',version:VERSION},plan,used:Object.fromEntries(used), + after_base64:body.toString('base64'),after_sha256:sha(body),bytes:body.length, + scope:'Trusted modern ESM bundling over captured virtual files; original plugins not executed; original build equivalence and application behavior unverified'}; +} +if(process.argv[1]&&import.meta.url===pathToFileURL(path.resolve(process.argv[1])).href){ + const chunks=[];let size=0; + for await(const chunk of process.stdin){size+=chunk.length;if(size>8388608)fail('BUILD_INPUT_BUDGET');chunks.push(chunk);} + const r=JSON.parse(Buffer.concat(chunks).toString('utf8')); + process.stdout.write(JSON.stringify(await buildDeclaredModule(r.package,r.importer,r.policy))); +} diff --git a/orbiters/chameleon/scripts/build_declared_module.test.mjs b/orbiters/chameleon/scripts/build_declared_module.test.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6ce5f0d5d1d78b83a3887db2106d87b779be5f81 --- /dev/null +++ b/orbiters/chameleon/scripts/build_declared_module.test.mjs @@ -0,0 +1,37 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import {createHash} from 'node:crypto'; +import {buildDeclaredModule} from './build_declared_module.mjs'; +import {buildGraphPlan} from './build_graph_plan.mjs'; +function fixture(source){ + const raw={'rollup.config.js':`const pkg=require('./package.json');export default {input:'src/core.js',output:{file:pkg.module,format:'es'}}`, + 'package.json':JSON.stringify({module:'dist/core.js',scripts:{sync:'cp dist/core.js web/core.js'}}), + 'src/core.js':source,'web/main.js':`import {twice} from './core'; export const answer=twice(21);`}; + return {digest:'a'.repeat(64),repository:{files:Object.fromEntries(Object.entries(raw).map(([p,s])=>{const b=Buffer.from(s);return[p,{base64:b.toString('base64'),bytes:b.length,sha256:createHash('sha256').update(b).digest('hex')}];}))}}; +} +test('bundles declared generated alias using captured bytes only',async()=>{ + const p=fixture('export const twice=x=>x*2;');const before=JSON.stringify(p); + const r=await buildDeclaredModule(p,'web/main.js','modern-esm-bundle-v1'); + assert.equal(r.used['web/core.js'].source,'src/core.js'); + assert.equal(r.status,'UNVERIFIED_CANDIDATE');assert.equal(JSON.stringify(p),before); + assert.ok(r.bytes>0); +}); +test('external and dynamic module acquisition refuse',async()=>{ + await assert.rejects(()=>buildDeclaredModule(fixture(`import x from 'https://example.com/a.js';export const twice=x;`),'web/main.js','modern-esm-bundle-v1')); + await assert.rejects(()=>buildDeclaredModule(fixture(`export const twice=()=>import('./later.js');`),'web/main.js','modern-esm-bundle-v1')); +}); +test('graph readiness detects transitive gaps without executing source',()=>{ + const p=fixture(`throw Error('must not execute');export {twice} from './helper';`); + const r=buildGraphPlan(p,'web/main.js'); + assert.deepEqual(r.graph.missing_paths,['src/helper']); + assert.equal(r.graph.status,'CAPTURE_REQUIRED'); + assert.equal(r.graph.verified_application,false); + for(const source of [`import x from 'external';`, `import('./later.js');`, `import '../../../escape.js';`]) + assert.throws(()=>buildGraphPlan(fixture(source),'web/main.js')); +}); +test('graph readiness terminates cycles and checks source bytes',()=>{ + const p=fixture(`import '../web/main.js';export const twice=x=>x*2;`); + assert.equal(buildGraphPlan(p,'web/main.js').graph.status,'READY'); + p.repository.files['src/core.js'].sha256='0'.repeat(64); + assert.throws(()=>buildGraphPlan(p,'web/main.js'),/SOURCE_BINDING/); +}); diff --git a/orbiters/chameleon/scripts/build_defined_module.mjs b/orbiters/chameleon/scripts/build_defined_module.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c97e8ede1353eaa7d54f0db3673cae8073c1f112 --- /dev/null +++ b/orbiters/chameleon/scripts/build_defined_module.mjs @@ -0,0 +1,20 @@ +/** Compiler-only transform; target imports stay external and target code is never run. */ +import {createRequire} from 'node:module'; +import {pathToFileURL} from 'node:url'; +import {createHash} from 'node:crypto'; +import {definePlan} from './vite_define_plan.mjs'; +const require=createRequire(import.meta.url), vr=createRequire(require.resolve('vite/package.json')); +const {rolldown,VERSION}=await import(pathToFileURL(vr.resolve('rolldown')).href); +let raw='';for await(const chunk of process.stdin){raw+=chunk;if(raw.length>524288)throw Error('DEFINE_INPUT_BUDGET');} +const r=JSON.parse(raw),plan=definePlan(r.config,r.package,r.config_path); +if(typeof r.source!=='string'||Buffer.byteLength(r.source)>262144)throw Error('DEFINE_SOURCE_BUDGET'); +const bundle=await rolldown({input:'virtual-entry',treeshake:false,transform:{define:plan.constants}, + onLog(level,log){if(level==='warn'||level==='error')throw Error('DEFINE_COMPILER_WARNING:'+log.code);}, + makeAbsoluteExternalsRelative:false,plugins:[{name:'frozen-single-module', + resolveId(id,importer){if(!importer&&id==='virtual-entry')return id;if(importer==='virtual-entry')return {id,external:'absolute'};throw Error('DEFINE_HOST_RESOLUTION_DENIED');}, + load(id){if(id==='virtual-entry')return r.source;throw Error('DEFINE_HOST_LOAD_DENIED');}}]}); +let result;try{result=await bundle.generate({format:'es',minify:true,sourcemap:false});}finally{await bundle.close();} +if(result.output.length!==1||result.output[0].type!=='chunk'||Buffer.byteLength(result.output[0].code)>65536)throw Error('DEFINE_OUTPUT_BUDGET'); +const code=result.output[0].code,sha=s=>createHash('sha256').update(s).digest('hex'); +console.log(JSON.stringify({plan,source_sha256:sha(r.source),after_sha256:sha(code),code, + compiler:{name:'rolldown',version:VERSION},source_executed:false})); diff --git a/orbiters/chameleon/scripts/build_graph_plan.mjs b/orbiters/chameleon/scripts/build_graph_plan.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b346e13c4ef7ea64d48c133c318671ec5e5784eb --- /dev/null +++ b/orbiters/chameleon/scripts/build_graph_plan.mjs @@ -0,0 +1,54 @@ +/** Inert graph readiness only. No source imports, host resolution or network. */ +import {createHash} from 'node:crypto'; +import path from 'node:path'; +import {pathToFileURL} from 'node:url'; +import {buildArtifactPlan} from './build_artifact_plan.mjs'; +import {moduleReferences} from './module_references.mjs'; +const sha=b=>createHash('sha256').update(b).digest('hex'); +const fail=s=>{throw Error(s);}; +const safe=s=>typeof s==='string'&&s.length<=512&&!s.startsWith('/')&&!/[\\%?#:\s]/.test(s)&&s.split('/').every(x=>x&&x!=='.'&&x!=='..'); +export function buildGraphPlan(pkg,importer){ + const records=pkg?.repository?.files,files=new Map();let total=0; + if(!records||Object.keys(records).length>64||!safe(importer))fail('BUILD_GRAPH_INPUT'); + for(const [name,r] of Object.entries(records)){ + const body=Buffer.from(r.base64,'base64');total+=body.length; + if(!safe(name)||r.bytes!==body.length||r.sha256!==sha(body)||total>2097152)fail('BUILD_GRAPH_SOURCE_BINDING'); + files.set(name,body); + } + const text=p=>{if(!files.has(p))fail('BUILD_METADATA_NOT_CAPTURED');return new TextDecoder('utf-8',{fatal:true}).decode(files.get(p));}; + const plan=buildArtifactPlan(text('rollup.config.js'),text('package.json')),aliases=new Map(); + for(const m of plan.mappings.filter(m=>m.format==='es')){ + if(aliases.has(m.destination)||files.has(m.destination))fail('BUILD_MAPPING_AMBIGUOUS'); + aliases.set(m.destination,m.input); + } + if(!aliases.size)fail('BUILD_ES_MAPPING_REQUIRED'); + const pending=[importer],visited=new Set(),missing=new Set(),used={};let edges=0; + while(pending.length){ + const logical=pending.pop(),source=aliases.get(logical)??logical; + if(visited.has(source))continue; + visited.add(source);if(visited.size>64)fail('BUILD_GRAPH_BUDGET'); + if(!files.has(source)){missing.add(source);continue;} + used[source]=sha(files.get(source)); + const syntax=moduleReferences(text(source)); + if(syntax.dynamic_imports)fail('BUILD_DYNAMIC_IMPORT_UNSUPPORTED'); + for(const ref of syntax.references){ + if(++edges>256)fail('BUILD_GRAPH_EDGE_BUDGET'); + if(!ref.specifier.startsWith('./')&&!ref.specifier.startsWith('../'))fail('BUILD_EXTERNAL_IMPORT_DENIED'); + const name=path.posix.normalize(path.posix.join(path.posix.dirname(source),ref.specifier)); + if(!safe(name))fail('BUILD_PATH_DENIED'); + const candidates=path.posix.extname(name)?[name]:[name,name+'.js',name+'.mjs',name+'/index.js',name+'/index.mjs']; + const found=candidates.filter(n=>files.has(n)||aliases.has(n)); + if(found.length>1)fail('BUILD_MODULE_AMBIGUOUS'); + if(!found.length){missing.add(name);continue;} + if(!/\.(m?js)$/.test(found[0]))fail('BUILD_MODULE_TYPE'); + pending.push(found[0]); + } + } + return {...plan,graph:{source_digest:pkg.digest,importer,used,missing_paths:[...missing].sort(), + status:missing.size?'CAPTURE_REQUIRED':'READY',verified_application:false}}; +} +if(process.argv[1]&&import.meta.url===pathToFileURL(path.resolve(process.argv[1])).href){ + const chunks=[];let size=0;for await(const chunk of process.stdin){size+=chunk.length;if(size>8388608)fail('BUILD_GRAPH_INPUT_BUDGET');chunks.push(chunk);} + const r=JSON.parse(Buffer.concat(chunks).toString('utf8')); + process.stdout.write(JSON.stringify(buildGraphPlan(r.package,r.importer))); +} diff --git a/orbiters/chameleon/scripts/build_input_discovery.py b/orbiters/chameleon/scripts/build_input_discovery.py new file mode 100644 index 0000000000000000000000000000000000000000..678a057e85d68a004d3a6e974e2b3e7c9a4c94e6 --- /dev/null +++ b/orbiters/chameleon/scripts/build_input_discovery.py @@ -0,0 +1,132 @@ +"""Bounded staged input discovery from pinned inventory and inert build declarations.""" +import json +import posixpath + +from build_module_overlay import parse_module_source +from chameleon_core.adaptation_contracts import Intake, Residual +from chameleon_core.contracts import digest +from chameleon_core.entry_capture import capture_entry +from chameleon_core.module_resolution import resolve_relative_import +from chameleon_core.repository_capture import fetch_bytes, tree_files, verify_package +from plan_saved_build import plan_saved_build + + +def capture_build_inputs(source, entry, importer, *, additional_paths=(), fetch=fetch_bytes): + """Runs in isolated capture worker; cache frozen GETs and cap the entire chain.""" + cache, trees, plans = {}, {}, [] + wire = reads = 0 + def bounded_fetch(url, limit): + nonlocal wire, reads + if url not in cache: + if reads >= 64: + raise Residual('BUILD_DISCOVERY_REQUEST_BUDGET') + reads += 1 + body = fetch(url, limit) + wire += len(body) + if len(body) > limit or wire > 6*1024*1024: + raise Residual('BUILD_DISCOVERY_WIRE_BUDGET') + cache[url] = body + if '?recursive=1' in url: + tree = json.loads(body) + trees[tree['sha']] = tree + if len(cache[url]) > limit: + raise Residual('BUILD_DISCOVERY_WIRE_BUDGET') + return cache[url] + paths = sorted(set(additional_paths) | {importer}) + previous = None + for _ in range(8): + package = capture_entry(source, entry, bounded_fetch, additional_paths=paths) + repo = package['repository'] + if previous and (any(repo[k] != previous[k] for k in ('source', 'commit_sha', 'tree_sha', 'entry')) + or any(repo['files'].get(p) != r for p, r in previous['files'].items())): + raise Residual('BUILD_DISCOVERY_RECAPTURE_MISMATCH') + tree = trees.get(repo['tree_sha']) + if tree is None: + raise Residual('BUILD_COMPLETE_INVENTORY_REQUIRED') + try: + plan = discover_build_inputs(package, importer, tree) + except ValueError as exc: + raise Residual(str(exc)) from exc + plans.append(plan) + if plan['status'] == 'READY': + repo['projection'].update(additional_local_paths=list(additional_paths), + build_importer=importer, build_discovered_paths=paths, build_discovery=plans) + repo['acquisition'].update(external_reads=reads, wire_bytes=wire) + package['digest'] = digest(repo) + verify_package(package) + return package + new_paths = sorted(set(paths) | set(plan['missing_paths'])) + if new_paths == paths: + raise Residual('BUILD_DISCOVERY_STALLED') + paths, previous = new_paths, repo + raise Residual('BUILD_DISCOVERY_PASS_BUDGET') + + +def discover_build_inputs(package, importer, tree): + files = verify_package(package) + repo = package['repository'] + if tree.get('sha') != repo['tree_sha']: + raise ValueError('BUILD_TREE_BINDING_MISMATCH') + inventory = tree_files(tree, metadata_only=True) + for name, record in repo['files'].items(): + if (name not in inventory or inventory[name]['sha'] != record['git_blob_sha'] + or inventory[name]['size'] != record['bytes']): + raise ValueError('BUILD_HELD_TREE_MISMATCH') + if importer not in files or not importer.endswith(('.js', '.mjs')): + raise ValueError('BUILD_CAPTURED_IMPORTER_REQUIRED') + metadata = {'package.json', 'rollup.config.js'} + if not metadata <= inventory.keys(): + raise ValueError('BUILD_DECLARATION_FILES_ABSENT') + missing = metadata - files.keys() + visited, edges = set(), [] + if not missing: + plan = plan_saved_build(package)['plan'] + aliases = {} + for row in plan['mappings']: + if row['format'] != 'es': + continue + destination = row.get('destination', row['output']) + if destination in aliases or destination in inventory: + raise ValueError('BUILD_ALIAS_AMBIGUOUS') + aliases[destination] = row['input'] + if not aliases: + raise ValueError('BUILD_ES_MAPPING_REQUIRED') + pending = [importer] + while pending: + current = pending.pop() + if current in visited: + continue + visited.add(current) + if len(visited) > 64: + raise ValueError('BUILD_GRAPH_BUDGET') + if current not in inventory: + raise ValueError('BUILD_DECLARED_INPUT_ABSENT') + if current not in files: + missing.add(current) + continue + syntax = parse_module_source(files[current]) + if syntax['dynamic_imports']: + raise ValueError('BUILD_DYNAMIC_IMPORT_UNSUPPORTED') + for ref in syntax['references']: + # Resolver enforces relative-only paths and ambiguity refusal. + virtual = {**inventory, **{p: {'sha': '0'*40, 'size': 0} for p in aliases if p not in inventory}} + resolution = resolve_relative_import(current, ref['specifier'], virtual) + if resolution['status'] != 'RESOLVED': + raise ValueError('BUILD_MODULE_' + resolution['status']) + destination = resolution['matches'][0]['path'] + source = destination if destination in inventory else aliases[destination] + if not posixpath.splitext(source)[1] in ('.js', '.mjs'): + raise ValueError('BUILD_SOURCE_TYPE_UNSUPPORTED') + edges.append({'importer': current, 'specifier': ref['specifier'], + 'destination': destination, 'source': source}) + pending.append(source) + paths = sorted(set(repo.get('projection', {}).get('additional_local_paths', [])) | missing) + if len(paths) > 16: + raise ValueError('BUILD_CAPTURE_PATH_BUDGET') + intake = Intake(source=repo['source']+'/tree/'+repo['commit_sha'], source_type='repository', + repository_scope='entry', repository_entry=repo['entry'], + repository_assets=paths, build_counterpart=True) + return {'version': 'build-input-discovery-v1', 'source_digest': package['digest'], + 'inventory_digest': digest(tree), 'status': 'CAPTURE_REQUIRED' if missing else 'READY', + 'missing_paths': sorted(missing), 'visited': sorted(visited), 'edges': edges, + 'intake': intake.model_dump(mode='json'), 'verified_application': False} diff --git a/orbiters/chameleon/scripts/build_metafold_candidate.mjs b/orbiters/chameleon/scripts/build_metafold_candidate.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6cf927965999feea7230aec67bd48945a6505685 --- /dev/null +++ b/orbiters/chameleon/scripts/build_metafold_candidate.mjs @@ -0,0 +1,78 @@ +/** Build one inspectable arithmetic candidate from retained failure evidence. + * PACKAGE FAILED_LOOP_OR_RECEIPT OUTPUT --scope arithmetic [--contracts ORIGINAL_CONTRACTS] + * Output is exclusive. No browser, installation, source write or target execution. + */ +import {readFile,writeFile,stat,realpath} from 'node:fs/promises'; +import path from 'node:path'; +import {createHash} from 'node:crypto'; +import {selectArithmeticRepair} from './metafold_arithmetic_candidate.mjs'; +import {validateContract} from './browser_contract.mjs'; +const sha=value=>createHash('sha256').update(value).digest('hex'); +const canonical=value=>JSON.stringify(value,(_,v)=>v&&typeof v==='object'&&!Array.isArray(v) + ?Object.fromEntries(Object.keys(v).sort().map(key=>[key,v[key]])):v); +const contractHash=contract=>sha(canonical(contract).replace(/[\u007f-\uffff]/g,c=>'\\u'+c.charCodeAt(0).toString(16).padStart(4,'0'))); +async function json(file,budget=2*1024*1024){ + if((await stat(file)).size>budget)throw Error('CANDIDATE_INPUT_BUDGET'); + return JSON.parse(await readFile(file,'utf8')); +} +function checkedFailure(receipt,pkg,contract){ + const behavior=receipt.behavior,runtime=receipt.runtime,hash=contractHash(contract); + if(!behavior||!runtime||behavior.status!=='FAIL'||runtime.returncode!==1||runtime.remaining_job_processes!==0|| + runtime.timed_out!==false||runtime.cpu_budget_exhausted!==false||runtime.output_budget_exhausted!==false)throw Error('CANDIDATE_CLEAN_FAILED_RECEIPT_REQUIRED'); + for(const record of [behavior,runtime])if(record.package_digest!==pkg.digest||record.contract_digest!==hash|| + record.overlay_digest||record.dependency_digest)throw Error('CANDIDATE_RECEIPT_BINDING_MISMATCH'); + if(receipt.source_digest!==undefined&&receipt.source_digest!==pkg.digest)throw Error('CANDIDATE_RECEIPT_BINDING_MISMATCH'); + if(receipt.contract_digest!==undefined&&receipt.contract_digest!==hash)throw Error('CANDIDATE_RECEIPT_BINDING_MISMATCH'); + const assertion=behavior.assertion_failure; + if(!assertion||assertion.actual!=='error'||!Number.isInteger(assertion.step))throw Error('CANDIDATE_ARITHMETIC_FAILURE_REQUIRED'); + const step=contract.steps[assertion.step]; + if(!step||!['text','value'].includes(step.op)||String(step.equals)!==String(assertion.expected))throw Error('CANDIDATE_ASSERTION_BINDING_MISMATCH'); + return {step:assertion.step,expected:String(assertion.expected),actual:'error'}; +} + +const [packagePath,failurePath,output,flag,scope,...rest]=process.argv.slice(2); +if(!packagePath||!failurePath||!output||flag!=='--scope'||scope!=='arithmetic'|| + (rest.length!==0&&(rest.length!==2||rest[0]!=='--contracts'||!rest[1])))throw Error('PACKAGE FAILED_LOOP_OR_RECEIPT OUTPUT --scope arithmetic [--contracts ORIGINAL_CONTRACTS] required'); +const sourcePath=await realpath(packagePath),evidencePath=await realpath(failurePath); +const destination=path.resolve(output),parent=await realpath(path.dirname(destination)); +if(destination===sourcePath||destination===evidencePath||path.dirname(destination)!==parent)throw Error('CANDIDATE_OUTPUT_BOUNDARY'); +const pkg=await json(sourcePath,8*1024*1024),evidence=await json(evidencePath); +const descriptor={path:sourcePath,digest:pkg.digest},candidate=JSON.stringify(descriptor); +let contracts,attempt; +if(evidence.version==='metafold-clone-loop-v1'){ + if(evidence.sourceDigest!==pkg.digest||!Array.isArray(evidence.attempts)||!evidence.attempts.length)throw Error('CANDIDATE_LOOP_BINDING_MISMATCH'); + attempt=evidence.attempts[0]; + if(attempt.index!==0||attempt.candidateDigest!==sha(candidate)||!Array.isArray(attempt.checks)||attempt.checks.length>12)throw Error('CANDIDATE_ORIGINAL_ATTEMPT_REQUIRED'); + const original=evidence.contracts??(rest[1]?await json(rest[1],72000):null); + if(!original)throw Error('LOOP_ORIGINAL_CONTRACTS_REQUIRED_USE_CONTRACTS_FLAG_OR_RECEIPT'); + contracts=(Array.isArray(original)?original:[original]).map(validateContract); + if(contracts.length!==attempt.checks.length)throw Error('CANDIDATE_CONTRACT_SET_MISMATCH'); + if(sha(JSON.stringify(contracts))!==evidence.contractDigest)throw Error('CANDIDATE_CONTRACT_SET_MISMATCH'); + for(let index=0;index=contracts.length)throw Error('CANDIDATE_CHECK_INDEX_INVALID'); + const folder=path.join(path.dirname(evidencePath),String(index).padStart(3,'0'),'result'); + const assertion=checkedFailure({behavior:await json(path.join(folder,'behavior.json')),runtime:await json(path.join(folder,'runtime.json'))},pkg,contracts[index]); + if(canonical(assertion)!==canonical(check.residual.assertion))throw Error('CANDIDATE_LOOP_ASSERTION_MISMATCH'); + retained=true; + } + if(!retained)throw Error('CANDIDATE_RETAINED_FAILURE_REQUIRED'); +}else{ + const receipt=evidence.behavior?evidence:{behavior:evidence,runtime:await json(path.join(path.dirname(evidencePath),'runtime.json'))}; + const contract=validateContract(receipt.behavior?.behavior_contract); + const assertion=checkedFailure(receipt,pkg,contract); + contracts=[contract]; + attempt={index:0,candidateDigest:sha(candidate),checks:[{contractIndex:0,name:contract.name,status:'FAIL',residual:{kind:'BEHAVIOR_MISMATCH',assertion}}]}; +} +const context={candidate,sourceDigest:pkg.digest,contractDigest:sha(JSON.stringify(contracts)),attempt}; +const result=selectArithmeticRepair(pkg,descriptor,context,{scope,contracts}); +if(!result.candidate)throw Error(result.reason); +const selected=JSON.parse(result.candidate); +await writeFile(destination,JSON.stringify({version:'metafold-arithmetic-candidate-v1',...result,overlay:selected.overlay},null,2)+'\n',{flag:'wx'}); +console.log(JSON.stringify({status:'CANDIDATE_BUILT',operator:result.operator,source:result.source_file,output:destination,verified:false})); diff --git a/orbiters/chameleon/scripts/build_module_capture.py b/orbiters/chameleon/scripts/build_module_capture.py new file mode 100644 index 0000000000000000000000000000000000000000..7e3d7bc3f71456de8ed5243501f424357d499057 --- /dev/null +++ b/orbiters/chameleon/scripts/build_module_capture.py @@ -0,0 +1,90 @@ +"""Trusted local plan for exact additional files from one pinned complete tree.""" +import hashlib +import json +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path[:0] = [str(ROOT / "packages/core")] +from build_module_overlay import build_module_overlay, parse_module_source +from chameleon_core.adaptation_contracts import Intake +from chameleon_core.contracts import digest +from chameleon_core.entry_capture import capture_entry +from chameleon_core.module_resolution import POLICY, resolve_relative_import +from chameleon_core.repository_capture import fetch_bytes, target, tree_files, verify_package + + +def acquire_module_candidate(package, importer, *, policy, fetch=fetch_bytes): + """Bounded local acquire/capture/construct chain; does not verify behavior.""" + evidence = acquire_module_capture_plan(package, importer, policy=policy, fetch=fetch) + plan = evidence["plan"] + request = plan["intake"] + captured = package + if plan["status"] == "CAPTURE_REQUIRED": + captured = capture_entry(request["source"], request["repository_entry"], fetch, + additional_paths=request["repository_assets"]) + before, after = package["repository"], captured["repository"] + if any(before[key] != after[key] for key in ("source", "commit_sha", "tree_sha", "entry")): + raise ValueError("MODULE_RECAPTURE_IDENTITY_MISMATCH") + if any(after["files"].get(name) != record for name, record in before["files"].items()): + raise ValueError("MODULE_RECAPTURE_HELD_FILE_CHANGED") + candidate = build_module_overlay(captured, importer, policy=policy) + return {"package": captured, "candidate": candidate, "acquisition_evidence": evidence, + "status": "UNVERIFIED_CANDIDATE", "source_modified": False} + + +def acquire_module_capture_plan(package, importer, *, policy, fetch=fetch_bytes): + """One guarded metadata GET. Errors propagate; no retries or redirect bypass.""" + if policy != POLICY: + raise ValueError("EXPLICIT_MODULE_POLICY_REQUIRED") + verify_package(package) + repository = package["repository"] + owner, repo, _ = target(repository["source"]) + endpoint = f"https://api.github.com/repos/{owner}/{repo}/git/trees/{repository['tree_sha']}?recursive=1" + body = fetch(endpoint, 524288) + if not isinstance(body, bytes) or len(body) > 524288: + raise ValueError("MODULE_TREE_WIRE_BUDGET") + tree = json.loads(body) + plan = build_module_capture(package, importer, tree, policy=policy) + return {"plan": plan, "tree": tree, "acquisition": { + "url": endpoint, "external_reads": 1, "wire_bytes": len(body), + "response_sha256": hashlib.sha256(body).hexdigest(), "source_writes": False}} + + +def build_module_capture(package, importer, tree, *, policy): + if policy != POLICY: + raise ValueError("EXPLICIT_MODULE_POLICY_REQUIRED") + files = verify_package(package) + repository = package["repository"] + if not isinstance(tree, dict) or tree.get("sha") != repository["tree_sha"]: + raise ValueError("MODULE_TREE_BINDING_MISMATCH") + inventory = tree_files(tree, metadata_only=True) + # Check all held bytes against the same inventory, not just a caller's tree label. + for name, record in repository["files"].items(): + if (name not in inventory or inventory[name]["sha"] != record["git_blob_sha"] + or inventory[name]["size"] != record["bytes"]): + raise ValueError("MODULE_HELD_TREE_MISMATCH") + if importer not in files or not importer.endswith((".js", ".mjs")): + raise ValueError("CAPTURED_IMPORTER_REQUIRED") + syntax = parse_module_source(files[importer]) + plans, missing = [], set() + for reference in syntax["references"]: + plan = resolve_relative_import(importer, reference["specifier"], inventory) + if plan["status"] != "RESOLVED": + raise ValueError("MODULE_" + plan["status"]) + plans.append(plan) + destination = plan["matches"][0]["path"] + if destination not in files: + missing.add(destination) + prior = repository.get("projection", {}).get("additional_local_paths", []) + paths = sorted(set(prior) | missing) + if len(paths) > 16: + raise ValueError("MODULE_CAPTURE_PATH_BUDGET") + intake = Intake(source=repository["source"] + "/tree/" + repository["commit_sha"], + source_type="repository", repository_scope="entry", repository_entry=repository["entry"], + repository_assets=paths, build_counterpart=True) + return {"policy": POLICY, "source_digest": package["digest"], "tree_sha": tree["sha"], + "inventory_digest": digest(tree), "syntax": syntax, "resolutions": plans, + "missing_paths": sorted(missing), "status": "CAPTURE_REQUIRED" if missing else "READY", + "intake": intake.model_dump(mode="json"), + "scope": "Direct imports only; no acquisition, recursive closure or behavior claim"} diff --git a/orbiters/chameleon/scripts/build_module_overlay.py b/orbiters/chameleon/scripts/build_module_overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..ff3483d78060ffaab5f455eecf63a560b893894a --- /dev/null +++ b/orbiters/chameleon/scripts/build_module_overlay.py @@ -0,0 +1,68 @@ +"""Explicit local module compatibility candidate; no target code execution.""" +import base64 +import hashlib +import json +import posixpath +import subprocess +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path[:0] = [str(ROOT / "packages/core")] +from chameleon_core.module_resolution import POLICY, resolve_relative_import +from chameleon_core.repository_capture import verify_package +from derived_overlay import validate_overlay + + +def parse_module_source(original): + if len(original) > 262144: + raise ValueError("MODULE_SOURCE_BUDGET") + parsed = subprocess.run(["node", str(ROOT / "scripts/module_references.mjs")], + input=original, capture_output=True, timeout=10, check=False, cwd=ROOT) + if parsed.returncode or len(parsed.stdout) > 100000: + raise ValueError("MODULE_SYNTAX_UNSUPPORTED") + evidence = json.loads(parsed.stdout) + if evidence["source_sha256"] != hashlib.sha256(original).hexdigest() or evidence["dynamic_imports"]: + raise ValueError("MODULE_DYNAMIC_OR_SOURCE_MISMATCH") + return evidence + + +def build_module_overlay(package, importer, *, policy): + if policy != POLICY: + raise ValueError("EXPLICIT_MODULE_POLICY_REQUIRED") + files = verify_package(package) + if importer not in files or not importer.endswith((".js", ".mjs")): + raise ValueError("CAPTURED_IMPORTER_REQUIRED") + original = files[importer] + if len(original) > 12000: + raise ValueError("MODULE_OVERLAY_BUDGET") + evidence = parse_module_source(original) + inventory = {name: {"sha": record["git_blob_sha"], "size": record["bytes"]} + for name, record in package["repository"]["files"].items()} + edits, plans = [], [] + for reference in evidence["references"]: + plan = resolve_relative_import(importer, reference["specifier"], inventory) + if plan["status"] != "RESOLVED": + raise ValueError("MODULE_" + plan["status"]) + target = plan["matches"][0]["path"] + relative = posixpath.relpath(target, posixpath.dirname(importer) or ".") + if not relative.startswith("."): + relative = "./" + relative + start, end = reference["start_byte"], reference["end_byte"] + if hashlib.sha256(original[start:end]).hexdigest() != reference["literal_sha256"]: + raise ValueError("MODULE_LITERAL_BINDING") + plans.append(plan) + if relative != reference["specifier"]: + edits.append((start, end, json.dumps(relative).encode())) + if not edits: + raise ValueError("MODULE_NO_REWRITE_NEEDED") + after = original + for start, end, replacement in reversed(edits): + after = after[:start] + replacement + after[end:] + overlay = {"version": "derived-file-v1", "source_digest": package["digest"], "path": importer, + "before_sha256": hashlib.sha256(original).hexdigest(), + "after_base64": base64.b64encode(after).decode(), + "after_sha256": hashlib.sha256(after).hexdigest(), "operator": POLICY} + validate_overlay(overlay, package) + return {"overlay": overlay, "syntax": evidence, "resolutions": plans, + "scope": "One-file explicit module policy; all behavior and delivery checks still required"} diff --git a/orbiters/chameleon/scripts/build_public_archive.py b/orbiters/chameleon/scripts/build_public_archive.py new file mode 100644 index 0000000000000000000000000000000000000000..1b266c11dd05f8793ac305e824a4708d713f6e50 --- /dev/null +++ b/orbiters/chameleon/scripts/build_public_archive.py @@ -0,0 +1,26 @@ +"""Publishable catalogue metadata and reviewed previews only; no private logs.""" +import json,sqlite3,hashlib,shutil,subprocess +from pathlib import Path +root=Path('.local/public-archive');root.mkdir(exist_ok=True) +(root/'previews').mkdir(exist_ok=True) +db=sqlite3.connect('file:.local/clone-catalogue.sqlite3?mode=ro',uri=True) +rows=[] +thumbnails=[] +for url,kind,status,shot in db.execute('SELECT url,kind,status,screenshot FROM sites ORDER BY url'): + row={'url':url,'kind':kind,'status':status} + if status in ('approved','needs_review','needs_repair') and shot and Path(shot).is_file(): + name=hashlib.sha256(url.encode()).hexdigest()[:20]+'.webp' + thumbnails.append({'source':shot,'target':str(root/'previews'/name)}) + row['preview']='previews/'+name + rows.append(row) +db.close() +subprocess.run(['node','scripts/archive_thumbnails.mjs'],input=json.dumps(thumbnails),text=True,check=True) +(root/'catalogue.json').write_text(json.dumps(rows),encoding='utf8') +(root/'index.html').write_text('''Ditto · Archive
ditto with JevWorkspace ↗X

THE CAPTURE NOTEBOOK

Archive.

Real public sources, saved captures, and a visible review record.

Reviewed previews are static visual snapshots. Captured does not mean reviewed or functionally verified. Source sites are independent; no affiliation is implied.

Loading catalogue…

''',encoding='utf8') +(root/'archive.css').write_text('''*{box-sizing:border-box}body{margin:0;background:#101010;color:#f4f2ee;font:16px system-ui,sans-serif}header{display:flex;gap:28px;align-items:center;padding:24px 5%;border-bottom:1px solid #303030}a{color:inherit}header a:first-child{font:900 26px monospace;margin-right:auto;text-decoration:none}small{font:12px monospace;color:#aaa}main{max-width:1350px;margin:auto;padding:48px 5%}.tag{font:12px monospace;letter-spacing:.2em;color:#f28b44}h1{font-size:clamp(48px,8vw,94px);letter-spacing:-.06em;margin:14px 0}h1 span{color:#f28b44}.muted{color:#aaa;max-width:850px;line-height:1.6}.filters{display:flex;gap:20px;margin:30px 0;flex-wrap:wrap}label{display:grid;gap:8px;flex:1;min-width:200px}input,select,button{font:inherit;padding:13px;background:#202020;color:inherit;border:1px solid #444;border-radius:8px}#cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:18px}article{background:#191919;border:1px solid #333;border-radius:12px;overflow:hidden}article img{width:100%;aspect-ratio:1.6;object-fit:cover;object-position:top}article div{padding:18px}h2{font-size:17px;overflow-wrap:anywhere}article p{color:#bbb;font:12px monospace}button{margin-top:28px;cursor:pointer}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #f28b44}''',encoding='utf8') +(root/'archive.js').write_text('''let rows=[],limit=48;const cards=document.querySelector('#cards'),filter=document.querySelector('#filter'),search=document.querySelector('#search'),more=document.querySelector('#more');function render(){const q=search.value.toLowerCase();const selected=rows.filter(r=>r.url.toLowerCase().includes(q)).filter(r=>filter.value==='all'||(filter.value==='approved'?r.status==='approved':filter.value==='repository'?r.kind==='repository':filter.value==='failed'?['failed','needs_repair'].includes(r.status):['approved','needs_review','needs_repair','captured'].includes(r.status)));cards.replaceChildren();for(const r of selected.slice(0,limit)){const a=document.createElement('article');if(r.preview){const i=document.createElement('img');i.src=r.preview;i.alt='Reviewed static capture of '+new URL(r.url).hostname;i.loading='lazy';a.append(i)}const d=document.createElement('div'),h=document.createElement('h2'),link=document.createElement('a'),p=document.createElement('p');link.href=r.url;link.target='_blank';link.rel='noopener noreferrer';link.textContent=new URL(r.url).hostname+new URL(r.url).pathname;h.append(link);p.textContent=r.kind+' · '+(r.status==='approved'?'visually reviewed · static only':r.status.replaceAll('_',' '));d.append(h,p);a.append(d);cards.append(a)}more.hidden=selected.length<=limit}fetch('catalogue.json').then(r=>{if(!r.ok)throw Error();return r.json()}).then(data=>{rows=data;const captured=rows.filter(r=>r.kind==='website'&&['approved','needs_review','needs_repair'].includes(r.status)).length;document.querySelector('#counts').textContent=captured+' website captures · '+rows.filter(r=>r.kind==='repository'&&r.status==='captured').length+' repository captures · '+rows.filter(r=>r.status==='approved').length+' reviewed previews';render()}).catch(()=>document.querySelector('#counts').textContent='Catalogue unavailable. Please retry.');filter.onchange=search.oninput=()=>{limit=48;render()};more.onclick=()=>{limit+=48;render()};''',encoding='utf8') +page=root/'index.html' +page.write_text(page.read_text(encoding='utf8').replace('