mixdog 0.9.3 → 0.9.4
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/package.json +7 -3
- package/scripts/bench/lead-review-tasks-r3.json +20 -0
- package/scripts/bench/lead-review-tasks.json +20 -0
- package/scripts/bench/r4-mixed-tasks.json +20 -0
- package/scripts/bench/review-tasks.json +20 -0
- package/scripts/bench/round-codex.json +114 -0
- package/scripts/bench/round-mixdog-lead-r3.json +269 -0
- package/scripts/bench/round-mixdog-lead.json +269 -0
- package/scripts/bench/round-mixdog.json +126 -0
- package/scripts/bench/round-r10-bigsample.json +679 -0
- package/scripts/bench/round-r11-codexalign.json +257 -0
- package/scripts/bench/round-r4-codex.json +114 -0
- package/scripts/bench/round-r4-mixed.json +225 -0
- package/scripts/bench/round-r5-gpt-lead.json +259 -0
- package/scripts/bench/round-r6-codex.json +114 -0
- package/scripts/bench/round-r6-solo.json +257 -0
- package/scripts/bench/round-r7-full.json +254 -0
- package/scripts/bench/round-r8-fulldefault.json +255 -0
- package/scripts/bench-run.mjs +215 -29
- package/scripts/freevar-smoke.mjs +95 -0
- package/scripts/internal-comms-bench.mjs +1 -0
- package/scripts/internal-comms-smoke.mjs +10 -9
- package/scripts/mouse-probe.mjs +45 -0
- package/scripts/output-style-bench.mjs +13 -6
- package/scripts/output-style-smoke.mjs +4 -4
- package/scripts/provider-toolcall-test.mjs +7 -3
- package/scripts/recall-usecase-cases.json +18 -0
- package/scripts/recall-usecase-probe.json +6 -0
- package/scripts/session-bench.mjs +152 -6
- package/scripts/tool-smoke.mjs +23 -63
- package/scripts/tui-render-smoke.mjs +90 -0
- package/scripts/webhook-smoke.mjs +208 -0
- package/src/agents/debugger/AGENT.md +4 -1
- package/src/agents/heavy-worker/AGENT.md +6 -5
- package/src/agents/maintainer/AGENT.md +4 -0
- package/src/agents/reviewer/AGENT.md +2 -1
- package/src/agents/worker/AGENT.md +8 -4
- package/src/lib/rules-builder.cjs +4 -0
- package/src/mixdog-session-runtime.mjs +632 -2042
- package/src/output-styles/default.md +34 -9
- package/src/output-styles/{oneline.md → extreme-minimal.md} +5 -4
- package/src/output-styles/minimal.md +4 -1
- package/src/output-styles/simple.md +22 -7
- package/src/rules/agent/00-common.md +2 -0
- package/src/rules/lead/lead-brief.md +12 -0
- package/src/rules/lead/lead-tool.md +0 -11
- package/src/runtime/agent/orchestrator/agent-runtime/agent-loop-policy.mjs +25 -0
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +100 -23
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +6 -15
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +362 -0
- package/src/runtime/agent/orchestrator/agent-trace-io.mjs +410 -0
- package/src/runtime/agent/orchestrator/agent-trace.mjs +16 -735
- package/src/runtime/agent/orchestrator/config.mjs +69 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +62 -20
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +209 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +489 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +81 -1281
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +607 -0
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +32 -3
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +81 -0
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +248 -0
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +303 -0
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +505 -0
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +43 -1013
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +17 -3
- package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +86 -11
- package/src/runtime/agent/orchestrator/providers/model-list-sanitize.mjs +348 -0
- package/src/runtime/agent/orchestrator/providers/openai-codex-model.mjs +108 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-trace.mjs +58 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +368 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +760 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +40 -1143
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +732 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +193 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +297 -2123
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +130 -1002
- package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +227 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-events.mjs +67 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +436 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +1105 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +288 -0
- package/src/runtime/agent/orchestrator/session/compact/constants.mjs +85 -0
- package/src/runtime/agent/orchestrator/session/compact/engine.mjs +749 -0
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +82 -0
- package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +315 -0
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +643 -0
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +326 -0
- package/src/runtime/agent/orchestrator/session/compact.mjs +40 -2282
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +14 -2
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +61 -0
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +1 -3
- package/src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs +182 -0
- package/src/runtime/agent/orchestrator/session/loop/steering-ladder.mjs +173 -0
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +58 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +239 -0
- package/src/runtime/agent/orchestrator/session/loop.mjs +251 -397
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +471 -0
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +7 -4
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +12 -0
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +406 -0
- package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +80 -0
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +210 -0
- package/src/runtime/agent/orchestrator/session/manager.mjs +166 -1087
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +189 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +74 -179
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +70 -20
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +22 -2
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +32 -41
- package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +40 -0
- package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +29 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +8 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +126 -0
- package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +81 -92
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +161 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +108 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +28 -265
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +0 -6
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +57 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/keyword-match.mjs +82 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +10 -122
- package/src/runtime/agent/orchestrator/tools/code-graph/text-columns.mjs +45 -0
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +6 -6
- package/src/runtime/agent/orchestrator/tools/graph-binary-fetcher.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/patch/constants.mjs +9 -0
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +171 -0
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +471 -0
- package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +436 -0
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +342 -0
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +359 -0
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +340 -0
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +643 -0
- package/src/runtime/agent/orchestrator/tools/patch.mjs +36 -2959
- package/src/runtime/agent/orchestrator/tools/progress-message.mjs +0 -21
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +9 -72
- package/src/runtime/agent/orchestrator/tools/shell-powershell.mjs +77 -0
- package/src/runtime/agent/orchestrator/tools/shell-state.mjs +154 -0
- package/src/runtime/channels/backends/discord-access.mjs +32 -0
- package/src/runtime/channels/backends/discord-attachments.mjs +65 -0
- package/src/runtime/channels/backends/discord-gateway.mjs +233 -0
- package/src/runtime/channels/backends/discord.mjs +12 -292
- package/src/runtime/channels/index.mjs +229 -663
- package/src/runtime/channels/lib/backend-dispatch.mjs +44 -0
- package/src/runtime/channels/lib/event-pipeline.mjs +18 -1
- package/src/runtime/channels/lib/event-queue.mjs +63 -4
- package/src/runtime/channels/lib/inbound-routing.mjs +111 -0
- package/src/runtime/channels/lib/output-forwarder.mjs +1 -1
- package/src/runtime/channels/lib/owner-heartbeat.mjs +75 -0
- package/src/runtime/channels/lib/parent-bridge.mjs +88 -0
- package/src/runtime/channels/lib/runtime-paths.mjs +14 -4
- package/src/runtime/channels/lib/session-discovery.mjs +56 -4
- package/src/runtime/channels/lib/tool-dispatch.mjs +158 -0
- package/src/runtime/channels/lib/tool-format.mjs +1 -1
- package/src/runtime/channels/lib/transcript-discovery.mjs +4 -4
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +6 -3
- package/src/runtime/channels/lib/voice-transcription.mjs +179 -0
- package/src/runtime/channels/lib/webhook/deliveries.mjs +312 -0
- package/src/runtime/channels/lib/webhook/log.mjs +42 -0
- package/src/runtime/channels/lib/webhook/ngrok.mjs +181 -0
- package/src/runtime/channels/lib/webhook/signature.mjs +60 -0
- package/src/runtime/channels/lib/webhook.mjs +36 -570
- package/src/runtime/channels/tool-defs.mjs +11 -130
- package/src/runtime/memory/index.mjs +201 -1948
- package/src/runtime/memory/lib/cycle-llm-adapters.mjs +58 -0
- package/src/runtime/memory/lib/cycle-scheduler.mjs +497 -0
- package/src/runtime/memory/lib/embedding-warmup.mjs +58 -0
- package/src/runtime/memory/lib/memory-config-flags.mjs +91 -0
- package/src/runtime/memory/lib/memory-cycle.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-gate.mjs +515 -0
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +324 -0
- package/src/runtime/memory/lib/memory-cycle2-shared.mjs +18 -0
- package/src/runtime/memory/lib/memory-cycle2.mjs +24 -842
- package/src/runtime/memory/lib/memory-embed.mjs +149 -0
- package/src/runtime/memory/lib/memory-process-lock.mjs +162 -0
- package/src/runtime/memory/lib/memory-recall-store.mjs +22 -2
- package/src/runtime/memory/lib/pg/supervisor.mjs +1 -1
- package/src/runtime/memory/lib/query-handlers.mjs +780 -0
- package/src/runtime/memory/lib/recall-format.mjs +55 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +8 -3
- package/src/runtime/memory/lib/transcript-ingest.mjs +425 -0
- package/src/runtime/memory/tool-defs.mjs +5 -13
- package/src/runtime/search/lib/http-fetch.mjs +274 -0
- package/src/runtime/search/lib/ssrf-guard.mjs +333 -0
- package/src/runtime/search/lib/web-tools.mjs +24 -602
- package/src/runtime/shared/atomic-file.mjs +26 -1
- package/src/runtime/shared/launcher-control.mjs +2 -2
- package/src/runtime/shared/tool-primitives.mjs +308 -0
- package/src/runtime/shared/tool-result-summary.mjs +515 -0
- package/src/runtime/shared/tool-surface.mjs +80 -898
- package/src/runtime/shared/transcript-writer.mjs +23 -0
- package/src/runtime/shared/update-checker.mjs +7 -4
- package/src/session-runtime/config-helpers.mjs +84 -2
- package/src/session-runtime/config-lifecycle.mjs +232 -0
- package/src/session-runtime/cwd-plugins.mjs +226 -0
- package/src/session-runtime/mcp-glue.mjs +177 -0
- package/src/session-runtime/model-recency.mjs +111 -0
- package/src/session-runtime/native-search.mjs +247 -0
- package/src/session-runtime/output-styles.mjs +11 -9
- package/src/session-runtime/prewarm.mjs +142 -0
- package/src/session-runtime/provider-models.mjs +278 -0
- package/src/session-runtime/provider-usage.mjs +120 -0
- package/src/session-runtime/quick-model-rows.mjs +170 -0
- package/src/session-runtime/quick-search-models.mjs +46 -0
- package/src/session-runtime/session-hooks.mjs +93 -0
- package/src/session-runtime/settings-api.mjs +319 -0
- package/src/session-runtime/tool-catalog.mjs +29 -29
- package/src/session-runtime/tool-defs.mjs +84 -0
- package/src/session-runtime/warmup-schedulers.mjs +201 -0
- package/src/standalone/agent-tool/helpers.mjs +237 -0
- package/src/standalone/agent-tool/notify.mjs +107 -0
- package/src/standalone/agent-tool/provider-init.mjs +143 -0
- package/src/standalone/agent-tool/render.mjs +152 -0
- package/src/standalone/agent-tool/tool-def.mjs +55 -0
- package/src/standalone/agent-tool.mjs +110 -671
- package/src/standalone/channel-worker.mjs +4 -7
- package/src/standalone/explore-tool.mjs +30 -9
- package/src/standalone/hook-bus/config.mjs +207 -0
- package/src/standalone/hook-bus/constants.mjs +90 -0
- package/src/standalone/hook-bus/handlers.mjs +481 -0
- package/src/standalone/hook-bus/payload.mjs +31 -0
- package/src/standalone/hook-bus/rules.mjs +77 -0
- package/src/standalone/hook-bus.mjs +77 -870
- package/src/standalone/memory-runtime-proxy.mjs +7 -0
- package/src/standalone/opencode-go-login.mjs +5 -1
- package/src/standalone/provider-admin.mjs +1 -16
- package/src/standalone/usage-dashboard.mjs +3 -1
- package/src/tui/App.jsx +945 -8094
- package/src/tui/app/app-format.mjs +206 -0
- package/src/tui/app/channel-pickers.mjs +510 -0
- package/src/tui/app/clipboard.mjs +67 -0
- package/src/tui/app/core-memory-picker.mjs +210 -0
- package/src/tui/app/extension-pickers.mjs +506 -0
- package/src/tui/app/input-parsers.mjs +193 -0
- package/src/tui/app/maintenance-pickers.mjs +324 -0
- package/src/tui/app/model-options.mjs +330 -0
- package/src/tui/app/model-picker.mjs +365 -0
- package/src/tui/app/onboarding-steps.mjs +400 -0
- package/src/tui/app/project-picker.mjs +247 -0
- package/src/tui/app/provider-setup-picker.mjs +580 -0
- package/src/tui/app/resume-picker.mjs +55 -0
- package/src/tui/app/route-pickers.mjs +419 -0
- package/src/tui/app/settings-picker.mjs +490 -0
- package/src/tui/app/slash-commands.mjs +101 -0
- package/src/tui/app/slash-dispatch.mjs +427 -0
- package/src/tui/app/text-layout.mjs +46 -0
- package/src/tui/app/theme-effort-pickers.mjs +154 -0
- package/src/tui/app/transcript-window.mjs +671 -0
- package/src/tui/app/use-mouse-input.mjs +460 -0
- package/src/tui/app/use-prompt-handlers.mjs +310 -0
- package/src/tui/app/use-transcript-scroll.mjs +510 -0
- package/src/tui/app/use-transcript-window.mjs +589 -0
- package/src/tui/components/ConfirmBar.jsx +1 -1
- package/src/tui/components/Picker.jsx +32 -4
- package/src/tui/components/PromptInput.jsx +23 -101
- package/src/tui/components/SlashCommandPalette.jsx +8 -1
- package/src/tui/components/StatusLine.jsx +63 -12
- package/src/tui/components/TextEntryPanel.jsx +11 -0
- package/src/tui/components/ToolExecution.jsx +52 -594
- package/src/tui/components/TranscriptItem.jsx +105 -0
- package/src/tui/components/UsagePanel.jsx +18 -4
- package/src/tui/components/prompt-input/edit-helpers.mjs +72 -0
- package/src/tui/components/prompt-input/voice-indicator.mjs +39 -0
- package/src/tui/components/tool-execution/ResultBody.jsx +56 -0
- package/src/tui/components/tool-execution/surface-detail.mjs +405 -0
- package/src/tui/components/tool-execution/text-format.mjs +161 -0
- package/src/tui/display-width.mjs +20 -3
- package/src/tui/dist/index.mjs +19652 -18630
- package/src/tui/engine/agent-job-feed.mjs +133 -0
- package/src/tui/engine/notification-plan.mjs +76 -0
- package/src/tui/engine/render-timing.mjs +17 -0
- package/src/tui/engine/tool-approval.mjs +94 -0
- package/src/tui/engine/tool-card-results.mjs +234 -0
- package/src/tui/engine/tool-result-status.mjs +135 -0
- package/src/tui/engine.mjs +122 -562
- package/src/tui/figures.mjs +5 -0
- package/src/tui/index.jsx +105 -0
- package/src/tui/input-editing.mjs +2 -2
- package/src/tui/markdown/format-token.mjs +4 -1
- package/src/tui/statusline-ansi-bridge.mjs +11 -3
- package/src/tui/theme.mjs +6 -0
- package/src/ui/statusline-agents.mjs +213 -0
- package/src/ui/statusline-format.mjs +146 -0
- package/src/ui/statusline-segments.mjs +148 -0
- package/src/ui/statusline.mjs +67 -501
- package/src/ui/tool-card.mjs +0 -1
- package/src/vendor/statusline/bin/statusline-route.mjs +15 -2
- package/src/workflows/default/WORKFLOW.md +1 -1
- package/src/workflows/sequential/WORKFLOW.md +1 -1
- package/vendor/ink/build/display-width.js +19 -3
- package/vendor/ink/build/ink.js +103 -6
- package/vendor/ink/build/log-update.js +17 -3
- package/vendor/ink/build/wrap-text.js +125 -0
- package/scripts/_test-folder-dialog.mjs +0 -30
- package/scripts/fix-brief-fn.mjs +0 -35
- package/scripts/fix-format-tool-surface.mjs +0 -24
- package/scripts/fix-tool-exec-visible.mjs +0 -42
- package/scripts/patch-agent-brief.mjs +0 -48
- package/scripts/patch-app.mjs +0 -21
- package/scripts/patch-app2.mjs +0 -18
- package/scripts/patch-dist-brief.mjs +0 -96
- package/scripts/patch-tool-exec.mjs +0 -70
- package/src/examples/schedules/SCHEDULE.example.md +0 -32
- package/src/examples/webhooks/WEBHOOK.example.md +0 -40
- package/src/runtime/agent/orchestrator/session/manager.reactive-persist.test.mjs +0 -107
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.test.mjs +0 -143
- package/src/runtime/agent/orchestrator/tools/builtin/diagnostics-tool.mjs +0 -285
- package/src/runtime/agent/orchestrator/tools/builtin/external-tool-adapters.test.mjs +0 -162
- package/src/runtime/agent/orchestrator/tools/builtin/open-config-tool.mjs +0 -26
- package/src/runtime/shared/channel-notification-routing.test.mjs +0 -45
- package/src/runtime/shared/task-notification-envelope.test.mjs +0 -107
- package/src/runtime/shared/tool-execution-contract.test.mjs +0 -183
- package/src/standalone/agent-task-status.test.mjs +0 -76
- package/src/tui/components/tool-output-format.test.mjs +0 -399
- package/src/tui/display-width.test.mjs +0 -35
- package/src/tui/engine-runtime-notification.test.mjs +0 -115
- package/src/tui/engine-tool-result-text.test.mjs +0 -75
- package/src/tui/input-editing.selection.test.mjs +0 -75
- package/src/tui/markdown/format-token.test.mjs +0 -354
- package/src/tui/markdown/render-ansi.test.mjs +0 -108
- package/src/tui/markdown/stream-fence.test.mjs +0 -26
- package/src/tui/markdown/streaming-markdown.test.mjs +0 -70
- package/src/tui/paste-fix.test.mjs +0 -119
- package/src/tui/prompt-history-store.test.mjs +0 -52
- package/src/tui/statusline-ansi-bridge.test.mjs +0 -159
- package/src/tui/transcript-tool-failures.test.mjs +0 -111
- package/src/ui/markdown.test.mjs +0 -70
- package/src/ui/statusline-context-label.test.mjs +0 -15
- package/src/vendor/statusline/bin/statusline-lib.mjs +0 -186
- package/src/vendor/statusline/bin/statusline-route.test.mjs +0 -80
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
{
|
|
2
|
+
"round": "11",
|
|
3
|
+
"runner": "lead",
|
|
4
|
+
"opts": {
|
|
5
|
+
"provider": "openai-oauth",
|
|
6
|
+
"model": "gpt-5.5",
|
|
7
|
+
"effort": null,
|
|
8
|
+
"fast": false,
|
|
9
|
+
"env": {
|
|
10
|
+
"MIXDOG_DATA_DIR": "C:\\Users\\tempe\\.mixdog\\bench-data"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"tasks": 3,
|
|
14
|
+
"completed": 3,
|
|
15
|
+
"completion_rate": 100,
|
|
16
|
+
"sessions": [
|
|
17
|
+
"sess_47100_1783055745198_1783055745435_dcf2093a36ef942ce3a48b2cc5b2544f",
|
|
18
|
+
"sess_37868_1783055745212_1783055745449_8ddb3a100a3e63e79471cd301c4b4e9d",
|
|
19
|
+
"sess_24344_1783055745227_1783055745464_1171ce7c8fbe4ebac0323e11cd6150ac"
|
|
20
|
+
],
|
|
21
|
+
"results": [
|
|
22
|
+
{
|
|
23
|
+
"id": "r4-debug-forwarding-gap",
|
|
24
|
+
"agent": "reviewer",
|
|
25
|
+
"ok": true,
|
|
26
|
+
"ms": 110161,
|
|
27
|
+
"sessionId": "sess_47100_1783055745198_1783055745435_dcf2093a36ef942ce3a48b2cc5b2544f",
|
|
28
|
+
"output": "sessionId: sess_47100_1783055745198_1783055745435_dcf2093a36ef942ce3a48b2cc5b2544f\n재영님, 조사 결과 활성화 직후 출력은 “지연”은 대체로 복구되지만, 이미 존재하는 새 transcript에 대한 첫 바인딩은 실제 유실 경로입니다.\n\n**경로 요약**: `bridge-state.json`은 `activate_channel_bridge`에서 먼저 쓰이고(`src/runtime/channels/lib/tool-dispatch.mjs:45-59`), worker start도 동일하게 먼저 활성화합니다(`src/runtime/channels/index.mjs:1735-1745`). 이후 ownership/connect, persisted transcript bind, `fs.watch`, `forwardNewText()`가 이어집니다.\n\n**1. 최대 영향 — 기존 transcript를 첫 바인딩하면 EOF로 점프해 이전 출력 유실**: `catchUpFromPersisted`는 같은 persisted path일 때만 이전 cursor를 쓰고, 아니면 `currentSize`로 시작합니다(`src/runtime/channels/lib/output-forwarder.mjs:117-126`). 활성화 bind는 이 상태로 `forwardNewText()`를 호출하므로(`src/runtime/channels/index.mjs:625-629`, `src/runtime/channels/index.mjs:801-812`) 바인딩 전 이미 파일에 쓰인 assistant 출력은 backlog로 복구되지 않습니다. 단, 같은 transcript의 persisted `lastFileSize`가 남아 있으면 복구됩니다.\n\n**2. 채널 바인딩이 없으면 나중의 첫 inbound에서 기존 출력이 EOF 처리될 수 있음**: 활성화 시 status/main channel이 없으면 bind가 아예 중단됩니다(`src/runtime/channels/index.mjs:610-624`), `forwardNewText()`도 `channelId` 없이 no-op입니다(`src/runtime/channels/lib/output-forwarder.mjs:351-354`). 나중에 inbound가 기존 transcript를 `applyTranscriptBinding()`하면 catch-up 옵션 없이 EOF로 잡힐 수 있어(`src/runtime/channels/index.mjs:1597-1603`) backlog는 기존 파일에 대해 복구하지 못합니다.\n\n**3. not-yet-created transcript의 `fs.watch` 실패는 설계상 지연 복구됨**: `startWatch()`는 없는 파일에서 catch 후 watcher를 닫습니다(`src/runtime/channels/lib/output-forwarder.mjs:647-670`), 이를 `schedulePendingTranscriptRearm()`이 250ms polling으로 재설치하고 즉시 `forwardNewText()` 합니다(`src/runtime/channels/index.mjs:339-346`, `src/runtime/channels/index.mjs:376-381`, `src/runtime/channels/index.mjs:493-498`). 60초 내 생성되고 ownership이 유지되면 backlog 복구됩니다; timeout/ownership loss 후 재bind가 없으면 복구되지 않습니다.\n\n**4. bridge-state write 후 ownership/backend connect 전 출력은 지연됨**: forwarder는 `bridgeRuntimeConnected && currentOwnerState().owned`가 false면 읽지 않습니다(`src/runtime/channels/index.mjs:316`, `src/runtime/channels/lib/output-forwarder.mjs:351-353`). connect 완료 후 `bridgeRuntimeConnected = true`가 되고 post-connect `forwardNewText()`가 실행됩니다(`src/runtime/channels/index.mjs:769-781`, `src/runtime/channels/index.mjs:801-812`), 그래서 cursor가 보존된 경우 backlog 복구됩니다.\n\n**5. watch 설치 직전/직후의 짧은 race는 복구됨**: `setContext()`의 stat 이후 watch 설치 사이에 쓰인 bytes는 `startWatch()`가 즉시 `scheduleWatchFlush()`를 호출해 읽습니다(`src/runtime/channels/lib/output-forwarder.mjs:665-666`, `src/runtime/channels/lib/output-forwarder.mjs:703-731`). 단, `setContext()` stat 이전 bytes는 1번 유실 조건에 속합니다.\n\n**Verdict**: 활성화-연결-미생성 파일 구간의 지연은 대부분 catch-up 되지만, “새로 발견된 이미 존재하는 transcript”를 EOF로 바인딩하는 경로는 첫 assistant 출력을 조용히 유실할 수 있습니다.",
|
|
29
|
+
"card": {
|
|
30
|
+
"session": "sess_47100_1783055745198_1783055745435_dcf2093a36ef942ce3a48b2cc5b2544f",
|
|
31
|
+
"provider": "openai-oauth",
|
|
32
|
+
"model": "gpt-5.5",
|
|
33
|
+
"wall_ms": 99667,
|
|
34
|
+
"turns": 6,
|
|
35
|
+
"tool_calls": 7,
|
|
36
|
+
"tools_per_turn": 1.2,
|
|
37
|
+
"total_tool_ms": 654,
|
|
38
|
+
"llm_stream_ms": 98986,
|
|
39
|
+
"cache_ratio": 0.4810080500736896,
|
|
40
|
+
"cached_tokens": 81920,
|
|
41
|
+
"prompt_tokens": 170309,
|
|
42
|
+
"uncached_tokens": 88389,
|
|
43
|
+
"output_tokens": 10473,
|
|
44
|
+
"cache_weighted_input_10": 96581,
|
|
45
|
+
"cache_weighted_input_25": 108869,
|
|
46
|
+
"prompt_growth": 49597,
|
|
47
|
+
"antipatterns": 1,
|
|
48
|
+
"issues": 5,
|
|
49
|
+
"issue_types": [
|
|
50
|
+
"cache_miss",
|
|
51
|
+
"cache",
|
|
52
|
+
"broad_tool_result",
|
|
53
|
+
"service_tier",
|
|
54
|
+
"tool_churn_cluster"
|
|
55
|
+
],
|
|
56
|
+
"read_fragmentation_paths": [],
|
|
57
|
+
"grep_sweep_count": 0
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "r4-impl-usage-summary",
|
|
62
|
+
"agent": "worker",
|
|
63
|
+
"ok": true,
|
|
64
|
+
"ms": 76472,
|
|
65
|
+
"sessionId": "sess_37868_1783055745212_1783055745449_8ddb3a100a3e63e79471cd301c4b4e9d",
|
|
66
|
+
"output": "sessionId: sess_37868_1783055745212_1783055745449_8ddb3a100a3e63e79471cd301c4b4e9d\n구현 상태를 확인하고 요청하신 검증을 바로 실행하겠습니다.요청한 기본 경로에 맞도록 `MIXDOG_DATA_DIR`가 없을 때는 `~/.mixdog/data`만 사용하게 조정하겠습니다.패치 도구가 실패해 PowerShell로 동일 변경을 적용하고 검증까지 다시 실행하겠습니다.완료했습니다: `usage:today` npm script와 새 `scripts/usage-today.mjs`를 추가했습니다.\n\n- **변경 요약**: `package.json:58`에 `usage:today`를 추가했고, 새 스크립트가 `MIXDOG_DATA_DIR` 또는 `~/.mixdog/data/history/agent-trace.jsonl`을 읽어 오늘 사용량을 모델별/총합으로 출력합니다.\n\n- **출력 항목**: 모델별 `calls`, `input`, `cached`, `output`, `costUsd`와 `GRAND TOTAL`을 표로 출력하며 `--trace`, `--json`도 지원합니다.\n\n- **검증 완료**: `node --check scripts/usage-today.mjs` 통과, `npm run usage:today` 실행 완료; 현재 환경에서는 총 `1157` calls, `76.2205` costUsd가 출력됐습니다.\n\n- **참고**: 기존 작업트리의 무관한 수정 `src/runtime/channels/lib/event-queue.mjs`, `src/runtime/channels/lib/output-forwarder.mjs`는 건드리지 않았습니다.",
|
|
67
|
+
"card": {
|
|
68
|
+
"session": "sess_37868_1783055745212_1783055745449_8ddb3a100a3e63e79471cd301c4b4e9d",
|
|
69
|
+
"provider": "openai-oauth",
|
|
70
|
+
"model": "gpt-5.5",
|
|
71
|
+
"wall_ms": 65981,
|
|
72
|
+
"turns": 9,
|
|
73
|
+
"tool_calls": 9,
|
|
74
|
+
"tools_per_turn": 1,
|
|
75
|
+
"total_tool_ms": 3173,
|
|
76
|
+
"llm_stream_ms": 62795,
|
|
77
|
+
"cache_ratio": 0.6369198951943337,
|
|
78
|
+
"cached_tokens": 81920,
|
|
79
|
+
"prompt_tokens": 128619,
|
|
80
|
+
"uncached_tokens": 46699,
|
|
81
|
+
"output_tokens": 5005,
|
|
82
|
+
"cache_weighted_input_10": 54891,
|
|
83
|
+
"cache_weighted_input_25": 67179,
|
|
84
|
+
"prompt_growth": 16779,
|
|
85
|
+
"antipatterns": 1,
|
|
86
|
+
"issues": 7,
|
|
87
|
+
"issue_types": [
|
|
88
|
+
"cache_miss",
|
|
89
|
+
"cache",
|
|
90
|
+
"tool_error",
|
|
91
|
+
"service_tier",
|
|
92
|
+
"missed_parallelism",
|
|
93
|
+
"tool_churn_cluster"
|
|
94
|
+
],
|
|
95
|
+
"read_fragmentation_paths": [],
|
|
96
|
+
"grep_sweep_count": 0
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "r4-explain-compact-engine",
|
|
101
|
+
"agent": "explore",
|
|
102
|
+
"ok": true,
|
|
103
|
+
"ms": 63493,
|
|
104
|
+
"sessionId": "sess_24344_1783055745227_1783055745464_1171ce7c8fbe4ebac0323e11cd6150ac",
|
|
105
|
+
"output": "sessionId: sess_24344_1783055745227_1783055745464_1171ce7c8fbe4ebac0323e11cd6150ac\nI’ll trace the code paths and line anchors directly from the repository, then condense the map.Architecture brief:\n\n- **Public surface:** `compact.mjs` is the facade and re-exports `semanticCompactMessages` / `recallFastTrackCompactMessages` from `engine.mjs` (`src/runtime/agent/orchestrator/session/compact.mjs:1-5`, `:52-55`; `engine.mjs:278`, `:445-447`).\n\n- **Main callers:** active turns enter through `askSession → agentLoop` (`manager.mjs:1379-1380`), then pre-send auto compaction calls recall-fasttrack or semantic paths (`loop.mjs:414-428`, `:439-465`).\n\n- **Manual/clear callers:** `compactSessionMessages` and clear-before-compact call `runSessionCompaction` (`manager.mjs:1841-1850`, `:1943-1957`), which dispatches recall-fasttrack or semantic (`compaction-runner.mjs:207-224`, `:280-310`).\n\n- **Fire decision:** loop drains pending steering before sizing so the next provider payload is measured (`loop.mjs:324-329`), resolves policy (`loop.mjs:329`; `compact-policy.mjs:89-148`), and compacts when pressure crosses trigger or reactive overflow forces it (`loop.mjs:351-364`; `compact-policy.mjs:170-174`).\n\n- **Policy math:** boundary comes from explicit/session context window, trigger is boundary minus buffer, reserve includes request/tool schema reserve, and target budget is capped to compact target plus reserve (`compact-policy.mjs:94-117`, `:121-145`, `:163-168`).\n\n- **Reactive path:** if provider send returns context overflow, one retry marks `reactiveOverflowRetryPending`, loops back through normal pre-send compaction, then surfaces overflow if it fails again (`loop.mjs:981-1010`, `:1012-1026`).\n\n- **Manual threshold:** `runSessionCompaction` treats manual as forced, skips auto if disabled, returns “below threshold” when non-forced pressure is under trigger (`compaction-runner.mjs:143-176`).\n\n- **Semantic window:** `splitLiveCompactionContext` sanitizes/repairs tool pairs, separates protected system/reminder prefix, extracts previous summary, and filters summary messages out of live history (`engine.mjs:100-111`; `messages.mjs:56-81`).\n\n- **Semantic tail choice:** if live has user turns, keep up to `tailTurns` recent turns within preserved budget and split newest turn suffix if needed; otherwise choose a valid non-`tool` cut point so tool results never start the tail (`engine.mjs:46`, `:134-185`, `:121-127`, `:193-232`, `:235-242`).\n\n- **Semantic assembly:** head is summarized, tail is preserved, tail is re-sanitized/reconciled for provider-valid tool pairs, and empty live windows or no prior head without summary throw (`engine.mjs:244-255`, `:314-317`, `:319-337`, `:367-397`).\n\n- **Recall tail choice:** recall fast-track keeps newest structured turns, default max two user turns / 8k cap, drops oldest kept turns first, truncates the oldest survivor if still too large, and permits no-user assistant/tool tails (`engine.mjs:449-468`, `:593-619`).\n\n- **Recall assembly:** recall path splits protected/live context, selects preserved tail, requires compactable head/previous/recall unless explicitly allowed, caps recall injection room, then emits `system + recall summary + preserved tail` (`engine.mjs:644-668`, `:679-699`).\n\n- **Redaction hook:** no-op fast paths return sanitized messages unchanged, but real semantic/recall compaction redacts tool-call secret arguments before window selection so preserved system/tail are measured and emitted redacted (`engine.mjs:286-312`, `:389-392`, `:622-645`).\n\n- **Redaction semantics:** secret-key and raw `key:value`/`key=value` values are replaced while preserving tool-call argument shape for verbatim tail messages (`text-utils.mjs:12-17`, `:40-80`, `:219-229`, `:230-288`).\n\n- **Fallbacks:** semantic auto failures can recover by unanchored tool-output prune; recall-fasttrack auto failures do not silently prune and escalate as overflow (`loop.mjs:500-537`, `:546-626`).\n\n- **Session fallback:** manual/clear recall-fasttrack failure tries semantic once when enabled/provider exists, then non-recall failures may use the same unanchored prune safety net; otherwise failure metadata is recorded without replacing history (`compaction-runner.mjs:231-278`, `:322-347`, `:348-397`).\n\n- **State after success:** changed loop compaction replaces in-memory messages, clears provider state, resets iteration/usage epoch, and emits telemetry/events; session compaction persists compacted messages and clears provider state (`loop.mjs:630-648`, `:651-716`; `compaction-runner.mjs:399-447`).",
|
|
106
|
+
"card": {
|
|
107
|
+
"session": "sess_24344_1783055745227_1783055745464_1171ce7c8fbe4ebac0323e11cd6150ac",
|
|
108
|
+
"provider": "openai-oauth",
|
|
109
|
+
"model": "gpt-5.5",
|
|
110
|
+
"wall_ms": 52999,
|
|
111
|
+
"turns": 8,
|
|
112
|
+
"tool_calls": 7,
|
|
113
|
+
"tools_per_turn": 0.9,
|
|
114
|
+
"total_tool_ms": 484,
|
|
115
|
+
"llm_stream_ms": 52522,
|
|
116
|
+
"cache_ratio": 0.27245049171494007,
|
|
117
|
+
"cached_tokens": 40448,
|
|
118
|
+
"prompt_tokens": 148460,
|
|
119
|
+
"uncached_tokens": 108012,
|
|
120
|
+
"output_tokens": 3624,
|
|
121
|
+
"cache_weighted_input_10": 112056.8,
|
|
122
|
+
"cache_weighted_input_25": 118124,
|
|
123
|
+
"prompt_growth": 39153,
|
|
124
|
+
"antipatterns": 1,
|
|
125
|
+
"issues": 9,
|
|
126
|
+
"issue_types": [
|
|
127
|
+
"cache_miss",
|
|
128
|
+
"cache",
|
|
129
|
+
"broad_tool_result",
|
|
130
|
+
"service_tier",
|
|
131
|
+
"missed_parallelism",
|
|
132
|
+
"tool_churn_cluster"
|
|
133
|
+
],
|
|
134
|
+
"read_fragmentation_paths": [],
|
|
135
|
+
"grep_sweep_count": 0
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"task_complete": true,
|
|
140
|
+
"task_errors": [],
|
|
141
|
+
"score_complete": true,
|
|
142
|
+
"score_errors": [],
|
|
143
|
+
"group": {
|
|
144
|
+
"n": 3,
|
|
145
|
+
"wall_ms": 72882.3,
|
|
146
|
+
"turns": 7.7,
|
|
147
|
+
"tool_calls": 7.7,
|
|
148
|
+
"tools_per_turn": 1,
|
|
149
|
+
"total_tool_ms": 1437,
|
|
150
|
+
"llm_stream_ms": 71434.3,
|
|
151
|
+
"cache_ratio": 0.5,
|
|
152
|
+
"cached_tokens": 68096,
|
|
153
|
+
"prompt_tokens": 149129.3,
|
|
154
|
+
"uncached_tokens": 81033.3,
|
|
155
|
+
"output_tokens": 6367.3,
|
|
156
|
+
"cache_weighted_input_10": 87842.9,
|
|
157
|
+
"cache_weighted_input_25": 98057.3,
|
|
158
|
+
"prompt_growth": 35176.3,
|
|
159
|
+
"antipatterns": 1,
|
|
160
|
+
"issues": 7,
|
|
161
|
+
"grep_sweep_count": 0
|
|
162
|
+
},
|
|
163
|
+
"cards": [
|
|
164
|
+
{
|
|
165
|
+
"session": "sess_47100_1783055745198_1783055745435_dcf2093a36ef942ce3a48b2cc5b2544f",
|
|
166
|
+
"provider": "openai-oauth",
|
|
167
|
+
"model": "gpt-5.5",
|
|
168
|
+
"wall_ms": 99667,
|
|
169
|
+
"turns": 6,
|
|
170
|
+
"tool_calls": 7,
|
|
171
|
+
"tools_per_turn": 1.2,
|
|
172
|
+
"total_tool_ms": 654,
|
|
173
|
+
"llm_stream_ms": 98986,
|
|
174
|
+
"cache_ratio": 0.4810080500736896,
|
|
175
|
+
"cached_tokens": 81920,
|
|
176
|
+
"prompt_tokens": 170309,
|
|
177
|
+
"uncached_tokens": 88389,
|
|
178
|
+
"output_tokens": 10473,
|
|
179
|
+
"cache_weighted_input_10": 96581,
|
|
180
|
+
"cache_weighted_input_25": 108869,
|
|
181
|
+
"prompt_growth": 49597,
|
|
182
|
+
"antipatterns": 1,
|
|
183
|
+
"issues": 5,
|
|
184
|
+
"issue_types": [
|
|
185
|
+
"cache_miss",
|
|
186
|
+
"cache",
|
|
187
|
+
"broad_tool_result",
|
|
188
|
+
"service_tier",
|
|
189
|
+
"tool_churn_cluster"
|
|
190
|
+
],
|
|
191
|
+
"read_fragmentation_paths": [],
|
|
192
|
+
"grep_sweep_count": 0
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"session": "sess_37868_1783055745212_1783055745449_8ddb3a100a3e63e79471cd301c4b4e9d",
|
|
196
|
+
"provider": "openai-oauth",
|
|
197
|
+
"model": "gpt-5.5",
|
|
198
|
+
"wall_ms": 65981,
|
|
199
|
+
"turns": 9,
|
|
200
|
+
"tool_calls": 9,
|
|
201
|
+
"tools_per_turn": 1,
|
|
202
|
+
"total_tool_ms": 3173,
|
|
203
|
+
"llm_stream_ms": 62795,
|
|
204
|
+
"cache_ratio": 0.6369198951943337,
|
|
205
|
+
"cached_tokens": 81920,
|
|
206
|
+
"prompt_tokens": 128619,
|
|
207
|
+
"uncached_tokens": 46699,
|
|
208
|
+
"output_tokens": 5005,
|
|
209
|
+
"cache_weighted_input_10": 54891,
|
|
210
|
+
"cache_weighted_input_25": 67179,
|
|
211
|
+
"prompt_growth": 16779,
|
|
212
|
+
"antipatterns": 1,
|
|
213
|
+
"issues": 7,
|
|
214
|
+
"issue_types": [
|
|
215
|
+
"cache_miss",
|
|
216
|
+
"cache",
|
|
217
|
+
"tool_error",
|
|
218
|
+
"service_tier",
|
|
219
|
+
"missed_parallelism",
|
|
220
|
+
"tool_churn_cluster"
|
|
221
|
+
],
|
|
222
|
+
"read_fragmentation_paths": [],
|
|
223
|
+
"grep_sweep_count": 0
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"session": "sess_24344_1783055745227_1783055745464_1171ce7c8fbe4ebac0323e11cd6150ac",
|
|
227
|
+
"provider": "openai-oauth",
|
|
228
|
+
"model": "gpt-5.5",
|
|
229
|
+
"wall_ms": 52999,
|
|
230
|
+
"turns": 8,
|
|
231
|
+
"tool_calls": 7,
|
|
232
|
+
"tools_per_turn": 0.9,
|
|
233
|
+
"total_tool_ms": 484,
|
|
234
|
+
"llm_stream_ms": 52522,
|
|
235
|
+
"cache_ratio": 0.27245049171494007,
|
|
236
|
+
"cached_tokens": 40448,
|
|
237
|
+
"prompt_tokens": 148460,
|
|
238
|
+
"uncached_tokens": 108012,
|
|
239
|
+
"output_tokens": 3624,
|
|
240
|
+
"cache_weighted_input_10": 112056.8,
|
|
241
|
+
"cache_weighted_input_25": 118124,
|
|
242
|
+
"prompt_growth": 39153,
|
|
243
|
+
"antipatterns": 1,
|
|
244
|
+
"issues": 9,
|
|
245
|
+
"issue_types": [
|
|
246
|
+
"cache_miss",
|
|
247
|
+
"cache",
|
|
248
|
+
"broad_tool_result",
|
|
249
|
+
"service_tier",
|
|
250
|
+
"missed_parallelism",
|
|
251
|
+
"tool_churn_cluster"
|
|
252
|
+
],
|
|
253
|
+
"read_fragmentation_paths": [],
|
|
254
|
+
"grep_sweep_count": 0
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"round": "4",
|
|
3
|
+
"runner": "codex",
|
|
4
|
+
"opts": {
|
|
5
|
+
"provider": "openai-oauth",
|
|
6
|
+
"model": "gpt-5.5",
|
|
7
|
+
"effort": "high",
|
|
8
|
+
"fast": false,
|
|
9
|
+
"env": {}
|
|
10
|
+
},
|
|
11
|
+
"tasks": 3,
|
|
12
|
+
"completed": 3,
|
|
13
|
+
"completion_rate": 100,
|
|
14
|
+
"sessions": [
|
|
15
|
+
"019f254d-7eb9-7b61-8033-dac06c077921",
|
|
16
|
+
"019f254d-80cf-7ee2-bc2b-e189fd3466e1",
|
|
17
|
+
"019f254d-7f3e-73d1-89b0-a4bd9928d221"
|
|
18
|
+
],
|
|
19
|
+
"results": [
|
|
20
|
+
{
|
|
21
|
+
"id": "r4-debug-forwarding-gap",
|
|
22
|
+
"agent": "reviewer",
|
|
23
|
+
"ok": true,
|
|
24
|
+
"ms": 113095,
|
|
25
|
+
"sessionId": "019f254d-7eb9-7b61-8033-dac06c077921",
|
|
26
|
+
"card": {
|
|
27
|
+
"session": "019f254d-7eb9-7b61-8033-dac06c077921",
|
|
28
|
+
"wall_ms": 113095,
|
|
29
|
+
"uncached_in": 73170,
|
|
30
|
+
"cached_in": 184192,
|
|
31
|
+
"out_tokens": 6579,
|
|
32
|
+
"cache_ratio": 0.716,
|
|
33
|
+
"completed": 1
|
|
34
|
+
},
|
|
35
|
+
"output": "조사 결과입니다. 코드 변경 없이 `src/runtime/channels/index.mjs`와 `src/runtime/channels/lib/output-forwarder.mjs`만 추적했습니다.\n\n**Activation Path**\n`start()`가 먼저 `channelBridgeActive = true`로 만들고 `bridge-state.json`을 씁니다: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:1734). 그 뒤에 소유권을 claim하고 `refreshBridgeOwnership({ restoreBinding: true })`를 기다립니다: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:1741).\n\n소유권이 확인되면 `startOwnedRuntime()`이 `active-instance.json`을 `backendReady:false`로 먼저 publish하고: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:723), persisted transcript bind를 `backend.connect()`와 병렬로 시작합니다: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:758). connect가 끝나야 `bridgeRuntimeConnected = true`가 됩니다: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:769). 이후 binding task를 기다린 다음, transcript가 있으면 `forwarder.forwardNewText()`가 첫 실제 forward를 시도합니다: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:801).\n\n첫 Discord send는 `forwardNewText()` → `extractNewText()` → `deliverQueueItem()` → `cb.send()` → `backend.sendMessage()` 경로입니다: [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:351), [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:316), [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:285).\n\n**Findings By Impact**\n\n1. **Highest: existing transcript can be bound at EOF, making already-written assistant output unrecoverable.** \n `setContext()` defaults to `fileSize = currentSize` unless `replayFromStart` or matching `catchUpFromPersisted` is active: [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:115). If bridge activation discovers an already-existing transcript whose path does not match persisted status, `catchUpFromPersisted` falls back to EOF: [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:117). The activation bind passes `catchUpFromPersisted:true`: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:625), but that only catches up when the persisted path matches. \n Backlog recovery: **No**, not after the cursor is initialized to EOF and persisted through `applyTranscriptBinding()` status update: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:326).\n\n2. **High: inbound Discord messages arriving before `bridgeRuntimeConnected` are dropped, not queued.** \n `backend.onMessage` calls `refreshBridgeOwnershipSafe()` and immediately returns if runtime is not connected or ownership snapshot is false: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:1469). If this happens during the activation/connect window, the user message is not delivered to the assistant, so there may be no transcript output to forward. \n Backlog recovery: **No** for the inbound message itself. Transcript catch-up can only forward assistant output that was produced by some other path.\n\n3. **Medium: not-yet-created transcript files are not watchable; forwarding is delayed until re-arm succeeds.** \n `applyTranscriptBinding()` calls `forwarder.startWatch()` immediately: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:317). If the transcript file does not exist, `fs.watch()` throws and `startWatch()` closes the watcher: [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:647). The repo has a re-arm poll for this exact gap: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:357). When the file appears, it installs the watcher and calls `forwardNewText()`: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:376). \n Backlog recovery: **Yes, if the file appears within 60s and ownership is still active**. After timeout, recovery is only by a later rebind/forward trigger, not automatic: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:384).\n\n4. **Medium: pre-connect ownership probe suppresses early watch flushes, but usually delays rather than drops.** \n The forwarder owner gate requires both `bridgeRuntimeConnected` and `currentOwnerState().owned`: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:316). Before connect completes, `forwardNewText()` returns before reading bytes: [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:351). Since it does not advance the cursor, output is not silently consumed. `startOwnedRuntime()` later compensates with post-connect `forwardNewText()` or re-arm scheduling: [index.mjs](C:/Project/mixdog-bench/src/runtime/channels/index.mjs:803). \n Backlog recovery: **Yes on normal activation with `restoreBinding:true`**, delayed until connect finishes.\n\n5. **Low: bytes written between `setContext()` stat and watch install are covered.** \n `startWatch()` schedules an immediate flush after installing `fs.watch()`: [output-forwarder.mjs](C:/Project/mixdog-bench/src/runtime/channels/lib/output-forwarder.mjs:665). \n Backlog recovery: **Yes**, unless this combines with the EOF binding problem above.\n\nVerdict: **The bridge mostly delays early output until connect/re-arm, but an already-existing transcript without a matching persisted cursor can still be bound at EOF and silently lose pre-bind assistant output.**"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "r4-impl-usage-summary",
|
|
39
|
+
"agent": "worker",
|
|
40
|
+
"ok": true,
|
|
41
|
+
"ms": 59039,
|
|
42
|
+
"sessionId": "019f254d-80cf-7ee2-bc2b-e189fd3466e1",
|
|
43
|
+
"card": {
|
|
44
|
+
"session": "019f254d-80cf-7ee2-bc2b-e189fd3466e1",
|
|
45
|
+
"wall_ms": 59039,
|
|
46
|
+
"uncached_in": 54732,
|
|
47
|
+
"cached_in": 138496,
|
|
48
|
+
"out_tokens": 2624,
|
|
49
|
+
"cache_ratio": 0.717,
|
|
50
|
+
"completed": 1
|
|
51
|
+
},
|
|
52
|
+
"output": "완료했습니다. 다만 현재 세션은 파일 쓰기 권한이 read-only라 제가 새 패치를 적용하진 못했고, 요청하신 변경이 이미 작업트리에 반영되어 있는 상태를 확인하고 검증했습니다.\n\nDiff summary:\n- [package.json](C:\\Project\\mixdog-bench\\package.json): `usage:today` npm script 추가\n- [scripts/usage-today.mjs](C:\\Project\\mixdog-bench\\scripts\\usage-today.mjs): 신규 스크립트 추가\n - `MIXDOG_DATA_DIR` 우선, 기본 `~/.mixdog/data/history/agent-trace.jsonl`\n - 로컬 자정 이후 `kind: \"usage\"` rows 집계\n - 모델별 calls/input/cached/output/costUsd 및 `TOTAL` 출력\n - `--trace`, `--json` 인자 파싱은 `session-bench.mjs` 스타일 사용\n\n검증:\n- `node --check scripts/usage-today.mjs`: 통과\n- `node scripts/usage-today.mjs`: 정상 출력\n- `npm run usage:today`: 정상 출력, 다만 PowerShell의 `npm.ps1`에서 npm global path 접근 경고가 한 줄 뜬 뒤 스크립트는 exit 0으로 실행됐습니다.\n\n참고로 작업트리에는 제가 건드리지 않은 기존 수정도 있습니다:\n- `src/runtime/channels/lib/event-queue.mjs`\n- `src/runtime/channels/lib/output-forwarder.mjs`"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "r4-explain-compact-engine",
|
|
56
|
+
"agent": "explore",
|
|
57
|
+
"ok": true,
|
|
58
|
+
"ms": 97535,
|
|
59
|
+
"sessionId": "019f254d-7f3e-73d1-89b0-a4bd9928d221",
|
|
60
|
+
"card": {
|
|
61
|
+
"session": "019f254d-7f3e-73d1-89b0-a4bd9928d221",
|
|
62
|
+
"wall_ms": 97535,
|
|
63
|
+
"uncached_in": 71445,
|
|
64
|
+
"cached_in": 307328,
|
|
65
|
+
"out_tokens": 5046,
|
|
66
|
+
"cache_ratio": 0.811,
|
|
67
|
+
"completed": 1
|
|
68
|
+
},
|
|
69
|
+
"output": "**Compaction Brief**\n\n- Public surface starts in `src/runtime/agent/orchestrator/session/compact/engine.mjs`: `semanticCompactMessages()` and `recallFastTrackCompactMessages()` are exported by the facade at `src/runtime/agent/orchestrator/session/compact.mjs:52-55`.\n- Automatic pre-send caller is `session/loop.mjs`, importing semantic compact at `src/runtime/agent/orchestrator/session/loop.mjs:10-16` and recall pipeline at `src/runtime/agent/orchestrator/session/loop.mjs:31-33`.\n- Manual/session caller is `runSessionCompaction()`, importing both engine entry points through the facade at `src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs:8-16`.\n- CLI `/compact` calls `runtime.compact()` at `src/repl.mjs:304-307`; runtime compact blocks active turns, fires manual hooks, then calls `mgr.compactSessionMessages()` at `src/mixdog-session-runtime.mjs:2452-2464`.\n- `compactSessionMessages()` loads the session, rejects closed/in-progress sessions, and invokes `runSessionCompaction(... mode:'manual', force:true ...)` at `src/runtime/agent/orchestrator/session/manager.mjs:1943-1957`.\n- Auto policy resolves only when `compaction.auto` and env allow it, then derives boundary/trigger/reserve/type/tail settings at `src/runtime/agent/orchestrator/session/loop/compact-policy.mjs:89-148`.\n- Auto fires when `forceReactive` is true, token estimate is unavailable, or `messageTokens + reserve >= triggerTokens` at `src/runtime/agent/orchestrator/session/loop/compact-policy.mjs:170-174`.\n- Loop computes `messageTokensEst`, `shouldCompact`, pressure, trigger label `auto|reactive`, and target budget before the send at `src/runtime/agent/orchestrator/session/loop.mjs:351-364`.\n- Reactive compaction is armed after a provider context-overflow refusal, then the loop continues back through the same pre-send compact path at `src/runtime/agent/orchestrator/session/loop.mjs:982-1011`.\n- Manual runner skips if auto is disabled only for `mode:'auto'`, forces manual runs, skips tiny histories when not forced, and returns “below threshold” when pressure is below trigger at `src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs:143-195`.\n- Semantic engine first sanitizes/dedups/tool-pair reconciles, no-ops if already within budget and not forced, then redacts and selects the compaction window at `src/runtime/agent/orchestrator/session/compact/engine.mjs:278-314`.\n- Semantic window selection separates protected system prefix, strips prior summary from live messages, and remembers the latest previous summary at `src/runtime/agent/orchestrator/session/compact/engine.mjs:100-111`.\n- Semantic preserved-tail budget is `preserveRecentBudget()`, capped by explicit keep/preserve settings or default/min/25%-of-budget rules at `src/runtime/agent/orchestrator/session/compact/budget.mjs:274-287`.\n- With user turns, semantic keeps up to recent `tailTurns`, splitting the newest turn suffix if needed, and force-compaction can move the cut forward to ensure a compactable head at `src/runtime/agent/orchestrator/session/compact/engine.mjs:130-185`.\n- Without user turns, semantic picks non-tool cut points so tool results do not start the tail, grows newest-to-oldest while fitting budget, and falls back to minimal/empty tail cases at `src/runtime/agent/orchestrator/session/compact/engine.mjs:188-232`.\n- After cutting, semantic sanitizes/dedups/reconciles the tail and throws only for an empty live window or no compactable head without a previous summary at `src/runtime/agent/orchestrator/session/compact/engine.mjs:244-258` and `src/runtime/agent/orchestrator/session/compact/engine.mjs:314-317`.\n- Semantic raises budget to fit mandatory `system + tail + summary room`, builds a fitted prompt, calls `provider.send()`, schema-repairs the summary, then emits `system + summary + tail` at `src/runtime/agent/orchestrator/session/compact/engine.mjs:319-397`.\n- Recall-fasttrack loop hydrates memory, dumps session roots, drains raw cycle1 rows when needed, caps recall injection to 5% of context with a floor, then calls `recallFastTrackCompactMessages()` at `src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs:57-172`.\n- Recall preserved tail keeps newest structured turns, drops oldest kept turns until under cap, or truncates the single newest surviving turn; no-user tails are valid at `src/runtime/agent/orchestrator/session/compact/engine.mjs:593-619`.\n- Recall engine redacts, splits protected context, chooses recall tail/head, rejects empty recall/head cases unless allowed, raises mandatory budget, fits recall summary, and emits `system + recall summary + tail` at `src/runtime/agent/orchestrator/session/compact/engine.mjs:622-699`.\n- Redaction hooks in after the no-op fast path and before semantic window selection at `src/runtime/agent/orchestrator/session/compact/engine.mjs:286-314`, and before recall context split at `src/runtime/agent/orchestrator/session/compact/engine.mjs:644-651`.\n- Preserved-message redaction touches only assistant `toolCalls` argument values, preserving role/content/tool IDs/shape/order at `src/runtime/agent/orchestrator/session/compact/text-utils.mjs:261-266` and `src/runtime/agent/orchestrator/session/compact/text-utils.mjs:291-325`.\n- Prompt-side/preserved-fact redaction also scrubs raw secret strings and sensitive tool args before summaries/facts are built at `src/runtime/agent/orchestrator/session/compact/text-utils.mjs:121-160` and `src/runtime/agent/orchestrator/session/compact/budget.mjs:119-163`.\n- Loop failure path: recall failures are not silently pruned; non-recall failures try `pruneToolOutputsUnanchored()` and accept only if changed and within effective budget at `src/runtime/agent/orchestrator/session/loop.mjs:500-537`.\n- If loop fallback succeeds it continues; otherwise it records `overflow_failed`, traces/emits failed compact, and throws `agentContextOverflowError` at `src/runtime/agent/orchestrator/session/loop.mjs:538-627`.\n- Loop success mutates `messages`, clears provider state, resets iterations/usage epoch, records telemetry, traces, emits compact/no_change, and runs post-compact hook at `src/runtime/agent/orchestrator/session/loop.mjs:629-728`.\n- Manager failure path: recall-fasttrack failure can degrade to semantic fallback if semantic is enabled and provider exists at `src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs:231-278`.\n- Manager semantic failures then try the same non-recall unanchored prune fallback, gated off recall errors, at `src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs:319-347`.\n- If manager still has no compacted output it records `manual_failed|post_turn_failed` and returns an error result; success replaces session messages, clears provider state, records stage `manual|post_turn`, and updates compact timestamps at `src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs:348-447`."
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"task_complete": true,
|
|
73
|
+
"task_errors": [],
|
|
74
|
+
"score_complete": true,
|
|
75
|
+
"score_errors": [],
|
|
76
|
+
"group": {
|
|
77
|
+
"n": 3,
|
|
78
|
+
"wall_ms": 89889.7,
|
|
79
|
+
"uncached_in": 66449,
|
|
80
|
+
"cached_in": 210005.3,
|
|
81
|
+
"out_tokens": 4749.7,
|
|
82
|
+
"cache_ratio": 0.7,
|
|
83
|
+
"completed": 1
|
|
84
|
+
},
|
|
85
|
+
"cards": [
|
|
86
|
+
{
|
|
87
|
+
"session": "019f254d-7eb9-7b61-8033-dac06c077921",
|
|
88
|
+
"wall_ms": 113095,
|
|
89
|
+
"uncached_in": 73170,
|
|
90
|
+
"cached_in": 184192,
|
|
91
|
+
"out_tokens": 6579,
|
|
92
|
+
"cache_ratio": 0.716,
|
|
93
|
+
"completed": 1
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"session": "019f254d-80cf-7ee2-bc2b-e189fd3466e1",
|
|
97
|
+
"wall_ms": 59039,
|
|
98
|
+
"uncached_in": 54732,
|
|
99
|
+
"cached_in": 138496,
|
|
100
|
+
"out_tokens": 2624,
|
|
101
|
+
"cache_ratio": 0.717,
|
|
102
|
+
"completed": 1
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"session": "019f254d-7f3e-73d1-89b0-a4bd9928d221",
|
|
106
|
+
"wall_ms": 97535,
|
|
107
|
+
"uncached_in": 71445,
|
|
108
|
+
"cached_in": 307328,
|
|
109
|
+
"out_tokens": 5046,
|
|
110
|
+
"cache_ratio": 0.811,
|
|
111
|
+
"completed": 1
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"round": "4",
|
|
3
|
+
"runner": "lead",
|
|
4
|
+
"opts": {
|
|
5
|
+
"provider": null,
|
|
6
|
+
"model": null,
|
|
7
|
+
"effort": null,
|
|
8
|
+
"fast": false,
|
|
9
|
+
"env": {
|
|
10
|
+
"MIXDOG_DATA_DIR": "C:\\Users\\tempe\\.mixdog\\bench-data"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"tasks": 3,
|
|
14
|
+
"completed": 3,
|
|
15
|
+
"completion_rate": 100,
|
|
16
|
+
"sessions": [
|
|
17
|
+
"sess_54432_1783037011657_1783037011956_040141751665fcffed70f31af6fed031",
|
|
18
|
+
"sess_56432_1783037011657_1783037011956_67cb279c86f5fc873eeae934c042b296",
|
|
19
|
+
"sess_20684_1783037011676_1783037011957_f3a34ca2114150d22a2f8c6ba82408de"
|
|
20
|
+
],
|
|
21
|
+
"results": [
|
|
22
|
+
{
|
|
23
|
+
"id": "r4-debug-forwarding-gap",
|
|
24
|
+
"agent": "reviewer",
|
|
25
|
+
"ok": true,
|
|
26
|
+
"ms": 246989,
|
|
27
|
+
"sessionId": "sess_54432_1783037011657_1783037011956_040141751665fcffed70f31af6fed031",
|
|
28
|
+
"output": "sessionId: sess_54432_1783037011657_1783037011956_040141751665fcffed70f31af6fed031\n조사 완료했습니다. 활성화 경로는 `activate_channel_bridge`(tool-dispatch.mjs:45) 또는 `start()`(index.mjs:1734)에서 `writeBridgeState(true)`(index.mjs:218)가 **바인딩보다 먼저** 기록되고, 이후 `refreshBridgeOwnership → startOwnedRuntime → bindPersistedTranscriptIfAny → rebindTranscriptContext → applyTranscriptBinding → forwarder.setContext/startWatch` 순으로 진행됩니다. 그 창구간의 갭은 다음과 같습니다.\n\n**갭 목록 (영향 순)**\n\n1. **EOF 바인드로 인한 영구 드롭** — `setContext`의 `catchUpFromPersisted`는 영속 경로와 새 트랜스크립트가 다르면 커서를 `currentSize`(EOF)로 설정합니다(output-forwarder.mjs:117-124). `rebindTranscriptContext`의 exists:true 분기는 루프가 먼저 PENDING 상태를 봤을 때만 `replayFromStart`를 켜므로(index.mjs:438-439), 첫 반복에서 이미 파일이 존재하는 새 세션 트랜스크립트는 EOF에 바인드됩니다. 세션 시작~바인드 사이에 기록된 어시스턴트 출력은 커서가 되감기지 않아 **백로그 캐치업으로 복구 불가(영구 손실)**. pending 분기(index.mjs:485-491)와 steal 경로(index.mjs:1602-1616 주석)만 이 문제를 방어합니다.\n\n2. **channelId 미해결 시 첫 인바운드 이전 출력 영구 드롭** — 영속 status도, `mainChannel` 설정도 없으면 `bindPersistedTranscriptIfAny`가 바인딩 없이 반환하고(index.mjs:624), 첫 인바운드의 `applyTranscriptBinding`(index.mjs:1598)은 replay 플래그 없이 EOF 바인드합니다. 그 이전 출력은 **복구 불가**. main 폴백(index.mjs:610-623)이 설정된 환경에서만 완화됩니다.\n\n3. **pre-connect 소유권 게이트로 인한 tool-log 드롭** — `ownerGetter`는 `bridgeRuntimeConnected && owned`(index.mjs:316)인데, 바인딩 태스크는 `backend.connect()`와 동시 실행됩니다(index.mjs:759 vs 769). 이 창에서 `forwardNewText`는 커서를 안 옮기고 반환하므로 텍스트는 post-connect 재전송(index.mjs:801-812)으로 **복구됨(지연만)**. 반면 `forwardToolLog`(output-forwarder.mjs:414)는 트랜스크립트 기반이 아니라 큐 적재 자체가 스킵되어 해당 진행 로그는 **복구 불가**.\n\n4. **미존재 파일 fs.watch 실패 + 60초 rearm 상한** — `startWatch`는 없는 파일에서 조용히 실패하고(output-forwarder.mjs:667-670), rearm 폴은 `PENDING_REARM_MAX_MS=60_000` 후 무음 타임아웃합니다(index.mjs:349, 384-386). 커서가 0이라 다음 트리거(인바운드 리바인드, 툴콜 250ms 디바운스 forwardNewText tool-dispatch.mjs:125, turn-end)에서 **백로그로 복구되나 무기한 지연 가능** — 특히 worker 모드는 `turnEndWatcher`가 미설치라(index.mjs:251) 인바운드/툴콜이 없으면 트리거가 없습니다.\n\n5. **watch error 후 재설치 부재** — watcher 에러 시 `closeWatcher`만 하고 rearm하지 않습니다(output-forwarder.mjs:658-661). 커서는 보존되어 다음 트리거에서 **복구됨(지연)**.\n\n6. **rearm tick의 `!bridgeRuntimeConnected` 영구 종료** — 재스케줄 없이 종료하지만(index.mjs:372-375), start 경로의 post-connect 재무장(index.mjs:804-812)이 커버해 실질 영향은 낮습니다.\n\n**한 줄 결론**: 창구간의 대부분 갭은 커서 보존 덕에 지연 후 백로그로 복구되지만, 영속 경로와 불일치하는 이미-존재하는 새 트랜스크립트를 EOF에 바인드하는 경우(1번, 2번)와 pre-connect 창의 tool-log(3번)는 어떤 캐치업으로도 복구되지 않는 진짜 무음 손실입니다.",
|
|
29
|
+
"card": {
|
|
30
|
+
"session": "sess_54432_1783037011657_1783037011956_040141751665fcffed70f31af6fed031",
|
|
31
|
+
"provider": "anthropic-oauth",
|
|
32
|
+
"model": "claude-fable-5",
|
|
33
|
+
"wall_ms": 236323,
|
|
34
|
+
"turns": 6,
|
|
35
|
+
"tool_calls": 8,
|
|
36
|
+
"tools_per_turn": 1.3,
|
|
37
|
+
"total_tool_ms": 307,
|
|
38
|
+
"llm_stream_ms": 214082,
|
|
39
|
+
"cache_ratio": 0.8010233375523009,
|
|
40
|
+
"cached_tokens": 252517,
|
|
41
|
+
"prompt_tokens": 315243,
|
|
42
|
+
"uncached_tokens": 62726,
|
|
43
|
+
"output_tokens": 29608,
|
|
44
|
+
"cache_weighted_input_10": 87977.7,
|
|
45
|
+
"cache_weighted_input_25": 125855.25,
|
|
46
|
+
"prompt_growth": 62036,
|
|
47
|
+
"antipatterns": 0,
|
|
48
|
+
"issues": 0,
|
|
49
|
+
"issue_types": [],
|
|
50
|
+
"read_fragmentation_paths": [],
|
|
51
|
+
"grep_sweep_count": 0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "r4-impl-usage-summary",
|
|
56
|
+
"agent": "worker",
|
|
57
|
+
"ok": true,
|
|
58
|
+
"ms": 136723,
|
|
59
|
+
"sessionId": "sess_56432_1783037011657_1783037011956_67cb279c86f5fc873eeae934c042b296",
|
|
60
|
+
"output": "sessionId: sess_56432_1783037011657_1783037011956_67cb279c86f5fc873eeae934c042b296\napply_patch 도구가 깨져 있어 파일 생성은 shell로 대신합니다.완료했습니다. `usage:today` 스크립트 추가와 npm script 등록, 검증까지 마쳤습니다.\n\n**바뀐 점**\n- `scripts/usage-today.mjs` 신규 (114줄): session-bench.mjs 스타일의 `argValue`/`hasFlag` 파싱(`--trace`, `--json` 지원), `MIXDOG_DATA_DIR` → `resolvePluginData()` → `~/.mixdog/data` 순으로 trace 경로 해석, 로컬 자정 이후 `kind === 'usage'` 행을 모델별로 집계.\n- `package.json`: `\"usage:today\": \"node scripts/usage-today.mjs\"` 스크립트 1줄 추가.\n\n**확인한 것**\n- `node --check` 통과, `npm run usage:today` 실행 결과 모델별 calls/input/cached/output/costUsd + TOTAL 행 정상 출력 (오늘 89 calls, $55.41).\n\n**참고** — apply_patch 도구가 환경 문제(`native patch binary unavailable`)로 실패해서 파일 쓰기는 PowerShell로 처리했고, 실행 시 trace가 `MIXDOG_DATA_DIR` 환경변수 덕에 `.mixdog\\bench-data`로 해석됐습니다(의도된 우선순위 동작).",
|
|
61
|
+
"card": {
|
|
62
|
+
"session": "sess_56432_1783037011657_1783037011956_67cb279c86f5fc873eeae934c042b296",
|
|
63
|
+
"provider": "anthropic-oauth",
|
|
64
|
+
"model": "claude-fable-5",
|
|
65
|
+
"wall_ms": 126133,
|
|
66
|
+
"turns": 9,
|
|
67
|
+
"tool_calls": 9,
|
|
68
|
+
"tools_per_turn": 1,
|
|
69
|
+
"total_tool_ms": 2867,
|
|
70
|
+
"llm_stream_ms": 88804,
|
|
71
|
+
"cache_ratio": 0.892783231866202,
|
|
72
|
+
"cached_tokens": 296371,
|
|
73
|
+
"prompt_tokens": 331963,
|
|
74
|
+
"uncached_tokens": 35592,
|
|
75
|
+
"output_tokens": 10689,
|
|
76
|
+
"cache_weighted_input_10": 65229.100000000006,
|
|
77
|
+
"cache_weighted_input_25": 109684.75,
|
|
78
|
+
"prompt_growth": 34902,
|
|
79
|
+
"antipatterns": 0,
|
|
80
|
+
"issues": 1,
|
|
81
|
+
"issue_types": [
|
|
82
|
+
"tool_error"
|
|
83
|
+
],
|
|
84
|
+
"read_fragmentation_paths": [],
|
|
85
|
+
"grep_sweep_count": 0
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "r4-explain-compact-engine",
|
|
90
|
+
"agent": "explore",
|
|
91
|
+
"ok": true,
|
|
92
|
+
"ms": 65718,
|
|
93
|
+
"sessionId": "sess_20684_1783037011676_1783037011957_f3a34ca2114150d22a2f8c6ba82408de",
|
|
94
|
+
"output": "sessionId: sess_20684_1783037011676_1783037011957_f3a34ca2114150d22a2f8c6ba82408de\n컴팩션 서브시스템 아키텍처 브리프입니다.\n\n**진입점과 호출자**\n- 엔진 공개 API 2개: `semanticCompactMessages` (engine.mjs:278, LLM 요약), `recallFastTrackCompactMessages` (engine.mjs:445, 비-LLM recall 주입). `compact.mjs:53-54`가 재수출.\n- 호출자 3곳: 루프 내 자동 컴팩트 `loop.mjs:414-460` (recall은 `loop/recall-fasttrack.mjs:161` 경유), 매니저의 수동/auto-clear 경로 `manager/compaction-runner.mjs:210,245,288`, 스모크/벤치 스크립트(`scripts/compact-smoke.mjs`, `scripts/session-context-bench.mjs:257`).\n\n**발동 결정 흐름**\n- 루프: `shouldCompactForSession(loop.mjs:353)`이 압력 토큰으로 판정, reactive overflow 재시도 플래그가 강제 트리거(loop.mjs:352,361). 타입 분기는 recallFastTrack → semantic → 에러(loop.mjs:414,439,497).\n- 매니저: `pressureTokens < triggerTokens`면 no-op 반환(compaction-runner.mjs:176), 예산은 `compactTargetBudget`(compaction-runner.mjs:197).\n- 엔진 자체 no-op 가드: sanitize 후에도 예산에 맞고 `force !== true`면 원본 그대로 반환(engine.mjs:289, 627).\n\n**보존 tail 선택**\n- 공통: `splitLiveCompactionContext`(engine.mjs:100)가 보호 prefix/이전 summary/live를 분리.\n- semantic 경로 `selectCompactionWindow`(engine.mjs:235): user 턴이 있으면 턴 단위 선택 `selectTailStartByTurns`(engine.mjs:134, 최근 `tailTurns`=2턴을 `preserveRecentBudget` 내로), 없으면 컷포인트 방식 `selectTailStartByCutPoint`(engine.mjs:193, tool result에서 시작 불가 규칙은 engine.mjs:121).\n- recall 경로 `selectRecallPreservedTail`(engine.mjs:593): 최근 2턴(engine.mjs:467)을 8k 캡(engine.mjs:468) 내로, 초과 시 오래된 턴 드롭 → 중간 절단(engine.mjs:473).\n- tail 컷 후 `sanitizeToolPairs`류로 tool 페어링 복구(engine.mjs:250, 608).\n\n**레닥션 훅**\n- 컴팩션 진행이 확정된 직후, 윈도 선택 **전에** `redactToolCallSecretsInMessages` 적용(engine.mjs:312, 644; text-utils.mjs에서 import, engine.mjs:23) — 보존 tail이 레닥션된 형태로 측정·방출됨. no-op 경로에는 미적용(engine.mjs:288 주석).\n\n**실패/폴백 경로**\n- 엔진 하드 실패: 빈 live 윈도(engine.mjs:255), 압축할 head 없음(engine.mjs:316), 프롬프트/summary 예산 미달(engine.mjs:336, 386), 결과 예산 초과(engine.mjs:396). 빈 summary(engine.mjs:372), malformed summary는 스키마 강제 복구(engine.mjs:376).\n- 예산 부족은 거부 대신 mandatory+summary room으로 예산 상향(engine.mjs:328-330).\n- 매니저: recall 실패 → semantic 폴백 1회(compaction-runner.mjs:242-263), semantic 실패 → 비-LLM prune 안전망 `pruneToolOutputsUnanchored`(compaction-runner.mjs:327-345), 전부 실패 시 실패 상태 기록(compaction-runner.mjs:348).\n- 루프: 동일한 prune 안전망이 있으나 recall 실패에는 gated(loop.mjs:517-537), 최종 실패는 `overflow_failed` 텔레메트리로 에스컬레이션(loop.mjs:552).",
|
|
95
|
+
"card": {
|
|
96
|
+
"session": "sess_20684_1783037011676_1783037011957_f3a34ca2114150d22a2f8c6ba82408de",
|
|
97
|
+
"provider": "anthropic-oauth",
|
|
98
|
+
"model": "claude-fable-5",
|
|
99
|
+
"wall_ms": 55137,
|
|
100
|
+
"turns": 5,
|
|
101
|
+
"tool_calls": 5,
|
|
102
|
+
"tools_per_turn": 1,
|
|
103
|
+
"total_tool_ms": 511,
|
|
104
|
+
"llm_stream_ms": 32155,
|
|
105
|
+
"cache_ratio": 0.7874257600674105,
|
|
106
|
+
"cached_tokens": 115876,
|
|
107
|
+
"prompt_tokens": 147158,
|
|
108
|
+
"uncached_tokens": 31282,
|
|
109
|
+
"output_tokens": 2956,
|
|
110
|
+
"cache_weighted_input_10": 42869.6,
|
|
111
|
+
"cache_weighted_input_25": 60251,
|
|
112
|
+
"prompt_growth": 30774,
|
|
113
|
+
"antipatterns": 1,
|
|
114
|
+
"issues": 1,
|
|
115
|
+
"issue_types": [
|
|
116
|
+
"tool_churn_cluster"
|
|
117
|
+
],
|
|
118
|
+
"read_fragmentation_paths": [],
|
|
119
|
+
"grep_sweep_count": 0
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"task_complete": true,
|
|
124
|
+
"task_errors": [],
|
|
125
|
+
"score_complete": true,
|
|
126
|
+
"score_errors": [],
|
|
127
|
+
"group": {
|
|
128
|
+
"n": 3,
|
|
129
|
+
"wall_ms": 139197.7,
|
|
130
|
+
"turns": 6.7,
|
|
131
|
+
"tool_calls": 7.3,
|
|
132
|
+
"tools_per_turn": 1.1,
|
|
133
|
+
"total_tool_ms": 1228.3,
|
|
134
|
+
"llm_stream_ms": 111680.3,
|
|
135
|
+
"cache_ratio": 0.8,
|
|
136
|
+
"cached_tokens": 221588,
|
|
137
|
+
"prompt_tokens": 264788,
|
|
138
|
+
"uncached_tokens": 43200,
|
|
139
|
+
"output_tokens": 14417.7,
|
|
140
|
+
"cache_weighted_input_10": 65358.8,
|
|
141
|
+
"cache_weighted_input_25": 98597,
|
|
142
|
+
"prompt_growth": 42570.7,
|
|
143
|
+
"antipatterns": 0.3,
|
|
144
|
+
"issues": 0.7,
|
|
145
|
+
"grep_sweep_count": 0
|
|
146
|
+
},
|
|
147
|
+
"cards": [
|
|
148
|
+
{
|
|
149
|
+
"session": "sess_54432_1783037011657_1783037011956_040141751665fcffed70f31af6fed031",
|
|
150
|
+
"provider": "anthropic-oauth",
|
|
151
|
+
"model": "claude-fable-5",
|
|
152
|
+
"wall_ms": 236323,
|
|
153
|
+
"turns": 6,
|
|
154
|
+
"tool_calls": 8,
|
|
155
|
+
"tools_per_turn": 1.3,
|
|
156
|
+
"total_tool_ms": 307,
|
|
157
|
+
"llm_stream_ms": 214082,
|
|
158
|
+
"cache_ratio": 0.8010233375523009,
|
|
159
|
+
"cached_tokens": 252517,
|
|
160
|
+
"prompt_tokens": 315243,
|
|
161
|
+
"uncached_tokens": 62726,
|
|
162
|
+
"output_tokens": 29608,
|
|
163
|
+
"cache_weighted_input_10": 87977.7,
|
|
164
|
+
"cache_weighted_input_25": 125855.25,
|
|
165
|
+
"prompt_growth": 62036,
|
|
166
|
+
"antipatterns": 0,
|
|
167
|
+
"issues": 0,
|
|
168
|
+
"issue_types": [],
|
|
169
|
+
"read_fragmentation_paths": [],
|
|
170
|
+
"grep_sweep_count": 0
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"session": "sess_56432_1783037011657_1783037011956_67cb279c86f5fc873eeae934c042b296",
|
|
174
|
+
"provider": "anthropic-oauth",
|
|
175
|
+
"model": "claude-fable-5",
|
|
176
|
+
"wall_ms": 126133,
|
|
177
|
+
"turns": 9,
|
|
178
|
+
"tool_calls": 9,
|
|
179
|
+
"tools_per_turn": 1,
|
|
180
|
+
"total_tool_ms": 2867,
|
|
181
|
+
"llm_stream_ms": 88804,
|
|
182
|
+
"cache_ratio": 0.892783231866202,
|
|
183
|
+
"cached_tokens": 296371,
|
|
184
|
+
"prompt_tokens": 331963,
|
|
185
|
+
"uncached_tokens": 35592,
|
|
186
|
+
"output_tokens": 10689,
|
|
187
|
+
"cache_weighted_input_10": 65229.100000000006,
|
|
188
|
+
"cache_weighted_input_25": 109684.75,
|
|
189
|
+
"prompt_growth": 34902,
|
|
190
|
+
"antipatterns": 0,
|
|
191
|
+
"issues": 1,
|
|
192
|
+
"issue_types": [
|
|
193
|
+
"tool_error"
|
|
194
|
+
],
|
|
195
|
+
"read_fragmentation_paths": [],
|
|
196
|
+
"grep_sweep_count": 0
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"session": "sess_20684_1783037011676_1783037011957_f3a34ca2114150d22a2f8c6ba82408de",
|
|
200
|
+
"provider": "anthropic-oauth",
|
|
201
|
+
"model": "claude-fable-5",
|
|
202
|
+
"wall_ms": 55137,
|
|
203
|
+
"turns": 5,
|
|
204
|
+
"tool_calls": 5,
|
|
205
|
+
"tools_per_turn": 1,
|
|
206
|
+
"total_tool_ms": 511,
|
|
207
|
+
"llm_stream_ms": 32155,
|
|
208
|
+
"cache_ratio": 0.7874257600674105,
|
|
209
|
+
"cached_tokens": 115876,
|
|
210
|
+
"prompt_tokens": 147158,
|
|
211
|
+
"uncached_tokens": 31282,
|
|
212
|
+
"output_tokens": 2956,
|
|
213
|
+
"cache_weighted_input_10": 42869.6,
|
|
214
|
+
"cache_weighted_input_25": 60251,
|
|
215
|
+
"prompt_growth": 30774,
|
|
216
|
+
"antipatterns": 1,
|
|
217
|
+
"issues": 1,
|
|
218
|
+
"issue_types": [
|
|
219
|
+
"tool_churn_cluster"
|
|
220
|
+
],
|
|
221
|
+
"read_fragmentation_paths": [],
|
|
222
|
+
"grep_sweep_count": 0
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|