luca 3.0.0 → 3.1.0
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.
- package/.github/workflows/release.yaml +1 -0
- package/CLAUDE.md +10 -2
- package/README.md +130 -112
- package/assistants/codingAssistant/CORE.md +6 -1
- package/assistants/codingAssistant/hooks.ts +1 -1
- package/assistants/inkbot/hooks.ts +1 -1
- package/assistants/inkbot/tools.ts +1 -1
- package/bun.lock +264 -321
- package/commands/audit-docs.ts +2 -2
- package/commands/build-bootstrap.ts +2 -3
- package/commands/build-python-bridge.ts +2 -3
- package/commands/build-scaffolds.ts +2 -3
- package/commands/bundle-consumer-project.ts +521 -0
- package/commands/generate-api-docs.ts +2 -2
- package/commands/inkbot.ts +2 -2
- package/commands/release.ts +2 -2
- package/commands/social.ts +137 -0
- package/commands/try-all-challenges.ts +3 -3
- package/commands/try-challenge.ts +3 -3
- package/datasets/lora/agentic-loop-session-candidates.jsonl +91 -0
- package/datasets/lora/agentic-loop-session-curation-summary.json +123 -0
- package/datasets/lora/luca-session-candidates.jsonl +29 -0
- package/datasets/lora/luca-session-curation-summary.json +121 -0
- package/datasets/lora/review-batch-1.jsonl +30 -0
- package/datasets/lora/review-manifest.json +41 -0
- package/datasets/lora/review-queue.jsonl +120 -0
- package/datasets/lora/review-schema.json +134 -0
- package/datasets/lora/review-template.jsonl +2 -0
- package/datasets/lora/review-ui.html +725 -0
- package/dist/agi/container.server.d.ts +2 -2
- package/dist/agi/features/assistant.d.ts +2 -2
- package/dist/agi/features/assistants-manager.d.ts +1 -1
- package/dist/agi/features/autonomous-assistant.d.ts +1 -1
- package/dist/agi/features/browser-use.d.ts +1 -1
- package/dist/agi/features/claude-code.d.ts +1 -1
- package/dist/agi/features/conversation-history.d.ts +2 -2
- package/dist/agi/features/conversation.d.ts +1 -1
- package/dist/agi/features/docs-reader.d.ts +1 -1
- package/dist/agi/features/file-tools.d.ts +1 -1
- package/dist/agi/features/luca-coder.d.ts +1 -1
- package/dist/agi/features/openai-codex.d.ts +1 -1
- package/dist/agi/features/skills-library.d.ts +1 -1
- package/dist/clients/civitai/index.d.ts +4 -4
- package/dist/clients/client-template.d.ts +4 -4
- package/dist/clients/comfyui/index.d.ts +2 -2
- package/dist/clients/elevenlabs/index.d.ts +2 -2
- package/dist/clients/openai/index.d.ts +2 -2
- package/dist/clients/supabase/index.d.ts +3 -3
- package/dist/command.d.ts +1 -1
- package/dist/node/container.d.ts +1 -1
- package/dist/node/features/helpers.d.ts +3 -3
- package/dist/node/features/semantic-search.d.ts +1 -1
- package/dist/node/features/vm.d.ts +3 -3
- package/dist/node.d.ts +1 -1
- package/dist/scaffolds/generated.d.ts +1 -1
- package/dist/selector.d.ts +1 -1
- package/features/cipher-social.ts +493 -0
- package/index.html +217 -190
- package/luca.console.ts +1 -1
- package/package.json +7 -2
- package/public/index.html +217 -190
- package/public/slides-ai-native.html +1 -1
- package/public/slides-intro.html +2 -2
- package/scripts/curate-claude-sessions.ts +561 -0
- package/scripts/examples/ask-luca-expert.ts +1 -1
- package/scripts/examples/assistant-questions.ts +1 -1
- package/scripts/examples/excalidraw-expert.ts +1 -1
- package/scripts/examples/file-manager.ts +1 -1
- package/scripts/examples/ideas.ts +1 -1
- package/scripts/examples/interactive-chat.ts +1 -1
- package/scripts/examples/opening-a-web-browser.ts +1 -1
- package/scripts/examples/telegram-bot.ts +1 -1
- package/scripts/examples/using-assistant-with-mcp.ts +1 -1
- package/scripts/examples/using-claude-code.ts +1 -1
- package/scripts/examples/using-contentdb.ts +2 -2
- package/scripts/examples/using-conversations.ts +1 -1
- package/scripts/examples/using-disk-cache.ts +1 -1
- package/scripts/examples/using-docker-shell.ts +1 -1
- package/scripts/examples/using-elevenlabs.ts +1 -1
- package/scripts/examples/using-google-calendar.ts +1 -1
- package/scripts/examples/using-google-docs.ts +1 -1
- package/scripts/examples/using-google-drive.ts +1 -1
- package/scripts/examples/using-google-sheets.ts +1 -1
- package/scripts/examples/using-nlp.ts +1 -1
- package/scripts/examples/using-ollama.ts +1 -1
- package/scripts/examples/using-postgres.ts +1 -1
- package/scripts/examples/using-runpod.ts +1 -1
- package/scripts/examples/using-tts.ts +1 -1
- package/scripts/scaffold.ts +5 -5
- package/scripts/scratch.ts +1 -1
- package/scripts/test-assistant-hooks.ts +1 -1
- package/scripts/test-docs-reader.ts +1 -1
- package/src/agi/container.server.ts +6 -2
- package/src/agi/features/agent-memory.ts +25 -25
- package/src/agi/features/assistant.ts +34 -5
- package/src/agi/features/assistants-manager.ts +122 -6
- package/src/agi/features/autonomous-assistant.ts +1 -1
- package/src/agi/features/browser-use.ts +20 -1
- package/src/agi/features/claude-code.ts +51 -5
- package/src/agi/features/coding-tools.ts +1 -1
- package/src/agi/features/conversation-history.ts +181 -4
- package/src/agi/features/conversation.ts +186 -15
- package/src/agi/features/docs-reader.ts +2 -2
- package/src/agi/features/file-tools.ts +49 -2
- package/src/agi/features/luca-coder.ts +7 -5
- package/src/agi/features/mcp-bridge.ts +532 -0
- package/src/agi/features/openai-codex.ts +2 -2
- package/src/agi/features/skills-library.ts +131 -52
- package/src/agi/lib/token-counter.ts +80 -0
- package/src/bootstrap/generated.ts +56 -57
- package/src/browser.ts +1 -1
- package/src/cli/build-info.ts +2 -2
- package/src/cli/cli.ts +2 -2
- package/src/clients/civitai/index.ts +5 -5
- package/src/clients/client-template.ts +4 -4
- package/src/clients/comfyui/index.ts +4 -4
- package/src/clients/elevenlabs/index.ts +4 -4
- package/src/clients/openai/index.ts +7 -7
- package/src/clients/supabase/index.ts +4 -4
- package/src/clients/voicebox/index.ts +4 -4
- package/src/command.ts +2 -1
- package/src/commands/chat.ts +1 -0
- package/src/commands/eval.ts +2 -56
- package/src/commands/introspect.ts +1 -1
- package/src/commands/prompt.ts +41 -9
- package/src/container-describer.ts +8 -1
- package/src/container.ts +13 -0
- package/src/entity.ts +2 -2
- package/src/helper.ts +1 -1
- package/src/introspection/generated.agi.ts +29596 -27654
- package/src/introspection/generated.node.ts +20284 -19247
- package/src/introspection/generated.web.ts +605 -584
- package/src/introspection/scan.ts +11 -6
- package/src/node/container.ts +9 -1
- package/src/node/features/content-db.ts +39 -2
- package/src/node/features/display-result.ts +57 -0
- package/src/node/features/helpers.ts +46 -7
- package/src/node/features/python.ts +25 -19
- package/src/node/features/repl.ts +1 -1
- package/src/node/features/secure-shell.ts +11 -17
- package/src/node/features/semantic-search.ts +2 -2
- package/src/node/features/socket-repl.ts +336 -0
- package/src/node/features/telnyx-assistant-connector.ts +1206 -0
- package/src/node/features/transpiler.ts +2 -3
- package/src/node/features/ui.ts +5 -0
- package/src/node/features/vm.ts +20 -3
- package/src/node.ts +3 -3
- package/src/python/generated.ts +0 -1
- package/src/scaffolds/generated.ts +82 -83
- package/src/selector.ts +1 -1
- package/src/servers/express.ts +1 -1
- package/src/web/features/helpers.ts +22 -0
- package/tsconfig.json +12 -12
- package/docs/CLI.md +0 -335
- package/docs/CNAME +0 -1
- package/docs/README.md +0 -60
- package/docs/TABLE-OF-CONTENTS.md +0 -183
- package/docs/apis/clients/elevenlabs.md +0 -308
- package/docs/apis/clients/graph.md +0 -107
- package/docs/apis/clients/openai.md +0 -429
- package/docs/apis/clients/rest.md +0 -161
- package/docs/apis/clients/websocket.md +0 -174
- package/docs/apis/features/agi/assistant.md +0 -625
- package/docs/apis/features/agi/assistants-manager.md +0 -282
- package/docs/apis/features/agi/auto-assistant.md +0 -279
- package/docs/apis/features/agi/browser-use.md +0 -802
- package/docs/apis/features/agi/claude-code.md +0 -884
- package/docs/apis/features/agi/conversation-history.md +0 -364
- package/docs/apis/features/agi/conversation.md +0 -548
- package/docs/apis/features/agi/docs-reader.md +0 -99
- package/docs/apis/features/agi/file-tools.md +0 -163
- package/docs/apis/features/agi/luca-coder.md +0 -407
- package/docs/apis/features/agi/openai-codex.md +0 -396
- package/docs/apis/features/agi/openapi.md +0 -138
- package/docs/apis/features/agi/semantic-search.md +0 -387
- package/docs/apis/features/agi/skills-library.md +0 -239
- package/docs/apis/features/node/container-link.md +0 -192
- package/docs/apis/features/node/content-db.md +0 -450
- package/docs/apis/features/node/disk-cache.md +0 -379
- package/docs/apis/features/node/dns.md +0 -652
- package/docs/apis/features/node/docker.md +0 -706
- package/docs/apis/features/node/downloader.md +0 -81
- package/docs/apis/features/node/esbuild.md +0 -60
- package/docs/apis/features/node/file-manager.md +0 -191
- package/docs/apis/features/node/fs.md +0 -1217
- package/docs/apis/features/node/git.md +0 -371
- package/docs/apis/features/node/google-auth.md +0 -193
- package/docs/apis/features/node/google-calendar.md +0 -202
- package/docs/apis/features/node/google-docs.md +0 -173
- package/docs/apis/features/node/google-drive.md +0 -246
- package/docs/apis/features/node/google-mail.md +0 -214
- package/docs/apis/features/node/google-sheets.md +0 -194
- package/docs/apis/features/node/grep.md +0 -292
- package/docs/apis/features/node/helpers.md +0 -164
- package/docs/apis/features/node/ink.md +0 -334
- package/docs/apis/features/node/ipc-socket.md +0 -249
- package/docs/apis/features/node/json-tree.md +0 -86
- package/docs/apis/features/node/networking.md +0 -316
- package/docs/apis/features/node/nlp.md +0 -133
- package/docs/apis/features/node/opener.md +0 -97
- package/docs/apis/features/node/os.md +0 -146
- package/docs/apis/features/node/package-finder.md +0 -392
- package/docs/apis/features/node/postgres.md +0 -234
- package/docs/apis/features/node/proc.md +0 -399
- package/docs/apis/features/node/process-manager.md +0 -305
- package/docs/apis/features/node/python.md +0 -604
- package/docs/apis/features/node/redis.md +0 -380
- package/docs/apis/features/node/repl.md +0 -88
- package/docs/apis/features/node/runpod.md +0 -674
- package/docs/apis/features/node/secure-shell.md +0 -176
- package/docs/apis/features/node/semantic-search.md +0 -408
- package/docs/apis/features/node/sqlite.md +0 -233
- package/docs/apis/features/node/telegram.md +0 -279
- package/docs/apis/features/node/transpiler.md +0 -74
- package/docs/apis/features/node/tts.md +0 -133
- package/docs/apis/features/node/ui.md +0 -701
- package/docs/apis/features/node/vault.md +0 -59
- package/docs/apis/features/node/vm.md +0 -75
- package/docs/apis/features/node/yaml-tree.md +0 -85
- package/docs/apis/features/node/yaml.md +0 -176
- package/docs/apis/features/web/asset-loader.md +0 -59
- package/docs/apis/features/web/container-link.md +0 -192
- package/docs/apis/features/web/esbuild.md +0 -54
- package/docs/apis/features/web/helpers.md +0 -164
- package/docs/apis/features/web/network.md +0 -44
- package/docs/apis/features/web/speech.md +0 -69
- package/docs/apis/features/web/vault.md +0 -59
- package/docs/apis/features/web/vm.md +0 -75
- package/docs/apis/features/web/voice.md +0 -84
- package/docs/apis/servers/express.md +0 -171
- package/docs/apis/servers/mcp.md +0 -238
- package/docs/apis/servers/websocket.md +0 -170
- package/docs/bootstrap/CLAUDE.md +0 -101
- package/docs/bootstrap/SKILL.md +0 -341
- package/docs/bootstrap/templates/about-command.ts +0 -41
- package/docs/bootstrap/templates/docs-models.ts +0 -22
- package/docs/bootstrap/templates/docs-readme.md +0 -43
- package/docs/bootstrap/templates/example-feature.ts +0 -53
- package/docs/bootstrap/templates/health-endpoint.ts +0 -15
- package/docs/bootstrap/templates/luca-cli.ts +0 -30
- package/docs/bootstrap/templates/runme.md +0 -54
- package/docs/challenges/caching-proxy.md +0 -16
- package/docs/challenges/content-db-round-trip.md +0 -14
- package/docs/challenges/custom-command.md +0 -9
- package/docs/challenges/file-watcher-pipeline.md +0 -11
- package/docs/challenges/grep-audit-report.md +0 -15
- package/docs/challenges/multi-feature-dashboard.md +0 -14
- package/docs/challenges/process-orchestrator.md +0 -17
- package/docs/challenges/rest-api-server-with-client.md +0 -12
- package/docs/challenges/script-runner-with-vm.md +0 -11
- package/docs/challenges/simple-rest-api.md +0 -15
- package/docs/challenges/websocket-serve-and-client.md +0 -11
- package/docs/challenges/yaml-config-system.md +0 -14
- package/docs/command-system-overhaul.md +0 -94
- package/docs/documentation-audit.md +0 -134
- package/docs/examples/assistant/CORE.md +0 -18
- package/docs/examples/assistant/hooks.ts +0 -3
- package/docs/examples/assistant/tools.ts +0 -10
- package/docs/examples/assistant-hooks-reference.ts +0 -171
- package/docs/examples/assistant-with-process-manager.md +0 -84
- package/docs/examples/content-db.md +0 -77
- package/docs/examples/disk-cache.md +0 -83
- package/docs/examples/docker.md +0 -101
- package/docs/examples/downloader.md +0 -70
- package/docs/examples/entity.md +0 -124
- package/docs/examples/esbuild.md +0 -80
- package/docs/examples/feature-as-tool-provider.md +0 -143
- package/docs/examples/file-manager.md +0 -82
- package/docs/examples/fs.md +0 -83
- package/docs/examples/git.md +0 -85
- package/docs/examples/google-auth.md +0 -88
- package/docs/examples/google-calendar.md +0 -94
- package/docs/examples/google-docs.md +0 -82
- package/docs/examples/google-drive.md +0 -96
- package/docs/examples/google-sheets.md +0 -95
- package/docs/examples/grep.md +0 -85
- package/docs/examples/ink-blocks.md +0 -75
- package/docs/examples/ink-renderer.md +0 -41
- package/docs/examples/ink.md +0 -103
- package/docs/examples/ipc-socket.md +0 -103
- package/docs/examples/json-tree.md +0 -91
- package/docs/examples/networking.md +0 -58
- package/docs/examples/nlp.md +0 -91
- package/docs/examples/opener.md +0 -78
- package/docs/examples/os.md +0 -72
- package/docs/examples/package-finder.md +0 -89
- package/docs/examples/postgres.md +0 -91
- package/docs/examples/proc.md +0 -81
- package/docs/examples/process-manager.md +0 -79
- package/docs/examples/python.md +0 -132
- package/docs/examples/repl.md +0 -93
- package/docs/examples/runpod.md +0 -119
- package/docs/examples/secure-shell.md +0 -92
- package/docs/examples/sqlite.md +0 -86
- package/docs/examples/structured-output-with-assistants.md +0 -144
- package/docs/examples/telegram.md +0 -77
- package/docs/examples/tts.md +0 -86
- package/docs/examples/ui.md +0 -80
- package/docs/examples/vault.md +0 -70
- package/docs/examples/vm.md +0 -86
- package/docs/examples/websocket-ask-and-reply-example.md +0 -128
- package/docs/examples/yaml-tree.md +0 -93
- package/docs/examples/yaml.md +0 -104
- package/docs/ideas/assistant-factory-pattern.md +0 -142
- package/docs/in-memory-fs.md +0 -4
- package/docs/introspection-audit.md +0 -49
- package/docs/introspection.md +0 -164
- package/docs/mcp/readme.md +0 -162
- package/docs/models.ts +0 -41
- package/docs/philosophy.md +0 -86
- package/docs/principles.md +0 -7
- package/docs/prompts/audit-codebase-for-failures-to-use-the-container.md +0 -34
- package/docs/prompts/check-for-undocumented-features.md +0 -27
- package/docs/prompts/mcp-test-easy-command.md +0 -27
- package/docs/scaffolds/client.md +0 -149
- package/docs/scaffolds/command.md +0 -120
- package/docs/scaffolds/endpoint.md +0 -171
- package/docs/scaffolds/feature.md +0 -158
- package/docs/scaffolds/selector.md +0 -91
- package/docs/scaffolds/server.md +0 -196
- package/docs/selectors.md +0 -115
- package/docs/sessions/custom-command/attempt-log-2.md +0 -195
- package/docs/sessions/file-watcher-pipeline/attempt-log-1.md +0 -728
- package/docs/sessions/file-watcher-pipeline/attempt-log-2.md +0 -555
- package/docs/sessions/grep-audit-report/attempt-log-1.md +0 -289
- package/docs/sessions/multi-feature-dashboard/attempt-log-2.md +0 -679
- package/docs/sessions/rest-api-server-with-client/attempt-log-1.md +0 -1
- package/docs/sessions/rest-api-server-with-client/attempt-log-3.md +0 -920
- package/docs/sessions/simple-rest-api/attempt-log-1.md +0 -593
- package/docs/sessions/websocket-serve-and-client/attempt-log-2.md +0 -995
- package/docs/tutorials/00-bootstrap.md +0 -166
- package/docs/tutorials/01-getting-started.md +0 -106
- package/docs/tutorials/02-container.md +0 -210
- package/docs/tutorials/03-scripts.md +0 -194
- package/docs/tutorials/04-features-overview.md +0 -196
- package/docs/tutorials/05-state-and-events.md +0 -171
- package/docs/tutorials/06-servers.md +0 -157
- package/docs/tutorials/07-endpoints.md +0 -198
- package/docs/tutorials/08-commands.md +0 -252
- package/docs/tutorials/09-clients.md +0 -162
- package/docs/tutorials/10-creating-features.md +0 -203
- package/docs/tutorials/11-contentbase.md +0 -191
- package/docs/tutorials/12-assistants.md +0 -215
- package/docs/tutorials/13-introspection.md +0 -157
- package/docs/tutorials/14-type-system.md +0 -174
- package/docs/tutorials/15-project-patterns.md +0 -222
- package/docs/tutorials/16-google-features.md +0 -534
- package/docs/tutorials/17-tui-blocks.md +0 -530
- package/docs/tutorials/18-semantic-search.md +0 -334
- package/docs/tutorials/19-python-sessions.md +0 -401
- package/docs/tutorials/20-browser-esm.md +0 -234
- package/index.ts +0 -1
- package/src/agi/endpoints/ask.ts +0 -60
- package/src/agi/endpoints/conversations/[id].ts +0 -45
- package/src/agi/endpoints/conversations.ts +0 -31
- package/src/agi/endpoints/experts.ts +0 -37
- package/test/assistant-hooks.test.ts +0 -306
- package/test/assistant.test.ts +0 -81
- package/test/bus.test.ts +0 -134
- package/test/clients-servers.test.ts +0 -217
- package/test/command.test.ts +0 -267
- package/test/container-link.test.ts +0 -274
- package/test/conversation.test.ts +0 -220
- package/test/features.test.ts +0 -160
- package/test/fork-and-research.test.ts +0 -450
- package/test/integration.test.ts +0 -787
- package/test/interceptor-chain.test.ts +0 -61
- package/test/node-container.test.ts +0 -121
- package/test/python-session.test.ts +0 -105
- package/test/rate-limit.test.ts +0 -272
- package/test/semantic-search.test.ts +0 -550
- package/test/state.test.ts +0 -121
- package/test/vm-context.test.ts +0 -146
- package/test/vm-loadmodule.test.ts +0 -213
- package/test/websocket-ask.test.ts +0 -101
- package/test-integration/assistant.test.ts +0 -138
- package/test-integration/assistants-manager.test.ts +0 -113
- package/test-integration/claude-code.test.ts +0 -98
- package/test-integration/conversation-history.test.ts +0 -205
- package/test-integration/conversation.test.ts +0 -137
- package/test-integration/elevenlabs.test.ts +0 -55
- package/test-integration/google-services.test.ts +0 -80
- package/test-integration/helpers.ts +0 -89
- package/test-integration/memory.test.ts +0 -204
- package/test-integration/openai-codex.test.ts +0 -93
- package/test-integration/runpod.test.ts +0 -58
- package/test-integration/server-endpoints.test.ts +0 -97
- package/test-integration/telegram.test.ts +0 -46
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Luca Dataset Review UI</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #0b1020;
|
|
10
|
+
--panel: #121a30;
|
|
11
|
+
--panel-2: #18223f;
|
|
12
|
+
--text: #e7ecff;
|
|
13
|
+
--muted: #9db0e0;
|
|
14
|
+
--accent: #72a1ff;
|
|
15
|
+
--good: #33c27f;
|
|
16
|
+
--warn: #f0b24a;
|
|
17
|
+
--bad: #ef6b73;
|
|
18
|
+
--border: #2b3967;
|
|
19
|
+
}
|
|
20
|
+
* { box-sizing: border-box; }
|
|
21
|
+
body {
|
|
22
|
+
margin: 0;
|
|
23
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
24
|
+
background: var(--bg);
|
|
25
|
+
color: var(--text);
|
|
26
|
+
}
|
|
27
|
+
.app {
|
|
28
|
+
display: grid;
|
|
29
|
+
grid-template-columns: 340px 1fr;
|
|
30
|
+
min-height: 100vh;
|
|
31
|
+
}
|
|
32
|
+
.sidebar, .main {
|
|
33
|
+
padding: 16px;
|
|
34
|
+
}
|
|
35
|
+
.sidebar {
|
|
36
|
+
border-right: 1px solid var(--border);
|
|
37
|
+
background: linear-gradient(180deg, #0d1428, #0b1020);
|
|
38
|
+
position: sticky;
|
|
39
|
+
top: 0;
|
|
40
|
+
height: 100vh;
|
|
41
|
+
overflow: auto;
|
|
42
|
+
}
|
|
43
|
+
.main {
|
|
44
|
+
display: grid;
|
|
45
|
+
gap: 16px;
|
|
46
|
+
align-content: start;
|
|
47
|
+
}
|
|
48
|
+
h1, h2, h3 {
|
|
49
|
+
margin: 0 0 8px;
|
|
50
|
+
line-height: 1.2;
|
|
51
|
+
}
|
|
52
|
+
p { color: var(--muted); }
|
|
53
|
+
.panel {
|
|
54
|
+
background: var(--panel);
|
|
55
|
+
border: 1px solid var(--border);
|
|
56
|
+
border-radius: 12px;
|
|
57
|
+
padding: 14px;
|
|
58
|
+
box-shadow: 0 8px 24px rgba(0,0,0,.22);
|
|
59
|
+
}
|
|
60
|
+
.row {
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
63
|
+
gap: 12px;
|
|
64
|
+
}
|
|
65
|
+
.row-3 {
|
|
66
|
+
display: grid;
|
|
67
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
68
|
+
gap: 12px;
|
|
69
|
+
}
|
|
70
|
+
label {
|
|
71
|
+
display: block;
|
|
72
|
+
font-size: 12px;
|
|
73
|
+
color: var(--muted);
|
|
74
|
+
margin-bottom: 6px;
|
|
75
|
+
}
|
|
76
|
+
input[type="text"], textarea, select {
|
|
77
|
+
width: 100%;
|
|
78
|
+
background: var(--panel-2);
|
|
79
|
+
border: 1px solid var(--border);
|
|
80
|
+
color: var(--text);
|
|
81
|
+
border-radius: 10px;
|
|
82
|
+
padding: 10px 12px;
|
|
83
|
+
font: inherit;
|
|
84
|
+
}
|
|
85
|
+
textarea { min-height: 96px; resize: vertical; }
|
|
86
|
+
button {
|
|
87
|
+
background: var(--accent);
|
|
88
|
+
color: white;
|
|
89
|
+
border: 0;
|
|
90
|
+
border-radius: 10px;
|
|
91
|
+
padding: 10px 14px;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
button.secondary {
|
|
96
|
+
background: #243660;
|
|
97
|
+
color: var(--text);
|
|
98
|
+
}
|
|
99
|
+
button.warn { background: var(--warn); color: #111; }
|
|
100
|
+
button.good { background: var(--good); }
|
|
101
|
+
button.bad { background: var(--bad); }
|
|
102
|
+
.button-row {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-wrap: wrap;
|
|
105
|
+
gap: 8px;
|
|
106
|
+
}
|
|
107
|
+
.meta {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-wrap: wrap;
|
|
110
|
+
gap: 8px;
|
|
111
|
+
margin: 8px 0 0;
|
|
112
|
+
}
|
|
113
|
+
.chip {
|
|
114
|
+
border: 1px solid var(--border);
|
|
115
|
+
background: #101831;
|
|
116
|
+
color: var(--text);
|
|
117
|
+
border-radius: 999px;
|
|
118
|
+
padding: 4px 10px;
|
|
119
|
+
font-size: 12px;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
}
|
|
122
|
+
.chip.good { border-color: rgba(51,194,127,.4); color: #bdf2d8; }
|
|
123
|
+
.chip.warn { border-color: rgba(240,178,74,.4); color: #ffe0aa; }
|
|
124
|
+
.chip.bad { border-color: rgba(239,107,115,.4); color: #ffc0c4; }
|
|
125
|
+
.candidate-list {
|
|
126
|
+
display: grid;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
margin-top: 12px;
|
|
129
|
+
}
|
|
130
|
+
.candidate-item {
|
|
131
|
+
padding: 10px;
|
|
132
|
+
border: 1px solid var(--border);
|
|
133
|
+
border-radius: 10px;
|
|
134
|
+
background: #0f1730;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
.candidate-item.active {
|
|
138
|
+
border-color: var(--accent);
|
|
139
|
+
outline: 1px solid var(--accent);
|
|
140
|
+
}
|
|
141
|
+
.candidate-item .title {
|
|
142
|
+
font-weight: 700;
|
|
143
|
+
font-size: 13px;
|
|
144
|
+
margin-bottom: 4px;
|
|
145
|
+
}
|
|
146
|
+
.candidate-item .subtitle {
|
|
147
|
+
font-size: 12px;
|
|
148
|
+
color: var(--muted);
|
|
149
|
+
line-height: 1.35;
|
|
150
|
+
}
|
|
151
|
+
.kvs {
|
|
152
|
+
display: grid;
|
|
153
|
+
grid-template-columns: 180px 1fr;
|
|
154
|
+
gap: 8px 12px;
|
|
155
|
+
font-size: 14px;
|
|
156
|
+
}
|
|
157
|
+
.kvs .k {
|
|
158
|
+
color: var(--muted);
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
}
|
|
161
|
+
pre {
|
|
162
|
+
margin: 0;
|
|
163
|
+
white-space: pre-wrap;
|
|
164
|
+
word-break: break-word;
|
|
165
|
+
background: #0c1328;
|
|
166
|
+
border: 1px solid var(--border);
|
|
167
|
+
border-radius: 10px;
|
|
168
|
+
padding: 10px;
|
|
169
|
+
color: #d6e1ff;
|
|
170
|
+
}
|
|
171
|
+
.snippet-list {
|
|
172
|
+
display: grid;
|
|
173
|
+
gap: 8px;
|
|
174
|
+
}
|
|
175
|
+
.hint {
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
color: var(--muted);
|
|
178
|
+
}
|
|
179
|
+
.statline {
|
|
180
|
+
display: flex;
|
|
181
|
+
gap: 10px;
|
|
182
|
+
flex-wrap: wrap;
|
|
183
|
+
font-size: 13px;
|
|
184
|
+
color: var(--muted);
|
|
185
|
+
}
|
|
186
|
+
.statline strong { color: var(--text); }
|
|
187
|
+
@media (max-width: 980px) {
|
|
188
|
+
.app { grid-template-columns: 1fr; }
|
|
189
|
+
.sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
|
|
190
|
+
.row, .row-3 { grid-template-columns: 1fr; }
|
|
191
|
+
.kvs { grid-template-columns: 1fr; }
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
194
|
+
</head>
|
|
195
|
+
<body>
|
|
196
|
+
<div class="app">
|
|
197
|
+
<aside class="sidebar">
|
|
198
|
+
<div class="panel">
|
|
199
|
+
<h1>Luca review UI</h1>
|
|
200
|
+
<p>Load review-batch-1.jsonl or review-queue.jsonl, then label rows and export review records as JSONL.</p>
|
|
201
|
+
<div class="button-row">
|
|
202
|
+
<button id="loadBatchBtn">Load review-batch-1.jsonl</button>
|
|
203
|
+
<button class="secondary" id="loadQueueBtn">Load review-queue.jsonl</button>
|
|
204
|
+
</div>
|
|
205
|
+
<div style="margin-top:10px;">
|
|
206
|
+
<label for="fileInput">Or load a local JSONL file</label>
|
|
207
|
+
<input id="fileInput" type="file" accept=".jsonl,.json" />
|
|
208
|
+
</div>
|
|
209
|
+
<div style="margin-top:10px;">
|
|
210
|
+
<label for="basePathInput">Base directory</label>
|
|
211
|
+
<input id="basePathInput" type="text" value="./" />
|
|
212
|
+
<div class="hint">When serving this file from the repo, ./ should work. If not, enter the folder that contains the review JSONL files.</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<div class="panel" style="margin-top:16px;">
|
|
217
|
+
<h2>Progress</h2>
|
|
218
|
+
<div class="statline" id="progressStats"></div>
|
|
219
|
+
<div style="margin-top:10px;">
|
|
220
|
+
<label for="filterSelect">Filter</label>
|
|
221
|
+
<select id="filterSelect">
|
|
222
|
+
<option value="all">All</option>
|
|
223
|
+
<option value="unreviewed">Unreviewed</option>
|
|
224
|
+
<option value="reviewed">Reviewed</option>
|
|
225
|
+
<option value="canonical-policy">Canonical-policy guess</option>
|
|
226
|
+
<option value="planning">Planning guess</option>
|
|
227
|
+
<option value="strong-implementation">Strong-implementation guess</option>
|
|
228
|
+
<option value="rejects">Reject guess</option>
|
|
229
|
+
</select>
|
|
230
|
+
</div>
|
|
231
|
+
<div style="margin-top:10px;">
|
|
232
|
+
<label for="searchInput">Search</label>
|
|
233
|
+
<input id="searchInput" type="text" placeholder="session id, repo, helper, command..." />
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div class="panel" style="margin-top:16px;">
|
|
238
|
+
<div class="button-row">
|
|
239
|
+
<button class="good" id="exportBtn">Export reviews JSONL</button>
|
|
240
|
+
<button class="secondary" id="saveLocalBtn">Save state</button>
|
|
241
|
+
<button class="secondary" id="restoreLocalBtn">Restore state</button>
|
|
242
|
+
<button class="warn" id="clearLocalBtn">Clear saved state</button>
|
|
243
|
+
</div>
|
|
244
|
+
<div class="hint" style="margin-top:10px;">State is stored in localStorage under luca-review-ui-state.</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div class="candidate-list" id="candidateList"></div>
|
|
248
|
+
</aside>
|
|
249
|
+
|
|
250
|
+
<main class="main">
|
|
251
|
+
<section class="panel">
|
|
252
|
+
<h2 id="detailTitle">No dataset loaded</h2>
|
|
253
|
+
<div class="meta" id="detailChips"></div>
|
|
254
|
+
<div class="kvs" style="margin-top:12px;" id="detailMeta"></div>
|
|
255
|
+
</section>
|
|
256
|
+
|
|
257
|
+
<section class="panel">
|
|
258
|
+
<h3>Summary</h3>
|
|
259
|
+
<pre id="summaryPre">Load a batch to begin.</pre>
|
|
260
|
+
</section>
|
|
261
|
+
|
|
262
|
+
<section class="panel">
|
|
263
|
+
<h3>Signals</h3>
|
|
264
|
+
<div class="row-3">
|
|
265
|
+
<div>
|
|
266
|
+
<label>Positive signals</label>
|
|
267
|
+
<pre id="positivePre"></pre>
|
|
268
|
+
</div>
|
|
269
|
+
<div>
|
|
270
|
+
<label>Negative signals</label>
|
|
271
|
+
<pre id="negativePre"></pre>
|
|
272
|
+
</div>
|
|
273
|
+
<div>
|
|
274
|
+
<label>Policy / verification</label>
|
|
275
|
+
<pre id="policyPre"></pre>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</section>
|
|
279
|
+
|
|
280
|
+
<section class="panel">
|
|
281
|
+
<h3>Snippets</h3>
|
|
282
|
+
<div class="snippet-list" id="snippetList"></div>
|
|
283
|
+
</section>
|
|
284
|
+
|
|
285
|
+
<section class="panel">
|
|
286
|
+
<h3>Author review</h3>
|
|
287
|
+
<div class="row-3">
|
|
288
|
+
<div>
|
|
289
|
+
<label for="reviewerInput">Reviewer</label>
|
|
290
|
+
<input id="reviewerInput" type="text" placeholder="jon" />
|
|
291
|
+
</div>
|
|
292
|
+
<div>
|
|
293
|
+
<label for="canonicalityInput">Canonicality</label>
|
|
294
|
+
<select id="canonicalityInput">
|
|
295
|
+
<option value=""></option>
|
|
296
|
+
<option value="canonical">canonical</option>
|
|
297
|
+
<option value="acceptable">acceptable</option>
|
|
298
|
+
<option value="off-policy">off-policy</option>
|
|
299
|
+
</select>
|
|
300
|
+
</div>
|
|
301
|
+
<div>
|
|
302
|
+
<label for="policyValueInput">Policy value</label>
|
|
303
|
+
<select id="policyValueInput">
|
|
304
|
+
<option value=""></option>
|
|
305
|
+
<option value="high">high</option>
|
|
306
|
+
<option value="medium">medium</option>
|
|
307
|
+
<option value="low">low</option>
|
|
308
|
+
</select>
|
|
309
|
+
</div>
|
|
310
|
+
<div>
|
|
311
|
+
<label for="codeTasteInput">Code taste</label>
|
|
312
|
+
<select id="codeTasteInput">
|
|
313
|
+
<option value=""></option>
|
|
314
|
+
<option value="strong">strong</option>
|
|
315
|
+
<option value="mixed">mixed</option>
|
|
316
|
+
<option value="weak">weak</option>
|
|
317
|
+
</select>
|
|
318
|
+
</div>
|
|
319
|
+
<div>
|
|
320
|
+
<label for="verificationQualityInput">Verification quality</label>
|
|
321
|
+
<select id="verificationQualityInput">
|
|
322
|
+
<option value=""></option>
|
|
323
|
+
<option value="strong">strong</option>
|
|
324
|
+
<option value="weak">weak</option>
|
|
325
|
+
<option value="none">none</option>
|
|
326
|
+
</select>
|
|
327
|
+
</div>
|
|
328
|
+
<div>
|
|
329
|
+
<label for="dispositionInput">Disposition</label>
|
|
330
|
+
<select id="dispositionInput">
|
|
331
|
+
<option value=""></option>
|
|
332
|
+
<option value="keep">keep</option>
|
|
333
|
+
<option value="rewrite">rewrite</option>
|
|
334
|
+
<option value="reject">reject</option>
|
|
335
|
+
</select>
|
|
336
|
+
</div>
|
|
337
|
+
<div>
|
|
338
|
+
<label for="bucketInput">Bucket</label>
|
|
339
|
+
<select id="bucketInput">
|
|
340
|
+
<option value=""></option>
|
|
341
|
+
<option value="canonical-policy">canonical-policy</option>
|
|
342
|
+
<option value="strong-implementation">strong-implementation</option>
|
|
343
|
+
<option value="planning">planning</option>
|
|
344
|
+
<option value="rejects">rejects</option>
|
|
345
|
+
</select>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<div class="row" style="margin-top:12px;">
|
|
350
|
+
<div>
|
|
351
|
+
<label for="positiveSignalsInput">Positive signals</label>
|
|
352
|
+
<textarea id="positiveSignalsInput" placeholder="One per line"></textarea>
|
|
353
|
+
</div>
|
|
354
|
+
<div>
|
|
355
|
+
<label for="negativeSignalsInput">Negative signals</label>
|
|
356
|
+
<textarea id="negativeSignalsInput" placeholder="One per line"></textarea>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div class="row" style="margin-top:12px;">
|
|
361
|
+
<div>
|
|
362
|
+
<label for="whyKeepInput">Why keep</label>
|
|
363
|
+
<textarea id="whyKeepInput"></textarea>
|
|
364
|
+
</div>
|
|
365
|
+
<div>
|
|
366
|
+
<label for="whyRejectInput">Why reject</label>
|
|
367
|
+
<textarea id="whyRejectInput"></textarea>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
<div style="margin-top:12px;">
|
|
372
|
+
<label for="rewriteBriefInput">Rewrite brief</label>
|
|
373
|
+
<textarea id="rewriteBriefInput"></textarea>
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
<div style="margin-top:12px;">
|
|
377
|
+
<label for="notesInput">Notes</label>
|
|
378
|
+
<textarea id="notesInput"></textarea>
|
|
379
|
+
</div>
|
|
380
|
+
|
|
381
|
+
<div class="button-row" style="margin-top:12px;">
|
|
382
|
+
<button class="good" id="saveReviewBtn">Save review</button>
|
|
383
|
+
<button class="secondary" id="copyReviewBtn">Copy current review JSON</button>
|
|
384
|
+
<button class="secondary" id="nextBtn">Next</button>
|
|
385
|
+
</div>
|
|
386
|
+
</section>
|
|
387
|
+
</main>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<script>
|
|
391
|
+
const state = {
|
|
392
|
+
candidates: [],
|
|
393
|
+
reviews: {},
|
|
394
|
+
selectedIndex: 0,
|
|
395
|
+
datasetName: '',
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
const els = {
|
|
399
|
+
candidateList: document.getElementById('candidateList'),
|
|
400
|
+
progressStats: document.getElementById('progressStats'),
|
|
401
|
+
filterSelect: document.getElementById('filterSelect'),
|
|
402
|
+
searchInput: document.getElementById('searchInput'),
|
|
403
|
+
detailTitle: document.getElementById('detailTitle'),
|
|
404
|
+
detailChips: document.getElementById('detailChips'),
|
|
405
|
+
detailMeta: document.getElementById('detailMeta'),
|
|
406
|
+
summaryPre: document.getElementById('summaryPre'),
|
|
407
|
+
positivePre: document.getElementById('positivePre'),
|
|
408
|
+
negativePre: document.getElementById('negativePre'),
|
|
409
|
+
policyPre: document.getElementById('policyPre'),
|
|
410
|
+
snippetList: document.getElementById('snippetList'),
|
|
411
|
+
basePathInput: document.getElementById('basePathInput'),
|
|
412
|
+
fileInput: document.getElementById('fileInput'),
|
|
413
|
+
reviewerInput: document.getElementById('reviewerInput'),
|
|
414
|
+
canonicalityInput: document.getElementById('canonicalityInput'),
|
|
415
|
+
policyValueInput: document.getElementById('policyValueInput'),
|
|
416
|
+
codeTasteInput: document.getElementById('codeTasteInput'),
|
|
417
|
+
verificationQualityInput: document.getElementById('verificationQualityInput'),
|
|
418
|
+
dispositionInput: document.getElementById('dispositionInput'),
|
|
419
|
+
bucketInput: document.getElementById('bucketInput'),
|
|
420
|
+
positiveSignalsInput: document.getElementById('positiveSignalsInput'),
|
|
421
|
+
negativeSignalsInput: document.getElementById('negativeSignalsInput'),
|
|
422
|
+
whyKeepInput: document.getElementById('whyKeepInput'),
|
|
423
|
+
whyRejectInput: document.getElementById('whyRejectInput'),
|
|
424
|
+
rewriteBriefInput: document.getElementById('rewriteBriefInput'),
|
|
425
|
+
notesInput: document.getElementById('notesInput'),
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
function splitLines(text) {
|
|
429
|
+
return text.split('\n').map(s => s.trim()).filter(Boolean);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function joinLines(arr) {
|
|
433
|
+
return (arr || []).join('\n');
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function currentCandidate() {
|
|
437
|
+
return state.candidates[state.selectedIndex] || null;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function currentReviewKey(candidate) {
|
|
441
|
+
return candidate ? `${candidate.source_repo}:${candidate.session_id}` : null;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function getReview(candidate) {
|
|
445
|
+
const key = currentReviewKey(candidate);
|
|
446
|
+
return key ? state.reviews[key] || null : null;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function setReview(candidate, review) {
|
|
450
|
+
const key = currentReviewKey(candidate);
|
|
451
|
+
if (key) state.reviews[key] = review;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function filteredCandidates() {
|
|
455
|
+
const filter = els.filterSelect.value;
|
|
456
|
+
const query = els.searchInput.value.trim().toLowerCase();
|
|
457
|
+
return state.candidates.filter(candidate => {
|
|
458
|
+
const key = currentReviewKey(candidate);
|
|
459
|
+
const reviewed = Boolean(state.reviews[key]);
|
|
460
|
+
const haystack = JSON.stringify(candidate).toLowerCase();
|
|
461
|
+
if (query && !haystack.includes(query)) return false;
|
|
462
|
+
if (filter === 'all') return true;
|
|
463
|
+
if (filter === 'unreviewed') return !reviewed;
|
|
464
|
+
if (filter === 'reviewed') return reviewed;
|
|
465
|
+
return candidate.bucket_guess === filter;
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function renderList() {
|
|
470
|
+
const items = filteredCandidates();
|
|
471
|
+
els.candidateList.innerHTML = '';
|
|
472
|
+
items.forEach(candidate => {
|
|
473
|
+
const key = currentReviewKey(candidate);
|
|
474
|
+
const reviewed = Boolean(state.reviews[key]);
|
|
475
|
+
const div = document.createElement('div');
|
|
476
|
+
div.className = 'candidate-item';
|
|
477
|
+
if (candidate === currentCandidate()) div.classList.add('active');
|
|
478
|
+
div.innerHTML = `
|
|
479
|
+
<div class="title">#${candidate.rank} ${candidate.session_id}</div>
|
|
480
|
+
<div class="subtitle">${candidate.source_repo} • ${candidate.task_type} • ${candidate.bucket_guess}</div>
|
|
481
|
+
<div class="subtitle">${candidate.summary}</div>
|
|
482
|
+
<div class="meta" style="margin-top:8px;">
|
|
483
|
+
<span class="chip ${reviewed ? 'good' : ''}">${reviewed ? 'reviewed' : 'unreviewed'}</span>
|
|
484
|
+
<span class="chip">score ${candidate.review_score}</span>
|
|
485
|
+
<span class="chip">${candidate.quality_tier}</span>
|
|
486
|
+
</div>
|
|
487
|
+
`;
|
|
488
|
+
div.onclick = () => {
|
|
489
|
+
const globalIndex = state.candidates.findIndex(c => c.session_id === candidate.session_id && c.source_repo === candidate.source_repo);
|
|
490
|
+
state.selectedIndex = globalIndex;
|
|
491
|
+
renderAll();
|
|
492
|
+
};
|
|
493
|
+
els.candidateList.appendChild(div);
|
|
494
|
+
});
|
|
495
|
+
renderStats(items.length);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function renderStats(filteredCount) {
|
|
499
|
+
const reviewed = Object.keys(state.reviews).length;
|
|
500
|
+
els.progressStats.innerHTML = `
|
|
501
|
+
<span><strong>${state.candidates.length}</strong> loaded</span>
|
|
502
|
+
<span><strong>${filteredCount}</strong> shown</span>
|
|
503
|
+
<span><strong>${reviewed}</strong> reviewed</span>
|
|
504
|
+
<span><strong>${Math.max(state.candidates.length - reviewed, 0)}</strong> remaining</span>
|
|
505
|
+
`;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function renderDetail() {
|
|
509
|
+
const candidate = currentCandidate();
|
|
510
|
+
if (!candidate) {
|
|
511
|
+
els.detailTitle.textContent = 'No dataset loaded';
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
els.detailTitle.textContent = `${candidate.rank}. ${candidate.session_id}`;
|
|
515
|
+
els.detailChips.innerHTML = [
|
|
516
|
+
candidate.source_repo,
|
|
517
|
+
candidate.task_type,
|
|
518
|
+
candidate.quality_tier,
|
|
519
|
+
candidate.bucket_guess,
|
|
520
|
+
candidate.suggested_disposition,
|
|
521
|
+
candidate.canonicality_guess,
|
|
522
|
+
].map(v => `<span class="chip">${v}</span>`).join('');
|
|
523
|
+
|
|
524
|
+
const metaRows = [
|
|
525
|
+
['Branch', candidate.branch || '—'],
|
|
526
|
+
['Review score', String(candidate.review_score)],
|
|
527
|
+
['Commands', (candidate.commands_run || []).join(', ') || '—'],
|
|
528
|
+
['Tests', (candidate.tests_run || []).join('\n') || '—'],
|
|
529
|
+
['Helpers', (candidate.relevant_helpers || []).join(', ') || '—'],
|
|
530
|
+
['Changed files', (candidate.changed_files || []).join('\n') || '—'],
|
|
531
|
+
['Path', candidate.candidate_path],
|
|
532
|
+
];
|
|
533
|
+
els.detailMeta.innerHTML = metaRows.map(([k, v]) => `<div class="k">${k}</div><div>${String(v).replace(/\n/g, '<br>')}</div>`).join('');
|
|
534
|
+
els.summaryPre.textContent = candidate.summary || '';
|
|
535
|
+
els.positivePre.textContent = joinLines(candidate.positive_signals || []);
|
|
536
|
+
els.negativePre.textContent = joinLines(candidate.negative_signals || []);
|
|
537
|
+
els.policyPre.textContent = joinLines([...(candidate.policy_signals || []), ...(candidate.verification_signals || [])]);
|
|
538
|
+
|
|
539
|
+
els.snippetList.innerHTML = '';
|
|
540
|
+
(candidate.snippets || []).forEach(snippet => {
|
|
541
|
+
const pre = document.createElement('pre');
|
|
542
|
+
pre.textContent = snippet;
|
|
543
|
+
els.snippetList.appendChild(pre);
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function loadReviewForm() {
|
|
548
|
+
const candidate = currentCandidate();
|
|
549
|
+
const review = getReview(candidate) || {
|
|
550
|
+
session_id: candidate?.session_id,
|
|
551
|
+
source_repo: candidate?.source_repo,
|
|
552
|
+
candidate_path: candidate?.candidate_path,
|
|
553
|
+
reviewer: '',
|
|
554
|
+
canonicality: '',
|
|
555
|
+
policy_value: '',
|
|
556
|
+
code_taste: '',
|
|
557
|
+
verification_quality: '',
|
|
558
|
+
disposition: '',
|
|
559
|
+
bucket: candidate?.bucket_guess || '',
|
|
560
|
+
positive_signals: candidate?.positive_signals || [],
|
|
561
|
+
negative_signals: candidate?.negative_signals || [],
|
|
562
|
+
commands_run: candidate?.commands_run || [],
|
|
563
|
+
relevant_helpers: candidate?.relevant_helpers || [],
|
|
564
|
+
changed_files: candidate?.changed_files || [],
|
|
565
|
+
first_instruction: candidate?.first_instruction || '',
|
|
566
|
+
task_type: candidate?.task_type || '',
|
|
567
|
+
why_keep: '',
|
|
568
|
+
why_reject: '',
|
|
569
|
+
rewrite_brief: '',
|
|
570
|
+
notes: '',
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
els.reviewerInput.value = review.reviewer || '';
|
|
574
|
+
els.canonicalityInput.value = review.canonicality || '';
|
|
575
|
+
els.policyValueInput.value = review.policy_value || '';
|
|
576
|
+
els.codeTasteInput.value = review.code_taste || '';
|
|
577
|
+
els.verificationQualityInput.value = review.verification_quality || '';
|
|
578
|
+
els.dispositionInput.value = review.disposition || '';
|
|
579
|
+
els.bucketInput.value = review.bucket || '';
|
|
580
|
+
els.positiveSignalsInput.value = joinLines(review.positive_signals || []);
|
|
581
|
+
els.negativeSignalsInput.value = joinLines(review.negative_signals || []);
|
|
582
|
+
els.whyKeepInput.value = review.why_keep || '';
|
|
583
|
+
els.whyRejectInput.value = review.why_reject || '';
|
|
584
|
+
els.rewriteBriefInput.value = review.rewrite_brief || '';
|
|
585
|
+
els.notesInput.value = review.notes || '';
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function saveCurrentReview() {
|
|
589
|
+
const candidate = currentCandidate();
|
|
590
|
+
if (!candidate) return;
|
|
591
|
+
const review = {
|
|
592
|
+
session_id: candidate.session_id,
|
|
593
|
+
source_repo: candidate.source_repo,
|
|
594
|
+
candidate_path: candidate.candidate_path,
|
|
595
|
+
reviewer: els.reviewerInput.value.trim(),
|
|
596
|
+
reviewed_at: new Date().toISOString(),
|
|
597
|
+
first_instruction: candidate.first_instruction || '',
|
|
598
|
+
task_type: candidate.task_type || '',
|
|
599
|
+
canonicality: els.canonicalityInput.value,
|
|
600
|
+
policy_value: els.policyValueInput.value,
|
|
601
|
+
code_taste: els.codeTasteInput.value,
|
|
602
|
+
verification_quality: els.verificationQualityInput.value,
|
|
603
|
+
disposition: els.dispositionInput.value,
|
|
604
|
+
bucket: els.bucketInput.value,
|
|
605
|
+
positive_signals: splitLines(els.positiveSignalsInput.value),
|
|
606
|
+
negative_signals: splitLines(els.negativeSignalsInput.value),
|
|
607
|
+
commands_run: candidate.commands_run || [],
|
|
608
|
+
relevant_helpers: candidate.relevant_helpers || [],
|
|
609
|
+
changed_files: candidate.changed_files || [],
|
|
610
|
+
why_keep: els.whyKeepInput.value.trim(),
|
|
611
|
+
why_reject: els.whyRejectInput.value.trim(),
|
|
612
|
+
rewrite_brief: els.rewriteBriefInput.value.trim(),
|
|
613
|
+
notes: els.notesInput.value.trim(),
|
|
614
|
+
};
|
|
615
|
+
setReview(candidate, review);
|
|
616
|
+
persistState();
|
|
617
|
+
renderAll();
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function exportReviews() {
|
|
621
|
+
const rows = Object.values(state.reviews);
|
|
622
|
+
const blob = new Blob([rows.map(row => JSON.stringify(row)).join('\n') + '\n'], { type: 'application/jsonl' });
|
|
623
|
+
const a = document.createElement('a');
|
|
624
|
+
a.href = URL.createObjectURL(blob);
|
|
625
|
+
a.download = `${state.datasetName || 'luca-review'}-reviews.jsonl`;
|
|
626
|
+
a.click();
|
|
627
|
+
URL.revokeObjectURL(a.href);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function copyCurrentReview() {
|
|
631
|
+
const candidate = currentCandidate();
|
|
632
|
+
if (!candidate) return;
|
|
633
|
+
saveCurrentReview();
|
|
634
|
+
const review = getReview(candidate);
|
|
635
|
+
navigator.clipboard.writeText(JSON.stringify(review, null, 2));
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function persistState() {
|
|
639
|
+
localStorage.setItem('luca-review-ui-state', JSON.stringify({
|
|
640
|
+
reviews: state.reviews,
|
|
641
|
+
datasetName: state.datasetName,
|
|
642
|
+
}));
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function restoreState() {
|
|
646
|
+
const raw = localStorage.getItem('luca-review-ui-state');
|
|
647
|
+
if (!raw) return;
|
|
648
|
+
try {
|
|
649
|
+
const parsed = JSON.parse(raw);
|
|
650
|
+
state.reviews = parsed.reviews || {};
|
|
651
|
+
state.datasetName = parsed.datasetName || state.datasetName;
|
|
652
|
+
} catch (err) {
|
|
653
|
+
console.error(err);
|
|
654
|
+
}
|
|
655
|
+
renderAll();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function clearState() {
|
|
659
|
+
localStorage.removeItem('luca-review-ui-state');
|
|
660
|
+
state.reviews = {};
|
|
661
|
+
renderAll();
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function renderAll() {
|
|
665
|
+
renderList();
|
|
666
|
+
renderDetail();
|
|
667
|
+
loadReviewForm();
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
function parseJsonl(text) {
|
|
671
|
+
return text.split('\n').map(line => line.trim()).filter(Boolean).map(line => JSON.parse(line));
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
async function loadDatasetFromPath(path) {
|
|
675
|
+
const res = await fetch(path);
|
|
676
|
+
if (!res.ok) throw new Error(`Failed to load ${path}: ${res.status}`);
|
|
677
|
+
const text = await res.text();
|
|
678
|
+
state.candidates = parseJsonl(text);
|
|
679
|
+
state.selectedIndex = 0;
|
|
680
|
+
state.datasetName = path.split('/').pop().replace(/\.jsonl$/, '');
|
|
681
|
+
renderAll();
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function loadDatasetFromText(text, name = 'manual-load') {
|
|
685
|
+
state.candidates = parseJsonl(text);
|
|
686
|
+
state.selectedIndex = 0;
|
|
687
|
+
state.datasetName = name;
|
|
688
|
+
renderAll();
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
document.getElementById('loadBatchBtn').onclick = async () => {
|
|
692
|
+
const base = els.basePathInput.value || './';
|
|
693
|
+
await loadDatasetFromPath(base.replace(/\/?$/, '/') + 'review-batch-1.jsonl');
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
document.getElementById('loadQueueBtn').onclick = async () => {
|
|
697
|
+
const base = els.basePathInput.value || './';
|
|
698
|
+
await loadDatasetFromPath(base.replace(/\/?$/, '/') + 'review-queue.jsonl');
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
els.fileInput.onchange = async (event) => {
|
|
702
|
+
const file = event.target.files[0];
|
|
703
|
+
if (!file) return;
|
|
704
|
+
const text = await file.text();
|
|
705
|
+
loadDatasetFromText(text, file.name.replace(/\.jsonl$/, ''));
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
document.getElementById('saveReviewBtn').onclick = saveCurrentReview;
|
|
709
|
+
document.getElementById('exportBtn').onclick = exportReviews;
|
|
710
|
+
document.getElementById('copyReviewBtn').onclick = copyCurrentReview;
|
|
711
|
+
document.getElementById('saveLocalBtn').onclick = () => { saveCurrentReview(); persistState(); };
|
|
712
|
+
document.getElementById('restoreLocalBtn').onclick = restoreState;
|
|
713
|
+
document.getElementById('clearLocalBtn').onclick = clearState;
|
|
714
|
+
document.getElementById('nextBtn').onclick = () => {
|
|
715
|
+
saveCurrentReview();
|
|
716
|
+
if (state.selectedIndex < state.candidates.length - 1) state.selectedIndex += 1;
|
|
717
|
+
renderAll();
|
|
718
|
+
};
|
|
719
|
+
els.filterSelect.onchange = renderAll;
|
|
720
|
+
els.searchInput.oninput = renderAll;
|
|
721
|
+
|
|
722
|
+
restoreState();
|
|
723
|
+
</script>
|
|
724
|
+
</body>
|
|
725
|
+
</html>
|