agentinputlab 0.1.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. agentinputlab/__init__.py +28 -0
  2. agentinputlab/algorithms/__init__.py +6 -0
  3. agentinputlab/algorithms/acquire/__init__.py +145 -0
  4. agentinputlab/algorithms/acquire/adaptive_rag/__init__.py +43 -0
  5. agentinputlab/algorithms/acquire/adaptive_rag/replay.py +367 -0
  6. agentinputlab/algorithms/acquire/adaptive_rag/runtime.py +1202 -0
  7. agentinputlab/algorithms/acquire/adaptive_rag_common_support.py +542 -0
  8. agentinputlab/algorithms/acquire/hyde.py +296 -0
  9. agentinputlab/algorithms/acquire/hyde_controlled.py +200 -0
  10. agentinputlab/algorithms/acquire/hyde_external.py +148 -0
  11. agentinputlab/algorithms/acquire/ircot.py +28 -0
  12. agentinputlab/algorithms/acquire/ircot_common_support.py +478 -0
  13. agentinputlab/algorithms/acquire/ircot_native.py +355 -0
  14. agentinputlab/algorithms/acquire/ircot_replay.py +327 -0
  15. agentinputlab/algorithms/acquire/qrag/__init__.py +79 -0
  16. agentinputlab/algorithms/acquire/qrag/bridge.py +828 -0
  17. agentinputlab/algorithms/acquire/qrag/common_support.py +891 -0
  18. agentinputlab/algorithms/acquire/qrag/native_axis.py +71 -0
  19. agentinputlab/algorithms/acquire/qrag/reader_adapter.py +139 -0
  20. agentinputlab/algorithms/acquire/r2ag/__init__.py +57 -0
  21. agentinputlab/algorithms/acquire/r2ag/bridge.py +1312 -0
  22. agentinputlab/algorithms/acquire/r2ag/common_support.py +1029 -0
  23. agentinputlab/algorithms/acquire/r2ag/socket_runtime.py +255 -0
  24. agentinputlab/algorithms/clarify/__init__.py +61 -0
  25. agentinputlab/algorithms/clarify/_structured.py +64 -0
  26. agentinputlab/algorithms/clarify/active_task_disambiguation.py +371 -0
  27. agentinputlab/algorithms/clarify/ask_or_assume/__init__.py +17 -0
  28. agentinputlab/algorithms/clarify/ask_or_assume/monitor.py +410 -0
  29. agentinputlab/algorithms/clarify/future_turns.py +379 -0
  30. agentinputlab/algorithms/clarify/udcs.py +255 -0
  31. agentinputlab/algorithms/clarify/udcs_deterministic.py +196 -0
  32. agentinputlab/algorithms/curate/__init__.py +65 -0
  33. agentinputlab/algorithms/curate/acon/__init__.py +27 -0
  34. agentinputlab/algorithms/curate/acon/common.py +284 -0
  35. agentinputlab/algorithms/curate/acon/common_support.py +136 -0
  36. agentinputlab/algorithms/curate/acon/history_bridge.py +309 -0
  37. agentinputlab/algorithms/curate/acon/observation_bridge.py +290 -0
  38. agentinputlab/algorithms/curate/llmlingua/__init__.py +30 -0
  39. agentinputlab/algorithms/curate/llmlingua/adapters.py +537 -0
  40. agentinputlab/algorithms/curate/llmlingua/budget.py +48 -0
  41. agentinputlab/algorithms/curate/llmlingua/controlled.py +175 -0
  42. agentinputlab/algorithms/curate/llmlingua/multilingual.py +105 -0
  43. agentinputlab/algorithms/curate/llmlingua/span_map.py +167 -0
  44. agentinputlab/algorithms/curate/recomp/__init__.py +47 -0
  45. agentinputlab/algorithms/curate/recomp/external.py +1129 -0
  46. agentinputlab/algorithms/curate/recomp/selective.py +304 -0
  47. agentinputlab/algorithms/decompose/__init__.py +107 -0
  48. agentinputlab/algorithms/decompose/decomp/__init__.py +53 -0
  49. agentinputlab/algorithms/decompose/decomp/common_support.py +478 -0
  50. agentinputlab/algorithms/decompose/decomp/planner_component.py +199 -0
  51. agentinputlab/algorithms/decompose/decomp/worker_bridge.py +416 -0
  52. agentinputlab/algorithms/decompose/llm_compiler/__init__.py +35 -0
  53. agentinputlab/algorithms/decompose/llm_compiler/bridge.py +520 -0
  54. agentinputlab/algorithms/decompose/llm_compiler/common_support.py +504 -0
  55. agentinputlab/algorithms/decompose/plan_and_budget/__init__.py +43 -0
  56. agentinputlab/algorithms/decompose/plan_and_budget/cached_soft_budget.py +362 -0
  57. agentinputlab/algorithms/decompose/plan_and_budget/decomposer_component.py +107 -0
  58. agentinputlab/algorithms/decompose/plan_and_budget/full.py +205 -0
  59. agentinputlab/algorithms/decompose/plan_and_budget/hard_cap.py +246 -0
  60. agentinputlab/algorithms/decompose/plan_and_budget/regenerated_soft_budget.py +448 -0
  61. agentinputlab/algorithms/decompose/plan_and_solve/__init__.py +33 -0
  62. agentinputlab/algorithms/decompose/plan_and_solve/plan_component.py +192 -0
  63. agentinputlab/algorithms/decompose/plan_and_solve/ps_prompt.py +127 -0
  64. agentinputlab/algorithms/decompose/self_ask/__init__.py +27 -0
  65. agentinputlab/algorithms/decompose/self_ask/loop.py +362 -0
  66. agentinputlab/algorithms/decompose/self_ask/planner_component.py +117 -0
  67. agentinputlab/algorithms/reformulate/__init__.py +85 -0
  68. agentinputlab/algorithms/reformulate/infocqr/__init__.py +40 -0
  69. agentinputlab/algorithms/reformulate/infocqr/cache_replay.py +362 -0
  70. agentinputlab/algorithms/reformulate/infocqr/external.py +675 -0
  71. agentinputlab/algorithms/reformulate/infocqr/student.py +189 -0
  72. agentinputlab/algorithms/reformulate/query2doc/__init__.py +42 -0
  73. agentinputlab/algorithms/reformulate/query2doc/controlled_live.py +190 -0
  74. agentinputlab/algorithms/reformulate/query2doc/models.py +95 -0
  75. agentinputlab/algorithms/reformulate/query2doc/official_cached.py +335 -0
  76. agentinputlab/algorithms/reformulate/query2doc/querygym_bridge.py +223 -0
  77. agentinputlab/algorithms/reformulate/query2doc/querygym_runtime.py +326 -0
  78. agentinputlab/algorithms/reformulate/reformer/__init__.py +23 -0
  79. agentinputlab/algorithms/reformulate/reformer/external.py +417 -0
  80. agentinputlab/algorithms/reformulate/rrr.py +696 -0
  81. agentinputlab/annotation/__init__.py +5 -0
  82. agentinputlab/annotation/independent.py +428 -0
  83. agentinputlab/annotation/server.py +233 -0
  84. agentinputlab/annotation/static/app.js +121 -0
  85. agentinputlab/annotation/static/index.html +60 -0
  86. agentinputlab/annotation/static/review.css +2 -0
  87. agentinputlab/annotation/static/review.html +10 -0
  88. agentinputlab/annotation/static/review.js +11 -0
  89. agentinputlab/annotation/static/styles.css +55 -0
  90. agentinputlab/annotation/store.py +444 -0
  91. agentinputlab/api.py +368 -0
  92. agentinputlab/artifacts/__init__.py +15 -0
  93. agentinputlab/artifacts/json_file.py +104 -0
  94. agentinputlab/artifacts/manifest.py +98 -0
  95. agentinputlab/artifacts/store.py +157 -0
  96. agentinputlab/backends/__init__.py +98 -0
  97. agentinputlab/backends/embedding/__init__.py +25 -0
  98. agentinputlab/backends/embedding/base.py +145 -0
  99. agentinputlab/backends/embedding/callable.py +75 -0
  100. agentinputlab/backends/embedding/replay.py +129 -0
  101. agentinputlab/backends/llm/__init__.py +31 -0
  102. agentinputlab/backends/llm/base.py +149 -0
  103. agentinputlab/backends/llm/callable.py +108 -0
  104. agentinputlab/backends/llm/decomp_completion.py +88 -0
  105. agentinputlab/backends/llm/final_content_stop.py +72 -0
  106. agentinputlab/backends/llm/gpt_oss_final_channel.py +84 -0
  107. agentinputlab/backends/llm/openai_compatible.py +332 -0
  108. agentinputlab/backends/llm/transformers.py +171 -0
  109. agentinputlab/backends/retrieval/__init__.py +35 -0
  110. agentinputlab/backends/retrieval/base.py +50 -0
  111. agentinputlab/backends/retrieval/dense.py +777 -0
  112. agentinputlab/backends/retrieval/memory.py +119 -0
  113. agentinputlab/backends/retrieval/sqlite_fts.py +155 -0
  114. agentinputlab/backends/user/__init__.py +15 -0
  115. agentinputlab/backends/user/base.py +66 -0
  116. agentinputlab/backends/user/callable.py +54 -0
  117. agentinputlab/backends/user/replay.py +89 -0
  118. agentinputlab/backends/vector.py +38 -0
  119. agentinputlab/benchmarks/__init__.py +246 -0
  120. agentinputlab/benchmarks/acquisition.py +106 -0
  121. agentinputlab/benchmarks/ale.py +540 -0
  122. agentinputlab/benchmarks/appworld_ul.py +669 -0
  123. agentinputlab/benchmarks/assets.py +226 -0
  124. agentinputlab/benchmarks/base.py +68 -0
  125. agentinputlab/benchmarks/beir_archive.py +235 -0
  126. agentinputlab/benchmarks/beir_sample.py +269 -0
  127. agentinputlab/benchmarks/bfcl_native.py +245 -0
  128. agentinputlab/benchmarks/bfcl_v3.py +607 -0
  129. agentinputlab/benchmarks/cache.py +218 -0
  130. agentinputlab/benchmarks/clariq.py +203 -0
  131. agentinputlab/benchmarks/data/registry.json +321 -0
  132. agentinputlab/benchmarks/data/smoke_assets.json +511 -0
  133. agentinputlab/benchmarks/data/statebench_v0_8_1_task_ids.json +475 -0
  134. agentinputlab/benchmarks/data/toolsandbox_165848b_scenario_names.json +1 -0
  135. agentinputlab/benchmarks/execution.py +1111 -0
  136. agentinputlab/benchmarks/interactive.py +257 -0
  137. agentinputlab/benchmarks/ir_query.py +204 -0
  138. agentinputlab/benchmarks/longbench.py +203 -0
  139. agentinputlab/benchmarks/paired_replay.py +479 -0
  140. agentinputlab/benchmarks/preprocess.py +2313 -0
  141. agentinputlab/benchmarks/production.py +236 -0
  142. agentinputlab/benchmarks/qa.py +963 -0
  143. agentinputlab/benchmarks/registry.py +110 -0
  144. agentinputlab/benchmarks/retrieval.py +459 -0
  145. agentinputlab/benchmarks/runtime.py +509 -0
  146. agentinputlab/benchmarks/statebench.py +938 -0
  147. agentinputlab/benchmarks/tau3.py +725 -0
  148. agentinputlab/benchmarks/toolsandbox.py +626 -0
  149. agentinputlab/benchmarks/trec_dl_sample.py +263 -0
  150. agentinputlab/campaign.py +654 -0
  151. agentinputlab/campaign_runner.py +953 -0
  152. agentinputlab/cli/__init__.py +6 -0
  153. agentinputlab/cli/main.py +933 -0
  154. agentinputlab/connectors/__init__.py +46 -0
  155. agentinputlab/connectors/knowledge/__init__.py +4 -0
  156. agentinputlab/connectors/tools/__init__.py +30 -0
  157. agentinputlab/connectors/tools/base.py +57 -0
  158. agentinputlab/connectors/tools/mcp.py +222 -0
  159. agentinputlab/connectors/tools/memory.py +41 -0
  160. agentinputlab/connectors/tools/openapi.py +695 -0
  161. agentinputlab/connectors/tools/schema.py +102 -0
  162. agentinputlab/contracts/__init__.py +91 -0
  163. agentinputlab/contracts/availability.py +24 -0
  164. agentinputlab/contracts/dependency.py +58 -0
  165. agentinputlab/contracts/enums.py +82 -0
  166. agentinputlab/contracts/errors.py +63 -0
  167. agentinputlab/contracts/evidence.py +43 -0
  168. agentinputlab/contracts/intent.py +110 -0
  169. agentinputlab/contracts/lifecycle.py +164 -0
  170. agentinputlab/contracts/patch.py +167 -0
  171. agentinputlab/contracts/serialization.py +93 -0
  172. agentinputlab/contracts/state.py +127 -0
  173. agentinputlab/contracts/trace.py +59 -0
  174. agentinputlab/contracts/worker.py +42 -0
  175. agentinputlab/core/__init__.py +7 -0
  176. agentinputlab/data/__init__.py +32 -0
  177. agentinputlab/data/checksums.py +9 -0
  178. agentinputlab/data/downloader.py +235 -0
  179. agentinputlab/data/http.py +171 -0
  180. agentinputlab/data/index.py +21 -0
  181. agentinputlab/data/overlap.py +28 -0
  182. agentinputlab/data/preprocess.py +32 -0
  183. agentinputlab/data/storage.py +57 -0
  184. agentinputlab/data/trec_sample.py +427 -0
  185. agentinputlab/evaluation/__init__.py +5 -0
  186. agentinputlab/evaluation/outcomes.py +32 -0
  187. agentinputlab/experiments/__init__.py +278 -0
  188. agentinputlab/experiments/analysis.py +981 -0
  189. agentinputlab/experiments/artifacts.py +687 -0
  190. agentinputlab/experiments/automatic_measurement.py +678 -0
  191. agentinputlab/experiments/auxiliary_matrix.py +203 -0
  192. agentinputlab/experiments/bindings.py +430 -0
  193. agentinputlab/experiments/blueprints.py +147 -0
  194. agentinputlab/experiments/builders/__init__.py +45 -0
  195. agentinputlab/experiments/builders/executable_external_payload.py +423 -0
  196. agentinputlab/experiments/builders/external_process_arena.py +1018 -0
  197. agentinputlab/experiments/builders/registry_intervention.py +463 -0
  198. agentinputlab/experiments/cli.py +158 -0
  199. agentinputlab/experiments/controls.py +340 -0
  200. agentinputlab/experiments/driver_guard.py +205 -0
  201. agentinputlab/experiments/drivers/__init__.py +89 -0
  202. agentinputlab/experiments/drivers/external_arena.py +2908 -0
  203. agentinputlab/experiments/drivers/method_process.py +662 -0
  204. agentinputlab/experiments/drivers/parity_process.py +1484 -0
  205. agentinputlab/experiments/drivers/static_production.py +1574 -0
  206. agentinputlab/experiments/executor.py +448 -0
  207. agentinputlab/experiments/loader.py +605 -0
  208. agentinputlab/experiments/measurement.py +675 -0
  209. agentinputlab/experiments/paper_analysis.py +1818 -0
  210. agentinputlab/experiments/parity_identity.py +605 -0
  211. agentinputlab/experiments/plan.py +277 -0
  212. agentinputlab/experiments/production_builders.py +3739 -0
  213. agentinputlab/experiments/readiness.py +432 -0
  214. agentinputlab/experiments/schema.py +514 -0
  215. agentinputlab/experiments/secrets.py +177 -0
  216. agentinputlab/experiments/stateful_analysis.py +1738 -0
  217. agentinputlab/experiments/transfer_analysis.py +1316 -0
  218. agentinputlab/experiments/unseen_analysis.py +1025 -0
  219. agentinputlab/integrations/__init__.py +1 -0
  220. agentinputlab/integrations/action_space/__init__.py +1 -0
  221. agentinputlab/integrations/external_workers/__init__.py +76 -0
  222. agentinputlab/integrations/external_workers/ace.py +431 -0
  223. agentinputlab/integrations/external_workers/base.py +181 -0
  224. agentinputlab/integrations/external_workers/decomp_live.py +249 -0
  225. agentinputlab/integrations/external_workers/decomp_planner.py +30 -0
  226. agentinputlab/integrations/external_workers/infocqr_student.py +280 -0
  227. agentinputlab/integrations/external_workers/ircot.py +576 -0
  228. agentinputlab/integrations/external_workers/llmcompiler_live.py +360 -0
  229. agentinputlab/integrations/external_workers/longllmlingua.py +162 -0
  230. agentinputlab/integrations/external_workers/method.py +314 -0
  231. agentinputlab/integrations/external_workers/process.py +678 -0
  232. agentinputlab/integrations/external_workers/supervisor.py +1071 -0
  233. agentinputlab/integrations/full_architecture/__init__.py +1 -0
  234. agentinputlab/integrations/full_architecture/hyde.py +212 -0
  235. agentinputlab/integrations/full_architecture/plan_and_budget.py +188 -0
  236. agentinputlab/integrations/live_history.py +222 -0
  237. agentinputlab/integrations/prompt_optimization/__init__.py +1 -0
  238. agentinputlab/integrations/training/__init__.py +1 -0
  239. agentinputlab/metrics/__init__.py +50 -0
  240. agentinputlab/metrics/catalog.py +313 -0
  241. agentinputlab/metrics/harm.py +95 -0
  242. agentinputlab/metrics/paired.py +40 -0
  243. agentinputlab/metrics/qa.py +76 -0
  244. agentinputlab/metrics/text.py +33 -0
  245. agentinputlab/metrics/third_party.py +161 -0
  246. agentinputlab/models/__init__.py +4 -0
  247. agentinputlab/observability/__init__.py +56 -0
  248. agentinputlab/observability/budget.py +316 -0
  249. agentinputlab/observability/instrumentation.py +754 -0
  250. agentinputlab/observability/models.py +403 -0
  251. agentinputlab/observability/monitor.py +380 -0
  252. agentinputlab/optimizers/__init__.py +1 -0
  253. agentinputlab/optimizers/clarify/__init__.py +12 -0
  254. agentinputlab/optimizers/context/__init__.py +22 -0
  255. agentinputlab/optimizers/decompose/__init__.py +64 -0
  256. agentinputlab/optimizers/evidence/__init__.py +22 -0
  257. agentinputlab/optimizers/rewrite/__init__.py +30 -0
  258. agentinputlab/parity/__init__.py +5 -0
  259. agentinputlab/parity/base.py +206 -0
  260. agentinputlab/production_campaign.py +763 -0
  261. agentinputlab/py.typed +1 -0
  262. agentinputlab/recipes/__init__.py +333 -0
  263. agentinputlab/recipes/ace.py +418 -0
  264. agentinputlab/recipes/ace_bfcl.py +273 -0
  265. agentinputlab/recipes/ace_common_support.py +169 -0
  266. agentinputlab/recipes/ace_native_plan.py +322 -0
  267. agentinputlab/recipes/ace_online.py +711 -0
  268. agentinputlab/recipes/ace_retrieval.py +330 -0
  269. agentinputlab/recipes/ace_statebench.py +382 -0
  270. agentinputlab/recipes/ace_tau.py +463 -0
  271. agentinputlab/recipes/ace_toolsandbox.py +432 -0
  272. agentinputlab/recipes/acon_guideline.py +22 -0
  273. agentinputlab/recipes/adaptive_rag.py +822 -0
  274. agentinputlab/recipes/llmlingua2_inference.py +146 -0
  275. agentinputlab/recipes/llmlingua2_training.py +796 -0
  276. agentinputlab/recipes/mce.py +1486 -0
  277. agentinputlab/recipes/mce_final.py +335 -0
  278. agentinputlab/recipes/mce_text_fit.py +499 -0
  279. agentinputlab/recipes/mce_text_only.py +298 -0
  280. agentinputlab/recipes/qrag.py +729 -0
  281. agentinputlab/recipes/qrag_inference.py +364 -0
  282. agentinputlab/recipes/r2ag_features.py +236 -0
  283. agentinputlab/recipes/r2ag_inference.py +503 -0
  284. agentinputlab/recipes/r2ag_training.py +948 -0
  285. agentinputlab/recipes/recomp_abstractive.py +592 -0
  286. agentinputlab/recipes/recomp_extractive.py +525 -0
  287. agentinputlab/recipes/reformer.py +17 -0
  288. agentinputlab/recipes/rqrag.py +1516 -0
  289. agentinputlab/recipes/rqrag_common_support.py +193 -0
  290. agentinputlab/recipes/rqrag_completion.py +147 -0
  291. agentinputlab/recipes/skillopt.py +462 -0
  292. agentinputlab/recipes/skillopt_common_support.py +154 -0
  293. agentinputlab/recipes/skillopt_environment.py +165 -0
  294. agentinputlab/recipes/skillopt_environment_cli.py +5 -0
  295. agentinputlab/recipes/skillopt_retrieval.py +188 -0
  296. agentinputlab/recipes/smartsearch.py +897 -0
  297. agentinputlab/recipes/smartsearch_curriculum.py +283 -0
  298. agentinputlab/recipes/smartsearch_grpo_contracts.py +58 -0
  299. agentinputlab/recipes/smartsearch_grpo_data.py +314 -0
  300. agentinputlab/recipes/smartsearch_grpo_meter.py +324 -0
  301. agentinputlab/recipes/smartsearch_grpo_prefix.py +144 -0
  302. agentinputlab/recipes/smartsearch_grpo_rollout.py +119 -0
  303. agentinputlab/recipes/smartsearch_grpo_tools.py +364 -0
  304. agentinputlab/recipes/smartsearch_grpo_training.py +305 -0
  305. agentinputlab/recipes/smartsearch_grpo_transport.py +248 -0
  306. agentinputlab/recipes/smartsearch_grpo_worker.py +364 -0
  307. agentinputlab/recipes/smartsearch_inference.py +524 -0
  308. agentinputlab/recipes/smartsearch_native_data.py +172 -0
  309. agentinputlab/recipes/smartsearch_policy.py +616 -0
  310. agentinputlab/recipes/smartsearch_policy_worker.py +9 -0
  311. agentinputlab/recipes/smartsearch_sampling.py +232 -0
  312. agentinputlab/recipes/smartsearch_teacher.py +203 -0
  313. agentinputlab/recipes/smartsearch_training.py +265 -0
  314. agentinputlab/registry/__init__.py +46 -0
  315. agentinputlab/registry/beta.py +727 -0
  316. agentinputlab/registry/data/algorithms.json +1959 -0
  317. agentinputlab/registry/data/auxiliary_method_profiles.json +34 -0
  318. agentinputlab/registry/loader.py +100 -0
  319. agentinputlab/registry/result_manifest.py +184 -0
  320. agentinputlab/registry/runtime.py +195 -0
  321. agentinputlab/registry/schema.py +449 -0
  322. agentinputlab/runner/__init__.py +30 -0
  323. agentinputlab/runner/balance.py +248 -0
  324. agentinputlab/runner/cache.py +135 -0
  325. agentinputlab/runner/composite.py +130 -0
  326. agentinputlab/runner/engine.py +285 -0
  327. agentinputlab/runner/runtime_guard.py +268 -0
  328. agentinputlab/runner/worker.py +80 -0
  329. agentinputlab/runtime_bootstrap.py +288 -0
  330. agentinputlab/selectors/__init__.py +196 -0
  331. agentinputlab/selectors/advanced.py +1514 -0
  332. agentinputlab/selectors/artifacts.py +1087 -0
  333. agentinputlab/selectors/base.py +112 -0
  334. agentinputlab/selectors/campaigns.py +1893 -0
  335. agentinputlab/selectors/catalog.py +86 -0
  336. agentinputlab/selectors/discovery.py +1860 -0
  337. agentinputlab/selectors/evaluation.py +1348 -0
  338. agentinputlab/selectors/features.py +383 -0
  339. agentinputlab/selectors/learned.py +502 -0
  340. agentinputlab/selectors/no_op.py +28 -0
  341. agentinputlab/selectors/outcome_table.py +475 -0
  342. agentinputlab/selectors/producer.py +853 -0
  343. agentinputlab/selectors/rules.py +109 -0
  344. agentinputlab/selectors/runtime.py +420 -0
  345. agentinputlab/studies/__init__.py +16 -0
  346. agentinputlab/studies/design.py +165 -0
  347. agentinputlab/studies/paired.py +322 -0
  348. agentinputlab/studio/__init__.py +6 -0
  349. agentinputlab/studio/campaigns.py +819 -0
  350. agentinputlab/studio/engine.py +1408 -0
  351. agentinputlab/studio/model_backends.py +425 -0
  352. agentinputlab/studio/prepared.py +410 -0
  353. agentinputlab/studio/server.py +613 -0
  354. agentinputlab/studio/static/app.js +397 -0
  355. agentinputlab/studio/static/campaigns.html +175 -0
  356. agentinputlab/studio/static/campaigns.js +426 -0
  357. agentinputlab/studio/static/index.html +192 -0
  358. agentinputlab/studio/static/result.html +103 -0
  359. agentinputlab/studio/static/result.js +273 -0
  360. agentinputlab/studio/static/styles.css +467 -0
  361. agentinputlab-0.1.0a1.data/data/share/agentinputlab/CITATION.cff +22 -0
  362. agentinputlab-0.1.0a1.dist-info/METADATA +392 -0
  363. agentinputlab-0.1.0a1.dist-info/RECORD +469 -0
  364. agentinputlab-0.1.0a1.dist-info/WHEEL +5 -0
  365. agentinputlab-0.1.0a1.dist-info/entry_points.txt +6 -0
  366. agentinputlab-0.1.0a1.dist-info/licenses/LICENSE +21 -0
  367. agentinputlab-0.1.0a1.dist-info/licenses/NOTICE +31 -0
  368. agentinputlab-0.1.0a1.dist-info/licenses/THIRD_PARTY_NOTICES.md +94 -0
  369. agentinputlab-0.1.0a1.dist-info/top_level.txt +2 -0
  370. workers/README.md +94 -0
  371. workers/ace/README.md +261 -0
  372. workers/ace/__init__.py +1 -0
  373. workers/ace/compatibility_manifest.json +39 -0
  374. workers/ace/driver.py +1682 -0
  375. workers/acon/README.md +215 -0
  376. workers/acon/__init__.py +5 -0
  377. workers/acon/compatibility_manifest.json +93 -0
  378. workers/acon/driver.py +1859 -0
  379. workers/acon/fitted.py +395 -0
  380. workers/acon/guideline.py +470 -0
  381. workers/acon/guideline_source_manifest.json +20 -0
  382. workers/adaptive_rag/README.md +96 -0
  383. workers/adaptive_rag/__init__.py +15 -0
  384. workers/adaptive_rag/compatibility_manifest.json +61 -0
  385. workers/adaptive_rag/driver.py +1470 -0
  386. workers/adaptive_rag/fixture_runtime.py +163 -0
  387. workers/adaptive_rag/runtime.py +252 -0
  388. workers/ask_or_assume/README.md +124 -0
  389. workers/ask_or_assume/__init__.py +1 -0
  390. workers/ask_or_assume/compatibility_manifest.json +36 -0
  391. workers/ask_or_assume/driver.py +1227 -0
  392. workers/decomp/README.md +133 -0
  393. workers/decomp/UPSTREAM_LICENSE.Apache-2.0.txt +201 -0
  394. workers/decomp/__init__.py +5 -0
  395. workers/decomp/compatibility_manifest.json +205 -0
  396. workers/decomp/driver.py +1015 -0
  397. workers/decomp/live.py +137 -0
  398. workers/decomp/runtime.py +231 -0
  399. workers/infocqr/README.md +106 -0
  400. workers/infocqr/__init__.py +1 -0
  401. workers/infocqr/compatibility_manifest.json +84 -0
  402. workers/infocqr/driver.py +1766 -0
  403. workers/ircot/README.md +167 -0
  404. workers/ircot/__init__.py +7 -0
  405. workers/ircot/compatibility_manifest.json +121 -0
  406. workers/ircot/controlled.py +457 -0
  407. workers/ircot/driver.py +1373 -0
  408. workers/ircot/fixture_bindings.json +39 -0
  409. workers/ircot/fixture_config.json +48 -0
  410. workers/ircot/fixture_prompt.txt +2 -0
  411. workers/ircot/native_qa.py +398 -0
  412. workers/ircot/qa_compatibility_manifest.json +57 -0
  413. workers/ircot/runtime.py +97 -0
  414. workers/llmcompiler/README.md +160 -0
  415. workers/llmcompiler/__init__.py +1 -0
  416. workers/llmcompiler/compatibility_manifest.json +45 -0
  417. workers/llmcompiler/driver.py +1514 -0
  418. workers/llmcompiler/export_prompts.py +74 -0
  419. workers/llmcompiler/live.py +174 -0
  420. workers/llmcompiler/patch_manifest.json +147 -0
  421. workers/mce/README.md +198 -0
  422. workers/mce/__init__.py +29 -0
  423. workers/mce/compatibility_manifest.json +115 -0
  424. workers/mce/driver.py +2585 -0
  425. workers/mce/final_eval.py +173 -0
  426. workers/official_arenas/README.md +25 -0
  427. workers/official_arenas/__init__.py +1 -0
  428. workers/official_arenas/capture_records.py +110 -0
  429. workers/official_arenas/driver.py +619 -0
  430. workers/official_arenas/protocol.py +334 -0
  431. workers/official_arenas/providers/__init__.py +1 -0
  432. workers/official_arenas/providers/_live_history.py +228 -0
  433. workers/official_arenas/providers/_message_compat.py +77 -0
  434. workers/official_arenas/providers/appworld_ul.py +196 -0
  435. workers/official_arenas/providers/fixture.py +112 -0
  436. workers/official_arenas/providers/statebench.py +960 -0
  437. workers/official_arenas/providers/tau3.py +1672 -0
  438. workers/official_arenas/providers/tau_retail.py +586 -0
  439. workers/official_arenas/providers/toolsandbox.py +1321 -0
  440. workers/official_arenas/providers/tooltalk.py +699 -0
  441. workers/official_arenas/retail_capture.py +188 -0
  442. workers/official_arenas/retail_driver.py +275 -0
  443. workers/qrag/README.md +172 -0
  444. workers/qrag/__init__.py +1 -0
  445. workers/qrag/compatibility_manifest.json +64 -0
  446. workers/qrag/driver.py +673 -0
  447. workers/r2ag/README.md +154 -0
  448. workers/r2ag/__init__.py +5 -0
  449. workers/r2ag/compatibility_manifest.json +55 -0
  450. workers/r2ag/driver.py +1287 -0
  451. workers/r2ag/feature_schema.json +8 -0
  452. workers/r2ag/runtime.py +589 -0
  453. workers/recomp/README.md +120 -0
  454. workers/recomp/__init__.py +1 -0
  455. workers/recomp/compatibility_manifest.json +43 -0
  456. workers/recomp/driver.py +1653 -0
  457. workers/reformer/README.md +125 -0
  458. workers/reformer/__init__.py +1 -0
  459. workers/reformer/compatibility_manifest.json +68 -0
  460. workers/reformer/driver.py +1459 -0
  461. workers/reformer/induction.py +457 -0
  462. workers/rrr/README.md +126 -0
  463. workers/rrr/__init__.py +1 -0
  464. workers/rrr/compatibility_manifest.json +57 -0
  465. workers/rrr/driver.py +1133 -0
  466. workers/smartsearch/README.md +331 -0
  467. workers/smartsearch/__init__.py +1 -0
  468. workers/smartsearch/compatibility_manifest.json +41 -0
  469. workers/smartsearch/driver.py +1643 -0
@@ -0,0 +1,121 @@
1
+ const state = { status: null, version: null, items: [], annotations: new Map(), index: 0 };
2
+ const fields = {
3
+ input_audit: [
4
+ "unclear_or_misaligned_request", "decomposition_need", "missing_external_evidence",
5
+ "clarification_need", "context_overload_or_noise", "low_defect_state",
6
+ "reformulate_eligible", "decompose_eligible", "acquire_eligible",
7
+ "clarify_eligible", "curate_eligible"
8
+ ],
9
+ trajectory_audit: ["overall_contract_valid", "entity_preserved", "numeric_preserved", "constraint_preserved", "task_drift"]
10
+ };
11
+ const zh = {
12
+ unclear_or_misaligned_request:"请求不清晰或表达错位", decomposition_need:"需要任务分解", missing_external_evidence:"缺少外部证据",
13
+ clarification_need:"需要澄清", context_overload_or_noise:"上下文过载或噪声", low_defect_state:"低缺陷输入",
14
+ reformulate_eligible:"可使用 Reformulate", decompose_eligible:"可使用 Decompose", acquire_eligible:"可使用 Acquire",
15
+ clarify_eligible:"可使用 Clarify", curate_eligible:"可使用 Curate", overall_contract_valid:"整体 contract 有效",
16
+ entity_preserved:"实体保持", numeric_preserved:"数值保持", constraint_preserved:"约束保持", task_drift:"发生 task drift"
17
+ };
18
+
19
+ async function api(path, options={}) {
20
+ const response = await fetch(path, {headers:{"Content-Type":"application/json"}, ...options});
21
+ const body = await response.json();
22
+ if (!response.ok) throw new Error(body.error?.message || "请求失败");
23
+ return body;
24
+ }
25
+ function toast(message) { const el=document.querySelector("#toast"); el.textContent=message; el.classList.add("show"); setTimeout(()=>el.classList.remove("show"),1800); }
26
+ function completed(version) { return version.status === "complete"; }
27
+
28
+ async function loadStatus() {
29
+ state.status = await api("/api/status");
30
+ const select=document.querySelector("#version-select");
31
+ select.innerHTML='<option value="">请选择</option>';
32
+ state.status.versions.forEach(v => {
33
+ const option=document.createElement("option"); option.value=v.version_id;
34
+ option.textContent=`${v.version_id} · ${v.status} · ${v.annotation_count}/${v.item_count}`;
35
+ if (v.version_id === state.status.selected_version) option.textContent += " · 已选";
36
+ select.append(option);
37
+ });
38
+ const message=document.querySelector("#version-message");
39
+ message.textContent=state.status.completed_version_exists
40
+ ? "检测到已完成标注。请明确复用一个完成版本,或新建一个不会覆盖旧结果的重标版本。"
41
+ : "尚无完成标注。可以继续未完成版本,或新建第一个标注版本。";
42
+ }
43
+
44
+ async function openVersion(versionId) {
45
+ const payload=await api(`/api/versions/${versionId}`);
46
+ state.version=payload.manifest; state.items=payload.items;
47
+ state.annotations=new Map(payload.annotations.map(row=>[row.item_id,row]));
48
+ state.index=Math.max(0,state.items.findIndex(item=>!state.annotations.has(item.item_id)));
49
+ if (state.index < 0) state.index=0;
50
+ document.querySelector("#workspace").hidden=completed(state.version);
51
+ document.querySelector("#complete-panel").hidden=completed(state.version) || state.annotations.size !== state.items.length;
52
+ document.querySelector("#version-label").textContent=`${state.version.version_id} · ${state.version.status}`;
53
+ if (completed(state.version)) {
54
+ await api("/api/selection",{method:"POST",body:JSON.stringify({version_id:versionId})});
55
+ toast("已选择完成版本供后续实验与绘图使用"); await loadStatus(); return;
56
+ }
57
+ renderList(); renderItem(); updateProgress();
58
+ }
59
+
60
+ function renderList() {
61
+ const list=document.querySelector("#item-list"); list.innerHTML="";
62
+ state.items.forEach((item,index)=>{
63
+ const button=document.createElement("button"); button.type="button";
64
+ button.className=`item-link${index===state.index?" active":""}${state.annotations.has(item.item_id)?" done":""}`;
65
+ button.innerHTML=`<b>${String(index+1).padStart(3,"0")}</b><span></span><i></i>`;
66
+ button.querySelector("span").textContent=item.item_id;
67
+ button.addEventListener("click",()=>{state.index=index;renderList();renderItem();}); list.append(button);
68
+ });
69
+ }
70
+ function renderItem() {
71
+ const item=state.items[state.index]; const prior=state.annotations.get(item.item_id);
72
+ document.querySelector("#item-kind").textContent=state.status.kind.replace("_"," · ").toUpperCase();
73
+ document.querySelector("#item-title").textContent=`${state.index+1}. ${item.item_id}`;
74
+ const visible={...item}; delete visible.item_id; delete visible.audit_item_id;
75
+ document.querySelector("#item-content").textContent=JSON.stringify(visible,null,2);
76
+ const container=document.querySelector("#label-fields"); container.innerHTML="";
77
+ fields[state.status.kind].forEach(name=>{
78
+ const row=document.createElement("div"); row.className="label-row";
79
+ const label=document.createElement("label"); label.textContent=zh[name] || name;
80
+ const select=document.createElement("select"); select.name=name; select.required=true;
81
+ const options=state.status.kind==="input_audit" ? ["","yes","no","uncertain"] : ["","yes","no","uncertain"];
82
+ options.forEach(value=>{const option=document.createElement("option");option.value=value;option.textContent=value||"请选择";select.append(option);});
83
+ if (prior) select.value=String(prior.labels[name] ?? "");
84
+ row.append(label,select); container.append(row);
85
+ });
86
+ document.querySelector("#notes").value=prior?.notes || "";
87
+ const status=document.querySelector("#save-state"); status.textContent=prior?"已保存":"未保存"; status.classList.toggle("saved",Boolean(prior));
88
+ document.querySelector("#previous-button").disabled=state.index===0;
89
+ }
90
+ function updateProgress() {
91
+ const count=state.annotations.size,total=state.items.length;
92
+ document.querySelector("#progress-number").textContent=`${count} / ${total}`;
93
+ document.querySelector("#progress-bar").style.width=`${total?100*count/total:0}%`;
94
+ document.querySelector("#complete-panel").hidden=count!==total;
95
+ }
96
+
97
+ document.querySelector("#new-button").addEventListener("click",async()=>{
98
+ try {
99
+ if (state.status.completed_version_exists && !confirm("已有完成版本。确认新建一个独立的重标版本吗?旧版不会被覆盖。")) return;
100
+ const created=await api("/api/versions",{method:"POST",body:JSON.stringify({action:"new",annotator_id:document.querySelector("#annotator-id").value})});
101
+ await loadStatus(); document.querySelector("#version-select").value=created.version_id; await openVersion(created.version_id);
102
+ } catch(error){toast(error.message);}
103
+ });
104
+ document.querySelector("#resume-button").addEventListener("click",async()=>{
105
+ const id=document.querySelector("#version-select").value; if(!id){toast("请先选择版本");return;} try{await openVersion(id);}catch(error){toast(error.message);}
106
+ });
107
+ document.querySelector("#annotation-form").addEventListener("submit",async event=>{
108
+ event.preventDefault(); const item=state.items[state.index]; const labels={};
109
+ for(const select of document.querySelectorAll("#label-fields select")){if(!select.value){toast("请完成所有标签");return;}labels[select.name]=select.value;}
110
+ try {
111
+ await api(`/api/versions/${state.version.version_id}/annotations`,{method:"POST",body:JSON.stringify({item_id:item.item_id,labels,notes:document.querySelector("#notes").value})});
112
+ const payload=await api(`/api/versions/${state.version.version_id}`); state.annotations=new Map(payload.annotations.map(row=>[row.item_id,row]));
113
+ if(state.index<state.items.length-1)state.index+=1; renderList();renderItem();updateProgress();toast("已自动保存");
114
+ } catch(error){toast(error.message);}
115
+ });
116
+ document.querySelector("#previous-button").addEventListener("click",()=>{if(state.index>0){state.index-=1;renderList();renderItem();}});
117
+ document.querySelector("#complete-button").addEventListener("click",async()=>{
118
+ try{await api(`/api/versions/${state.version.version_id}/complete`,{method:"POST",body:"{}"});await api("/api/selection",{method:"POST",body:JSON.stringify({version_id:state.version.version_id})});toast("版本已冻结并选中");await loadStatus();await openVersion(state.version.version_id);}catch(error){toast(error.message);}
119
+ });
120
+
121
+ loadStatus().catch(error=>toast(error.message));
@@ -0,0 +1,60 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="color-scheme" content="light">
7
+ <title>AgentInputLab Audit</title>
8
+ <link rel="stylesheet" href="/styles.css">
9
+ <script src="/app.js" defer></script>
10
+ </head>
11
+ <body>
12
+ <header>
13
+ <div><span class="mark">AI</span><strong>AgentInputLab</strong><small>Measurement Audit</small></div>
14
+ <p>自动测量先运行,人工审计只验证可信度</p>
15
+ </header>
16
+ <main>
17
+ <section class="intro">
18
+ <div><p class="eyebrow">VERSIONED · LOCAL · AUTO-SAVE</p><h1>标注审计工作台</h1></div>
19
+ <div class="progress"><b id="progress-number">0 / 0</b><span><i id="progress-bar"></i></span><small id="version-label">尚未选择版本</small></div>
20
+ </section>
21
+
22
+ <section class="version-panel" id="version-panel">
23
+ <div><p class="eyebrow">01 / VERSION</p><h2>选择已有结果,或新建重标版本</h2></div>
24
+ <p id="version-message">正在检查已有标注……</p>
25
+ <div class="version-actions">
26
+ <label>已有版本<select id="version-select"><option value="">无</option></select></label>
27
+ <button id="resume-button" class="secondary" type="button">打开 / 复用</button>
28
+ <label>标注者<input id="annotator-id" value="annotator_a" maxlength="80"></label>
29
+ <button id="new-button" class="primary" type="button">新建重标版本</button>
30
+ </div>
31
+ <small>完成版本不可覆盖。重标会自动命名为新的 vNNN;后续实验与绘图读取显式选择 receipt。</small>
32
+ </section>
33
+
34
+ <section class="workspace" id="workspace" hidden>
35
+ <aside>
36
+ <p class="eyebrow">AUDIT QUEUE</p>
37
+ <div id="item-list" class="item-list"></div>
38
+ </aside>
39
+ <article>
40
+ <div class="item-header"><div><p class="eyebrow" id="item-kind">ITEM</p><h2 id="item-title">—</h2></div><span id="save-state">未保存</span></div>
41
+ <div id="item-content" class="content-card"></div>
42
+ <form id="annotation-form">
43
+ <div id="label-fields" class="label-grid"></div>
44
+ <label class="notes">备注(可选)<textarea id="notes" maxlength="4000" rows="4"></textarea></label>
45
+ <div class="form-actions">
46
+ <button id="previous-button" type="button" class="secondary">← 上一条</button>
47
+ <button id="save-button" type="submit" class="primary">保存并下一条 →</button>
48
+ </div>
49
+ </form>
50
+ </article>
51
+ </section>
52
+ <section class="complete-panel" id="complete-panel" hidden>
53
+ <div><p class="eyebrow">03 / FREEZE</p><h2>冻结并选择本版标注</h2></div>
54
+ <p>全部条目已自动保存。冻结后本版不可修改,并可显式选择为后续验证、实验导出和绘图所使用的人工审计版本。</p>
55
+ <button id="complete-button" class="primary" type="button">完成、冻结并选择</button>
56
+ </section>
57
+ </main>
58
+ <div id="toast" role="status"></div>
59
+ </body>
60
+ </html>
@@ -0,0 +1,2 @@
1
+ :root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#202923;background:#f5f6f2;--accent:#176657;--muted:#657169;--line:#dce1d9}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer;border:1px solid #bcc9bf;background:white;color:#263b30;border-radius:5px;padding:10px 17px;min-height:42px;transition:background .15s,transform .15s}button:hover{background:#edf3ed}button:active{transform:translateY(1px)}button.primary{background:var(--accent);color:white;border-color:var(--accent)}button:disabled{cursor:default;opacity:.5}header{height:64px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 32px;background:#fff}header span{font-weight:400;color:var(--muted);margin-left:12px}main{max-width:1500px;margin:auto}#login{max-width:570px;margin:72px auto;padding:0 24px}h1{font-size:32px;line-height:1.25;letter-spacing:-.025em;margin:8px 0 20px}.eyebrow{font:600 11px ui-monospace,monospace;color:var(--accent);letter-spacing:.1em}p{line-height:1.7}#login>p:not(.eyebrow),.footnote{color:var(--muted)}#login-form{display:grid;gap:20px;margin-top:32px}label{display:grid;gap:8px;font-size:14px}input,textarea{width:100%;border:1px solid #b9c5bb;padding:11px 12px;border-radius:5px;background:#fff;color:#202923}input:focus,textarea:focus,button:focus-visible,summary:focus-visible{outline:3px solid #91c2ac;outline-offset:2px}.check{display:flex;align-items:flex-start;font-size:13px;line-height:1.6}.check input{width:18px;flex-shrink:0;margin-top:3px}.notice{font-size:12px;line-height:1.7;border-top:1px solid var(--line);padding-top:20px;margin-top:32px;color:var(--muted)}#workspace{display:grid;grid-template-columns:270px minmax(0,1fr);min-height:calc(100vh - 64px)}nav{padding:28px 20px;border-right:1px solid var(--line);background:#eff2eb;position:sticky;top:0;max-height:calc(100vh - 64px);overflow:auto}.nav-heading{display:flex;justify-content:space-between;font-size:13px}progress{width:100%;height:5px;margin:14px 0 28px;accent-color:var(--accent)}#search label{font-size:12px;margin-bottom:8px}.search{display:flex;gap:6px}.search input{min-width:0}.search button{padding:8px 12px}#samples{display:grid;gap:2px;margin-top:24px}.sample{display:flex;justify-content:space-between;background:transparent;border:0;border-radius:3px;text-align:left;padding:8px 12px;font-size:13px}.sample.active{background:#d9e6d9;color:#174332}.sample em{font-style:normal;font-size:11px;color:var(--muted)}article{padding:34px 42px;background:#fff;max-width:1100px}.item-heading{display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid var(--line)}.item-heading h1{font-size:27px}#save-state{font-size:12px;color:var(--muted);text-align:right}.rubric{padding:14px 0;border-bottom:1px solid var(--line);font-size:13px;color:var(--muted)}summary{cursor:pointer;color:var(--accent)}#visible{margin:24px 0}#visible h2{font-size:13px;font-weight:600;color:var(--muted);margin:20px 0 9px}#visible pre{white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.75 ui-monospace,Menlo,monospace;margin:0;padding:16px 18px;background:#f4f6f2;border-left:2px solid #b6c8b9;max-height:420px;overflow:auto}.question{border-top:1px solid var(--line);padding:18px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px}.question h3{font-size:14px;margin:0 0 6px}.question p{font-size:12px;color:var(--muted);margin:0;max-width:600px}.choices{display:flex;align-items:center;gap:5px}.choices label{display:block;position:relative}.choices input{position:absolute;opacity:0;width:1px}.choices span{display:block;border:1px solid #c9d4cb;border-radius:4px;padding:8px 12px;font-size:13px;transition:background .15s;cursor:pointer}.choices input:checked+span{background:#deece2;color:#174332;border-color:var(--accent)}.choices input:focus-visible+span{outline:3px solid #91c2ac}.notes{margin-top:22px}.actions{display:flex;justify-content:space-between;gap:12px;margin-top:20px}.footnote{font-size:12px}#message{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#21392a;color:#fff;padding:12px 22px;border-radius:5px;max-width:90vw;box-shadow:0 4px 12px #0002;animation:appear .18s ease-out}@keyframes appear{from{opacity:0;bottom:18px}to{opacity:1;bottom:24px}}@media(max-width:850px){header{padding:0 20px}header span{display:block;font-size:11px;margin:4px 0}#workspace{grid-template-columns:1fr}nav{position:static;max-height:245px;border-right:0;border-bottom:1px solid var(--line)}#samples{grid-template-columns:repeat(3,1fr)}article{padding:24px 20px}.question{grid-template-columns:1fr}.choices{justify-content:flex-start}.item-heading{align-items:flex-start}.actions{flex-wrap:wrap}#login{margin:40px auto}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
2
+ .search button { white-space: nowrap; }
@@ -0,0 +1,10 @@
1
+ <!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>AgentInputLab · 独立盲评</title><link rel="stylesheet" href="/review.css"><script src="/review.js" defer></script></head><body>
2
+ <header><strong>AgentInputLab <span>/ 独立输入盲评</span></strong><button id="logout" hidden>退出</button></header>
3
+ <main><section id="login"><p class="eyebrow">HUMAN REVIEW / INPUTS ONLY</p><h1>独立判断,保留依据。</h1><p>仅展示原始可见输入。模型、方法、结果及其他人的标注均已隐藏。</p>
4
+ <form id="login-form"><label>评审 ID<input name="reviewer_id" placeholder="例如 R01" autocomplete="username" required></label><label>独立访问码<input name="code" type="password" autocomplete="current-password" required></label><label class="check"><input name="independent" type="checkbox" required>我本人独立评审,不查看或讨论他人的答案,也不使用模型代填。</label><button class="primary">进入分配样本</button></form>
5
+ <aside class="notice">研究负责人应安排至少 3 位真实评审。一个人使用 3 个 ID 不构成独立验证。访问码由负责人单独发放;本服务仅在本机开放。</aside></section>
6
+ <section id="workspace" hidden><nav><div class="nav-heading"><span id="reviewer"></span><strong id="count"></strong></div><progress id="progress" max="1" value="0"></progress><form id="search"><label for="sample-id">跳转到分配样本 ID</label><div class="search"><input id="sample-id" placeholder="S001" maxlength="4"><button>跳转</button></div></form><div id="samples"></div></nav>
7
+ <article><div class="item-heading"><div><p class="eyebrow" id="stage"></p><h1 id="item-title">请选择一个样本</h1></div><span id="save-state" role="status">尚未填写</span></div>
8
+ <p id="scope"></p><details class="rubric"><summary>判断原则与“不确定”的用法</summary><p>只依据下方可见材料;“允许某操作”不表示该操作必定成功。缺少证据时选择“不确定”,不要把未知当作“否”。锚点任务仅识别原输入中的实体/数值/约束,不评判后续执行或改写是否保留它们。第三人复核也不展示前两人的答案。</p></details>
9
+ <section id="visible"></section><form id="review-form"><div id="questions"></div><label class="notes">判断依据/原文摘录<textarea id="notes" rows="3" maxlength="4000" placeholder="简述你的依据;不确定时写明缺少什么信息。"></textarea></label><div class="actions"><button type="button" id="draft">保存草稿</button><button type="button" id="next">下一条待评</button><button class="primary" id="submit">确认并提交这条标注</button></div></form><p class="footnote">提交后不覆盖原标注。若发现错误,请联系负责人创建独立修订批次,保留原始记录。</p></article></section></main><div id="message" role="alert" hidden></div>
10
+ </body></html>
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ const $=id=>document.getElementById(id);let token=sessionStorage.getItem('input-review-token'),current=null,status=null,dirty=false,timer;
3
+ function message(text){$('message').textContent=text;$('message').hidden=false;clearTimeout(timer);timer=setTimeout(()=>$('message').hidden=true,5500);}
4
+ async function api(path,data){const response=await fetch(path,{method:data?'POST':'GET',headers:{...(data?{'Content-Type':'application/json'}:{}),...(token?{Authorization:'Bearer '+token}:{})},body:data?JSON.stringify(data):undefined});const value=await response.json();if(!response.ok)throw Error(value.error||'请求失败');return value;}
5
+ function guard(){return !dirty||confirm('还有未保存修改。确定离开这条样本?');}
6
+ async function refresh(){status=await api('/api/status');$('login').hidden=true;$('workspace').hidden=false;$('logout').hidden=false;$('reviewer').textContent=status.reviewer_id;$('count').textContent=`${status.submitted} / ${status.total}`;$('progress').max=status.total||1;$('progress').value=status.submitted;$('samples').replaceChildren();for(const row of status.items){const button=document.createElement('button');button.className='sample'+(current?.sample_id===row.sample_id?' active':'');const name=document.createElement('span');name.textContent=row.sample_id;const state=document.createElement('em');state.textContent=row.submitted?'已提交':row.draft?'草稿':row.stage==='adjudication'?'第三人复核':'待评';button.append(name,state);button.onclick=()=>load(row.sample_id);$('samples').append(button);}}
7
+ function block(title,value){if(value==null||value===''||(Array.isArray(value)&&!value.length))return;const heading=document.createElement('h2');heading.textContent=title;const pre=document.createElement('pre');pre.textContent=typeof value==='string'?value:JSON.stringify(value,null,2);$('visible').append(heading,pre);}
8
+ async function load(id){if(!guard())return;try{const data=await api('/api/items/'+encodeURIComponent(id.toUpperCase()));current=data;dirty=false;$('item-title').textContent=data.sample_id+' · '+(data.kind==='contract_anchor'?'原输入锚点':'输入缺陷与适用性');$('stage').textContent=data.stage==='adjudication'?'THIRD REVIEW / 无前两人答案':'FIRST PASS / 独立盲评';$('save-state').textContent=data.submitted?'已冻结提交':Object.keys(data.labels).length?'草稿已保存':'尚未填写';$('scope').textContent=data.kind==='contract_anchor'?'识别原输入中的实体、数值和约束,不判断后续改写或执行。':'依据现有输入判断缺陷与操作适用性,不预测得分。';$('visible').replaceChildren();block('用户请求',data.payload.query);block('指令',data.payload.instruction);block('可见上下文',data.payload.context);block('可见对话',data.payload.messages);block('可用工具名称',data.payload.tool_names);$('questions').replaceChildren();for(const field of data.fields){const div=document.createElement('div');div.className='question';const text=document.createElement('div');const heading=document.createElement('h3');heading.textContent=field.title;const help=document.createElement('p');help.textContent=field.help;text.append(heading,help);const choices=document.createElement('div');choices.className='choices';for(const [value,title] of [['yes','是'],['no','否'],['uncertain','不确定']]){const label=document.createElement('label');const input=document.createElement('input');input.type='radio';input.name=field.id;input.value=value;input.checked=data.labels[field.id]===value;input.disabled=data.submitted;input.onchange=()=>{dirty=true;$('save-state').textContent='有未保存修改';};const span=document.createElement('span');span.textContent=title;label.append(input,span);choices.append(label);}div.append(text,choices);$('questions').append(div);}$('notes').value=data.notes;$('notes').disabled=data.submitted;$('draft').disabled=$('submit').disabled=data.submitted;await refresh();}catch(error){message(error.message);}}
9
+ async function save(submit){if(!current)return message('先选择样本');const labels={};for(const field of current.fields){const value=document.querySelector(`input[name="${field.id}"]:checked`);if(value)labels[field.id]=value.value;}if(submit&&Object.keys(labels).length!==current.fields.length)return message('每项都需选择;没有证据可选“不确定”');if(submit&&!$('notes').value.trim())return message('请填写判断依据或无法判断的原因');if(submit&&!confirm('确认这是你本人独立填写的标注?提交后不能覆盖。'))return;try{const result=await api('/api/review',{sample_id:current.sample_id,labels,notes:$('notes').value,submit});dirty=false;$('save-state').textContent=(submit?'已冻结提交':'草稿已保存')+' · '+new Date(result.saved_at).toLocaleTimeString();await load(current.sample_id);message(submit?'标注已提交,原始记录已保留。':'草稿已保存。');}catch(error){message(error.message);}}
10
+ $('login-form').onsubmit=async event=>{event.preventDefault();const form=new FormData(event.target);try{const result=await api('/api/login',{reviewer_id:form.get('reviewer_id').trim(),code:form.get('code'),independent:form.has('independent')});token=result.token;sessionStorage.setItem('input-review-token',token);$('login-form').reset();await refresh();const first=status.items.find(x=>!x.submitted)||status.items[0];if(first)await load(first.sample_id);}catch(error){message(error.message);}};
11
+ $('logout').onclick=()=>{if(!guard())return;sessionStorage.removeItem('input-review-token');token=null;current=null;dirty=false;$('workspace').hidden=true;$('login').hidden=false;$('logout').hidden=true;};$('search').onsubmit=event=>{event.preventDefault();load($('sample-id').value.trim());};$('next').onclick=()=>{const next=status?.items.find(x=>!x.submitted&&x.sample_id!==current?.sample_id);if(next)load(next.sample_id);else message('当前没有其他待评样本。');};$('draft').onclick=()=>save(false);$('review-form').onsubmit=event=>{event.preventDefault();save(true);};$('notes').oninput=()=>{dirty=true;$('save-state').textContent='有未保存修改';};window.addEventListener('beforeunload',event=>{if(dirty){event.preventDefault();event.returnValue='';}});if(token)refresh().then(()=>{const first=status.items.find(x=>!x.submitted)||status.items[0];if(first)return load(first.sample_id);}).catch(()=>{$('logout').click();});
@@ -0,0 +1,55 @@
1
+ :root { --ink:#17202a; --muted:#69727d; --line:#dce2e7; --paper:#fff; --wash:#f4f6f8; --navy:#143e67; --blue:#2079c3; --teal:#16857c; --amber:#b77317; font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--ink); background:var(--wash); }
2
+ * { box-sizing:border-box; }
3
+ body { margin:0; min-width:320px; }
4
+ button,input,select,textarea { font:inherit; }
5
+ button { cursor:pointer; }
6
+ header { height:66px; display:flex; align-items:center; justify-content:space-between; padding:0 max(28px,calc((100vw - 1320px)/2)); color:#fff; background:var(--navy); }
7
+ header div { display:flex; align-items:center; gap:10px; }
8
+ header small { opacity:.65; border-left:1px solid #ffffff55; padding-left:10px; }
9
+ header p { margin:0; font-size:12px; opacity:.75; }
10
+ .mark { display:grid; width:32px; height:32px; place-items:center; font:800 11px/1 ui-monospace,monospace; background:#fff; color:var(--navy); border-radius:4px; }
11
+ main { width:min(1320px,calc(100% - 48px)); margin:36px auto 80px; }
12
+ .intro { display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:26px; }
13
+ .eyebrow { margin:0 0 7px; color:var(--blue); font:700 10px/1.2 ui-monospace,monospace; letter-spacing:.12em; }
14
+ h1,h2,p { text-wrap:pretty; }
15
+ h1 { margin:0; font-size:42px; letter-spacing:-.04em; }
16
+ h2 { margin:0; font-size:22px; letter-spacing:-.02em; }
17
+ .progress { display:grid; width:280px; gap:6px; text-align:right; }
18
+ .progress span { height:5px; overflow:hidden; background:#d9e0e5; border-radius:5px; }
19
+ .progress i { display:block; width:0; height:100%; background:var(--teal); transition:width .2s; }
20
+ .progress small { color:var(--muted); }
21
+ .version-panel,.complete-panel { display:grid; grid-template-columns:320px 1fr; gap:24px 38px; padding:28px; background:var(--paper); border:1px solid var(--line); border-top:4px solid var(--navy); box-shadow:0 10px 28px #25394d10; }
22
+ .version-panel > p,.complete-panel > p { margin:0; color:var(--muted); line-height:1.55; }
23
+ .version-panel > small { grid-column:1/-1; color:var(--muted); }
24
+ .version-actions { grid-column:1/-1; display:grid; grid-template-columns:1fr auto 1fr auto; gap:12px; align-items:end; padding-top:20px; border-top:1px solid var(--line); }
25
+ label { display:grid; gap:7px; color:#4d5863; font-size:12px; font-weight:650; }
26
+ input,select,textarea { min-height:42px; padding:10px 12px; color:var(--ink); background:#fff; border:1px solid #c9d1d8; border-radius:4px; outline:none; }
27
+ input:focus,select:focus,textarea:focus { border-color:var(--blue); box-shadow:0 0 0 3px #2079c315; }
28
+ button { min-height:42px; padding:0 17px; border-radius:4px; font-weight:700; border:1px solid transparent; }
29
+ .primary { color:#fff; background:var(--blue); }
30
+ .secondary { color:var(--navy); background:#fff; border-color:#aebac5; }
31
+ .workspace { display:grid; grid-template-columns:290px minmax(0,1fr); margin-top:26px; background:var(--paper); border:1px solid var(--line); box-shadow:0 10px 28px #25394d10; }
32
+ .workspace aside { padding:24px 18px; border-right:1px solid var(--line); background:#f8fafb; }
33
+ .item-list { display:grid; gap:6px; max-height:760px; overflow:auto; }
34
+ .item-link { display:grid; grid-template-columns:28px 1fr 8px; gap:8px; align-items:center; width:100%; min-height:42px; padding:7px 9px; text-align:left; color:#40505e; background:transparent; border:0; }
35
+ .item-link:hover,.item-link.active { background:#e8f0f7; color:var(--navy); }
36
+ .item-link b { font:600 10px ui-monospace,monospace; color:#89939d; }
37
+ .item-link span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:11px; }
38
+ .item-link i { width:7px; height:7px; border-radius:50%; background:#ccd3d8; }
39
+ .item-link.done i { background:var(--teal); }
40
+ .workspace article { padding:34px 42px 40px; }
41
+ .item-header { display:flex; justify-content:space-between; align-items:flex-start; padding-bottom:22px; border-bottom:1px solid var(--line); }
42
+ #save-state { padding:5px 8px; color:var(--amber); background:#fff6e7; font:700 9px ui-monospace,monospace; border-radius:3px; }
43
+ #save-state.saved { color:var(--teal); background:#eaf7f5; }
44
+ .content-card { margin:24px 0; padding:20px; color:#36434e; background:#f7f9fa; border-left:3px solid var(--blue); font:12px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; overflow-wrap:anywhere; max-height:340px; overflow:auto; }
45
+ .label-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 18px; }
46
+ .label-row { display:grid; grid-template-columns:1fr 130px; gap:12px; align-items:center; min-height:50px; padding:0 12px; background:#fbfcfd; border:1px solid #e2e7eb; }
47
+ .label-row label { color:#35424d; }
48
+ .label-row select { min-height:34px; padding:5px 8px; }
49
+ .notes { margin-top:20px; }
50
+ .form-actions { display:flex; justify-content:space-between; margin-top:24px; }
51
+ .complete-panel { margin-top:26px; border-top-color:var(--teal); }
52
+ .complete-panel button { grid-column:2; justify-self:start; }
53
+ #toast { position:fixed; right:24px; bottom:22px; min-width:240px; padding:13px 16px; color:#fff; background:#22313e; border-radius:4px; opacity:0; transform:translateY(8px); transition:.2s; pointer-events:none; }
54
+ #toast.show { opacity:1; transform:none; }
55
+ @media (max-width:820px) { header p{display:none}.intro{align-items:flex-start;gap:24px}.progress{width:190px}.version-panel,.complete-panel,.workspace{grid-template-columns:1fr}.version-actions{grid-template-columns:1fr}.workspace aside{border-right:0;border-bottom:1px solid var(--line)}.item-list{max-height:180px}.label-grid{grid-template-columns:1fr}.complete-panel button{grid-column:1}.workspace article{padding:28px 22px} }