User1342 commited on
Commit
0dbbc41
·
1 Parent(s): 38cbc41

Library as its own page; cards show what each member makes; Anthropic-calm palette; artifact previews in answers

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. APPLY-AND-PUSH.bat +17 -0
  2. assets/library-demos/academy_guide-1.gif +2 -2
  3. assets/library-demos/academy_guide-1.webp +3 -0
  4. assets/library-demos/algorithmic_art-1.gif +2 -2
  5. assets/library-demos/algorithmic_art-1.webp +3 -0
  6. assets/library-demos/brand_guidelines-1.gif +2 -2
  7. assets/library-demos/brand_guidelines-1.webp +3 -0
  8. assets/library-demos/canvas_design-1.gif +2 -2
  9. assets/library-demos/canvas_design-1.webp +3 -0
  10. assets/library-demos/claude_api-1.gif +2 -2
  11. assets/library-demos/claude_api-1.webp +3 -0
  12. assets/library-demos/create_deck-1.gif +2 -2
  13. assets/library-demos/create_deck-1.webp +3 -0
  14. assets/library-demos/create_docx-1.gif +2 -2
  15. assets/library-demos/create_docx-1.webp +3 -0
  16. assets/library-demos/create_pdf-1.gif +2 -2
  17. assets/library-demos/create_pdf-1.webp +3 -0
  18. assets/library-demos/create_xlsx-1.gif +2 -2
  19. assets/library-demos/create_xlsx-1.webp +3 -0
  20. assets/library-demos/csv_table-1.gif +2 -2
  21. assets/library-demos/csv_table-1.webp +3 -0
  22. assets/library-demos/discernment_nudge-1.gif +2 -2
  23. assets/library-demos/discernment_nudge-1.webp +3 -0
  24. assets/library-demos/frontend_design-1.gif +2 -2
  25. assets/library-demos/frontend_design-1.webp +3 -0
  26. assets/library-demos/make_plan-1.gif +2 -2
  27. assets/library-demos/make_plan-1.webp +3 -0
  28. assets/library-demos/mcp_builder-1.gif +2 -2
  29. assets/library-demos/mcp_builder-1.webp +3 -0
  30. assets/library-demos/review_checklist-1.gif +2 -2
  31. assets/library-demos/review_checklist-1.webp +3 -0
  32. assets/library-demos/skill_scaffold-1.gif +2 -2
  33. assets/library-demos/skill_scaffold-1.webp +3 -0
  34. assets/library-demos/slack_gif_creator-1.gif +2 -2
  35. assets/library-demos/slack_gif_creator-1.webp +3 -0
  36. assets/library-demos/status_update-1.gif +2 -2
  37. assets/library-demos/status_update-1.webp +3 -0
  38. assets/library-demos/theme_factory-1.gif +2 -2
  39. assets/library-demos/theme_factory-1.webp +3 -0
  40. assets/library-demos/web_artifacts_builder-1.gif +2 -2
  41. assets/library-demos/web_artifacts_builder-1.webp +3 -0
  42. assets/library-demos/webapp_testing-1.gif +2 -2
  43. assets/library-demos/webapp_testing-1.webp +3 -0
  44. distinct-update.zip +3 -0
  45. distinct_agent/runners.py +2 -3
  46. distinct_server.egg-info/SOURCES.txt +41 -0
  47. distinct_server/presentation.py +438 -142
  48. distinct_server/render.py +585 -221
  49. distinct_server/ui.py +392 -285
  50. distinct_skills/manifest.py +10 -10
APPLY-AND-PUSH.bat ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cd /d "%~dp0"
2
+ @echo off
3
+ (
4
+ echo ===== APPLY =====
5
+ powershell -NoProfile -Command "Expand-Archive -LiteralPath distinct-update.zip -DestinationPath . -Force"
6
+ echo EXPAND_EXIT=%ERRORLEVEL%
7
+ git lfs install --local
8
+ git lfs track "*.gif"
9
+ git lfs track "*.webp"
10
+ git add -A
11
+ git -c user.name=User1342 -c user.email=User1342@users.noreply.huggingface.co commit -m "Library as its own page; cards show what each member makes; Anthropic-calm palette; artifact previews in answers"
12
+ echo COMMIT_EXIT=%ERRORLEVEL%
13
+ git push origin main
14
+ echo PUSH_EXIT=%ERRORLEVEL%
15
+ git log --oneline -1
16
+ git ls-remote origin main
17
+ ) >> push-log6.txt 2>&1
assets/library-demos/academy_guide-1.gif CHANGED

Git LFS Details

  • SHA256: a7581db4887795b4376d8bcaba304403a05335dceffa67020ebcdc9a9a3e1d7b
  • Pointer size: 131 Bytes
  • Size of remote file: 131 kB

Git LFS Details

  • SHA256: f7b8b9b58839c535ed845c92370af525d9fbb9baf725489dbaa311a5a0234cd4
  • Pointer size: 130 Bytes
  • Size of remote file: 90.4 kB
assets/library-demos/academy_guide-1.webp ADDED

Git LFS Details

  • SHA256: 82080fe65ae6385d14a510b0de3a5e7152ec42277b6b7ead1854a3050172c4fb
  • Pointer size: 130 Bytes
  • Size of remote file: 21.3 kB
assets/library-demos/algorithmic_art-1.gif CHANGED

Git LFS Details

  • SHA256: 24e948eb23740a9cd7690a6a0176918b7223deeded1cbc91a52f35550edbaa55
  • Pointer size: 131 Bytes
  • Size of remote file: 134 kB

Git LFS Details

  • SHA256: 0b6402435472af80c6a46ec98d5225fb37ed301b6ab9f2b29bd26fbbb115f904
  • Pointer size: 131 Bytes
  • Size of remote file: 125 kB
assets/library-demos/algorithmic_art-1.webp ADDED

Git LFS Details

  • SHA256: ab2f0738377734c8f8e59e7eda6514d73111c3d56d16b0623bb486bd930a2b72
  • Pointer size: 130 Bytes
  • Size of remote file: 21 kB
assets/library-demos/brand_guidelines-1.gif CHANGED

Git LFS Details

  • SHA256: 8b92458e28f5a7aeb240f12f753869fee5c3c37de187eb62e0ede6dc3afa91a0
  • Pointer size: 131 Bytes
  • Size of remote file: 169 kB

Git LFS Details

  • SHA256: e71800aa51a67ccbac19113728f90048b14cbb5fe847bac9f3c893c7f78d31f1
  • Pointer size: 131 Bytes
  • Size of remote file: 115 kB
assets/library-demos/brand_guidelines-1.webp ADDED

Git LFS Details

  • SHA256: e45cdad8e194ed0cecb8c79010e665ce9dd353a4cc6397be1ec2b599d0b4c5d4
  • Pointer size: 130 Bytes
  • Size of remote file: 21.2 kB
assets/library-demos/canvas_design-1.gif CHANGED

Git LFS Details

  • SHA256: 2a660604fce9e8c84c25a5d96e7b75698e65c6e6ace781e4ab1e4a5bbcb9a80a
  • Pointer size: 131 Bytes
  • Size of remote file: 138 kB

Git LFS Details

  • SHA256: 6f9af576a25d840bb43ad3477423ab6166f4ad2cda83b135ce3453611186dc9e
  • Pointer size: 131 Bytes
  • Size of remote file: 112 kB
assets/library-demos/canvas_design-1.webp ADDED

Git LFS Details

  • SHA256: de62403c2e78ae0ea914eaf3dc2764e9d88178a993ad4c0c34ab24a925d514d0
  • Pointer size: 130 Bytes
  • Size of remote file: 18.2 kB
assets/library-demos/claude_api-1.gif CHANGED

Git LFS Details

  • SHA256: e2ca63522dbecadd19d8388f5724b780807ce01fba702d5a8d4a9058e02f4e6f
  • Pointer size: 131 Bytes
  • Size of remote file: 181 kB

Git LFS Details

  • SHA256: b3042a2895d944c91279f20d2ea609de99c9cf1cb34a721718c2d18658129256
  • Pointer size: 131 Bytes
  • Size of remote file: 115 kB
assets/library-demos/claude_api-1.webp ADDED

Git LFS Details

  • SHA256: 4012a926acd5a57cb878bf51897aac01719e1999c2181925db0c01cba47adea0
  • Pointer size: 130 Bytes
  • Size of remote file: 21.9 kB
assets/library-demos/create_deck-1.gif CHANGED

Git LFS Details

  • SHA256: 2902674f868d902a4a98700ffbb2db616d84ddae0ca509b237b336a98daad504
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB

Git LFS Details

  • SHA256: 23b29e3f009fb409031418d92292d83f50f9a578d41479860f31c8db7430a4a2
  • Pointer size: 130 Bytes
  • Size of remote file: 68.7 kB
assets/library-demos/create_deck-1.webp ADDED

Git LFS Details

  • SHA256: e28f20549d198317ddf12e878e9aa3339774bab4da590f8abb77df91f81f5aaa
  • Pointer size: 129 Bytes
  • Size of remote file: 5.64 kB
assets/library-demos/create_docx-1.gif CHANGED

Git LFS Details

  • SHA256: 0c558b81576b98aca28e913552f3f441b15580a46a557ddeee603160948ce846
  • Pointer size: 131 Bytes
  • Size of remote file: 151 kB

Git LFS Details

  • SHA256: f79068f86deb34d02cf7e8c5228b5515c38a91055d6315d7da876892f39577b3
  • Pointer size: 130 Bytes
  • Size of remote file: 80.4 kB
assets/library-demos/create_docx-1.webp ADDED

Git LFS Details

  • SHA256: ec773cfe779ddc84113fc96152fd644ad9d5f081da3a28c0d0abdec88b17925e
  • Pointer size: 129 Bytes
  • Size of remote file: 8.07 kB
assets/library-demos/create_pdf-1.gif CHANGED

Git LFS Details

  • SHA256: ae39a352baddd190fb4334d3afe6a4c03e5de9e22adf05479244874ddc2036e4
  • Pointer size: 131 Bytes
  • Size of remote file: 145 kB

Git LFS Details

  • SHA256: e50294206ddbca9ffd0dcf194dd6ee802caf1d2c419127f01e7cccc7f9813c21
  • Pointer size: 130 Bytes
  • Size of remote file: 88 kB
assets/library-demos/create_pdf-1.webp ADDED

Git LFS Details

  • SHA256: 5adf90bbecae8e930bf559f2d5ff066fc6ffae3af68f86c3c79ffd0417b4e2c3
  • Pointer size: 130 Bytes
  • Size of remote file: 10.4 kB
assets/library-demos/create_xlsx-1.gif CHANGED

Git LFS Details

  • SHA256: 3ab1c433d970104069aeca9a50d26b849f55ab27a213fe19e799e7679e3c6fb5
  • Pointer size: 131 Bytes
  • Size of remote file: 144 kB

Git LFS Details

  • SHA256: 10786266bc1cafef302bf156977d78e21a1b00f2687320fd334c8a0f3c94ce74
  • Pointer size: 130 Bytes
  • Size of remote file: 86.2 kB
assets/library-demos/create_xlsx-1.webp ADDED

Git LFS Details

  • SHA256: 8a8ceaf23219b1715a00f6cd7cf6dfa070640226a7cb3632d54acc46e98de75d
  • Pointer size: 129 Bytes
  • Size of remote file: 7.7 kB
assets/library-demos/csv_table-1.gif CHANGED

Git LFS Details

  • SHA256: bdab202b76de062b9823051efbe93c52f7efb88e2c44ac71e05c1ffcdef76bb2
  • Pointer size: 131 Bytes
  • Size of remote file: 162 kB

Git LFS Details

  • SHA256: 8b4962a4f78d9fd23f898c01b1580afef1b46c9b55d5be558b3fe678348c5d8b
  • Pointer size: 130 Bytes
  • Size of remote file: 62 kB
assets/library-demos/csv_table-1.webp ADDED

Git LFS Details

  • SHA256: cd67791a142b1e932d4c4d2245f4233de1f68d2263835dc1e97b5f9be73194dd
  • Pointer size: 129 Bytes
  • Size of remote file: 6.75 kB
assets/library-demos/discernment_nudge-1.gif CHANGED

Git LFS Details

  • SHA256: a5d5fc150d2d405d5ac77b89cdae61b8e5a6f48f65bed92f84c3c141ceb53342
  • Pointer size: 131 Bytes
  • Size of remote file: 196 kB

Git LFS Details

  • SHA256: 254e810eb3817945fa95f09a8502e4e110b898190f5b1594ff59646ac6ab4ead
  • Pointer size: 131 Bytes
  • Size of remote file: 110 kB
assets/library-demos/discernment_nudge-1.webp ADDED

Git LFS Details

  • SHA256: b357f4dcc21c9a405807d9fef3c9adca9f42d4a229bcf25e36adec225bb734cc
  • Pointer size: 130 Bytes
  • Size of remote file: 21.2 kB
assets/library-demos/frontend_design-1.gif CHANGED

Git LFS Details

  • SHA256: 64b742dbd12476e11be711c461ccf0a624d9c033d0320889ec5be7e4da7980d1
  • Pointer size: 131 Bytes
  • Size of remote file: 151 kB

Git LFS Details

  • SHA256: 3797dccb5e149355dfff3a56f6d8b50d0cd06744fd3bc14e4e903eb9cf29049c
  • Pointer size: 131 Bytes
  • Size of remote file: 136 kB
assets/library-demos/frontend_design-1.webp ADDED

Git LFS Details

  • SHA256: 9cdfdc9aa099348b4bf6a0f8e9f7d05f2b5c223f550b0acdb9245ab335a73278
  • Pointer size: 130 Bytes
  • Size of remote file: 32.8 kB
assets/library-demos/make_plan-1.gif CHANGED

Git LFS Details

  • SHA256: 7dbcf416da1c6b49034fcfab2e9c8ec4d86166d6a1fc09e7a2161a456f83db9d
  • Pointer size: 131 Bytes
  • Size of remote file: 170 kB

Git LFS Details

  • SHA256: 27db0e2a367fc92148dd4071bf468cf4ee0f8ff3bc3432741031dfeee999c73c
  • Pointer size: 131 Bytes
  • Size of remote file: 108 kB
assets/library-demos/make_plan-1.webp ADDED

Git LFS Details

  • SHA256: 1cbc4842ce3481ac01ff642e3ea312083a55f3f682c52e76d30436e7f7a3eacb
  • Pointer size: 129 Bytes
  • Size of remote file: 9.27 kB
assets/library-demos/mcp_builder-1.gif CHANGED

Git LFS Details

  • SHA256: 4e5ba79a1825fcf96898da76fab8aafd47827a90e74cab97e82beac37e4c7579
  • Pointer size: 131 Bytes
  • Size of remote file: 201 kB

Git LFS Details

  • SHA256: f21732700f5f69495bd38d34e926cf231003493bc51064c7fdfa082aa0b7e88a
  • Pointer size: 130 Bytes
  • Size of remote file: 81.1 kB
assets/library-demos/mcp_builder-1.webp ADDED

Git LFS Details

  • SHA256: 874c55caf4d8ee1814afbd66083bef507a14b15ccbbd88a6cc418db33b0e3bc8
  • Pointer size: 130 Bytes
  • Size of remote file: 19.4 kB
assets/library-demos/review_checklist-1.gif CHANGED

Git LFS Details

  • SHA256: 1c263afc4154698eec30f16ee621304b783cfc3451db346cb4ae6a59970cb8f8
  • Pointer size: 131 Bytes
  • Size of remote file: 201 kB

Git LFS Details

  • SHA256: 1ccd7e1d9c5d1482009992578a8e6c5d8db517c53e62d102290e4eadefbddb89
  • Pointer size: 131 Bytes
  • Size of remote file: 120 kB
assets/library-demos/review_checklist-1.webp ADDED

Git LFS Details

  • SHA256: 2af80caf9c787efdceebd849d3d1a36aa87af753a2c50aa66cc94f09599fd4c7
  • Pointer size: 130 Bytes
  • Size of remote file: 21.8 kB
assets/library-demos/skill_scaffold-1.gif CHANGED

Git LFS Details

  • SHA256: 73e61434456717ab60604722e2b5424cc69c17a0d1ac449fb4678be4b9a5b2a0
  • Pointer size: 131 Bytes
  • Size of remote file: 156 kB

Git LFS Details

  • SHA256: 0902e9fcca3d231cc81528919fccbd656c38c768e86fd7a1ddcd41c60bba307c
  • Pointer size: 131 Bytes
  • Size of remote file: 108 kB
assets/library-demos/skill_scaffold-1.webp ADDED

Git LFS Details

  • SHA256: 0f47dbf3ff56eea681c17e3a93679197ee1e72fc884e5c57bea206b612a1958b
  • Pointer size: 130 Bytes
  • Size of remote file: 11.5 kB
assets/library-demos/slack_gif_creator-1.gif CHANGED

Git LFS Details

  • SHA256: 97931b56d97ce6c9a0fc833f3c087c3a5929ff8a41a2d25e031f84a09ab3b35d
  • Pointer size: 131 Bytes
  • Size of remote file: 154 kB

Git LFS Details

  • SHA256: 8aace9eff595a3c0f074634b0b683042465fc6d7c1561da34c24f82c1f1f7052
  • Pointer size: 131 Bytes
  • Size of remote file: 114 kB
assets/library-demos/slack_gif_creator-1.webp ADDED

Git LFS Details

  • SHA256: bdeef3b8919635c984c414364cfe06cf83a86dc636222413ebe16776d3b532e0
  • Pointer size: 130 Bytes
  • Size of remote file: 21.5 kB
assets/library-demos/status_update-1.gif CHANGED

Git LFS Details

  • SHA256: 09c8214372ba172b41d55d17d7095fc0fd6216c67cc864dff8c73f2fbd6259fa
  • Pointer size: 131 Bytes
  • Size of remote file: 199 kB

Git LFS Details

  • SHA256: f4ca8f05752e8169b14c8c98fc856a1f97a1841a03e45231d8b6ae454ddb260a
  • Pointer size: 130 Bytes
  • Size of remote file: 81.4 kB
assets/library-demos/status_update-1.webp ADDED

Git LFS Details

  • SHA256: 69c5386dcc5f77fe1364e281b556503c1c099f5973af4e13563c4d629edffe73
  • Pointer size: 130 Bytes
  • Size of remote file: 16.2 kB
assets/library-demos/theme_factory-1.gif CHANGED

Git LFS Details

  • SHA256: 04966f0ef15defdc90afcf15243dbc07cd159c8679d1c9adc2e0512ed4ee4f58
  • Pointer size: 131 Bytes
  • Size of remote file: 159 kB

Git LFS Details

  • SHA256: ba557bae19c19551179bdc07d4d33db46a99655799228a9a6f8f84c27fa99523
  • Pointer size: 131 Bytes
  • Size of remote file: 114 kB
assets/library-demos/theme_factory-1.webp ADDED

Git LFS Details

  • SHA256: 4dfa2c9a2772b31619173449eb49479b4542d55da562b294fdac300a809a8e83
  • Pointer size: 130 Bytes
  • Size of remote file: 16.6 kB
assets/library-demos/web_artifacts_builder-1.gif CHANGED

Git LFS Details

  • SHA256: 33109a137efdc9958bfbd459e89b98d6c914e6d39a764304395dd6bcd808a6bd
  • Pointer size: 131 Bytes
  • Size of remote file: 162 kB

Git LFS Details

  • SHA256: ea5a1ce194e452ea1e5848e6b600764db1dce6d97a4432b0634830cb1c0b37eb
  • Pointer size: 131 Bytes
  • Size of remote file: 115 kB
assets/library-demos/web_artifacts_builder-1.webp ADDED

Git LFS Details

  • SHA256: 670490cb1fb61c78f43fd66802353920266bd8832045051a42f202f6c28e0252
  • Pointer size: 130 Bytes
  • Size of remote file: 20.7 kB
assets/library-demos/webapp_testing-1.gif CHANGED

Git LFS Details

  • SHA256: 27e5bb56ece3ab1bc3487031b161c96d0369c86063ee3c50fcdf9f7a8ca2d14f
  • Pointer size: 131 Bytes
  • Size of remote file: 204 kB

Git LFS Details

  • SHA256: 27d6484c71f1e61ec2031508eb10e2da78415aa39012ceadc2526149461fef34
  • Pointer size: 131 Bytes
  • Size of remote file: 125 kB
assets/library-demos/webapp_testing-1.webp ADDED

Git LFS Details

  • SHA256: 6bd4d447231e25943f36a3a56b6e83b285e61e10d21c4ef5ac73dcdc16606543
  • Pointer size: 130 Bytes
  • Size of remote file: 21.5 kB
distinct-update.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf6567abd8ff59b1041ca1e41072335eebeff321526bb347d243f08f8abefad1
3
+ size 2613564
distinct_agent/runners.py CHANGED
@@ -172,9 +172,8 @@ class DeterministicDemoRunner:
172
  "type": "final",
173
  "answer": (
174
  f"[demo:{model.manifest.id}] ran "
175
- f"{len(directives)} requested library call(s); "
176
- "results are in the trace and any artifact is in "
177
- "your session outputs."
178
  ),
179
  },
180
  ensure_ascii=False,
 
172
  "type": "final",
173
  "answer": (
174
  f"[demo:{model.manifest.id}] ran "
175
+ f"{len(directives)} requested library call(s). "
176
+ "Here is what came back."
 
177
  ),
178
  },
179
  ensure_ascii=False,
distinct_server.egg-info/SOURCES.txt CHANGED
@@ -36,6 +36,7 @@ distinct_agent/isolation/windows.py
36
  distinct_agent/isolation/windows_appcontainer.py
37
  distinct_mcp/__init__.py
38
  distinct_mcp/common.py
 
39
  distinct_mcp/files.py
40
  distinct_mcp/lists.py
41
  distinct_mcp/numbers.py
@@ -69,8 +70,37 @@ distinct_skills/__main__.py
69
  distinct_skills/handlers.py
70
  distinct_skills/loader.py
71
  distinct_skills/manifest.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  distinct_skills/skills/csv-table/SKILL.md
73
  distinct_skills/skills/csv-table/tool.json
 
 
 
 
 
 
 
 
74
  distinct_skills/skills/review-checklist/SKILL.md
75
  distinct_skills/skills/review-checklist/tool.json
76
  distinct_skills/skills/review-checklist/assets/checklist.md
@@ -78,9 +108,20 @@ distinct_skills/skills/review-checklist/assets/claim-block.md
78
  distinct_skills/skills/skill-scaffold/SKILL.md
79
  distinct_skills/skills/skill-scaffold/tool.json
80
  distinct_skills/skills/skill-scaffold/assets/skill-template.md
 
 
 
81
  distinct_skills/skills/status-update/SKILL.md
82
  distinct_skills/skills/status-update/tool.json
83
  distinct_skills/skills/status-update/assets/status-update.md
 
 
 
 
 
 
 
 
84
  distinct_tools/__init__.py
85
  distinct_tools/approval.py
86
  distinct_tools/core.py
 
36
  distinct_agent/isolation/windows_appcontainer.py
37
  distinct_mcp/__init__.py
38
  distinct_mcp/common.py
39
+ distinct_mcp/external.py
40
  distinct_mcp/files.py
41
  distinct_mcp/lists.py
42
  distinct_mcp/numbers.py
 
70
  distinct_skills/handlers.py
71
  distinct_skills/loader.py
72
  distinct_skills/manifest.py
73
+ distinct_skills/skills/academy-guide/SKILL.md
74
+ distinct_skills/skills/academy-guide/tool.json
75
+ distinct_skills/skills/academy-guide/assets/guide.md
76
+ distinct_skills/skills/algorithmic-art/SKILL.md
77
+ distinct_skills/skills/algorithmic-art/tool.json
78
+ distinct_skills/skills/algorithmic-art/assets/guide.md
79
+ distinct_skills/skills/brand-guidelines/SKILL.md
80
+ distinct_skills/skills/brand-guidelines/tool.json
81
+ distinct_skills/skills/brand-guidelines/assets/guide.md
82
+ distinct_skills/skills/canvas-design/SKILL.md
83
+ distinct_skills/skills/canvas-design/tool.json
84
+ distinct_skills/skills/canvas-design/assets/guide.md
85
+ distinct_skills/skills/claude-api/SKILL.md
86
+ distinct_skills/skills/claude-api/tool.json
87
+ distinct_skills/skills/claude-api/assets/guide.md
88
+ distinct_skills/skills/create-deck/SKILL.md
89
+ distinct_skills/skills/create-deck/tool.json
90
+ distinct_skills/skills/create-docx/SKILL.md
91
+ distinct_skills/skills/create-docx/tool.json
92
+ distinct_skills/skills/create-xlsx/SKILL.md
93
+ distinct_skills/skills/create-xlsx/tool.json
94
  distinct_skills/skills/csv-table/SKILL.md
95
  distinct_skills/skills/csv-table/tool.json
96
+ distinct_skills/skills/discernment-nudge/SKILL.md
97
+ distinct_skills/skills/discernment-nudge/tool.json
98
+ distinct_skills/skills/discernment-nudge/assets/guide.md
99
+ distinct_skills/skills/frontend-design/SKILL.md
100
+ distinct_skills/skills/frontend-design/tool.json
101
+ distinct_skills/skills/mcp-builder/SKILL.md
102
+ distinct_skills/skills/mcp-builder/tool.json
103
+ distinct_skills/skills/mcp-builder/assets/guide.md
104
  distinct_skills/skills/review-checklist/SKILL.md
105
  distinct_skills/skills/review-checklist/tool.json
106
  distinct_skills/skills/review-checklist/assets/checklist.md
 
108
  distinct_skills/skills/skill-scaffold/SKILL.md
109
  distinct_skills/skills/skill-scaffold/tool.json
110
  distinct_skills/skills/skill-scaffold/assets/skill-template.md
111
+ distinct_skills/skills/slack-gif-creator/SKILL.md
112
+ distinct_skills/skills/slack-gif-creator/tool.json
113
+ distinct_skills/skills/slack-gif-creator/assets/guide.md
114
  distinct_skills/skills/status-update/SKILL.md
115
  distinct_skills/skills/status-update/tool.json
116
  distinct_skills/skills/status-update/assets/status-update.md
117
+ distinct_skills/skills/theme-factory/SKILL.md
118
+ distinct_skills/skills/theme-factory/tool.json
119
+ distinct_skills/skills/web-artifacts-builder/SKILL.md
120
+ distinct_skills/skills/web-artifacts-builder/tool.json
121
+ distinct_skills/skills/web-artifacts-builder/assets/guide.md
122
+ distinct_skills/skills/webapp-testing/SKILL.md
123
+ distinct_skills/skills/webapp-testing/tool.json
124
+ distinct_skills/skills/webapp-testing/assets/guide.md
125
  distinct_tools/__init__.py
126
  distinct_tools/approval.py
127
  distinct_tools/core.py
distinct_server/presentation.py CHANGED
@@ -18,22 +18,23 @@ letter, because an absence drawn as a D is a measured poor result that nobody
18
  measured.
19
 
20
  **2. WCAG AA, computed rather than assumed.**
21
- Contrast against the canvas ``#F7FAF3``:
22
 
23
  =============== ========= ====== ==========================================
24
  Colour Ratio AA? Used for
25
  =============== ========= ====== ==========================================
26
- ``#203127`` 13.3:1 pass body text
27
- ``#4A5A50`` 6.0:1 pass secondary text
28
- ``#5F7064`` 4.9:1 pass muted text
29
- ``#2F4A38`` 9.2:1 pass accent text
30
- ``#3F6349`` 6.8:1* pass primary button (*white on it)
31
- ``#557E5E`` 4.3:1 FAIL borders, focus rings, 24px+ only
32
- ``#6E9B76`` 3.0:1 FAIL decorative fill only
33
  =============== ========= ====== ==========================================
34
 
35
- The spec's two greens fail AA for body text, so neither is ever used for body
36
- text. The darker values are shades of the same hue, not new colours.
 
37
 
38
  **Layout: the shell decides its own height.**
39
  The previous sheet locked ``.gradio-container`` and ``.c-shell`` to ``100vh``
@@ -54,19 +55,25 @@ four the layout had grown.
54
  from __future__ import annotations
55
 
56
  PALETTE = {
57
- "canvas": "#F7FAF3",
 
 
 
 
 
 
58
  "surface": "#FFFFFF",
59
- "mint": "#DDECD7",
60
- "sage": "#6E9B76",
61
- "sage_dark": "#557E5E",
62
- "border": "#BDD2B7",
63
- "text": "#203127",
64
- "muted": "#5F7064",
65
- # Accessible shades of the same hue; see the table above.
66
- "sage_deep": "#2F4A38",
67
- "sage_button": "#3F6349",
68
- "text_secondary": "#4A5A50",
69
- "hairline": "#E6EDE1",
70
  }
71
 
72
  # Loaded via launch(head=...) so the font arrives before first paint rather than
@@ -87,7 +94,8 @@ HEAD = """
87
 
88
  <script>
89
  (function(){
90
- function media(el){return el.closest ? el.closest('.c-libcard__media') : null;}
 
91
  function show(m){
92
  if(!m || m.classList.contains('is-playing')) return;
93
  var src = m.getAttribute('data-gif');
@@ -101,21 +109,65 @@ HEAD = """
101
  m.classList.remove('is-playing');
102
  m.querySelectorAll('img').forEach(function(i){i.remove();});
103
  }
104
- document.addEventListener('mouseover', function(e){show(media(e.target));});
 
 
 
 
105
  document.addEventListener('mouseout', function(e){
106
- var m = media(e.target);
107
  if(m && !m.contains(e.relatedTarget)) hide(m);
108
  });
109
- var holdTimer=null;
 
 
110
  document.addEventListener('touchstart', function(e){
111
- var m = media(e.target); if(!m) return;
112
- holdTimer = setTimeout(function(){show(m);}, 300);
 
113
  }, {passive:true});
114
  ['touchend','touchcancel'].forEach(function(name){
115
  document.addEventListener(name, function(e){
116
- clearTimeout(holdTimer); hide(media(e.target));
117
  }, {passive:true});
118
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  })();
120
  </script>
121
  """
@@ -127,12 +179,12 @@ CSS = """
127
  ==================================================================== */
128
  :root{
129
  /* colour */
130
- --c-canvas:#F7FAF3; --c-surface:#FFFFFF; --c-mint:#DDECD7;
131
- --c-sage:#6E9B76; --c-sage-dark:#557E5E; --c-sage-deep:#2F4A38;
132
- --c-accent:#3F6349; --c-accent-hover:#33523B;
133
- --c-text:#203127; --c-text-2:#4A5A50; --c-muted:#5F7064;
134
- --c-hairline:#E6EDE1; --c-border:#BDD2B7; --c-fill:#F1F5EE;
135
- --c-warn-bg:#FDF8EA; --c-warn-rule:#8A6D23;
136
 
137
  /* spacing: 4px base, no value outside this scale */
138
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;
@@ -146,17 +198,20 @@ CSS = """
146
  --r-md:12px; --r-lg:16px; --r-pill:999px;
147
 
148
  /* elevation: two levels */
149
- --e1:0 1px 2px rgba(32,49,39,.05);
150
- --e2:0 8px 28px -12px rgba(32,49,39,.18);
151
 
152
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
153
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
154
 
155
- /* DISPLAY FACE. Option A is live. Comment it out and uncomment option B to
156
- compare; nothing else in the sheet changes. */
157
- --font-display:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; /* A */
158
- /* --font-display:'Fraunces','Iowan Old Style',Georgia,serif; */ /* B */
 
 
159
 
 
160
  --measure:68ch;
161
 
162
  /* One shell geometry, referenced by every top-level block so there is
@@ -272,9 +327,11 @@ footer,.gradio-container footer{display:none !important;}
272
  line-height:1; white-space:nowrap; overflow:hidden;
273
  text-overflow:ellipsis; padding-left:var(--s3);
274
  border-left:1px solid var(--c-hairline);}
275
- .c-identity{font-size:var(--t-micro); color:var(--c-text-2);
276
- background:var(--c-surface); padding:5px 12px;
277
- border-radius:var(--r-pill); box-shadow:var(--e1); white-space:nowrap;}
 
 
278
  .c-identity--link{text-decoration:underline; cursor:pointer;}
279
 
280
  /* ========================================================================
@@ -344,19 +401,24 @@ footer,.gradio-container footer{display:none !important;}
344
  /* ========================================================================
345
  NOTICE
346
  ==================================================================== */
347
- .c-notice{background:var(--c-warn-bg); border-radius:var(--r-md);
348
- padding:var(--s3) var(--s4);}
349
- .c-notice__summary{display:flex; align-items:center; gap:var(--s3);
350
- cursor:pointer; list-style:none;
 
 
 
351
  font-size:var(--t-label); color:var(--c-text-2);
352
- line-height:1.45;}
353
  .c-notice__summary::-webkit-details-marker{display:none;}
354
  .c-notice__summary strong{color:var(--c-text); font-weight:600;}
355
  .c-notice__mark{flex:none; width:16px; height:16px; border-radius:50%;
356
- background:var(--c-warn-rule); color:#fff; font-size:11px;
357
- font-weight:700; display:grid; place-items:center;}
 
358
  .c-notice__toggle{margin-left:auto; white-space:nowrap; font-size:var(--t-micro);
359
- color:var(--c-muted); text-decoration:underline;}
 
360
  .c-notice__body{margin:var(--s3) 0 var(--s1) 28px; font-size:var(--t-micro);
361
  line-height:1.6; color:var(--c-text-2); max-width:var(--measure);}
362
  .c-notice__summary:focus-visible{outline:3px solid var(--c-sage); outline-offset:3px;
@@ -495,10 +557,9 @@ footer,.gradio-container footer{display:none !important;}
495
  .c-grade-card__name{font-size:var(--t-body); font-weight:600; color:var(--c-text);}
496
  .c-grade-card__link{font-size:var(--t-micro); color:var(--c-sage-deep);
497
  text-decoration:underline; white-space:nowrap;}
498
- .c-grade-card__overall{display:flex; align-items:center; gap:var(--s3);
499
- margin:0; flex-wrap:wrap;}
500
- /* Coverage is never separated from the overall result. A letter with no
501
- denominator beside it is the thing this panel must not produce. */
502
  .c-grade-card__coverage{font-size:var(--t-micro); color:var(--c-text-2);
503
  font-variant-numeric:tabular-nums;}
504
  .c-grade-card__note{margin:0; padding-top:var(--s3); font-size:var(--t-micro);
@@ -511,50 +572,82 @@ footer,.gradio-container footer{display:none !important;}
511
  .c-grade-row:last-child{border-bottom:none;}
512
  .c-grade-row__label{font-size:var(--t-label); color:var(--c-text-2);}
513
 
514
- /* ONE TOKEN, NOT A LETTER WITH A CAPTION.
515
- The scale name, the letter and the coverage share a single border and a
516
- single overflow context, so there is no crop, no skim and no line break that
517
- can separate a letter from the coverage it was drawn from. "B" over two of
518
- six areas cannot be quoted as "B" because the two of six is inside the box.
519
-
520
- Impact and evidence are told apart three ways at once: the word inside the
521
- token, the corner radius (rectangle against pill) and the fill. Three signals
522
- because one is a column heading away from being lost, and the palette has a
523
- single hue so colour cannot be one of them. */
524
- .c-score{display:inline-flex; align-items:stretch; flex:none; line-height:1;
525
- border:1px solid var(--c-border); overflow:hidden;
526
- font-variant-numeric:tabular-nums;}
527
- .c-score--performance{border-radius:8px;}
528
- .c-score--evidence{border-radius:var(--r-pill);}
529
- .c-score__scale{display:flex; align-items:center; padding:0 8px;
530
- font-size:9.5px; font-weight:600; letter-spacing:.08em;
531
- text-transform:uppercase; color:var(--c-muted);
532
- background:var(--c-fill); border-right:1px solid var(--c-border);}
533
- .c-score__letter{display:flex; align-items:center; justify-content:center;
534
- min-width:30px; padding:6px 8px; font-size:var(--t-body);
535
- font-weight:700; color:#22402C; background:var(--c-mint);}
536
- .c-score--evidence .c-score__letter{background:transparent; color:var(--c-text);}
537
- .c-score__coverage{display:flex; align-items:center; padding:0 9px;
538
- font-size:var(--t-micro); color:var(--c-text-2);
539
- background:var(--c-surface);
540
- border-left:1px solid var(--c-border); white-space:nowrap;}
541
- /* An absence keeps its scale label, so a reader knows which question went
542
- unanswered, and is dashed and lowercase so it cannot be mistaken for a
543
- result on either scale. */
544
- .c-score--none{border-style:dashed; background:transparent;}
545
- .c-score--none .c-score__scale{background:transparent; border-right-style:dashed;}
546
- .c-score__word{display:flex; align-items:center; padding:6px 10px;
547
- font-size:var(--t-micro); font-weight:500; color:var(--c-muted);
548
- white-space:nowrap;}
549
- /* A reported value is published fact without a letter: solid border, no fill,
550
- value text where a letter would sit. Distinct from both a grade (filled
551
- letter) and an absence (dashed). */
552
- .c-score--reported{background:transparent;}
553
- .c-score--reported .c-score__word{color:var(--c-text-2); white-space:normal;}
554
- .c-grade-row__value{font-size:var(--t-micro); color:var(--c-text-2);
555
- margin-left:var(--s2); white-space:nowrap;}
556
- .c-grade-card__evidence-detail{font-size:var(--t-micro); color:var(--c-muted);
557
- align-self:center;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558
  .c-rubric__warning{margin:0; padding:var(--s3); background:var(--c-mint);
559
  border-radius:var(--r-md); font-size:var(--t-micro);
560
  line-height:1.55; color:var(--c-text);}
@@ -567,7 +660,6 @@ footer,.gradio-container footer{display:none !important;}
567
  .c-legend__scale-body{margin:0; font-size:var(--t-micro); line-height:1.55;
568
  color:var(--c-text-2);}
569
  .c-legend__scale-body strong{color:var(--c-text); font-weight:600;}
570
- .c-grade-card__scores{display:flex; flex-wrap:wrap; gap:var(--s2);}
571
 
572
  /* ========================================================================
573
  EMPTY STATES: no dashed drop-zone rectangles
@@ -1317,14 +1409,12 @@ details[open] .c-libhelp__toggle::after{content:" -";}
1317
  .c-grade-row{flex-wrap:wrap; gap:var(--s2);}
1318
  }
1319
 
1320
- /* The score token never breaks up, at any width. Coverage sharing a border
1321
- with its letter is the whole design, so the cells are explicitly not
1322
  allowed to wrap and the token is not allowed to shrink below its content.
1323
  The row around it wraps instead. */
1324
- .c-score{flex-wrap:nowrap !important; flex:none !important;}
1325
- .c-score__scale,.c-score__letter,.c-score__coverage,.c-score__word{
1326
- white-space:nowrap; flex:none;
1327
- }
1328
  .c-grade-row__label{min-width:0; overflow-wrap:anywhere;}
1329
 
1330
  @media (prefers-reduced-motion:reduce){
@@ -1356,48 +1446,163 @@ details[open] .c-libhelp__toggle::after{content:" -";}
1356
  }
1357
 
1358
 
1359
- /* ---- Library page: cards over tick boxes ------------------------------ */
1360
- .c-library-section{scroll-margin-top:24px;}
1361
- .c-libgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1362
  gap:var(--s4); margin:var(--s4) 0;}
1363
- .c-libcard{background:var(--c-surface); border:1px solid var(--c-hairline);
1364
- border-radius:var(--r-lg); padding:var(--s4);
1365
- display:flex; flex-direction:column; gap:6px;
1366
- transition:box-shadow .18s ease, transform .18s ease;}
1367
- .c-libcard:hover{box-shadow:var(--e2); transform:translateY(-2px);}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1368
  .c-libcard__media{margin:calc(var(--s4)*-1) calc(var(--s4)*-1) var(--s2);
1369
- aspect-ratio:16/9; border-radius:var(--r-lg) var(--r-lg) 0 0;
1370
  background:var(--c-fill) center/cover no-repeat;
1371
  display:flex; align-items:center; justify-content:center;
1372
  overflow:hidden; position:relative;}
1373
- .c-libcard__media img{width:100%; height:100%; object-fit:cover; display:block;}
1374
- .c-libcard__play{font-size:22px; color:var(--c-muted); opacity:.8;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1375
  .c-libcard__media.is-playing .c-libcard__play{display:none;}
1376
- .c-libcard__head{display:flex; align-items:center; gap:var(--s2);}
1377
  .c-libcard__kind{font-size:var(--t-micro); letter-spacing:.06em; text-transform:uppercase;
1378
  padding:2px 8px; border-radius:999px; background:var(--c-fill);
1379
- color:var(--c-text-2);}
1380
- .c-libcard__kind--skill{background:var(--c-sage-wash, #e7efe7); color:var(--c-sage-deep);}
1381
- .c-libcard__default{margin-left:auto; font-size:var(--t-micro); color:var(--c-sage-deep);
1382
- border:1px solid currentColor; border-radius:999px; padding:1px 8px;}
1383
  .c-libcard__name{margin:0; font-size:var(--t-body); font-weight:650; color:var(--c-text);
1384
  text-transform:capitalize;}
1385
  .c-libcard__author{margin:0; font-size:var(--t-micro); color:var(--c-muted);}
1386
- .c-libcard__desc{margin:2px 0 0; font-size:var(--t-small, 13px); line-height:1.5;
1387
  color:var(--c-text-2);
1388
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical;
1389
  overflow:hidden;}
1390
  .c-libcard__ref{margin-top:auto; padding-top:var(--s2); font-family:var(--mono);
1391
  font-size:11px; color:var(--c-muted);}
1392
- .c-librarydefaults-head{margin-top:var(--s4);}
1393
 
1394
- /* ---- Quick nav under the identity box --------------------------------- */
1395
- .c-quicknav{display:flex; gap:var(--s3); justify-content:flex-end;
1396
- margin:calc(var(--s2)*-1) 0 var(--s2);}
1397
- .c-quicknav__link{font-size:var(--t-micro); letter-spacing:.04em; text-decoration:none;
1398
- color:var(--c-sage-deep); border:1px solid var(--c-hairline);
1399
- background:var(--c-surface); padding:4px 12px; border-radius:999px;}
1400
- .c-quicknav__link:hover{border-color:var(--c-sage-deep);}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1401
 
1402
  /* ---- The no-agents veil ----------------------------------------------- */
1403
  /* Shown only while somebody is signed in (the identity span has text) and
@@ -1406,9 +1611,13 @@ details[open] .c-libhelp__toggle::after{content:" -";}
1406
  .c-conversation{position:relative;}
1407
  .c-shell:has(.c-identity:not(:empty)):has(.c-noworker-hook) .c-veil{
1408
  display:flex; position:absolute; inset:0; z-index:12;
1409
- align-items:center; justify-content:center; padding:var(--s5);
1410
- background:color-mix(in srgb, var(--c-bg, #f7f9f3) 62%, transparent);
1411
- backdrop-filter:blur(2.5px); border-radius:var(--r-lg);
 
 
 
 
1412
  /* The veil informs; it does not imprison. Pointer events pass through
1413
  everywhere except its own panel, so a transient no-worker blip (a poll
1414
  gap, a mode change) can never trap a click mid-flow. */
@@ -1419,11 +1628,16 @@ details[open] .c-libhelp__toggle::after{content:" -";}
1419
  .c-veil__panel{max-width:380px; text-align:center; background:var(--c-surface);
1420
  border:1px solid var(--c-hairline); border-radius:var(--r-lg);
1421
  box-shadow:var(--e2); padding:var(--s5);}
 
 
 
 
 
1422
  .c-veil__title{margin:0 0 6px; font-weight:650; font-size:var(--t-lg); color:var(--c-text);}
1423
  .c-veil__body{margin:0 0 var(--s4); color:var(--c-text-2); line-height:1.55;}
1424
- .c-veil__action{display:inline-block; text-decoration:none; background:var(--c-sage-deep);
1425
- color:#fff; padding:10px 20px; border-radius:999px; font-weight:600;}
1426
- .c-veil__action:hover{filter:brightness(1.08);}
1427
 
1428
  /* ---- Professional polish pass ----------------------------------------- */
1429
  /* Calmer sections: the tail accordions read as pages, not widgets. */
@@ -1436,11 +1650,93 @@ details[open] .c-libhelp__toggle::after{content:" -";}
1436
  /* Inputs: quiet until focused. */
1437
  .gradio-container input[type="text"], .gradio-container textarea{
1438
  border-radius:var(--r-md) !important;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1439
  @media (max-width:700px){
1440
- .c-libgrid{grid-template-columns:1fr 1fr; gap:var(--s3);}
1441
  .c-quicknav{justify-content:flex-start;}
1442
- }
1443
- @media (max-width:460px){
1444
- .c-libgrid{grid-template-columns:1fr;}
1445
  }
1446
  """
 
18
  measured.
19
 
20
  **2. WCAG AA, computed rather than assumed.**
21
+ Contrast against the canvas ``#FAF9F5``:
22
 
23
  =============== ========= ====== ==========================================
24
  Colour Ratio AA? Used for
25
  =============== ========= ====== ==========================================
26
+ ``#1F1E1A`` 15.6:1 pass body text
27
+ ``#504D45`` 7.6:1 pass secondary text
28
+ ``#6C6961`` 4.6:1 pass muted text
29
+ ``#174F37`` 9.3:1 pass accent text
30
+ ``#1E6E4B`` 6.0:1* pass primary button (*white on it: 6.2:1)
31
+ ``#4E7561`` 4.2:1 FAIL borders, strokes, 24px+ only
32
+ ``#5E8A73`` 3.2:1 FAIL decorative fill only
33
  =============== ========= ====== ==========================================
34
 
35
+ The two lighter greens fail AA for body text, so neither is ever used for
36
+ body text. Every neutral is warm-grey over ivory; green appears only where
37
+ it means something (the action, the selection, the focus).
38
 
39
  **Layout: the shell decides its own height.**
40
  The previous sheet locked ``.gradio-container`` and ``.c-shell`` to ``100vh``
 
55
  from __future__ import annotations
56
 
57
  PALETTE = {
58
+ # A warm paper ground with exactly one accent. The previous sheet tinted
59
+ # the canvas, the borders, the fills and the pills green all at once, and
60
+ # four tinted neutrals beside one another read as a colour scheme fighting
61
+ # itself. Now the neutrals are neutral (warm greys over an ivory ground)
62
+ # and green appears only where it means something: the primary action,
63
+ # the selected state, the focus ring.
64
+ "canvas": "#FAF9F5",
65
  "surface": "#FFFFFF",
66
+ "mint": "#E8F0EA", # selection tint, the only coloured fill
67
+ "sage": "#5E8A73", # decorative strokes over 24px
68
+ "sage_dark": "#4E7561",
69
+ "border": "#D8D3C7",
70
+ "text": "#1F1E1A",
71
+ "muted": "#6C6961",
72
+ # Accessible shades of the accent; see the table above.
73
+ "sage_deep": "#174F37",
74
+ "sage_button": "#1E6E4B",
75
+ "text_secondary": "#504D45",
76
+ "hairline": "#EAE7DF",
77
  }
78
 
79
  # Loaded via launch(head=...) so the font arrives before first paint rather than
 
94
 
95
  <script>
96
  (function(){
97
+ function card(el){return el && el.closest ? el.closest('.c-libcard') : null;}
98
+ function mediaOf(c){return c ? c.querySelector('.c-libcard__media') : null;}
99
  function show(m){
100
  if(!m || m.classList.contains('is-playing')) return;
101
  var src = m.getAttribute('data-gif');
 
109
  m.classList.remove('is-playing');
110
  m.querySelectorAll('img').forEach(function(i){i.remove();});
111
  }
112
+ /* Hover previews, scoped to the media block so sweeping the grid does not
113
+ start twenty GIFs at once. */
114
+ document.addEventListener('mouseover', function(e){
115
+ var m = e.target.closest ? e.target.closest('.c-libcard__media') : null; show(m);
116
+ });
117
  document.addEventListener('mouseout', function(e){
118
+ var m = e.target.closest ? e.target.closest('.c-libcard__media') : null;
119
  if(m && !m.contains(e.relatedTarget)) hide(m);
120
  });
121
+ /* Press-and-hold anywhere on the card previews on a phone; a plain tap is
122
+ the selection. The two must not fire together, hence the flag. */
123
+ var holdTimer=null, held=false;
124
  document.addEventListener('touchstart', function(e){
125
+ var c = card(e.target); if(!c) return;
126
+ held=false;
127
+ holdTimer = setTimeout(function(){held=true; show(mediaOf(c));}, 350);
128
  }, {passive:true});
129
  ['touchend','touchcancel'].forEach(function(name){
130
  document.addEventListener(name, function(e){
131
+ clearTimeout(holdTimer); hide(mediaOf(card(e.target)));
132
  }, {passive:true});
133
  });
134
+ /* THE CARD IS THE CONTROL, and the way it saves is by forwarding its click
135
+ to the framework's own box for that member. Writing a hidden field's
136
+ value and dispatching an input event was tried first: it updates the DOM
137
+ and never reaches the server, because the framework listens to its own
138
+ binding rather than to the element. Clicking its control cannot drift
139
+ from it. The boxes are labelled with the bare reference, so the mapping
140
+ is an exact string rather than a position two lists could disagree on. */
141
+ function boxFor(ref){
142
+ var group = document.getElementById('library-choice');
143
+ if(!group) return null;
144
+ var labels = group.querySelectorAll('label');
145
+ for(var i=0;i<labels.length;i++){
146
+ if((labels[i].textContent||'').trim() === ref){
147
+ return labels[i].querySelector('input[type=checkbox]');
148
+ }
149
+ }
150
+ return null;
151
+ }
152
+ document.addEventListener('click', function(e){
153
+ var c = card(e.target);
154
+ if(!c || !c.hasAttribute('data-ref')) return;
155
+ if(held){held=false; return;}
156
+ if(e.target.closest && e.target.closest('a')) return;
157
+ var box = boxFor(c.getAttribute('data-ref'));
158
+ if(!box) return; /* no transport, no pretend selection */
159
+ /* Paint first so the card answers the tap immediately; the count catches
160
+ up when the save returns. */
161
+ c.classList.toggle('is-on');
162
+ c.setAttribute('aria-pressed', c.classList.contains('is-on') ? 'true' : 'false');
163
+ box.click();
164
+ });
165
+ document.addEventListener('keydown', function(e){
166
+ if(e.key !== ' ' && e.key !== 'Enter') return;
167
+ var c = card(e.target);
168
+ if(!c || e.target !== c) return;
169
+ e.preventDefault(); c.click();
170
+ });
171
  })();
172
  </script>
173
  """
 
179
  ==================================================================== */
180
  :root{
181
  /* colour */
182
+ --c-canvas:#FAF9F5; --c-surface:#FFFFFF; --c-mint:#E8F0EA;
183
+ --c-sage:#5E8A73; --c-sage-dark:#4E7561; --c-sage-deep:#174F37;
184
+ --c-accent:#1E6E4B; --c-accent-hover:#185C3E;
185
+ --c-text:#1F1E1A; --c-text-2:#504D45; --c-muted:#6C6961;
186
+ --c-hairline:#EAE7DF; --c-border:#D8D3C7; --c-fill:#F4F1EA;
187
+ --c-warn-bg:#FBF6E8; --c-warn-rule:#7A6420;
188
 
189
  /* spacing: 4px base, no value outside this scale */
190
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;
 
198
  --r-md:12px; --r-lg:16px; --r-pill:999px;
199
 
200
  /* elevation: two levels */
201
+ --e1:0 1px 2px rgba(35,32,26,.05);
202
+ --e2:0 8px 28px -12px rgba(35,32,26,.16);
203
 
204
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
205
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
206
 
207
+ /* DISPLAY FACE. Option B is live: the serif display over a warm paper
208
+ ground is what carries the editorial, Anthropic-adjacent register; the
209
+ sans stays for everything set smaller than a title. Swap the live line
210
+ to compare; nothing else in the sheet changes. */
211
+ /* --font-display:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; */ /* A */
212
+ --font-display:'Fraunces','Iowan Old Style',Georgia,serif; /* B */
213
 
214
+ --c-focus:rgba(30,110,75,.4);
215
  --measure:68ch;
216
 
217
  /* One shell geometry, referenced by every top-level block so there is
 
327
  line-height:1; white-space:nowrap; overflow:hidden;
328
  text-overflow:ellipsis; padding-left:var(--s3);
329
  border-left:1px solid var(--c-hairline);}
330
+ /* Who you are, said quietly. This was a floating white pill with a shadow,
331
+ which gave the top of the page a second object competing with the
332
+ wordmark for the eye; it is a caption, so it is set like one. */
333
+ .c-identity{font-size:var(--t-micro); color:var(--c-muted); white-space:nowrap;
334
+ overflow:hidden; text-overflow:ellipsis; max-width:38ch;}
335
  .c-identity--link{text-decoration:underline; cursor:pointer;}
336
 
337
  /* ========================================================================
 
401
  /* ========================================================================
402
  NOTICE
403
  ==================================================================== */
404
+ /* A caution, not an alarm: paper surface and a hairline, with the mark the
405
+ only saturated pixel. The previous amber flood shouted over the page and
406
+ was the loudest colour on it. */
407
+ .c-notice{background:var(--c-surface); border:1px solid var(--c-hairline);
408
+ border-radius:var(--r-md); padding:var(--s3) var(--s4);}
409
+ .c-notice__summary{display:flex; align-items:baseline; gap:var(--s3);
410
+ flex-wrap:wrap; cursor:pointer; list-style:none;
411
  font-size:var(--t-label); color:var(--c-text-2);
412
+ line-height:1.5;}
413
  .c-notice__summary::-webkit-details-marker{display:none;}
414
  .c-notice__summary strong{color:var(--c-text); font-weight:600;}
415
  .c-notice__mark{flex:none; width:16px; height:16px; border-radius:50%;
416
+ align-self:center;
417
+ border:1.5px solid var(--c-warn-rule); color:var(--c-warn-rule);
418
+ font-size:10px; font-weight:700; display:grid; place-items:center;}
419
  .c-notice__toggle{margin-left:auto; white-space:nowrap; font-size:var(--t-micro);
420
+ color:var(--c-muted); text-decoration:underline;
421
+ text-underline-offset:2px; padding-left:var(--s3);}
422
  .c-notice__body{margin:var(--s3) 0 var(--s1) 28px; font-size:var(--t-micro);
423
  line-height:1.6; color:var(--c-text-2); max-width:var(--measure);}
424
  .c-notice__summary:focus-visible{outline:3px solid var(--c-sage); outline-offset:3px;
 
557
  .c-grade-card__name{font-size:var(--t-body); font-weight:600; color:var(--c-text);}
558
  .c-grade-card__link{font-size:var(--t-micro); color:var(--c-sage-deep);
559
  text-decoration:underline; white-space:nowrap;}
560
+ /* Coverage sits in the card head, beside the name, because it qualifies the
561
+ whole card. "three of six areas published" is not a score and must never be
562
+ read as one, so it is set as quiet metadata rather than as a result. */
 
563
  .c-grade-card__coverage{font-size:var(--t-micro); color:var(--c-text-2);
564
  font-variant-numeric:tabular-nums;}
565
  .c-grade-card__note{margin:0; padding-top:var(--s3); font-size:var(--t-micro);
 
572
  .c-grade-row:last-child{border-bottom:none;}
573
  .c-grade-row__label{font-size:var(--t-label); color:var(--c-text-2);}
574
 
575
+ /* ONE TOKEN, NOT A NUMBER WITH A CAPTION.
576
+ The figure and the method that produced it share a single border and a single
577
+ overflow context, so there is no crop, no skim and no line break that can
578
+ separate them. "54 MWh" metered at the socket and "54 MWh" inferred from a
579
+ chip's rated wattage are different claims, and the word that tells them apart
580
+ is inside the box rather than beside it.
581
+
582
+ Method is told apart three ways at once: the word itself, the fill, and the
583
+ border. Three signals because one is a heading away from being lost, and the
584
+ palette has a single hue so colour cannot carry it alone. */
585
+ .c-fig{display:inline-flex; align-items:stretch; flex:none; line-height:1;
586
+ border:1px solid var(--c-border); border-radius:8px; overflow:hidden;
587
+ font-variant-numeric:tabular-nums;}
588
+ .c-fig__value{display:flex; align-items:center; padding:6px 9px;
589
+ font-size:var(--t-label); font-weight:600; color:#22402C;
590
+ background:var(--c-mint); white-space:nowrap;}
591
+ .c-fig__method{display:flex; align-items:center; padding:0 8px;
592
+ font-size:9.5px; font-weight:600; letter-spacing:.08em;
593
+ text-transform:uppercase; color:var(--c-muted);
594
+ background:var(--c-surface);
595
+ border-left:1px solid var(--c-border); white-space:nowrap;}
596
+ /* A measured figure is the only one that gets the filled value. A modelled one
597
+ is the same shape unfilled, because it is a real published number arrived at
598
+ by calculation rather than by metering, and the difference should read at a
599
+ glance without either being dressed as a fault. */
600
+ .c-fig--modelled .c-fig__value,
601
+ .c-fig--proxy .c-fig__value{background:var(--c-fill); color:var(--c-text);}
602
+ .c-fig--unknown{border-style:dotted;}
603
+ .c-fig--unknown .c-fig__value{background:transparent; color:var(--c-text-2);}
604
+ /* An absence is dashed, wordy and unfilled: it differs from a figure in shape,
605
+ fill and content, because an absence drawn as a small number asserts a light
606
+ result that nobody measured. */
607
+ .c-fig--none{border-style:dashed; background:transparent;}
608
+ .c-fig__word{display:flex; align-items:center; padding:6px 10px;
609
+ font-size:var(--t-micro); font-weight:500; color:var(--c-muted);
610
+ white-space:nowrap;}
611
+
612
+ /* The card's own prose. Summary sits above the figures because a reader who
613
+ stops after one paragraph should stop having read the caveat, not the
614
+ headline number. */
615
+ .c-grade-card__summary{margin:0; font-size:var(--t-label); line-height:1.6;
616
+ color:var(--c-text-2);}
617
+ .c-grade-card__covers{margin:0; font-size:var(--t-micro); line-height:1.55;
618
+ color:var(--c-muted);}
619
+ .c-grade-card__covers strong{color:var(--c-text-2); font-weight:600;}
620
+ .c-grade-card__links{display:flex; flex-wrap:wrap; gap:var(--s3); margin:0;
621
+ padding-top:var(--s3);
622
+ border-top:1px solid var(--c-hairline);}
623
+
624
+ /* THE WORKING, ONE CLICK AWAY.
625
+ Six notes and six citations on the face of the card bury the figures; hiding
626
+ them makes the figures unverifiable. A disclosure is the only arrangement
627
+ that is both complete and readable. */
628
+ .c-sources{border-top:1px solid var(--c-hairline); padding-top:var(--s3);}
629
+ .c-sources__summary{cursor:pointer; font-size:var(--t-micro); font-weight:600;
630
+ letter-spacing:.04em; color:var(--c-sage-deep);}
631
+ .c-sources__summary:focus-visible{outline:2px solid var(--c-sage);
632
+ outline-offset:2px; border-radius:3px;}
633
+ .c-sources__body{display:flex; flex-direction:column; gap:var(--s2);
634
+ margin-top:var(--s3);}
635
+ .c-source{display:grid; grid-template-columns:minmax(88px,auto) 1fr;
636
+ gap:var(--s1) var(--s3); margin:0; font-size:var(--t-micro);
637
+ line-height:1.55;}
638
+ .c-source__label{color:var(--c-text-2); font-weight:600;}
639
+ .c-source__body{color:var(--c-muted);}
640
+ .c-source__link{color:var(--c-sage-deep); text-decoration:underline;
641
+ white-space:nowrap;}
642
+
643
+ .c-reading{padding-top:var(--s3); border-top:1px dashed var(--c-border);}
644
+ .c-reading__title{margin:0 0 var(--s2); font-size:var(--t-micro); font-weight:600;
645
+ letter-spacing:.06em; text-transform:uppercase;
646
+ color:var(--c-muted);}
647
+ .c-reading__links{display:flex; flex-direction:column; gap:var(--s1); margin:0;}
648
+ .c-reading__link{font-size:var(--t-micro); color:var(--c-sage-deep);
649
+ text-decoration:underline;}
650
+
651
  .c-rubric__warning{margin:0; padding:var(--s3); background:var(--c-mint);
652
  border-radius:var(--r-md); font-size:var(--t-micro);
653
  line-height:1.55; color:var(--c-text);}
 
660
  .c-legend__scale-body{margin:0; font-size:var(--t-micro); line-height:1.55;
661
  color:var(--c-text-2);}
662
  .c-legend__scale-body strong{color:var(--c-text); font-weight:600;}
 
663
 
664
  /* ========================================================================
665
  EMPTY STATES: no dashed drop-zone rectangles
 
1409
  .c-grade-row{flex-wrap:wrap; gap:var(--s2);}
1410
  }
1411
 
1412
+ /* The figure token never breaks up, at any width. The method word sharing a
1413
+ border with its number is the whole design, so the cells are explicitly not
1414
  allowed to wrap and the token is not allowed to shrink below its content.
1415
  The row around it wraps instead. */
1416
+ .c-fig{flex-wrap:nowrap !important; flex:none !important;}
1417
+ .c-fig__value,.c-fig__method,.c-fig__word{white-space:nowrap; flex:none;}
 
 
1418
  .c-grade-row__label{min-width:0; overflow-wrap:anywhere;}
1419
 
1420
  @media (prefers-reduced-motion:reduce){
 
1446
  }
1447
 
1448
 
1449
+ /* ---- Library page ------------------------------------------------------
1450
+ Its own page, reached from the quick nav. One control: the card. Clicking
1451
+ or tapping a card makes that member a default and the page saves at once;
1452
+ there is no separate list of tick boxes to reconcile with the grid. The
1453
+ selected state has to survive a squint test: accent border, filled check,
1454
+ tinted wash — three signals, any one of which is enough. */
1455
+ .c-libpage{max-width:var(--shell-max); margin:0 auto; padding:var(--s5) var(--shell-pad) var(--s8);}
1456
+ .c-libpage__back{font-size:var(--t-label); color:var(--c-text-2); text-decoration:none;
1457
+ display:inline-flex; align-items:center; gap:6px;}
1458
+ .c-libpage__back:hover{color:var(--c-text);}
1459
+ .c-libpage__title{margin:var(--s3) 0 4px; font-family:var(--font-display);
1460
+ font-weight:600; font-size:clamp(26px,4vw,34px); letter-spacing:-.015em;
1461
+ color:var(--c-text);}
1462
+ .c-libpage__lede{margin:0 0 var(--s5); max-width:var(--measure); color:var(--c-text-2);}
1463
+ .c-libsave{position:sticky; top:0; z-index:9; display:flex; align-items:center; gap:var(--s3);
1464
+ background:color-mix(in srgb, var(--c-canvas) 88%, transparent);
1465
+ backdrop-filter:blur(6px); padding:var(--s2) 0; margin-bottom:var(--s2);}
1466
+ .c-libsave__count{font-size:var(--t-label); color:var(--c-text-2);}
1467
+ .c-libsave__count strong{color:var(--c-sage-deep); font-weight:650;}
1468
+
1469
+ .c-libgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
1470
  gap:var(--s4); margin:var(--s4) 0;}
1471
+ .c-libcard{position:relative; background:var(--c-surface);
1472
+ border:1.5px solid var(--c-hairline); border-radius:var(--r-lg);
1473
+ padding:var(--s4); cursor:pointer; -webkit-tap-highlight-color:transparent;
1474
+ display:flex; flex-direction:column; gap:6px; text-align:left;
1475
+ transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;}
1476
+ .c-libcard:hover{border-color:var(--c-border); box-shadow:var(--e1);}
1477
+ .c-libcard:focus-visible{outline:3px solid var(--c-focus, rgba(30,110,75,.4)); outline-offset:2px;}
1478
+ .c-libcard.is-on{border-color:var(--c-accent); background:color-mix(in srgb, var(--c-mint) 38%, var(--c-surface));}
1479
+ .c-libcard.is-on:hover{box-shadow:var(--e1);}
1480
+ /* The check is a real mark, not a decoration: absent = a quiet plus, present
1481
+ = a filled tick. It is what makes the card legible as a control at all. */
1482
+ .c-libcard__check{position:absolute; top:10px; right:10px; z-index:2;
1483
+ width:24px; height:24px; border-radius:50%;
1484
+ display:flex; align-items:center; justify-content:center;
1485
+ font-size:14px; line-height:1;
1486
+ border:1.5px solid var(--c-border); color:var(--c-muted);
1487
+ background:var(--c-surface);
1488
+ transition:all .15s ease;}
1489
+ .c-libcard.is-on .c-libcard__check{border-color:var(--c-accent);
1490
+ background:var(--c-accent); color:#fff;}
1491
+ .c-libcard__check::before{content:"+";}
1492
+ .c-libcard.is-on .c-libcard__check::before{content:"✓";}
1493
  .c-libcard__media{margin:calc(var(--s4)*-1) calc(var(--s4)*-1) var(--s2);
1494
+ aspect-ratio:16/9; border-radius:calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px) 0 0;
1495
  background:var(--c-fill) center/cover no-repeat;
1496
  display:flex; align-items:center; justify-content:center;
1497
  overflow:hidden; position:relative;}
1498
+ .c-libcard__media img{width:100%; height:100%; object-fit:cover;
1499
+ object-position:top center; display:block;
1500
+ position:absolute; inset:0;}
1501
+ /* The still is the run's own result. It sits under the animation, and it is
1502
+ what the card shows on a phone, where nothing hovers. */
1503
+ .c-libcard__poster{z-index:0;}
1504
+ .c-libcard__media.is-playing .c-libcard__poster{opacity:0;}
1505
+ .c-libcard__play{position:relative; z-index:1;
1506
+ display:inline-flex; align-items:center; gap:6px;
1507
+ font-size:var(--t-micro); color:var(--c-text-2);
1508
+ background:color-mix(in srgb, var(--c-surface) 92%, transparent);
1509
+ border:1px solid var(--c-hairline); backdrop-filter:blur(3px);
1510
+ border-radius:999px; padding:4px 10px; opacity:0;
1511
+ transition:opacity .15s ease;}
1512
+ .c-libcard__play::before{content:"▶"; font-size:9px; color:var(--c-sage-deep);}
1513
+ /* The invitation appears on approach and never sits permanently over the
1514
+ result it is inviting you to watch. Always visible where there is no
1515
+ poster to obscure, since then it is the only thing in the frame. */
1516
+ .c-libcard:hover .c-libcard__play,
1517
+ .c-libcard:focus-visible .c-libcard__play{opacity:1;}
1518
+ .c-libcard__media:not(:has(.c-libcard__poster)) .c-libcard__play{opacity:1;}
1519
  .c-libcard__media.is-playing .c-libcard__play{display:none;}
1520
+ .c-libcard__head{display:flex; align-items:center; gap:var(--s2); padding-right:28px;}
1521
  .c-libcard__kind{font-size:var(--t-micro); letter-spacing:.06em; text-transform:uppercase;
1522
  padding:2px 8px; border-radius:999px; background:var(--c-fill);
1523
+ color:var(--c-text-2); flex:none;}
1524
+ .c-libcard__kind--skill{background:var(--c-mint); color:var(--c-sage-deep);}
 
 
1525
  .c-libcard__name{margin:0; font-size:var(--t-body); font-weight:650; color:var(--c-text);
1526
  text-transform:capitalize;}
1527
  .c-libcard__author{margin:0; font-size:var(--t-micro); color:var(--c-muted);}
1528
+ .c-libcard__desc{margin:2px 0 0; font-size:13px; line-height:1.5;
1529
  color:var(--c-text-2);
1530
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical;
1531
  overflow:hidden;}
1532
  .c-libcard__ref{margin-top:auto; padding-top:var(--s2); font-family:var(--mono);
1533
  font-size:11px; color:var(--c-muted);}
 
1534
 
1535
+ /* ---- Navigation, in the header band -----------------------------------
1536
+ A button (the library, which navigates) beside a link (a section of this
1537
+ page). They must look like one row of controls, so the button is styled to
1538
+ match the link rather than the other way round.
1539
+
1540
+ The row is pulled up against the header rule and the sign-in control sits
1541
+ with it, because a site's navigation belongs to its header. Left where it
1542
+ was, the page opened with a rule, a band of nothing, two floating pills,
1543
+ another band of nothing, and only then the product. */
1544
+ .c-quicknav{display:flex !important; flex-wrap:wrap !important; gap:var(--s2) !important;
1545
+ justify-content:flex-end !important; align-items:center !important;
1546
+ /* Pulled tight against the header rule on both sides. The shell
1547
+ puts a 24px gap between every child, which around a 34px row of
1548
+ pills left the page opening on a band of nothing; these margins
1549
+ spend that gap rather than adding to it. */
1550
+ margin:calc(var(--s4)*-1) 0 calc(var(--s2)*-1) !important;
1551
+ min-height:0 !important;}
1552
+ /* The row hugs its controls. Gradio wraps the anchor in a block that keeps a
1553
+ 60px minimum, which made a 32px row of pills reserve twice its own height;
1554
+ the wrapper is told to be the size of what it contains. */
1555
+ .c-quicknav>*{min-height:0 !important; margin:0 !important; align-self:center !important;}
1556
+ .c-quicknav .block,.c-quicknav .prose,.c-quicknav nav{min-height:0 !important;
1557
+ padding:0 !important; margin:0 !important; display:flex !important;
1558
+ align-items:center !important;}
1559
+ .c-quicknav .prose p{margin:0 !important;}
1560
+ /* The wrapper keeps a 60px floor that no rule on it reaches, so the row is
1561
+ given the height of its own controls and allowed to overflow it. On a
1562
+ narrow screen the pills wrap, so the height goes back to automatic. */
1563
+ @media (min-width:701px){
1564
+ .c-quicknav{height:34px !important; overflow:visible !important;}
1565
+ }
1566
+ /* The Hugging Face control keeps company with the nav rather than spanning
1567
+ the page as a full-width slab. */
1568
+ .c-shell>.gradio-button.huggingface,
1569
+ .c-shell button.huggingface{width:auto !important; max-width:280px;
1570
+ margin-left:auto !important; margin-top:calc(var(--s3)*-1) !important;}
1571
+ .c-quicknav>*{flex:0 0 auto !important; width:auto !important; min-width:0 !important;}
1572
+ .c-quicknav__link,
1573
+ .c-quicknav .c-quicknav__btn button,
1574
+ .c-quicknav button.c-quicknav__btn{
1575
+ display:inline-flex !important; align-items:center !important;
1576
+ font-size:var(--t-label) !important; text-decoration:none; font-weight:550 !important;
1577
+ color:var(--c-text-2) !important; border:1px solid var(--c-hairline) !important;
1578
+ background:var(--c-surface) !important; padding:5px 14px !important;
1579
+ border-radius:999px !important; min-height:0 !important; height:auto !important;
1580
+ line-height:1.5 !important;
1581
+ transition:border-color .15s ease, color .15s ease;}
1582
+ .c-quicknav__link:hover,
1583
+ .c-quicknav .c-quicknav__btn button:hover,
1584
+ .c-quicknav button.c-quicknav__btn:hover{
1585
+ border-color:var(--c-accent) !important; color:var(--c-sage-deep) !important;}
1586
+
1587
+ /* The library page's own way back, set as a quiet control at the top left. */
1588
+ .c-libpage .c-libpage__backbtn button,
1589
+ .c-libpage button.c-libpage__backbtn{
1590
+ background:transparent !important; border:none !important; padding:0 !important;
1591
+ color:var(--c-text-2) !important; font-size:var(--t-label) !important;
1592
+ font-weight:550 !important; min-height:0 !important;}
1593
+ .c-libpage .c-libpage__backbtn button:hover,
1594
+ .c-libpage button.c-libpage__backbtn:hover{color:var(--c-text) !important;}
1595
+ .c-libpage .c-librarysearch input,
1596
+ .c-libpage .c-librarysearch textarea{max-width:420px;}
1597
+ /* The transport, present in the document and not on the page.
1598
+ ``display:none`` rather than the usual clip-to-1px trick: a clipped
1599
+ element still occupies a box the browser hit-tests, so a stray box landed
1600
+ in the corner of the page and could take a click meant for something else.
1601
+ A synthetic ``click()`` — which is how a card forwards its selection —
1602
+ dispatches on a hidden element exactly as it does on a shown one, so
1603
+ nothing is lost by removing it from the layout entirely. It must never
1604
+ become ``visible=False`` in Python: gradio 6 leaves that out of the DOM. */
1605
+ .c-hiddenfield{display:none !important;}
1606
 
1607
  /* ---- The no-agents veil ----------------------------------------------- */
1608
  /* Shown only while somebody is signed in (the identity span has text) and
 
1611
  .c-conversation{position:relative;}
1612
  .c-shell:has(.c-identity:not(:empty)):has(.c-noworker-hook) .c-veil{
1613
  display:flex; position:absolute; inset:0; z-index:12;
1614
+ /* Aligned to the top of the column rather than its centre. Centred, the
1615
+ panel sat across the privacy notice above the conversation and read as
1616
+ a modal over the whole page instead of an explanation of this column. */
1617
+ align-items:flex-start; justify-content:center;
1618
+ padding:var(--s7) var(--s5) var(--s5);
1619
+ background:color-mix(in srgb, var(--c-canvas) 72%, transparent);
1620
+ backdrop-filter:blur(2px); border-radius:var(--r-lg);
1621
  /* The veil informs; it does not imprison. Pointer events pass through
1622
  everywhere except its own panel, so a transient no-worker blip (a poll
1623
  gap, a mode change) can never trap a click mid-flow. */
 
1628
  .c-veil__panel{max-width:380px; text-align:center; background:var(--c-surface);
1629
  border:1px solid var(--c-hairline); border-radius:var(--r-lg);
1630
  box-shadow:var(--e2); padding:var(--s5);}
1631
+ @media (max-width:700px){
1632
+ .c-shell:has(.c-identity:not(:empty)):has(.c-noworker-hook) .c-veil{
1633
+ padding:var(--s5) var(--s4);}
1634
+ .c-veil__panel{padding:var(--s4);}
1635
+ }
1636
  .c-veil__title{margin:0 0 6px; font-weight:650; font-size:var(--t-lg); color:var(--c-text);}
1637
  .c-veil__body{margin:0 0 var(--s4); color:var(--c-text-2); line-height:1.55;}
1638
+ .c-veil__action{display:inline-block; text-decoration:none; background:var(--c-accent);
1639
+ color:#fff; padding:10px 22px; border-radius:var(--r-md); font-weight:600;}
1640
+ .c-veil__action:hover{background:var(--c-accent-hover);}
1641
 
1642
  /* ---- Professional polish pass ----------------------------------------- */
1643
  /* Calmer sections: the tail accordions read as pages, not widgets. */
 
1650
  /* Inputs: quiet until focused. */
1651
  .gradio-container input[type="text"], .gradio-container textarea{
1652
  border-radius:var(--r-md) !important;}
1653
+ /* Buttons: one radius, one accent. The pill-shaped navy is gone; a primary
1654
+ action is the accent green, a secondary is paper with a hairline, and the
1655
+ Hugging Face sign-in follows the secondary language rather than bringing a
1656
+ fourth colour to the page. */
1657
+ .gradio-container button{border-radius:var(--r-md) !important; font-weight:600 !important;
1658
+ letter-spacing:0 !important; transition:background .15s ease, border-color .15s ease !important;}
1659
+ .gradio-container button.primary{background:var(--c-accent) !important; color:#fff !important;
1660
+ border:1px solid var(--c-accent) !important;}
1661
+ .gradio-container button.primary:hover{background:var(--c-accent-hover) !important;
1662
+ border-color:var(--c-accent-hover) !important;}
1663
+ .gradio-container button.secondary{background:var(--c-surface) !important;
1664
+ color:var(--c-text) !important; border:1px solid var(--c-border) !important;}
1665
+ .gradio-container button.secondary:hover{border-color:var(--c-accent) !important;
1666
+ color:var(--c-sage-deep) !important;}
1667
+ .gradio-container button.huggingface{background:var(--c-surface) !important;
1668
+ color:var(--c-text) !important; border:1px solid var(--c-border) !important;
1669
+ border-radius:var(--r-md) !important;}
1670
+ .gradio-container button.huggingface:hover{border-color:var(--c-accent) !important;}
1671
+ /* Focus is the accent, everywhere, and only on focus. */
1672
+ .gradio-container :is(button,a,input,textarea,select,[role="button"]):focus-visible{
1673
+ outline:3px solid rgba(30,110,75,.4) !important; outline-offset:2px !important;}
1674
+ /* Gradio's multipage navbar duplicates the quick nav; the page carries its
1675
+ own way back. Belt and braces beside gr.Navbar(visible=False). */
1676
+ nav.navbar, .gradio-container .navbar{display:none !important;}
1677
+
1678
+ /* ---- Answer artifacts: show the thing that came out -------------------- */
1679
+ /* A run that produced a file shows the file's own content, styled as the
1680
+ kind of thing it is, inside the answer. The GIF demos end on this block,
1681
+ because "generate a PDF" is only demonstrated by a PDF appearing. */
1682
+ .c-made{margin:var(--s3) 0 0; display:flex; flex-direction:column; gap:var(--s3);}
1683
+ .c-madecard{background:var(--c-surface); border:1px solid var(--c-hairline);
1684
+ border-radius:var(--r-md); overflow:hidden; max-width:520px;
1685
+ box-shadow:var(--e1);}
1686
+ .c-madecard__bar{display:flex; align-items:center; gap:var(--s2);
1687
+ padding:8px var(--s3); border-bottom:1px solid var(--c-hairline);
1688
+ background:var(--c-fill);}
1689
+ .c-madecard__dot{width:8px; height:8px; border-radius:50%; background:var(--c-accent); flex:none;}
1690
+ .c-madecard__name{font-family:var(--mono); font-size:12px; color:var(--c-text);
1691
+ overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
1692
+ .c-madecard__kind{margin-left:auto; flex:none; font-size:var(--t-micro); color:var(--c-muted);
1693
+ letter-spacing:.05em; text-transform:uppercase;}
1694
+ /* A glance, not a document viewer. The preview sits inside a conversation
1695
+ and has to read as one object at one glance; at 340px it was a scrolling
1696
+ panel taller than most of the answers around it. */
1697
+ .c-madecard__body{padding:var(--s3) var(--s4); max-height:210px; overflow:hidden;
1698
+ position:relative;}
1699
+ /* What is cut off is said with a fade rather than left as a hard edge, so a
1700
+ truncated preview reads as "there is more in the file" instead of as a
1701
+ rendering fault. The file itself is complete in Outputs. */
1702
+ .c-madecard__body::after{content:""; position:absolute; left:0; right:0; bottom:0;
1703
+ height:34px; pointer-events:none;
1704
+ background:linear-gradient(to bottom, transparent, var(--c-surface));}
1705
+ /* A document page: a white sheet with real margins and the actual text. */
1706
+ .c-made--doc .c-madecard__body{font-family:Georgia,'Times New Roman',serif;
1707
+ color:#26241F; line-height:1.6; font-size:13.5px;}
1708
+ .c-made--doc .c-madecard__body h4{margin:0 0 8px; font-size:16px; font-weight:700;}
1709
+ .c-made--doc .c-madecard__body p{margin:0 0 8px;}
1710
+ /* A sheet: a real grid of the actual cells. */
1711
+ .c-madegrid{border-collapse:collapse; width:100%; font-size:12px; font-family:var(--font);}
1712
+ .c-madegrid th{background:var(--c-fill); font-weight:650; text-align:left;}
1713
+ .c-madegrid th,.c-madegrid td{border:1px solid var(--c-hairline); padding:4px 8px;
1714
+ white-space:nowrap; max-width:180px; overflow:hidden; text-overflow:ellipsis;}
1715
+ /* A deck: each slide a 16:9 miniature with its actual title. */
1716
+ .c-madeslides{display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr));
1717
+ gap:var(--s2);}
1718
+ .c-madeslide{aspect-ratio:16/9; border:1px solid var(--c-hairline); border-radius:6px;
1719
+ background:#fff; padding:8px; display:flex; flex-direction:column; gap:3px; overflow:hidden;}
1720
+ .c-madeslide__no{font-size:9px; color:var(--c-muted);}
1721
+ .c-madeslide__title{font-size:11px; font-weight:650; color:var(--c-text); line-height:1.25;}
1722
+ .c-madeslide__line{height:3px; border-radius:2px; background:var(--c-fill); width:86%;}
1723
+ .c-madeslide__line+.c-madeslide__line{width:70%;}
1724
+ /* Code or plain text: the content itself, monospaced. */
1725
+ .c-made--text .c-madecard__body{padding:0;}
1726
+ .c-made--text .c-madecard__body::after{height:30px;}
1727
+ /* One height for every preview, whatever is inside it. The code preview kept
1728
+ its own taller cap, which meant a stylesheet came back twice the height of
1729
+ a document and the shelf of results had no common measure. */
1730
+ .c-made--text pre{margin:0; padding:var(--s3) var(--s4); font-family:var(--mono);
1731
+ font-size:12px; line-height:1.55; color:var(--c-text); overflow:hidden; max-height:210px;
1732
+ white-space:pre-wrap; overflow-wrap:anywhere;}
1733
+ .c-made__foot{padding:6px var(--s3); border-top:1px solid var(--c-hairline);
1734
+ font-size:var(--t-micro); color:var(--c-muted);}
1735
+
1736
  @media (max-width:700px){
1737
+ .c-libgrid{grid-template-columns:1fr; gap:var(--s3);}
1738
  .c-quicknav{justify-content:flex-start;}
1739
+ .c-libpage{padding:var(--s4) var(--s4) var(--s7);}
1740
+ .c-madecard{max-width:none;}
 
1741
  }
1742
  """
distinct_server/render.py CHANGED
@@ -37,6 +37,8 @@ from typing import Optional
37
 
38
  __all__ = [
39
  "activity",
 
 
40
  "chip",
41
  "comparator",
42
  "credit",
@@ -44,20 +46,18 @@ __all__ = [
44
  "empty_state",
45
  "energy_headline",
46
  "energy_panel",
47
- "format_joules",
48
  "esc",
 
49
  "footer",
50
- "grade_token",
51
  "header",
52
  "join_this_server",
53
  "library_help",
54
  "library_summary",
55
  "live_steps",
56
- "model_grade_card",
57
  "no_tools_note",
58
  "notice",
59
- "rubric_legend",
60
- "rubric_section",
61
  "run_receipts",
62
  "section_heading",
63
  "spinner",
@@ -221,7 +221,7 @@ def join_this_server(*, addresses, code: str, qr: str = "", tools: str = "local"
221
  # into every shell anybody actually uses.
222
  command = (
223
  f"python -m distinct_agent --server {first} "
224
- f"--pair {code or 'YOUR-CODE'} --models qwen3-0.6b --tools {tools or 'local'}"
225
  )
226
  picture = f'<div class="c-join__qr">{qr}</div>' if qr else ""
227
  return (
@@ -261,14 +261,13 @@ def library_summary(*, shown: int, matched: int, total: int, chosen: int) -> str
261
  else:
262
  body = f"All {total} members."
263
  kept = (
264
- "No defaults chosen yet."
265
  if not chosen
266
- else f"{chosen} chosen as {'a default' if chosen == 1 else 'defaults'}."
267
  )
268
  return (
269
- '<p class="c-note"><span class="c-note__text">'
270
- f"{esc(body)} {esc(kept)} A default is ticked automatically when a worker "
271
- "offers it, and can be unticked for any single run.</span></p>"
272
  )
273
 
274
 
@@ -845,6 +844,369 @@ STEP_LEAD = {
845
  }
846
 
847
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
848
  def run_steps(steps: Sequence[Mapping[str, object]]) -> str:
849
  """The agent's turns, in order, kept after the run that took them.
850
 
@@ -891,11 +1253,12 @@ def run_steps(steps: Sequence[Mapping[str, object]]) -> str:
891
 
892
  #: The wash each conversation state gets in the rail. Faint on purpose: see
893
  #: the note in presentation.py. A state with no entry gets no wash, which is
894
- #: how "idle" and "completed" are drawn.
 
895
  CONVERSATION_TONES = {
896
- "waiting": "#FBF6E8",
897
- "generating": "#EAF3E6",
898
- "failed": "#F9EDE8",
899
  }
900
 
901
 
@@ -1185,18 +1548,28 @@ _DEMO_DIR = (Path(__file__).resolve().parent.parent / "assets" / "library-demos"
1185
  _DEMO_BASE = f"/gradio_api/file={_DEMO_DIR.as_posix()}"
1186
 
1187
 
1188
- def _demo_gif(ref: str) -> str:
1189
- """The demo GIF's URL for a library member, or nothing.
1190
 
1191
- The file is looked for on disk at render time so a card never promises a
1192
  demonstration the repository does not carry. Slug: the ref with ``@`` and
1193
  ``.`` flattened, which is how the recorder names them.
 
 
 
 
1194
  """
1195
 
1196
  slug = ref.replace("@", "-").replace(".", "-")
1197
- if (_DEMO_DIR / f"{slug}.gif").is_file():
1198
- return f"{_DEMO_BASE}/{slug}.gif"
1199
- return ""
 
 
 
 
 
 
1200
 
1201
 
1202
  def library_cards(rows: Sequence[Mapping[str, object]], chosen: Sequence[str]) -> str:
@@ -1222,24 +1595,37 @@ def library_cards(rows: Sequence[Mapping[str, object]], chosen: Sequence[str]) -
1222
  name = str(row.get("name", ref))
1223
  author = str(row.get("author", "distinct"))
1224
  description = str(row.get("description", ""))
1225
- gif = _demo_gif(ref)
1226
- media = (
1227
- f'<figure class="c-libcard__media" data-gif="{esc(gif)}">'
1228
- '<span class="c-libcard__play" aria-hidden="true">&#9656;</span>'
1229
- "<figcaption class=\"c-visually-hidden\">Hover or hold to preview</figcaption>"
1230
- "</figure>"
1231
- if gif
1232
- else ""
1233
- )
1234
- default_mark = (
1235
- '<span class="c-libcard__default">default</span>' if ref in picked else ""
1236
- )
 
 
 
 
 
 
 
 
 
 
1237
  cards.append(
1238
- f'<article class="c-libcard c-libcard--{esc(kind)}">'
 
 
 
 
1239
  f"{media}"
1240
  '<div class="c-libcard__head">'
1241
  f'<span class="c-libcard__kind c-libcard__kind--{esc(kind)}">{esc(kind)}</span>'
1242
- f"{default_mark}"
1243
  "</div>"
1244
  f'<h3 class="c-libcard__name">{esc(name)}</h3>'
1245
  f'<p class="c-libcard__author">by {esc(author)}</p>'
@@ -1501,253 +1887,231 @@ def _safe_url(value: object) -> str:
1501
  #: reader who conflates them draws exactly the wrong conclusion, so each token
1502
  #: carries its own scale name inside it rather than relying on a column header
1503
  #: that may be scrolled away, screenshotted off, or read past.
1504
- PERFORMANCE = "performance"
1505
- EVIDENCE = "evidence"
1506
-
1507
- _SCALE_LABELS: Mapping[str, str] = {
1508
- PERFORMANCE: "impact",
1509
- EVIDENCE: "evidence",
 
1510
  }
1511
 
1512
 
1513
- def grade_token(
1514
- letter: Optional[str],
1515
  *,
1516
- scale: str = PERFORMANCE,
1517
- assessed: Optional[int] = None,
1518
- total: Optional[int] = None,
1519
- absent_word: str = "not assessed",
1520
  ) -> str:
1521
- """One score, as one indivisible unit.
1522
 
1523
- Three rules are enforced here rather than left to the caller.
 
 
 
1524
 
1525
- **A missing value is never a letter.** Not an F, not a D, not a dash in a
1526
- letter-shaped box. It is a dashed lozenge carrying words, which differs from
1527
- a grade in shape, fill, case and content. An absence drawn as a low grade
1528
- asserts a poor result that nobody measured.
1529
 
1530
- **A performance letter never appears without its coverage.** They are one
1531
- token with one border, not a letter with a caption beside it, because a
1532
- caption can be cropped, skimmed or read as belonging to the next row. "B"
1533
- over two of six areas is not a B, and this is the markup that makes the two
1534
- impossible to separate.
1535
 
1536
- **The two scales are told apart by more than a column heading.** A
1537
- performance letter is a filled square on a pill; an evidence letter is
1538
- outlined; and both name their own scale inside the token.
1539
  """
1540
 
1541
- scale_key = scale if scale in _SCALE_LABELS else PERFORMANCE
1542
- name = _SCALE_LABELS[scale_key]
1543
- tag = f'<span class="c-score__scale">{esc(name)}</span>'
1544
-
1545
- if letter is None or not str(letter).strip():
1546
- # ``absent_word`` distinguishes the two absences the rubric names:
1547
- # "not assessed" (nothing published) and "withheld" (published, but
1548
- # coverage too thin for an overall letter). Both are absences, never
1549
- # letters, and a withheld overall still carries its coverage so the
1550
- # reader can see why it was withheld.
1551
- word = esc(absent_word if str(absent_word).strip() else "not assessed")
1552
- coverage = ""
1553
- if assessed is not None and total is not None:
1554
- coverage = (
1555
- f'<span class="c-score__coverage">{esc(assessed)} of {esc(total)}</span>'
1556
- )
1557
  return (
1558
- f'<span class="c-score c-score--{esc(scale_key)} c-score--none">'
1559
- f'{tag}<span class="c-score__word">{word}</span>{coverage}</span>'
1560
- )
1561
-
1562
- body = f'<span class="c-score__letter">{esc(letter)}</span>'
1563
- if assessed is not None and total is not None:
1564
- body += (
1565
- f'<span class="c-score__coverage">{esc(assessed)} of {esc(total)}</span>'
1566
  )
1567
- return f'<span class="c-score c-score--{esc(scale_key)}">{tag}{body}</span>'
1568
-
1569
-
1570
- def rubric_legend() -> str:
1571
- """Two scales, what each one answers, and the case where they disagree.
1572
-
1573
- The worked example is the load-bearing part. Both misreadings this guards
1574
- against are the first reading most people take, so the legend shows them
1575
- happening rather than only warning against them.
1576
- """
1577
 
 
 
 
1578
  return (
1579
- '<section class="c-legend">'
1580
- '<p class="c-legend__title">Two scales, two questions</p>'
1581
- '<div class="c-legend__pair">'
1582
- '<div class="c-legend__scale">'
1583
- + grade_token("A", scale=PERFORMANCE, assessed=6, total=6)
1584
- + '<p class="c-legend__scale-body"><strong>Impact.</strong> How heavily the release '
1585
- "weighed on energy, water, land and the rest. A is the lightest. The coverage inside "
1586
- "the token is part of the score: a letter drawn from two areas out of six describes "
1587
- "two areas out of six, and the other four are unknown rather than fine.</p>"
1588
- "</div>"
1589
- '<div class="c-legend__scale">'
1590
- + grade_token("A", scale=EVIDENCE)
1591
- + '<p class="c-legend__scale-body"><strong>Evidence.</strong> How good the published '
1592
- "working is: method, boundary, primary sources. It says nothing about the size of "
1593
- "the impact, only about how much you can rely on the figure beside it.</p>"
1594
- "</div>"
1595
- "</div>"
1596
- '<p class="c-legend__example"><span class="c-legend__example-mark" '
1597
- 'aria-hidden="true">?</span><span><strong>The two come apart, and that is the '
1598
- "point.</strong> Lucie-7B has the best method quality of anything reviewed here and "
1599
- "still carries no impact letter, because too few areas have a published result to "
1600
- "score. A smaller model can show a B on the strength of a single measurement. The "
1601
- "high-evidence model is the better-documented one; the B is the thinner claim."
1602
- "</span></p>"
1603
- '<p class="c-legend__never">Cradle to release. Never added to, and never compared '
1604
- "with, the use-phase energy this network measures per run.</p>"
1605
- "</section>"
1606
  )
1607
 
1608
 
1609
- def _category_cell(entry: object) -> str:
1610
- """Render one category cell in one of its three states.
1611
 
1612
- A tuple ``(label_ignored, letter)`` is the legacy grade-or-absent form. A
1613
- mapping carries the display contract's full state vocabulary:
1614
-
1615
- * ``state == "grade"``: render the letter (with its value as detail text);
1616
- * ``state == "reported"``: render the published value, never a letter,
1617
- because the value is not in the reference's unit;
1618
- * anything else: an explicit "not assessed" absence.
1619
- """
1620
-
1621
- if isinstance(entry, Mapping):
1622
- state = str(entry.get("state") or "not_assessed")
1623
- letter = entry.get("letter")
1624
- value = entry.get("value")
1625
- if state == "grade" and letter is not None and str(letter).strip():
1626
- token = grade_token(str(letter), scale=PERFORMANCE)
1627
- if isinstance(value, str) and value.strip():
1628
- token += f'<span class="c-grade-row__value">{esc(value)}</span>'
1629
- return token
1630
- if state == "reported" and isinstance(value, str) and value.strip():
1631
- return (
1632
- f'<span class="c-score c-score--{PERFORMANCE} c-score--reported">'
1633
- '<span class="c-score__scale">impact</span>'
1634
- f'<span class="c-score__word">{esc(value)} · reported, no letter</span>'
1635
- "</span>"
1636
- )
1637
- return grade_token(None, scale=PERFORMANCE)
1638
- return grade_token(entry, scale=PERFORMANCE)
1639
 
1640
 
1641
- def model_grade_card(
1642
  *,
1643
  name: str,
1644
- impact: Optional[str],
1645
- assessed: int,
1646
- total: int,
1647
- evidence: Optional[str] = None,
1648
- evidence_detail: str = "",
1649
- categories: Sequence[object] = (),
1650
- download_url: str = "",
1651
- download_label: str = "",
1652
  note: str = "",
1653
- impact_absent_word: str = "not assessed",
1654
  ) -> str:
1655
- """One model release, on both scales.
1656
-
1657
- ``impact`` and ``evidence`` are passed straight through and are **never
1658
- derived here**. When the catalogue withholds one, this renders an explicit
1659
- absence. Computing a letter from partial categories is exactly the
1660
- assessor-created estimate the rubric prohibits, so there is no code path
1661
- that could, and the coverage that caused the absence travels inside the
1662
- token that reports it.
1663
-
1664
- ``categories`` entries are either legacy ``(label, letter)`` tuples or
1665
- mappings ``{"label", "state", "letter", "value"}`` following the display
1666
- contract in ``model_assessments.json``: read ``state`` before rendering
1667
- anything, and never render a letter for a category whose state is not
1668
- ``grade``.
1669
- """
1670
 
1671
- def _label(entry: object) -> str:
1672
- if isinstance(entry, Mapping):
1673
- return str(entry.get("label") or "")
1674
- if isinstance(entry, Sequence) and not isinstance(entry, str) and entry:
1675
- return str(entry[0])
1676
- return ""
1677
 
1678
- def _cell(entry: object) -> str:
1679
- if isinstance(entry, Mapping):
1680
- return _category_cell(entry)
1681
- if isinstance(entry, Sequence) and not isinstance(entry, str) and len(entry) >= 2:
1682
- return _category_cell(entry[1])
1683
- return _category_cell(None)
1684
 
1685
  rows = "".join(
1686
- f'<p class="c-grade-row"><span class="c-grade-row__label">{esc(_label(entry))}</span>'
1687
- f"{_cell(entry)}</p>"
 
 
 
 
 
 
1688
  for entry in categories
1689
  )
1690
 
1691
- href = _safe_url(download_url)
1692
- link = (
1693
  f'<a class="c-grade-card__link" href="{esc(href)}" target="_blank" '
1694
- f'rel="noopener noreferrer">{esc(download_label or "Weights on Hugging Face")}</a>'
1695
- if href
1696
- else ""
1697
  )
1698
- reason = f'<p class="c-grade-card__note">{esc(note)}</p>' if note else ""
1699
 
1700
- evidence_note = (
1701
- f'<span class="c-grade-card__evidence-detail">{esc(evidence_detail)}</span>'
1702
- if evidence_detail
 
 
 
1703
  else ""
1704
  )
 
 
 
 
1705
  return (
1706
  '<article class="c-grade-card">'
1707
  '<p class="c-grade-card__head">'
1708
- f'<span class="c-grade-card__name">{esc(name)}</span>{link}</p>'
1709
- '<div class="c-grade-card__scores">'
1710
- + grade_token(
1711
- impact,
1712
- scale=PERFORMANCE,
1713
- assessed=assessed,
1714
- total=total,
1715
- absent_word=impact_absent_word,
1716
- )
1717
- + grade_token(evidence, scale=EVIDENCE)
1718
- + evidence_note
1719
- + "</div>"
1720
  + (f'<div class="c-grade-rows">{rows}</div>' if rows else "")
1721
- + reason
 
 
 
1722
  + "</article>"
1723
  )
1724
 
1725
 
1726
- def rubric_section(cards: Iterable[str], *, warning: str = "") -> str:
1727
- """The legend, the assessment set's warning, and the model cards.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1728
 
1729
- ``warning`` is the data file's own caveat and renders **before** the
1730
- grades, as its display contract requires, never in a footnote.
1731
  """
1732
 
1733
  body = "".join(cards)
1734
  if not body:
1735
  body = empty_state(
1736
- glyph="○",
1737
  title="No assessed releases",
1738
  body=(
1739
  "No model in this catalogue has a published, model-specific assessment "
1740
- "recorded here yet. Nothing is graded until one exists."
1741
  ),
1742
  )
1743
- caution = (
1744
- f'<p class="c-rubric__warning">{esc(warning)}</p>' if warning else ""
 
 
 
 
 
 
 
 
 
 
1745
  )
1746
  return (
1747
  '<div class="c-rubric">'
1748
- + rubric_legend()
1749
  + caution
1750
  + f'<div class="c-grade-cards">{body}</div>'
 
1751
  + "</div>"
1752
  )
1753
 
 
37
 
38
  __all__ = [
39
  "activity",
40
+ "assessment_legend",
41
+ "assessment_section",
42
  "chip",
43
  "comparator",
44
  "credit",
 
46
  "empty_state",
47
  "energy_headline",
48
  "energy_panel",
 
49
  "esc",
50
+ "figure_token",
51
  "footer",
52
+ "format_joules",
53
  "header",
54
  "join_this_server",
55
  "library_help",
56
  "library_summary",
57
  "live_steps",
58
+ "model_evidence_card",
59
  "no_tools_note",
60
  "notice",
 
 
61
  "run_receipts",
62
  "section_heading",
63
  "spinner",
 
221
  # into every shell anybody actually uses.
222
  command = (
223
  f"python -m distinct_agent --server {first} "
224
+ f"--pair {code or 'YOUR-CODE'} --models olmoe-1b-7b-0924-instruct --tools {tools or 'local'}"
225
  )
226
  picture = f'<div class="c-join__qr">{qr}</div>' if qr else ""
227
  return (
 
261
  else:
262
  body = f"All {total} members."
263
  kept = (
264
+ "Tap a card to make it a default — it saves at once."
265
  if not chosen
266
+ else f"<strong>{chosen}</strong> saved as {'a default' if chosen == 1 else 'defaults'}."
267
  )
268
  return (
269
+ '<div class="c-libsave"><span class="c-libsave__count">'
270
+ f"{esc(body)} {kept}</span></div>"
 
271
  )
272
 
273
 
 
844
  }
845
 
846
 
847
+ # --------------------------------------------------------------------------
848
+ # What the run made: the artifact's own content, in the answer
849
+ # --------------------------------------------------------------------------
850
+ #
851
+ # A run that produced a file used to say so with a count in the receipt and a
852
+ # row in the Outputs panel. Both are true and neither shows the thing. These
853
+ # two functions close that gap: `artifact_preview_data` reads the stored file
854
+ # once, at the moment the answer is claimed, and reduces it to a small plain
855
+ # record; `made_things` renders those records as the kind of object each one
856
+ # is — a document page, a sheet of cells, a fan of slides, the text itself.
857
+ #
858
+ # The split matters. Derivation happens once and the record rides in browser
859
+ # state beside the answer, so the transcript can re-render every two seconds
860
+ # without re-opening zip files. And because the record is data assembled here
861
+ # from bytes the worker sent, rendering it is the same trust exercise as the
862
+ # rest of this file: every string is escaped, structure comes from this
863
+ # module, and a file that cannot be parsed degrades to its name and size
864
+ # rather than to an error.
865
+
866
+ #: Reading cap per artifact. Files are small (the job budget bounds them);
867
+ #: this is the backstop that keeps a surprise out of the render path.
868
+ _PREVIEW_READ_CAP = 400_000
869
+
870
+ _TEXT_SUFFIXES = {
871
+ ".txt", ".css", ".json", ".mermaid", ".py", ".js", ".html", ".svg",
872
+ ".yaml", ".yml", ".toml", ".xml",
873
+ }
874
+
875
+
876
+ def _xml_texts(blob: bytes, pattern: str) -> list[str]:
877
+ import re as _re
878
+
879
+ return [
880
+ escape_entities(match)
881
+ for match in _re.findall(pattern, blob.decode("utf-8", "replace"), _re.S)
882
+ ]
883
+
884
+
885
+ def escape_entities(text: str) -> str:
886
+ """Resolve the five XML entities OOXML writes; nothing else."""
887
+
888
+ return (
889
+ text.replace("&lt;", "<").replace("&gt;", ">").replace("&quot;", '"')
890
+ .replace("&apos;", "'").replace("&amp;", "&")
891
+ )
892
+
893
+
894
+ def _docx_preview(blob: bytes) -> Optional[Mapping[str, object]]:
895
+ import io as _io
896
+ import re as _re
897
+ import zipfile as _zipfile
898
+
899
+ try:
900
+ with _zipfile.ZipFile(_io.BytesIO(blob)) as archive:
901
+ document = archive.read("word/document.xml")
902
+ except Exception:
903
+ return None
904
+ paragraphs: list[str] = []
905
+ for paragraph in _re.findall(rb"<w:p[ >].*?</w:p>", document, _re.S):
906
+ runs = _xml_texts(paragraph, r"<w:t[^>]*>(.*?)</w:t>")
907
+ text = "".join(runs).strip()
908
+ if text:
909
+ paragraphs.append(text)
910
+ if not paragraphs:
911
+ return None
912
+ return {"kind": "doc", "title": paragraphs[0][:160], "paras": paragraphs[1:5]}
913
+
914
+
915
+ def _xlsx_preview(blob: bytes) -> Optional[Mapping[str, object]]:
916
+ import io as _io
917
+ import re as _re
918
+ import zipfile as _zipfile
919
+
920
+ try:
921
+ with _zipfile.ZipFile(_io.BytesIO(blob)) as archive:
922
+ sheet = archive.read("xl/worksheets/sheet1.xml")
923
+ try:
924
+ shared = archive.read("xl/sharedStrings.xml")
925
+ except KeyError:
926
+ shared = b""
927
+ except Exception:
928
+ return None
929
+ strings = _xml_texts(shared, r"<t[^>]*>(.*?)</t>") if shared else []
930
+ rows: list[list[str]] = []
931
+ # CELLS IN DOCUMENT ORDER, WHATEVER KIND THEY ARE.
932
+ #
933
+ # The first version of this pulled the numbers out with one pattern and
934
+ # the inline strings with another, then concatenated the two lists. Every
935
+ # mixed row came out rotated — "Widget | 4 | 9.50" rendered as
936
+ # "4 | 9.50 | Widget" — because the text cells were appended after the
937
+ # numeric ones rather than kept in their columns. A preview that reorders
938
+ # somebody's spreadsheet is worse than no preview, so the cells are now
939
+ # walked once, in order, and each is read according to its own type.
940
+ for row in _re.findall(rb"<row[ >].*?</row>", sheet, _re.S)[:8]:
941
+ cells: list[str] = []
942
+ for cell in _re.findall(rb"<c[ >].*?(?:</c>|/>)", row, _re.S):
943
+ kind = _re.search(rb'\st="(\w+)"', cell)
944
+ kind = kind.group(1).decode() if kind else "n"
945
+ inline = _xml_texts(cell, r"<t[^>]*>(.*?)</t>")
946
+ if inline:
947
+ cells.append(inline[0])
948
+ continue
949
+ value = _re.search(rb"<v>(.*?)</v>", cell, _re.S)
950
+ if value is None:
951
+ cells.append("")
952
+ continue
953
+ raw = escape_entities(value.group(1).decode("utf-8", "replace"))
954
+ if kind == "s":
955
+ try:
956
+ raw = strings[int(raw)]
957
+ except (ValueError, IndexError):
958
+ pass
959
+ cells.append(raw)
960
+ while cells and cells[-1] == "":
961
+ cells.pop()
962
+ if cells:
963
+ rows.append(cells[:8])
964
+ if not rows:
965
+ return None
966
+ return {"kind": "sheet", "rows": rows}
967
+
968
+
969
+ def _pptx_preview(blob: bytes) -> Optional[Mapping[str, object]]:
970
+ import io as _io
971
+ import re as _re
972
+ import zipfile as _zipfile
973
+
974
+ try:
975
+ with _zipfile.ZipFile(_io.BytesIO(blob)) as archive:
976
+ names = sorted(
977
+ name
978
+ for name in archive.namelist()
979
+ if _re.fullmatch(r"ppt/slides/slide\d+\.xml", name)
980
+ )
981
+ slides: list[Mapping[str, str]] = []
982
+ for name in names[:8]:
983
+ texts = _xml_texts(archive.read(name), r"<a:t>(.*?)</a:t>")
984
+ texts = [text for text in (t.strip() for t in texts) if text]
985
+ if texts:
986
+ slides.append({"title": texts[0][:120]})
987
+ except Exception:
988
+ return None
989
+ if not slides:
990
+ return None
991
+ return {"kind": "deck", "slides": slides}
992
+
993
+
994
+ def _pdf_preview(blob: bytes) -> Optional[Mapping[str, object]]:
995
+ import re as _re
996
+ import zlib as _zlib
997
+
998
+ pages = len(_re.findall(rb"/Type\s*/Page\b(?!s)", blob))
999
+ # Content streams are flate-compressed (the PDF this product writes says so
1000
+ # in its own builder), so the text operators only exist after inflating.
1001
+ # Streams that will not inflate are skipped rather than guessed at, and a
1002
+ # PDF nobody can read still reports its page count, which is a fact.
1003
+ chunks = [blob]
1004
+ for raw in _re.findall(rb"stream\r?\n(.*?)\r?\nendstream", blob, _re.S):
1005
+ try:
1006
+ chunks.append(_zlib.decompress(raw))
1007
+ except Exception:
1008
+ continue
1009
+ lines: list[str] = []
1010
+ seen: set[str] = set()
1011
+ for chunk in chunks:
1012
+ for raw in _re.findall(rb"\(((?:[^()\\]|\\.)*)\)\s*Tj", chunk):
1013
+ text = raw.decode("latin-1", "replace")
1014
+ text = _re.sub(r"\\([()\\])", r"\1", text).strip()
1015
+ if text and text not in seen:
1016
+ seen.add(text)
1017
+ lines.append(text)
1018
+ if len(lines) >= 14:
1019
+ break
1020
+ lines = lines[:14]
1021
+ if not lines and not pages:
1022
+ return None
1023
+ record: dict[str, object] = {"kind": "doc", "note": f"{pages or 1} page PDF"}
1024
+ if lines:
1025
+ record["title"] = lines[0][:160]
1026
+ record["paras"] = lines[1:5]
1027
+ else:
1028
+ record["title"] = "PDF document"
1029
+ record["paras"] = []
1030
+ return record
1031
+
1032
+
1033
+ def _markdown_preview(text: str) -> Optional[Mapping[str, object]]:
1034
+ """Markdown as the page it describes, not as its source.
1035
+
1036
+ A guide rendered as a wall of hashes and asterisks demonstrates nothing:
1037
+ the person is looking at the thing the run made, and the thing the run
1038
+ made is a document. Headings become the title, bullets keep their bullet,
1039
+ and everything else is a paragraph.
1040
+ """
1041
+
1042
+ lines = [line.rstrip() for line in text.splitlines()]
1043
+ title = ""
1044
+ paras: list[str] = []
1045
+ for line in lines:
1046
+ stripped = line.strip()
1047
+ if not stripped:
1048
+ continue
1049
+ if stripped.startswith("#"):
1050
+ heading = stripped.lstrip("#").strip()
1051
+ if not title:
1052
+ title = heading[:160]
1053
+ elif len(paras) < 4:
1054
+ paras.append(heading[:200])
1055
+ continue
1056
+ if stripped.startswith(("-", "*", "+")) and len(stripped) > 1:
1057
+ stripped = "• " + stripped[1:].strip()
1058
+ cleaned = stripped.replace("**", "").replace("`", "")
1059
+ if not title:
1060
+ title = cleaned[:160]
1061
+ elif len(paras) < 4:
1062
+ paras.append(cleaned[:200])
1063
+ if len(paras) >= 4:
1064
+ break
1065
+ if not title:
1066
+ return None
1067
+ return {"kind": "doc", "title": title, "paras": paras}
1068
+
1069
+
1070
+ def _table_preview(text: str) -> Optional[Mapping[str, object]]:
1071
+ rows = [line for line in text.splitlines() if line.strip()][:8]
1072
+ if not rows:
1073
+ return None
1074
+ split = [row.split(",") if "," in rows[0] else row.split("|") for row in rows]
1075
+ return {"kind": "sheet", "rows": [[cell.strip() for cell in row][:8] for row in split]}
1076
+
1077
+
1078
+ def artifact_preview_data(paths: Sequence[str]) -> list[Mapping[str, object]]:
1079
+ """Small, renderable records of what a run's files contain.
1080
+
1081
+ Read once per file, capped, every failure downgraded to name-and-size.
1082
+ The records are plain data so they can live in browser state beside the
1083
+ answer they belong to.
1084
+ """
1085
+
1086
+ records: list[Mapping[str, object]] = []
1087
+ for item in paths:
1088
+ path = Path(str(item))
1089
+ try:
1090
+ size = path.stat().st_size
1091
+ blob = path.read_bytes()[:_PREVIEW_READ_CAP]
1092
+ except OSError:
1093
+ continue
1094
+ suffix = path.suffix.lower()
1095
+ parsed: Optional[Mapping[str, object]] = None
1096
+ if suffix == ".docx":
1097
+ parsed = _docx_preview(blob)
1098
+ elif suffix == ".xlsx":
1099
+ parsed = _xlsx_preview(blob)
1100
+ elif suffix == ".pptx":
1101
+ parsed = _pptx_preview(blob)
1102
+ elif suffix == ".pdf":
1103
+ parsed = _pdf_preview(blob)
1104
+ elif suffix == ".csv":
1105
+ parsed = _table_preview(blob.decode("utf-8", "replace"))
1106
+ elif suffix == ".md":
1107
+ parsed = _markdown_preview(blob.decode("utf-8", "replace"))
1108
+ elif suffix in _TEXT_SUFFIXES:
1109
+ text = blob.decode("utf-8", "replace").strip()
1110
+ parsed = {"kind": "text", "text": text[:1400]} if text else None
1111
+ record: dict[str, object] = {
1112
+ "name": path.name,
1113
+ "size": size,
1114
+ "kind": "file",
1115
+ }
1116
+ if parsed:
1117
+ record.update(parsed)
1118
+ records.append(record)
1119
+ return records
1120
+
1121
+
1122
+ def _human_size(size: object) -> str:
1123
+ try:
1124
+ value = float(size) # type: ignore[arg-type]
1125
+ except (TypeError, ValueError):
1126
+ return ""
1127
+ if value >= 1_048_576:
1128
+ return f"{value / 1_048_576:.1f} MB"
1129
+ if value >= 1024:
1130
+ return f"{value / 1024:.1f} KB"
1131
+ return f"{int(value)} B"
1132
+
1133
+
1134
+ _MADE_KIND_WORDS = {
1135
+ "doc": "document",
1136
+ "sheet": "spreadsheet",
1137
+ "deck": "slides",
1138
+ "text": "text",
1139
+ "file": "file",
1140
+ }
1141
+
1142
+
1143
+ def made_things(previews: Sequence[Mapping[str, object]]) -> str:
1144
+ """The artifacts a run produced, rendered as the things they are.
1145
+
1146
+ Structure is fixed here; every string is escaped; a record whose kind is
1147
+ unknown renders as a plain file card. The block sits inside the answer,
1148
+ after the model's words, because "make me a PDF" is answered by the PDF.
1149
+ """
1150
+
1151
+ if not previews:
1152
+ return ""
1153
+ cards: list[str] = []
1154
+ for record in previews:
1155
+ if not isinstance(record, Mapping):
1156
+ continue
1157
+ name = esc(str(record.get("name") or "file"))
1158
+ kind = str(record.get("kind") or "file")
1159
+ kind_word = _MADE_KIND_WORDS.get(kind, "file")
1160
+ body = ""
1161
+ if kind == "doc":
1162
+ title = esc(str(record.get("title") or ""))
1163
+ paras = "".join(
1164
+ f"<p>{esc(str(para))}</p>" for para in record.get("paras") or ()
1165
+ if isinstance(para, str)
1166
+ )
1167
+ body = f"<h4>{title}</h4>{paras}" if title else paras
1168
+ elif kind == "sheet":
1169
+ rows = [row for row in record.get("rows") or () if isinstance(row, (list, tuple))]
1170
+ if rows:
1171
+ head = "".join(f"<th>{esc(str(cell))}</th>" for cell in rows[0])
1172
+ rest = "".join(
1173
+ "<tr>" + "".join(f"<td>{esc(str(cell))}</td>" for cell in row) + "</tr>"
1174
+ for row in rows[1:]
1175
+ )
1176
+ body = f'<table class="c-madegrid"><tr>{head}</tr>{rest}</table>'
1177
+ elif kind == "deck":
1178
+ slides = [
1179
+ slide for slide in record.get("slides") or () if isinstance(slide, Mapping)
1180
+ ]
1181
+ body = '<div class="c-madeslides">' + "".join(
1182
+ f'<div class="c-madeslide"><span class="c-madeslide__no">{index}</span>'
1183
+ f'<span class="c-madeslide__title">{esc(str(slide.get("title") or ""))}</span>'
1184
+ '<span class="c-madeslide__line"></span><span class="c-madeslide__line"></span>'
1185
+ "</div>"
1186
+ for index, slide in enumerate(slides, start=1)
1187
+ ) + "</div>"
1188
+ elif kind == "text":
1189
+ body = f"<pre>{esc(str(record.get('text') or ''))}</pre>"
1190
+ note = str(record.get("note") or "")
1191
+ size = _human_size(record.get("size"))
1192
+ foot_parts = [part for part in (note, size, "in Outputs, left panel") if part]
1193
+ modifier = kind if kind in ("doc", "sheet", "deck", "text") else "file"
1194
+ cards.append(
1195
+ f'<figure class="c-madecard c-made--{modifier}">'
1196
+ '<div class="c-madecard__bar">'
1197
+ '<span class="c-madecard__dot" aria-hidden="true"></span>'
1198
+ f'<span class="c-madecard__name">{name}</span>'
1199
+ f'<span class="c-madecard__kind">{esc(kind_word)}</span>'
1200
+ "</div>"
1201
+ + (f'<div class="c-madecard__body">{body}</div>' if body else "")
1202
+ + f'<figcaption class="c-made__foot">{esc(" · ".join(foot_parts))}</figcaption>'
1203
+ "</figure>"
1204
+ )
1205
+ if not cards:
1206
+ return ""
1207
+ return '<div class="c-made">' + "".join(cards) + "</div>"
1208
+
1209
+
1210
  def run_steps(steps: Sequence[Mapping[str, object]]) -> str:
1211
  """The agent's turns, in order, kept after the run that took them.
1212
 
 
1253
 
1254
  #: The wash each conversation state gets in the rail. Faint on purpose: see
1255
  #: the note in presentation.py. A state with no entry gets no wash, which is
1256
+ #: how "idle" and "completed" are drawn. Warm washes over the ivory canvas:
1257
+ #: the only saturated green on the page stays the accent.
1258
  CONVERSATION_TONES = {
1259
+ "waiting": "#F7F1E1",
1260
+ "generating": "#E8F0EA",
1261
+ "failed": "#F7ECE7",
1262
  }
1263
 
1264
 
 
1548
  _DEMO_BASE = f"/gradio_api/file={_DEMO_DIR.as_posix()}"
1549
 
1550
 
1551
+ def _demo_media(ref: str) -> tuple[str, str]:
1552
+ """``(poster, gif)`` URLs for a member's demonstration, either may be empty.
1553
 
1554
+ Both are looked for on disk at render time so a card never promises a
1555
  demonstration the repository does not carry. Slug: the ref with ``@`` and
1556
  ``.`` flattened, which is how the recorder names them.
1557
+
1558
+ The poster is the recording's last frame — the artifact the run produced —
1559
+ so a card at rest already shows what the member makes. That matters most
1560
+ on a phone, where there is no hover and the GIF is a deliberate act.
1561
  """
1562
 
1563
  slug = ref.replace("@", "-").replace(".", "-")
1564
+ poster = f"{_DEMO_BASE}/{slug}.webp" if (_DEMO_DIR / f"{slug}.webp").is_file() else ""
1565
+ gif = f"{_DEMO_BASE}/{slug}.gif" if (_DEMO_DIR / f"{slug}.gif").is_file() else ""
1566
+ return poster, gif
1567
+
1568
+
1569
+ def _demo_gif(ref: str) -> str:
1570
+ """The demo GIF's URL for a library member, or nothing."""
1571
+
1572
+ return _demo_media(ref)[1]
1573
 
1574
 
1575
  def library_cards(rows: Sequence[Mapping[str, object]], chosen: Sequence[str]) -> str:
 
1595
  name = str(row.get("name", ref))
1596
  author = str(row.get("author", "distinct"))
1597
  description = str(row.get("description", ""))
1598
+ poster, gif = _demo_media(ref)
1599
+ media = ""
1600
+ if poster or gif:
1601
+ still = (
1602
+ f'<img class="c-libcard__poster" src="{esc(poster)}" alt="" loading="lazy">'
1603
+ if poster
1604
+ else ""
1605
+ )
1606
+ media = (
1607
+ f'<figure class="c-libcard__media" data-gif="{esc(gif)}">'
1608
+ f"{still}"
1609
+ '<span class="c-libcard__play">watch it work</span>'
1610
+ '<figcaption class="c-visually-hidden">'
1611
+ "Hover, or press and hold, to play this member's demonstration"
1612
+ "</figcaption>"
1613
+ "</figure>"
1614
+ )
1615
+ on = ref in picked
1616
+ # The card itself is the control: role, state and keyboard focus are
1617
+ # its own, and the check mark is drawn by the stylesheet from the
1618
+ # ``is-on`` class so the page script and this renderer cannot
1619
+ # disagree about what selected looks like.
1620
  cards.append(
1621
+ f'<article class="c-libcard c-libcard--{esc(kind)}{" is-on" if on else ""}"'
1622
+ f' data-ref="{esc(ref)}" role="button" tabindex="0"'
1623
+ f' aria-pressed="{"true" if on else "false"}"'
1624
+ f' aria-label="{esc(name)}: use as a default">'
1625
+ f'<span class="c-libcard__check" aria-hidden="true"></span>'
1626
  f"{media}"
1627
  '<div class="c-libcard__head">'
1628
  f'<span class="c-libcard__kind c-libcard__kind--{esc(kind)}">{esc(kind)}</span>'
 
1629
  "</div>"
1630
  f'<h3 class="c-libcard__name">{esc(name)}</h3>'
1631
  f'<p class="c-libcard__author">by {esc(author)}</p>'
 
1887
  #: reader who conflates them draws exactly the wrong conclusion, so each token
1888
  #: carries its own scale name inside it rather than relying on a column header
1889
  #: that may be scrolled away, screenshotted off, or read past.
1890
+ #: Method words this surface knows, and the modifier each one paints with.
1891
+ #: A word outside this map is rendered verbatim but styled as unknown rather
1892
+ #: than silently promoted into one of the confident states.
1893
+ _METHOD_SLUGS: Mapping[str, str] = {
1894
+ "Measured": "measured",
1895
+ "Modelled": "modelled",
1896
+ "Proxy-based": "proxy",
1897
  }
1898
 
1899
 
1900
+ def figure_token(
 
1901
  *,
1902
+ value: str = "",
1903
+ unit: str = "",
1904
+ status: str = "",
1905
+ absent_word: str = "Missing",
1906
  ) -> str:
1907
+ """One published figure, or one explicit absence, as one indivisible unit.
1908
 
1909
+ This replaces the letter grade that used to sit here, and the replacement is
1910
+ the point rather than a restyling. A letter was this catalogue's ranking of
1911
+ somebody else's number; a figure is the number. Three rules survive from the
1912
+ grade token because they were never about letters:
1913
 
1914
+ **An absence is never a low value.** Missing is a dashed lozenge carrying a
1915
+ word, differing from a figure in shape, fill and content. Nobody measured it,
1916
+ so nothing may be drawn that looks like a small result.
 
1917
 
1918
+ **A figure never appears without its method.** "54 MWh" measured at the
1919
+ socket and "54 MWh" inferred from a chip's rated wattage are different
1920
+ claims, and a method printed as a caption beside the number can be cropped,
1921
+ skimmed, or read as belonging to the next row. One token, one border.
 
1922
 
1923
+ **Nothing is computed here.** Value, unit and method are passed straight
1924
+ through. There is no code path that could derive one from the others.
 
1925
  """
1926
 
1927
+ text = str(value).strip()
1928
+ if not text:
1929
+ word = esc(str(absent_word).strip() or "Missing")
 
 
 
 
 
 
 
 
 
 
 
 
 
1930
  return (
1931
+ '<span class="c-fig c-fig--none">'
1932
+ f'<span class="c-fig__word">{word}</span></span>'
 
 
 
 
 
 
1933
  )
 
 
 
 
 
 
 
 
 
 
1934
 
1935
+ method = str(status).strip()
1936
+ slug = _METHOD_SLUGS.get(method, "unknown")
1937
+ shown = f"{text} {unit}".strip() if str(unit).strip() else text
1938
  return (
1939
+ f'<span class="c-fig c-fig--{esc(slug)}">'
1940
+ f'<span class="c-fig__value">{esc(shown)}</span>'
1941
+ f'<span class="c-fig__method">{esc(method or "method not stated")}</span>'
1942
+ "</span>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1943
  )
1944
 
1945
 
1946
+ def _source_row(entry: Mapping[str, object]) -> str:
1947
+ """One area's working: what the note says, and where the number came from."""
1948
 
1949
+ label = esc(str(entry.get("label") or ""))
1950
+ note = str(entry.get("note") or "")
1951
+ href = _safe_url(entry.get("source_url"))
1952
+ cite = (
1953
+ f'<a class="c-source__link" href="{esc(href)}" target="_blank" '
1954
+ 'rel="noopener noreferrer">primary source</a>'
1955
+ if href
1956
+ else ""
1957
+ )
1958
+ body = esc(note) if note else "No note recorded."
1959
+ return (
1960
+ '<p class="c-source"><span class="c-source__label">'
1961
+ f"{label}</span><span class=\"c-source__body\">{body} {cite}</span></p>"
1962
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
1963
 
1964
 
1965
+ def model_evidence_card(
1966
  *,
1967
  name: str,
1968
+ coverage: str = "",
1969
+ summary: str = "",
1970
+ covers: str = "",
1971
+ categories: Sequence[Mapping[str, object]] = (),
1972
+ links: Sequence[Mapping[str, str]] = (),
 
 
 
1973
  note: str = "",
 
1974
  ) -> str:
1975
+ """One model release, showing what was published about it and nothing else.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1976
 
1977
+ Every area is always present. An area with no published result renders the
1978
+ word rather than being dropped, because a six-row card missing three rows
1979
+ reads as a model with three areas rather than a model with three unknowns.
 
 
 
1980
 
1981
+ The workings sit behind a disclosure rather than on the face of the card:
1982
+ six notes and six citations inline would bury the figures, and hiding them
1983
+ entirely would make the figures unverifiable. Complete, one click away.
1984
+ """
 
 
1985
 
1986
  rows = "".join(
1987
+ '<p class="c-grade-row">'
1988
+ f'<span class="c-grade-row__label">{esc(str(entry.get("label") or ""))}</span>'
1989
+ + figure_token(
1990
+ value=str(entry.get("value") or ""),
1991
+ unit=str(entry.get("unit") or ""),
1992
+ status=str(entry.get("status") or ""),
1993
+ )
1994
+ + "</p>"
1995
  for entry in categories
1996
  )
1997
 
1998
+ link_html = "".join(
 
1999
  f'<a class="c-grade-card__link" href="{esc(href)}" target="_blank" '
2000
+ f'rel="noopener noreferrer">{esc(str(link.get("label") or "Source"))}</a>'
2001
+ for link in links
2002
+ if (href := _safe_url(link.get("url")))
2003
  )
 
2004
 
2005
+ sources = "".join(_source_row(entry) for entry in categories)
2006
+ workings = (
2007
+ "<details class=\"c-sources\"><summary class=\"c-sources__summary\">"
2008
+ "Where these figures come from</summary>"
2009
+ f'<div class="c-sources__body">{sources}</div></details>'
2010
+ if sources
2011
  else ""
2012
  )
2013
+
2014
+ head_coverage = (
2015
+ f'<span class="c-grade-card__coverage">{esc(coverage)}</span>' if coverage else ""
2016
+ )
2017
  return (
2018
  '<article class="c-grade-card">'
2019
  '<p class="c-grade-card__head">'
2020
+ f'<span class="c-grade-card__name">{esc(name)}</span>{head_coverage}</p>'
2021
+ + (f'<p class="c-grade-card__summary">{esc(summary)}</p>' if summary else "")
 
 
 
 
 
 
 
 
 
 
2022
  + (f'<div class="c-grade-rows">{rows}</div>' if rows else "")
2023
+ + (f'<p class="c-grade-card__covers"><strong>Covers.</strong> {esc(covers)}</p>' if covers else "")
2024
+ + workings
2025
+ + (f'<p class="c-grade-card__note">{esc(note)}</p>' if note else "")
2026
+ + (f'<p class="c-grade-card__links">{link_html}</p>' if link_html else "")
2027
  + "</article>"
2028
  )
2029
 
2030
 
2031
+ def assessment_legend() -> str:
2032
+ """What the words mean, and the two readings this surface has to prevent.
2033
+
2034
+ The legend used to explain two letter scales and the case where they
2035
+ disagree. There are no letters now, so it explains the two things a reader
2036
+ can still get wrong: that Missing is a result, and that a small number is
2037
+ a good model.
2038
+ """
2039
+
2040
+ return (
2041
+ '<section class="c-legend">'
2042
+ '<p class="c-legend__title">How to read these</p>'
2043
+ '<div class="c-legend__pair">'
2044
+ '<div class="c-legend__scale">'
2045
+ + figure_token(value="54", unit="MWh", status="Measured")
2046
+ + '<p class="c-legend__scale-body"><strong>A figure and its method.</strong> '
2047
+ "Measured means somebody metered the hardware. Modelled means they computed it "
2048
+ "from something they did meter, or from rated specifications. The number is "
2049
+ "reproduced exactly as published; nothing here is converted, scaled or combined."
2050
+ "</p>"
2051
+ "</div>"
2052
+ '<div class="c-legend__scale">'
2053
+ + figure_token()
2054
+ + '<p class="c-legend__scale-body"><strong>Missing is not zero.</strong> '
2055
+ "It means nobody published a usable result for that area. It is not a low score, "
2056
+ "not a failure, and not evidence that the impact was small. Every area is shown "
2057
+ "for every model so an absence has to be stated rather than quietly omitted.</p>"
2058
+ "</div>"
2059
+ "</div>"
2060
+ '<p class="c-legend__example"><span class="c-legend__example-mark" '
2061
+ 'aria-hidden="true">?</span><span><strong>A smaller number is not automatically '
2062
+ "a better model.</strong> One OLMo 7B shows zero carbon and zero water because it "
2063
+ "trained on hydroelectric power in Finland, while still drawing more electricity "
2064
+ "than any other 7B in its cohort. Another drank four times the water of its sibling "
2065
+ "for no reason except which state the data centre stood in. Read the figure with "
2066
+ "the area beside it, and read both with where the run happened."
2067
+ "</span></p>"
2068
+ '<p class="c-legend__never">Cradle to release. Never added to, and never compared '
2069
+ "with, the use-phase energy this network measures per run.</p>"
2070
+ "</section>"
2071
+ )
2072
+
2073
+
2074
+ def assessment_section(
2075
+ cards: Iterable[str],
2076
+ *,
2077
+ warning: str = "",
2078
+ further_reading: Sequence[Mapping[str, str]] = (),
2079
+ ) -> str:
2080
+ """The legend, the assessment set's own caveat, the cards, and the reading.
2081
 
2082
+ ``warning`` is the data file's caveat and renders **before** the figures, as
2083
+ its display contract requires, never in a footnote.
2084
  """
2085
 
2086
  body = "".join(cards)
2087
  if not body:
2088
  body = empty_state(
2089
+ glyph="\u25cb",
2090
  title="No assessed releases",
2091
  body=(
2092
  "No model in this catalogue has a published, model-specific assessment "
2093
+ "recorded here yet. Nothing is shown until one exists."
2094
  ),
2095
  )
2096
+ caution = f'<p class="c-rubric__warning">{esc(warning)}</p>' if warning else ""
2097
+ reading = "".join(
2098
+ f'<a class="c-reading__link" href="{esc(href)}" target="_blank" '
2099
+ f'rel="noopener noreferrer">{esc(str(item.get("label") or "Source"))}</a>'
2100
+ for item in further_reading
2101
+ if (href := _safe_url(item.get("url")))
2102
+ )
2103
+ tail = (
2104
+ '<section class="c-reading"><p class="c-reading__title">Further reading</p>'
2105
+ f'<p class="c-reading__links">{reading}</p></section>'
2106
+ if reading
2107
+ else ""
2108
  )
2109
  return (
2110
  '<div class="c-rubric">'
2111
+ + assessment_legend()
2112
  + caution
2113
  + f'<div class="c-grade-cards">{body}</div>'
2114
+ + tail
2115
  + "</div>"
2116
  )
2117
 
distinct_server/ui.py CHANGED
@@ -50,6 +50,7 @@ from .catalog import (
50
  RELEASE_BOUNDARY,
51
  RUBRIC_AREAS,
52
  USE_PHASE_BOUNDARY,
 
53
  model_choices,
54
  )
55
  from .control_plane import ControlPlane
@@ -891,30 +892,31 @@ def _tool_line(spec_tools: Sequence[ToolSelection], calls_reported: Optional[int
891
 
892
 
893
  def _catalogue_markdown() -> str:
 
 
 
 
 
 
 
 
 
894
  lines = [
895
  "#### Release assessment · cradle to release",
896
  "",
897
  f"_{RELEASE_BOUNDARY}_",
898
  "",
899
- "Grades assess **evidence quality only**. They are absolute, never relative "
900
- "between models, and this list is not a ranking. `No data` is not a grade and "
901
- "is not zero.",
 
 
 
902
  "",
903
- ]
904
- for model_id, manifest in MODEL_CATALOG.items():
905
- assessment = RELEASE_ASSESSMENT[model_id]
906
- areas = " · ".join(
907
- f"{AREA_LABELS[area]}: {assessment.areas[area].display}" for area in RUBRIC_AREAS
908
- )
909
- lines.append(
910
- f"- **{manifest.label}** — evidence: {assessment.grade_display} — "
911
- f"weights identity: {manifest.identity_status} — hardware requirement: "
912
- f"{manifest.min_ram_gb:g} GB RAM"
913
- )
914
- lines.append(f" <br>{areas}")
915
- if assessment.reason:
916
- lines.append(f" <br>_{assessment.reason}_")
917
- lines += [
918
  "",
919
  "#### Use-phase energy · per run",
920
  "",
@@ -923,7 +925,7 @@ def _catalogue_markdown() -> str:
923
  "Shown on each completed run and totalled per conversation, partitioned by "
924
  "measurement scope. It is never added to a release figure, and never converted "
925
  "into CO2e, water, land, materials or pollution — those conversions would be "
926
- "assessor-created estimates, which the rubric prohibits.",
927
  "",
928
  "Minimum RAM is a disclosed hardware requirement of the file, not an "
929
  "environmental result. This catalogue deliberately carries no model-size or "
@@ -932,29 +934,13 @@ def _catalogue_markdown() -> str:
932
  return "\n".join(lines)
933
 
934
 
935
- #: Where the catalogue will publish the restructured rubric. Owned by the
936
- #: catalogue, read here. Absent for now, which is handled rather than guarded
937
- #: against: the fallback below reads the assessments already in catalog.py, and
938
- #: those are all "no data", which is the state this surface has to render well
939
- #: anyway.
940
  ASSESSMENTS_PATH = Path(__file__).resolve().parent.parent / "model_assessments.json"
941
 
942
 
943
- def _letter(value: Any) -> Optional[str]:
944
- """A single grade letter, or ``None``. Never a substitute for one.
945
-
946
- Anything that is not a plausible letter becomes ``None`` and renders as an
947
- explicit absence. That direction is deliberate and one-way: a malformed
948
- record must be able to degrade into "not assessed", and must never be able
949
- to acquire a letter it was not given.
950
- """
951
-
952
- if value is None:
953
- return None
954
- text = str(value).strip().upper()
955
- return text if text in {"A", "B", "C", "D", "E", "F"} else None
956
-
957
-
958
  def _rubric_display() -> Mapping[str, Any]:
959
  """The assessment file's ``website_display`` block, or an empty mapping.
960
 
@@ -978,71 +964,105 @@ def _rubric_warning() -> str:
978
  return warning if isinstance(warning, str) else ""
979
 
980
 
981
- def _display_card(record: Mapping[str, Any], *, unranked_note: str = "") -> str:
982
- """One ``website_display.models`` record as a grade card.
 
 
 
 
 
 
 
983
 
984
- State discipline, verbatim from the file's rendering rules: read ``state``
985
- before rendering anything; never render a letter for a category whose
986
- state is not ``grade``; render the overall's coverage beside it whichever
987
- state it is in; and a withheld overall renders the word "withheld", which
988
- is an absence and not last place.
 
 
 
 
 
 
 
 
989
  """
990
 
991
- overall = record.get("overall") if isinstance(record.get("overall"), Mapping) else {}
992
- evidence = record.get("evidence") if isinstance(record.get("evidence"), Mapping) else {}
993
  categories = record.get("categories")
 
994
  rows: list[Mapping[str, Any]] = []
995
- if isinstance(categories, Mapping):
996
- for area in RUBRIC_AREAS:
997
- cell = categories.get(area)
998
- cell = cell if isinstance(cell, Mapping) else {}
999
- rows.append(
1000
- {
1001
- "label": AREA_LABELS.get(area, area),
1002
- "state": str(cell.get("state") or "not_assessed"),
1003
- "letter": _letter(cell.get("letter")),
1004
- "value": cell.get("value") if isinstance(cell.get("value"), str) else None,
1005
- }
1006
- )
1007
- overall_state = str(overall.get("state") or "withheld")
1008
- assessed = overall.get("areas_assessed")
1009
- total = overall.get("areas_total")
1010
- download = record.get("download") if isinstance(record.get("download"), Mapping) else {}
1011
- note_parts = [str(record.get("boundary") or "")]
1012
- if unranked_note:
1013
- note_parts.insert(0, unranked_note)
1014
- return render.model_grade_card(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1015
  name=str(record.get("name") or record.get("model_id") or "unnamed"),
1016
- impact=_letter(overall.get("letter")) if overall_state == "grade" else None,
1017
- assessed=int(assessed) if isinstance(assessed, int) else 0,
1018
- total=int(total) if isinstance(total, int) else 6,
1019
- evidence=_letter(evidence.get("letter")),
1020
- evidence_detail=str(evidence.get("detail") or ""),
1021
- categories=rows,
1022
- download_url=str(download.get("url") or record.get("source_url") or ""),
1023
- download_label="Weights on Hugging Face" if download.get("url") else "Source",
1024
- note=" · ".join(part for part in note_parts if part),
1025
- impact_absent_word="withheld" if overall_state != "grade" else "not assessed",
1026
  )
1027
 
1028
 
1029
- #: The model selected when a session opens.
1030
- DEFAULT_MODEL_ID = "qwen3-0.6b"
 
1031
 
1032
 
1033
  def _assessment_by_model_id() -> Mapping[str, Mapping[str, Any]]:
1034
- """``website_display.models`` keyed by model id, exact matches only.
1035
 
1036
  Deliberately no fuzzy matching, and no alias table invented here. The
1037
- assessment records name releases ("OLMo 2 7B", "OLMo 1B"); the catalogue
1038
- names specific quantised checkpoints ("OLMo 2 0425 1B Instruct, Q4_K_M").
1039
- Those are not the same object, and a rubric whose first rule is that a
1040
- grade belongs to the thing that was assessed cannot have its own renderer
1041
- guessing which grade goes with which file.
1042
-
1043
- So a catalogue entry gets a grade when the assessment file uses the same
1044
- id, and renders as not assessed otherwise. Extending the coverage is a
1045
- change to the assessment data, which is where the evidence lives.
 
1046
  """
1047
 
1048
  records = _rubric_display().get("models")
@@ -1055,40 +1075,42 @@ def _assessment_by_model_id() -> Mapping[str, Mapping[str, Any]]:
1055
  }
1056
 
1057
 
1058
- #: Which assessment record covers which catalogue entry, and what it covers.
1059
- #:
1060
- #: The rubric's two scales behave differently under this mapping, and the
1061
- #: difference is the whole reason the table exists rather than a fuzzy match.
1062
  #:
1063
- #: **Evidence can always transfer within a release, because it grades
1064
- #: disclosure.** Whether a publisher published energy, carbon and water for a
1065
- #: release is a fact about the publisher's release, and it is the same fact for
1066
- #: every checkpoint in it. Silence transfers just as cleanly: Qwen disclosed
1067
- #: nothing for Qwen3, so every Qwen3 checkpoint earns the same F. This is what
1068
- #: makes "all models are assessed" achievable without inventing anything, and
1069
- #: it is the brief's own rule: evidence can always exist, because silence is
1070
- #: assessable.
1071
  #:
1072
- #: **Impact cannot transfer between checkpoints.** It grades a *published
1073
- #: result* against a budget, and a figure published for a 7B model is not a
1074
- #: figure for a 1B one. Where the assessed record is a different checkpoint,
1075
- #: impact is withheld and says so. Withheld is not last place.
1076
- RUBRIC_ASSIGNMENT: Mapping[str, Mapping[str, Any]] = {
1077
- "qwen3-0.6b": {
1078
- "record": "qwen3-4b",
1079
- "impact": False,
1080
- "note": "assessed across the Qwen3 release, which discloses nothing",
 
 
 
 
1081
  },
1082
- "qwen3-4b": {"record": "qwen3-4b", "impact": True, "note": ""},
1083
- "olmo-2-1b-instruct": {
1084
- "record": "olmo-2-7b",
1085
- "impact": False,
1086
- "note": "evidence assessed across the OLMo 2 release; no published figure for this checkpoint",
 
1087
  },
1088
- "olmoe-1b-7b-instruct": {
1089
- "record": "olmoe-1b-7b",
1090
- "impact": False,
1091
- "note": "evidence assessed across the OLMoE release; no published figure for this checkpoint",
 
 
1092
  },
1093
  }
1094
 
@@ -1096,99 +1118,84 @@ RUBRIC_ASSIGNMENT: Mapping[str, Mapping[str, Any]] = {
1096
  def _assignment(model_id: str) -> tuple[Mapping[str, Any] | None, Mapping[str, Any]]:
1097
  """``(assessment record, assignment rules)`` for one catalogue model."""
1098
 
1099
- rules = RUBRIC_ASSIGNMENT.get(model_id)
1100
  if rules is None:
1101
  return None, {}
1102
  return _assessment_by_model_id().get(str(rules["record"])), rules
1103
 
1104
 
1105
- def _grade_suffix(model_id: str) -> str:
1106
- """The grade fragment appended to a model's name in the chooser.
1107
 
1108
- Reads ``state`` before reading ``letter``, per the assessment file's own
1109
- rendering rules: a withheld overall renders the word, never a letter, and
1110
- coverage always travels with the letter so "E on two of six areas" cannot
1111
- be shortened into "E".
1112
  """
1113
 
1114
- record, rules = _assignment(model_id)
1115
  if record is None:
1116
- return "no assessment recorded"
1117
- overall = record.get("overall") if isinstance(record.get("overall"), Mapping) else {}
1118
- evidence = record.get("evidence") if isinstance(record.get("evidence"), Mapping) else {}
1119
- letter = _letter(overall.get("letter"))
1120
- if rules.get("impact") and str(overall.get("state") or "") == "grade" and letter:
1121
- assessed = overall.get("areas_assessed")
1122
- total = overall.get("areas_total")
1123
- coverage = (
1124
- f" on {assessed} of {total}"
1125
- if isinstance(assessed, int) and isinstance(total, int)
1126
- else ""
1127
- )
1128
- impact = f"impact {letter}{coverage}"
 
 
 
 
 
 
 
 
 
 
 
1129
  else:
1130
- impact = "impact withheld"
1131
- evidence_letter = _letter(evidence.get("letter"))
1132
- evidence_part = (
1133
- f"evidence {evidence_letter}" if evidence_letter else "evidence not assessed"
1134
- )
1135
- # Evidence first, because the chooser is 280px wide and the operating
1136
- # system truncates from the right. With impact leading, every option in
1137
- # the list read "Qwen3 0.6B · unsloth · impact with..." and the grade this
1138
- # product exists to show was the part that fell off the end. The order is
1139
- # a presentation decision about which fact survives a narrow control, not
1140
- # a claim that one grade outranks the other; both are still here, and the
1141
- # rubric panel still shows them in full.
1142
- return " · ".join((evidence_part, impact))
1143
 
1144
 
1145
  def _short_label(label: str) -> str:
1146
  """The model's name, without the packager that follows it.
1147
 
1148
- ``model_choices`` yields "Qwen3 0.6B · unsloth"; the part before the first
1149
- separator is the model, and that is what a chooser needs.
 
1150
  """
1151
 
1152
  return label.split(" · ", 1)[0].strip() or label
1153
 
1154
 
1155
- def model_choices_with_grades() -> list[tuple[str, str]]:
1156
- """Model options carrying their assessment rather than their RAM figure.
1157
 
1158
- Higher letter means lower impact, and the letters are not comparable
1159
- across models graded on different categories. That caveat lives in the
1160
- rubric panel; what belongs here is the fact that a grade exists at all,
1161
- beside the name, at the moment of choosing.
1162
  """
1163
 
1164
- # The publisher is dropped from the option text and not from the product:
1165
- # it is on the worker card, in the rubric panel and in the manifest the
1166
- # digest is checked against. In a 280px control it was 9 characters that
1167
- # pushed the grade out of view.
1168
- offered = [
1169
- (f"{_short_label(label)} · {_grade_suffix(model_id)}", model_id)
1170
- for label, model_id in model_choices()
1171
- if model_id in RUBRIC_ASSIGNMENT
1172
- ]
1173
- # A model with no assessment is not offered for selection. That is a
1174
- # stronger rule than it looks: this product's only claim is about measured
1175
- # and disclosed environmental cost, so a model nobody can say anything
1176
- # about is a model it has no business recommending. Such entries stay in
1177
- # the catalogue, where the rubric panel names them and says what is
1178
- # missing, rather than disappearing.
1179
- return offered or [
1180
- (f"{_short_label(label)} · {_grade_suffix(model_id)}", model_id)
1181
  for label, model_id in model_choices()
1182
  ]
1183
 
1184
 
1185
- def _rubric_cards() -> list[str]:
1186
- """Build the grade cards from the assessment file's display block.
1187
 
1188
- Ranked models first, in the file's impact order (lowest impact first),
1189
- then the withheld models under their own marker: unranked is not last
1190
- place. No overall letter is computed anywhere in this function; both
1191
- scales are read as published or rendered as explicit absences.
1192
  """
1193
 
1194
  display = _rubric_display()
@@ -1200,41 +1207,51 @@ def _rubric_cards() -> list[str]:
1200
  for record in records:
1201
  if isinstance(record, Mapping) and record.get("model_id"):
1202
  by_id[str(record["model_id"])] = record
1203
- ranking = display.get("impact_ranking")
1204
- ranking = ranking if isinstance(ranking, Mapping) else {}
1205
- ranked_ids = [str(v) for v in ranking.get("order") or () if str(v) in by_id]
1206
- withheld_ids = [str(v) for v in ranking.get("withheld") or () if str(v) in by_id]
1207
- leftover = [
1208
- model_id
1209
- for model_id in by_id
1210
- if model_id not in set(ranked_ids) | set(withheld_ids)
1211
- ]
1212
- withheld_note = str(ranking.get("withheld_note") or "Unranked, not last place.")
1213
- for model_id in ranked_ids + leftover:
1214
- cards.append(_display_card(by_id[model_id]))
1215
- for model_id in withheld_ids:
1216
- cards.append(_display_card(by_id[model_id], unranked_note=withheld_note))
 
 
1217
  return cards
1218
 
1219
- # Fallback: the assessments already in the catalogue. Every one of them is
1220
- # "no data", so this is the all-absent rendering, which is the state the
1221
- # design has to carry well rather than an edge case to apologise for.
 
1222
  for model_id, manifest in MODEL_CATALOG.items():
1223
  assessment = RELEASE_ASSESSMENT[model_id]
1224
- # Every area in the current catalogue is Missing, and Missing is not a
1225
- # letter, so every row is an explicit absence. Passing None rather than
1226
- # mapping a status onto a letter is the whole point: there is no
1227
- # translation table here that a future edit could extend into grading
1228
- # an absence.
1229
- rows = [(AREA_LABELS[area], None) for area in RUBRIC_AREAS]
 
 
 
 
 
 
 
1230
  cards.append(
1231
- render.model_grade_card(
1232
  name=manifest.label,
1233
- impact=None,
1234
- assessed=0,
1235
- total=len(RUBRIC_AREAS),
1236
- evidence=_letter(assessment.evidence_grade),
1237
  categories=rows,
 
1238
  note=assessment.reason,
1239
  )
1240
  )
@@ -1488,13 +1505,18 @@ class DistinctUI:
1488
  def _library_page(
1489
  self, query: str, defaults: Sequence[str]
1490
  ) -> tuple[Any, str, str]:
1491
- """The page a person picks their defaults on: cards, summary, picker."""
 
 
 
 
 
 
 
1492
 
1493
  rows, matched = self._library_rows(query)
1494
  total = len(_library_specs())
1495
- choices = [
1496
- (f"{row['name']} · {row['kind']}", row["ref"]) for row in rows
1497
- ]
1498
  # Defaults outside the current filter are preserved rather than
1499
  # dropped. Searching is a way of looking, not a way of deselecting,
1500
  # and a search box that quietly unticked everything it hid would be
@@ -1525,16 +1547,19 @@ class DistinctUI:
1525
  profile: "gr.OAuthProfile | None" = None,
1526
  request: "gr.Request | None" = None,
1527
  ) -> tuple[Any, Any, str, str, Any, str]:
1528
- """Record the defaults, merging the visible page into the kept set.
1529
-
1530
- The subtlety is that the component only reports what it can see. A
1531
- person who searches "pdf", unticks one member and then searches
1532
- "plan" has changed their mind about one member, not about every
1533
- member the filter was hiding. So the members currently on screen are
1534
- replaced wholesale and everything off screen is left exactly as it
1535
- was.
 
 
1536
  """
1537
 
 
1538
  rows, _ = self._library_rows(query)
1539
  on_screen = {row["ref"] for row in rows}
1540
  previous = set(_library_defaults(state))
@@ -1552,8 +1577,13 @@ class DistinctUI:
1552
  defaults=_library_defaults(updated),
1553
  viewer_id=viewer_id,
1554
  )
1555
- _, summary, cards = self._library_page(query, _library_defaults(updated))
1556
- return updated, updated, summary, cards, selector, note
 
 
 
 
 
1557
 
1558
  # Outputs ----------------------------------------------------------
1559
 
@@ -1866,7 +1896,9 @@ class DistinctUI:
1866
  library, library_note = self._library_components(
1867
  None, defaults=_library_defaults(updated), viewer_id=user_id
1868
  )
1869
- page, page_summary, page_cards = self._library_page("", _library_defaults(updated))
 
 
1870
  return (
1871
  updated,
1872
  updated,
@@ -1882,10 +1914,10 @@ class DistinctUI:
1882
  library_note,
1883
  self._outputs_component(updated),
1884
  activity,
1885
- # The library page is filled on arrival rather than on first
1886
- # open, so a browser that already has defaults shows them ticked
1887
- # the moment the accordion is expanded.
1888
- page,
1889
  page_summary,
1890
  page_cards,
1891
  )
@@ -2781,6 +2813,16 @@ class DistinctUI:
2781
  state["session_id"], job_id, raw_artifacts
2782
  )
2783
  answer["artifacts"] = [Path(item).name for item in stored]
 
 
 
 
 
 
 
 
 
 
2784
  updated = record_answer(updated, job_id=job_id, answer=answer)
2785
 
2786
  if answer is not None:
@@ -2828,6 +2870,12 @@ class DistinctUI:
2828
  _step_messages(answer.get("steps") or (), running=False)
2829
  )
2830
  messages.append({"role": "assistant", "content": str(answer.get("output", ""))})
 
 
 
 
 
 
2831
  status_label = "completed"
2832
  outcome = ""
2833
  elif view is None:
@@ -3109,15 +3157,18 @@ class DistinctUI:
3109
  # button below is the one sign-in control, so a header link
3110
  # would only duplicate it.
3111
  identity = gr.HTML(_identity_html(""))
3112
- # The quick nav sits directly under the identity box: one
3113
- # anchor per page-worthy section. Links, not buttons, because
3114
- # they navigate rather than act.
3115
- gr.HTML(
3116
- '<nav class="c-quicknav" aria-label="Sections">'
3117
- '<a class="c-quicknav__link" href="#library">Library</a>'
3118
- '<a class="c-quicknav__link" href="#join-agent">Run an agent</a>'
3119
- "</nav>"
3120
- )
 
 
 
3121
 
3122
  # THE SIGN-IN CONTROL, AND WHY IT IS CONDITIONAL.
3123
  #
@@ -3200,7 +3251,7 @@ class DistinctUI:
3200
  # the model.
3201
  model = gr.Dropdown(
3202
  label="Model",
3203
- choices=model_choices_with_grades(),
3204
  value=DEFAULT_MODEL_ID,
3205
  container=True,
3206
  )
@@ -3455,57 +3506,91 @@ class DistinctUI:
3455
  create_code = gr.Button("Generate pairing code")
3456
  gr.Markdown()
3457
 
3458
- # THE LIBRARY, AT THE SIZE IT IS GOING TO BE.
3459
- #
3460
- # The composer's picker shows what the chosen worker is
3461
- # actually offering, which is a handful. This page is the
3462
- # whole library, which is meant to reach the hundreds, and
3463
- # a list of hundreds is only usable through search. What a
3464
- # person does here is choose their defaults once; those
3465
- # are remembered in this browser and tick themselves on
3466
- # every run where a worker offers them.
3467
- with gr.Accordion(
3468
- "Library", open=True, elem_id="library",
3469
- elem_classes="c-library-section",
3470
- ):
3471
- gr.Markdown(
3472
- "Every tool and skill this server can offer, who wrote "
3473
- "it, and what it does. Hover a card — or press and hold "
3474
- "on a phone — to watch its demonstration. Tick the "
3475
- "members you usually want below: they select themselves "
3476
- "whenever a worker offers them, and any run can untick "
3477
- "them without changing what is saved."
3478
- )
3479
- library_search = gr.Textbox(
3480
- label="Search the library",
3481
- show_label=False,
3482
- placeholder="Search by name, reference or what it does…",
3483
- container=False,
3484
- elem_classes="c-librarysearch",
3485
- )
3486
- library_summary = gr.HTML(
3487
- render.library_summary(shown=0, matched=0, total=0, chosen=0)
3488
- )
3489
- library_cards_html = gr.HTML(elem_classes="c-librarycards")
3490
- gr.Markdown("**Your defaults**", elem_classes="c-librarydefaults-head")
3491
- library_defaults = gr.CheckboxGroup(
3492
- label="Your defaults",
3493
- show_label=False,
3494
- choices=[],
3495
- value=[],
3496
- elem_classes="c-librarypage",
3497
- )
3498
-
3499
- with gr.Accordion("Model grades and the rubric", open=False):
3500
  gr.HTML(
3501
  '<p class="c-panel__head">'
3502
  '<span class="c-panel__title">Release assessment</span>'
3503
  '<span class="c-panel__boundary">boundary 2 of 2</span></p>'
3504
  )
3505
  gr.HTML(
3506
- render.rubric_section(_rubric_cards(), warning=_rubric_warning())
 
 
 
 
3507
  )
3508
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3509
  # Hidden component bindings form the machine API consumed by gradio_client.
3510
  with gr.Column(visible=False):
3511
  api_pair_code = gr.Textbox()
@@ -3559,6 +3644,28 @@ class DistinctUI:
3559
  queue=False,
3560
  api_visibility="private",
3561
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3562
  new_conversation_button.click(
3563
  self.new_conversation,
3564
  inputs=[session_state],
 
50
  RELEASE_BOUNDARY,
51
  RUBRIC_AREAS,
52
  USE_PHASE_BOUNDARY,
53
+ AreaStatus,
54
  model_choices,
55
  )
56
  from .control_plane import ControlPlane
 
892
 
893
 
894
  def _catalogue_markdown() -> str:
895
+ """The two boundaries in prose, and where the working is.
896
+
897
+ This used to print the whole assessment inline as a bullet per model. The
898
+ assessment surface now renders the figures, their method, their notes and
899
+ their primary sources as cards, so repeating them here produced two copies
900
+ of the same claims that could drift apart. What stays is the part the cards
901
+ cannot carry: what the two boundaries are, and why they never meet.
902
+ """
903
+
904
  lines = [
905
  "#### Release assessment · cradle to release",
906
  "",
907
  f"_{RELEASE_BOUNDARY}_",
908
  "",
909
+ "Every model offered here has a published, model-specific assessment of its "
910
+ "training. Each figure is shown exactly as its publisher stated it, with the "
911
+ "method that produced it and a link to the document it came from, so you can "
912
+ "check the claim rather than take ours for it. Nothing on this surface is "
913
+ "ranked: a figure and an absence are not two points on one scale, and `Missing` "
914
+ "is neither zero nor a low score.",
915
  "",
916
+ "Models with no published assessment are not listed. That is a stronger rule "
917
+ "than it looks — this project's only claim is about disclosed and measured "
918
+ "environmental cost, so a release nobody has published anything about is one "
919
+ "it has no business recommending.",
 
 
 
 
 
 
 
 
 
 
 
920
  "",
921
  "#### Use-phase energy · per run",
922
  "",
 
925
  "Shown on each completed run and totalled per conversation, partitioned by "
926
  "measurement scope. It is never added to a release figure, and never converted "
927
  "into CO2e, water, land, materials or pollution — those conversions would be "
928
+ "assessor-created estimates, which this catalogue does not make.",
929
  "",
930
  "Minimum RAM is a disclosed hardware requirement of the file, not an "
931
  "environmental result. This catalogue deliberately carries no model-size or "
 
934
  return "\n".join(lines)
935
 
936
 
937
+ #: Where the catalogue publishes the assessment set. Owned by the catalogue,
938
+ #: read here. Absent is handled rather than guarded against: the fallback below
939
+ #: reads the assessments in catalog.py, which now carry real published figures,
940
+ #: so an absent file degrades to a smaller surface rather than an empty one.
 
941
  ASSESSMENTS_PATH = Path(__file__).resolve().parent.parent / "model_assessments.json"
942
 
943
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
944
  def _rubric_display() -> Mapping[str, Any]:
945
  """The assessment file's ``website_display`` block, or an empty mapping.
946
 
 
964
  return warning if isinstance(warning, str) else ""
965
 
966
 
967
+ def _further_reading() -> list[Mapping[str, str]]:
968
+ items = _rubric_display().get("further_reading")
969
+ if not isinstance(items, (list, tuple)):
970
+ return []
971
+ return [
972
+ {"label": str(item.get("label") or ""), "url": str(item.get("url") or "")}
973
+ for item in items
974
+ if isinstance(item, Mapping) and item.get("url")
975
+ ]
976
 
977
+
978
+ #: The published method words this surface will display. Anything else is shown
979
+ #: as stated but not painted as one of the confident states, and an area with no
980
+ #: value renders as an absence whatever its status field says.
981
+ _METHOD_WORDS = frozenset({"Measured", "Modelled", "Proxy-based"})
982
+
983
+
984
+ def _category_rows(record: Mapping[str, Any]) -> list[Mapping[str, Any]]:
985
+ """The six areas of one record, in the catalogue's order, always all six.
986
+
987
+ State is read before value, per the assessment file's own rendering rules.
988
+ A record that omits an area entirely gets an explicit absence rather than a
989
+ missing row, because a card with four rows reads as a model with four areas.
990
  """
991
 
 
 
992
  categories = record.get("categories")
993
+ categories = categories if isinstance(categories, Mapping) else {}
994
  rows: list[Mapping[str, Any]] = []
995
+ for area in RUBRIC_AREAS:
996
+ cell = categories.get(area)
997
+ cell = cell if isinstance(cell, Mapping) else {}
998
+ reported = str(cell.get("state") or "missing") == "reported"
999
+ value = cell.get("value")
1000
+ rows.append(
1001
+ {
1002
+ "label": AREA_LABELS.get(area, area),
1003
+ "status": str(cell.get("status") or "") if reported else "",
1004
+ "value": str(value) if reported and isinstance(value, (str, int, float)) else "",
1005
+ "unit": str(cell.get("unit") or "") if reported else "",
1006
+ "note": str(cell.get("note") or ""),
1007
+ "source_url": str(cell.get("source_url") or "") if reported else "",
1008
+ }
1009
+ )
1010
+ return rows
1011
+
1012
+
1013
+ def _evidence_card(record: Mapping[str, Any], *, note: str = "") -> str:
1014
+ """One ``website_display.models`` record as an evidence card.
1015
+
1016
+ No letter is computed, because there are no letters. Values, units and
1017
+ method words are passed through exactly as the file states them; a cell
1018
+ whose state is not ``reported`` renders as an absence regardless of what
1019
+ else it carries, so a malformed record can only ever lose a figure, never
1020
+ acquire one.
1021
+ """
1022
+
1023
+ assessed = sum(1 for row in _category_rows(record) if row["value"])
1024
+ coverage = str(record.get("coverage") or "").strip()
1025
+ coverage_text = (
1026
+ f"{coverage.lower()} · {assessed} of {len(RUBRIC_AREAS)} areas published"
1027
+ if coverage and assessed
1028
+ else "no published result"
1029
+ )
1030
+ links = record.get("links")
1031
+ links = links if isinstance(links, (list, tuple)) else ()
1032
+ return render.model_evidence_card(
1033
  name=str(record.get("name") or record.get("model_id") or "unnamed"),
1034
+ coverage=coverage_text,
1035
+ summary=str(record.get("summary") or ""),
1036
+ covers=str(record.get("covers") or ""),
1037
+ categories=_category_rows(record),
1038
+ links=[
1039
+ {"label": str(item.get("label") or ""), "url": str(item.get("url") or "")}
1040
+ for item in links
1041
+ if isinstance(item, Mapping) and item.get("url")
1042
+ ],
1043
+ note=note or str(record.get("boundary") or ""),
1044
  )
1045
 
1046
 
1047
+ #: The model selected when a session opens. The lowest published figures of any
1048
+ #: assessed release this network can run; see model_assessments.json.
1049
+ DEFAULT_MODEL_ID = "olmoe-1b-7b-0924-instruct"
1050
 
1051
 
1052
  def _assessment_by_model_id() -> Mapping[str, Mapping[str, Any]]:
1053
+ """``website_display.models`` keyed by record id, exact matches only.
1054
 
1055
  Deliberately no fuzzy matching, and no alias table invented here. The
1056
+ assessment records name releases ("OLMo 2 7B", "OLMoE 1B-7B 0924"); the
1057
+ catalogue names specific quantised checkpoints ("OLMo 2 1124 7B Instruct,
1058
+ Q4_K_M"). Those are not the same object, and a surface whose first rule is
1059
+ that a figure belongs to the thing that was assessed cannot have its own
1060
+ renderer guessing which figure goes with which file.
1061
+
1062
+ So a catalogue entry gets an assessment when ``ASSESSMENT_ASSIGNMENT`` says
1063
+ which record covers it, and renders as not assessed otherwise. Extending the
1064
+ coverage is a change to the assessment data, which is where the evidence
1065
+ lives.
1066
  """
1067
 
1068
  records = _rubric_display().get("models")
 
1075
  }
1076
 
1077
 
1078
+ #: Which assessment record covers which catalogue entry, and what it leaves out.
 
 
 
1079
  #:
1080
+ #: This table used to carry an ``impact`` boolean, because the surface had two
1081
+ #: ordinal scales and one of them could transfer between checkpoints while the
1082
+ #: other could not. Both scales are gone, and with them the reason for that
1083
+ #: flag: a published figure either covers the checkpoint being offered or it
1084
+ #: does not, and where it does not the card says so in words rather than
1085
+ #: withholding a letter.
 
 
1086
  #:
1087
+ #: The mapping itself stays, and stays explicit, for the reason it always
1088
+ #: existed. Every entry below is a *pretraining* result being shown beside an
1089
+ #: *instruction-tuned* checkpoint built on that pretraining run. That is a
1090
+ #: partial coverage claim, not a complete one, and it is one substitution away
1091
+ #: from the thing this catalogue refuses — quietly transferring a figure from
1092
+ #: one release to another. Writing it down is what keeps the two apart.
1093
+ ASSESSMENT_ASSIGNMENT: Mapping[str, Mapping[str, Any]] = {
1094
+ "olmoe-1b-7b-0924-instruct": {
1095
+ "record": "olmoe-1b-7b-0924",
1096
+ "note": (
1097
+ "Figures cover the 0924 pretraining run; the tuning stage that produced this "
1098
+ "checkpoint is not separately costed in the source."
1099
+ ),
1100
  },
1101
+ "olmo-2-1124-7b-instruct": {
1102
+ "record": "olmo-2-1124-7b",
1103
+ "note": (
1104
+ "Figures cover the 1124 pretraining run; the tuning stage that produced this "
1105
+ "checkpoint is not separately costed in the source."
1106
+ ),
1107
  },
1108
+ "llama-2-7b-chat": {
1109
+ "record": "llama-2-7b",
1110
+ "note": (
1111
+ "Figures cover Llama 2 7B pretraining; Meta report fine-tuning compute inside "
1112
+ "the family total without breaking it out per checkpoint."
1113
+ ),
1114
  },
1115
  }
1116
 
 
1118
  def _assignment(model_id: str) -> tuple[Mapping[str, Any] | None, Mapping[str, Any]]:
1119
  """``(assessment record, assignment rules)`` for one catalogue model."""
1120
 
1121
+ rules = ASSESSMENT_ASSIGNMENT.get(model_id)
1122
  if rules is None:
1123
  return None, {}
1124
  return _assessment_by_model_id().get(str(rules["record"])), rules
1125
 
1126
 
1127
+ def _evidence_suffix(model_id: str) -> str:
1128
+ """The fragment appended to a model's name in the chooser.
1129
 
1130
+ A letter used to go here. What replaced it is the fact the letter was
1131
+ standing in for: which areas somebody actually published, and how. That is
1132
+ longer, and it is the thing a person choosing a model can act on -- "energy,
1133
+ climate, water · measured" says what is known; "B" said what we thought of it.
1134
  """
1135
 
1136
+ record, _ = _assignment(model_id)
1137
  if record is None:
1138
+ assessment = RELEASE_ASSESSMENT.get(model_id)
1139
+ if assessment is None or not assessment.has_any_result:
1140
+ return "no published assessment"
1141
+ published = [
1142
+ AREA_LABELS[area].split(" /", 1)[0].lower()
1143
+ for area in RUBRIC_AREAS
1144
+ if assessment.areas[area].status is not AreaStatus.MISSING
1145
+ ]
1146
+ return ", ".join(published) + " published"
1147
+
1148
+ rows = _category_rows(record)
1149
+ published = [row["label"].split(" /", 1)[0].lower() for row in rows if row["value"]]
1150
+ if not published:
1151
+ return "no published assessment"
1152
+ methods = {row["status"] for row in rows if row["value"] and row["status"] in _METHOD_WORDS}
1153
+ if methods == {"Measured"}:
1154
+ method = "measured"
1155
+ elif "Measured" in methods:
1156
+ # Not "partly measured", which reads as a hedge about the measuring.
1157
+ # Some of these figures were metered and some were calculated from the
1158
+ # metered ones, and both halves of that belong in the phrase.
1159
+ method = "measured and modelled"
1160
+ elif methods:
1161
+ method = "modelled"
1162
  else:
1163
+ method = "method not stated"
1164
+ return f"{', '.join(published)} · {method}"
 
 
 
 
 
 
 
 
 
 
 
1165
 
1166
 
1167
  def _short_label(label: str) -> str:
1168
  """The model's name, without the packager that follows it.
1169
 
1170
+ ``model_choices`` yields "OLMoE 1B-7B 0924 Instruct · Ai2 first-party GGUF";
1171
+ the part before the first separator is the model, and that is what a chooser
1172
+ needs.
1173
  """
1174
 
1175
  return label.split(" · ", 1)[0].strip() or label
1176
 
1177
 
1178
+ def model_choices_with_evidence() -> list[tuple[str, str]]:
1179
+ """Model options carrying what was published about them, not their RAM.
1180
 
1181
+ The publisher is dropped from the option text and not from the product: it
1182
+ is on the worker card, on the assessment card and in the manifest the digest
1183
+ is checked against. In a 280px control it was 9 characters that pushed the
1184
+ disclosure out of view.
1185
  """
1186
 
1187
+ return [
1188
+ (f"{_short_label(label)} · {_evidence_suffix(model_id)}", model_id)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1189
  for label, model_id in model_choices()
1190
  ]
1191
 
1192
 
1193
+ def _assessment_cards() -> list[str]:
1194
+ """Build the evidence cards from the assessment file's display block.
1195
 
1196
+ Ordering follows the catalogue, and no ordering here implies a ranking:
1197
+ these are not scores, and two models with published figures in different
1198
+ areas are not on one scale.
 
1199
  """
1200
 
1201
  display = _rubric_display()
 
1207
  for record in records:
1208
  if isinstance(record, Mapping) and record.get("model_id"):
1209
  by_id[str(record["model_id"])] = record
1210
+ # Catalogue order first, so the surface matches the chooser; anything the
1211
+ # file carries that the catalogue does not is appended rather than
1212
+ # dropped, because a record for a model we no longer ship is still a
1213
+ # published result somebody may be looking for.
1214
+ seen: set[str] = set()
1215
+ for model_id in MODEL_CATALOG:
1216
+ rules = ASSESSMENT_ASSIGNMENT.get(model_id) or {}
1217
+ record_id = str(rules.get("record") or "")
1218
+ record = by_id.get(record_id)
1219
+ if record is None:
1220
+ continue
1221
+ seen.add(record_id)
1222
+ cards.append(_evidence_card(record, note=str(rules.get("note") or "")))
1223
+ for record_id, record in by_id.items():
1224
+ if record_id not in seen:
1225
+ cards.append(_evidence_card(record))
1226
  return cards
1227
 
1228
+ # Fallback: the assessments in the catalogue itself. These now carry real
1229
+ # published figures rather than a uniform "no data", so an absent or
1230
+ # unreadable assessment file degrades to a smaller surface rather than an
1231
+ # empty one.
1232
  for model_id, manifest in MODEL_CATALOG.items():
1233
  assessment = RELEASE_ASSESSMENT[model_id]
1234
+ rows = [
1235
+ {
1236
+ "label": AREA_LABELS[area],
1237
+ "status": assessment.areas[area].status.value
1238
+ if assessment.areas[area].status is not AreaStatus.MISSING
1239
+ else "",
1240
+ "value": assessment.areas[area].value or "",
1241
+ "unit": assessment.areas[area].unit or "",
1242
+ "note": assessment.areas[area].note,
1243
+ "source_url": assessment.areas[area].source_url or "",
1244
+ }
1245
+ for area in RUBRIC_AREAS
1246
+ ]
1247
  cards.append(
1248
+ render.model_evidence_card(
1249
  name=manifest.label,
1250
+ coverage=assessment.coverage_display,
1251
+ summary=assessment.summary,
1252
+ covers=assessment.covers,
 
1253
  categories=rows,
1254
+ links=list(assessment.links),
1255
  note=assessment.reason,
1256
  )
1257
  )
 
1505
  def _library_page(
1506
  self, query: str, defaults: Sequence[str]
1507
  ) -> tuple[Any, str, str]:
1508
+ """The page a person picks their defaults on: the transport, then what is drawn.
1509
+
1510
+ The checkbox group is not a second way to choose; it is the same
1511
+ choice, off the screen, because the framework only reports its own
1512
+ controls. Every box is labelled with the bare reference so the card
1513
+ that forwards a click to it can find it by an exact string rather than
1514
+ by its position in a list that a filter can reorder.
1515
+ """
1516
 
1517
  rows, matched = self._library_rows(query)
1518
  total = len(_library_specs())
1519
+ choices = [(row["ref"], row["ref"]) for row in rows]
 
 
1520
  # Defaults outside the current filter are preserved rather than
1521
  # dropped. Searching is a way of looking, not a way of deselecting,
1522
  # and a search box that quietly unticked everything it hid would be
 
1547
  profile: "gr.OAuthProfile | None" = None,
1548
  request: "gr.Request | None" = None,
1549
  ) -> tuple[Any, Any, str, str, Any, str]:
1550
+ """Record the defaults the page's cards are currently showing as on.
1551
+
1552
+ The merge only ever replaces members currently on screen. Somebody who
1553
+ searches "pdf", drops one member and then searches "plan" has changed
1554
+ their mind about one member, not about every member the filter was
1555
+ hiding, and a page whose whole job is to remember a choice must not
1556
+ forget one because it was scrolled out of a filter.
1557
+
1558
+ Values arrive from the page's own hidden group and are still filtered
1559
+ against the library, because a control in a browser is a suggestion.
1560
  """
1561
 
1562
+ visible_choice = [item for item in visible_choice or () if isinstance(item, str)]
1563
  rows, _ = self._library_rows(query)
1564
  on_screen = {row["ref"] for row in rows}
1565
  previous = set(_library_defaults(state))
 
1577
  defaults=_library_defaults(updated),
1578
  viewer_id=viewer_id,
1579
  )
1580
+ _group, summary, _cards = self._library_page(query, _library_defaults(updated))
1581
+ # The cards are NOT re-rendered here. The click already moved the card
1582
+ # in the browser, and pushing fresh markup back would rebuild the grid
1583
+ # under the user's cursor — losing a hover preview mid-play and, on a
1584
+ # phone, moving the thing they just tapped. The summary updates
1585
+ # because it is the count, which is the feedback that matters.
1586
+ return updated, updated, summary, gr.skip(), selector, note
1587
 
1588
  # Outputs ----------------------------------------------------------
1589
 
 
1896
  library, library_note = self._library_components(
1897
  None, defaults=_library_defaults(updated), viewer_id=user_id
1898
  )
1899
+ page_group, page_summary, page_cards = self._library_page(
1900
+ "", _library_defaults(updated)
1901
+ )
1902
  return (
1903
  updated,
1904
  updated,
 
1914
  library_note,
1915
  self._outputs_component(updated),
1916
  activity,
1917
+ # The library page is filled on arrival rather than on first open,
1918
+ # so a browser that already has defaults shows those cards already
1919
+ # selected the moment the page is opened.
1920
+ page_group,
1921
  page_summary,
1922
  page_cards,
1923
  )
 
2813
  state["session_id"], job_id, raw_artifacts
2814
  )
2815
  answer["artifacts"] = [Path(item).name for item in stored]
2816
+ # WHAT THE RUN MADE, READ ONCE.
2817
+ #
2818
+ # A file the run produced is the answer to "make me a
2819
+ # PDF", and until now the transcript said "1 file" and
2820
+ # left the thing itself in a panel. The preview is
2821
+ # derived here, at claim time, and travels in browser
2822
+ # state with the answer: the transcript re-renders
2823
+ # every two seconds and must never re-open a zip to
2824
+ # do it.
2825
+ answer["made"] = render.artifact_preview_data(stored)
2826
  updated = record_answer(updated, job_id=job_id, answer=answer)
2827
 
2828
  if answer is not None:
 
2870
  _step_messages(answer.get("steps") or (), running=False)
2871
  )
2872
  messages.append({"role": "assistant", "content": str(answer.get("output", ""))})
2873
+ # The artifact, immediately under the words that announced it.
2874
+ # A run whose whole purpose was to produce a file ends on the
2875
+ # file, not on a sentence about a file.
2876
+ made = render.made_things(answer.get("made") or ())
2877
+ if made:
2878
+ messages.append({"role": "assistant", "content": made})
2879
  status_label = "completed"
2880
  outcome = ""
2881
  elif view is None:
 
3157
  # button below is the one sign-in control, so a header link
3158
  # would only duplicate it.
3159
  identity = gr.HTML(_identity_html(""))
3160
+ # The quick nav sits directly under the identity box. The
3161
+ # library is a destination rather than a section, so its
3162
+ # control is a button that swaps the view; "Run an agent" is
3163
+ # still a section of this page, so it stays an anchor.
3164
+ with gr.Row(elem_classes="c-quicknav"):
3165
+ open_library = gr.Button(
3166
+ "Library", size="sm", variant="secondary",
3167
+ elem_classes="c-quicknav__btn", scale=0,
3168
+ )
3169
+ gr.HTML(
3170
+ '<a class="c-quicknav__link" href="#join-agent">Run an agent</a>'
3171
+ )
3172
 
3173
  # THE SIGN-IN CONTROL, AND WHY IT IS CONDITIONAL.
3174
  #
 
3251
  # the model.
3252
  model = gr.Dropdown(
3253
  label="Model",
3254
+ choices=model_choices_with_evidence(),
3255
  value=DEFAULT_MODEL_ID,
3256
  container=True,
3257
  )
 
3506
  create_code = gr.Button("Generate pairing code")
3507
  gr.Markdown()
3508
 
3509
+ with gr.Accordion("Model assessments and their sources", open=False):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3510
  gr.HTML(
3511
  '<p class="c-panel__head">'
3512
  '<span class="c-panel__title">Release assessment</span>'
3513
  '<span class="c-panel__boundary">boundary 2 of 2</span></p>'
3514
  )
3515
  gr.HTML(
3516
+ render.assessment_section(
3517
+ _assessment_cards(),
3518
+ warning=_rubric_warning(),
3519
+ further_reading=_further_reading(),
3520
+ )
3521
  )
3522
 
3523
+ # THE LIBRARY IS A PAGE, NOT A SECTION.
3524
+ #
3525
+ # It used to be an accordion at the bottom of the chat page, which
3526
+ # is where a person found it after scrolling past the conversation,
3527
+ # the composer and the agent panel — that is a footnote, not a
3528
+ # destination. It is now a full view of its own, reached from the
3529
+ # control under the sign-in box and leaving by the same route.
3530
+ #
3531
+ # A view rather than a Gradio route, deliberately. A second route
3532
+ # is a second Blocks with its own state, and the defaults live in
3533
+ # this browser's own storage beside the transcript; two pages
3534
+ # writing that one key is how a person loses their history to a
3535
+ # visit to the library. One Blocks, two views, one copy of the
3536
+ # state.
3537
+ with gr.Column(elem_classes="c-libpage", visible=False) as library_view:
3538
+ close_library = gr.Button(
3539
+ "\u2190 Back to the conversation", size="sm",
3540
+ variant="secondary", elem_classes="c-libpage__backbtn", scale=0,
3541
+ )
3542
+ gr.HTML(
3543
+ '<h1 class="c-libpage__title">Library</h1>'
3544
+ '<p class="c-libpage__lede">Every tool and skill this server can '
3545
+ "offer, who wrote it, and what it does. Hover a card — or press "
3546
+ "and hold on a phone — to watch it work. Tap a card to keep it as "
3547
+ "a default: it selects itself whenever a worker offers it, and any "
3548
+ "single run can drop it without changing what is saved.</p>"
3549
+ )
3550
+ library_search = gr.Textbox(
3551
+ label="Search the library",
3552
+ show_label=False,
3553
+ placeholder="Search by name, reference or what it does…",
3554
+ container=False,
3555
+ elem_classes="c-librarysearch",
3556
+ )
3557
+ library_summary = gr.HTML(
3558
+ render.library_summary(shown=0, matched=0, total=0, chosen=0)
3559
+ )
3560
+ library_cards_html = gr.HTML(elem_classes="c-librarycards")
3561
+ # THE CARDS ARE THE CONTROL; THIS IS HOW THEY REACH PYTHON.
3562
+ #
3563
+ # The page used to carry a grid of cards *and* a visible list
3564
+ # of tick boxes naming the same members again: two controls for
3565
+ # one decision, and the reason the page was unreadable on a
3566
+ # phone. The grid is the only control a person sees now. This
3567
+ # group is its transport, off the screen, and the click handler
3568
+ # forwards a card's click to the box that belongs to it.
3569
+ #
3570
+ # Forwarding a real click rather than writing a value is the
3571
+ # whole trick, and it was arrived at the hard way: setting a
3572
+ # hidden field's ``value`` and dispatching ``input`` looks
3573
+ # right, changes the DOM, and never reaches the server, because
3574
+ # the framework's own binding is what it listens to. Clicking
3575
+ # the framework's own control cannot drift from it.
3576
+ #
3577
+ # Each box is labelled with its bare reference so the mapping
3578
+ # from card to box is an exact string match rather than a
3579
+ # position, which would silently mis-tick the moment a filter
3580
+ # reordered one list and not the other. Hidden in CSS, never
3581
+ # with ``visible=False``: gradio 6 leaves an invisible block
3582
+ # out of the document altogether, and a transport the page
3583
+ # cannot find is a page that silently never saves.
3584
+ library_defaults = gr.CheckboxGroup(
3585
+ label="Saved defaults",
3586
+ show_label=False,
3587
+ choices=[],
3588
+ value=[],
3589
+ container=False,
3590
+ elem_id="library-choice",
3591
+ elem_classes="c-hiddenfield",
3592
+ )
3593
+
3594
  # Hidden component bindings form the machine API consumed by gradio_client.
3595
  with gr.Column(visible=False):
3596
  api_pair_code = gr.Textbox()
 
3644
  queue=False,
3645
  api_visibility="private",
3646
  )
3647
+ # THE LIBRARY VIEW SWAP.
3648
+ #
3649
+ # Two columns, one visible at a time, and the scroll position reset
3650
+ # on arrival: a page that opens halfway down is the single clearest
3651
+ # sign that nothing really navigated. The transition is instant
3652
+ # because both views are already in the document; nothing is
3653
+ # fetched to change page.
3654
+ _scroll_top = "() => { window.scrollTo({top: 0, behavior: 'instant'}); }"
3655
+ open_library.click(
3656
+ lambda: (gr.Column(visible=False), gr.Column(visible=True)),
3657
+ outputs=[app_view, library_view],
3658
+ queue=False,
3659
+ api_visibility="private",
3660
+ js=_scroll_top,
3661
+ )
3662
+ close_library.click(
3663
+ lambda: (gr.Column(visible=True), gr.Column(visible=False)),
3664
+ outputs=[app_view, library_view],
3665
+ queue=False,
3666
+ api_visibility="private",
3667
+ js=_scroll_top,
3668
+ )
3669
  new_conversation_button.click(
3670
  self.new_conversation,
3671
  inputs=[session_state],
distinct_skills/manifest.py CHANGED
@@ -44,25 +44,25 @@ PACKAGED_ROOT = Path(__file__).resolve().parent / "skills"
44
  #: expect the review to ask why the digest changed.
45
  PINNED_DIGESTS: Mapping[str, str] = MappingProxyType(
46
  {
47
- "academy-guide": "489ddd4c963552d243d68aa71af3e9f86ea58b6eb15fa77676eb21297d20e683",
48
- "algorithmic-art": "a20eeb2e787e8f01f66fefc61fa34d84c7046015ba39728952f97ebe29709822",
49
- "brand-guidelines": "bf9abe6506aa7785d36b027fd90f5a5552b40a36f1201ee09b3a680bbfff74d3",
50
- "canvas-design": "776e112543645c5b22515c6e503ab572cde35c4633e0fd09e2d7c53ed912cde0",
51
- "claude-api": "7f41a0e79797eb14c67e8a7fbfbabdb02da229829997496d719af141a597d0ce",
52
  "create-deck": "e7c9a709f4609af0e5560544ecd8b05cb32fe5e52c147a23690f700700ec5b88",
53
  "create-docx": "b1e950ab46f324bca84f6aade1d6772f13090e1fb1cb57df761c41bcb4764b7d",
54
  "create-xlsx": "73325b2bd0d99ec781610ed9da1af59fef2655fb6e7b3766a29e2915d5ec449d",
55
  "csv-table": "ff87a44fe03901f0cfb61f46209b6cc7138acf07d87279c936cd8711b0a5e455",
56
- "discernment-nudge": "1901fbb6a6a0980fe3c8fc5297d492c39ef02f1c46bbcd77223cf7622cabcd5b",
57
  "frontend-design": "283205e755626aae7c517f6a3b0f9b8d16b2d30f32d24822080b58393eae689a",
58
- "mcp-builder": "fafc5acb2b8e408182ed8f2be49e9c1dcf41827ceca7bba6aacaccce3393b37b",
59
  "review-checklist": "98af818e3e4c178021bb87bcf355934b5effca7240b738f48ee344f7c6b6686f",
60
  "skill-scaffold": "158d1d1ff1ff3ad83865537708cd4464cdd114f420912136917b9c143c32e18e",
61
- "slack-gif-creator": "854f079d2843b80cbf3bd261c099f187c07ad0edf69646ca122eee7e77007ae9",
62
  "status-update": "48b7b1914de88b70e0ff9d19262987aca01696f6ebce061d0793543cbacc309e",
63
  "theme-factory": "1b5d9800d869e902757d1b1733f98f3936319ee090035ffe9a82603662ccebe8",
64
- "web-artifacts-builder": "4d0576368ca16dea4d5dea809b4766146d49ef84354269289843f55e76f9615e",
65
- "webapp-testing": "cde6767ba5c2fd1cca6e86007010b228cb9296ffe3764485122ade9dd88c52fd",
66
  }
67
  )
68
 
 
44
  #: expect the review to ask why the digest changed.
45
  PINNED_DIGESTS: Mapping[str, str] = MappingProxyType(
46
  {
47
+ "academy-guide": "47c88cbeb129c2edcb68176bc09621df72557200d253c2a5795e8f76603d6b45",
48
+ "algorithmic-art": "15adcdf6e2f9a51d1a2cf9a0cfa636970c53c5f464fe6ef96b5144a72cc95dbd",
49
+ "brand-guidelines": "d4443542e29d6b91234dffd31a65ed7df578adea5f58dfc70af068ad82dae1e5",
50
+ "canvas-design": "fc44c8a8552c1c6bfc5f92f115d07082a9ae3a1a174333b9689abf1d6b8d3a69",
51
+ "claude-api": "23a386a66bce1123f0765779966b802279c23eff956932d3283cc9ba60ecea9e",
52
  "create-deck": "e7c9a709f4609af0e5560544ecd8b05cb32fe5e52c147a23690f700700ec5b88",
53
  "create-docx": "b1e950ab46f324bca84f6aade1d6772f13090e1fb1cb57df761c41bcb4764b7d",
54
  "create-xlsx": "73325b2bd0d99ec781610ed9da1af59fef2655fb6e7b3766a29e2915d5ec449d",
55
  "csv-table": "ff87a44fe03901f0cfb61f46209b6cc7138acf07d87279c936cd8711b0a5e455",
56
+ "discernment-nudge": "d83200e87cae43adbd61ff7277fc08e14c1f032f11590fb5a04bfbf55eb16fdd",
57
  "frontend-design": "283205e755626aae7c517f6a3b0f9b8d16b2d30f32d24822080b58393eae689a",
58
+ "mcp-builder": "0c714adae4963be9411e061647f4efa3820b06d2974a2b319aa93330afc8eb82",
59
  "review-checklist": "98af818e3e4c178021bb87bcf355934b5effca7240b738f48ee344f7c6b6686f",
60
  "skill-scaffold": "158d1d1ff1ff3ad83865537708cd4464cdd114f420912136917b9c143c32e18e",
61
+ "slack-gif-creator": "d1c7506e4c0bb3dfb17608e7e2909a91083d6f7323702a2b70bd5d3efc98c6b9",
62
  "status-update": "48b7b1914de88b70e0ff9d19262987aca01696f6ebce061d0793543cbacc309e",
63
  "theme-factory": "1b5d9800d869e902757d1b1733f98f3936319ee090035ffe9a82603662ccebe8",
64
+ "web-artifacts-builder": "c57043ce13ad02df16ce717da8572fc59ec309bf9326a1e7d8b2f4f6cbc7e962",
65
+ "webapp-testing": "c2202ffb51483464e7a485ffa704899f20bcb2feb71073689ed678af7b55e7a4",
66
  }
67
  )
68