@wjarka/cezarion 0.15.1 → 0.16.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/README.md +167 -46
- package/dist/agent-config/catalog.d.ts +6 -2
- package/dist/agent-config/catalog.js +78 -3
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/shared.js +6 -3
- package/dist/agent-config/model-settings/shared.js.map +1 -1
- package/dist/agent-config/models.js +4 -0
- package/dist/agent-config/models.js.map +1 -1
- package/dist/agent-config/validate.js +6 -0
- package/dist/agent-config/validate.js.map +1 -1
- package/dist/artifacts/cli.js +10 -2
- package/dist/artifacts/cli.js.map +1 -1
- package/dist/automations/coordinator.d.ts +7 -0
- package/dist/automations/coordinator.js +22 -2
- package/dist/automations/coordinator.js.map +1 -1
- package/dist/automations/github-poller.d.ts +4 -4
- package/dist/automations/github-poller.js.map +1 -1
- package/dist/automations/schedule-runner.d.ts +130 -0
- package/dist/automations/schedule-runner.js +326 -0
- package/dist/automations/schedule-runner.js.map +1 -0
- package/dist/automations/scheduler.d.ts +38 -7
- package/dist/automations/scheduler.js +90 -22
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/automations/store.d.ts +80 -3
- package/dist/automations/store.js +208 -16
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/task-template.d.ts +42 -6
- package/dist/automations/task-template.js +152 -24
- package/dist/automations/task-template.js.map +1 -1
- package/dist/automations/types.d.ts +142 -6
- package/dist/automations/types.js +64 -6
- package/dist/automations/types.js.map +1 -1
- package/dist/autosave-holders.js +8 -12
- package/dist/autosave-holders.js.map +1 -1
- package/dist/ci-wait/client.d.ts +8 -1
- package/dist/ci-wait/client.js +43 -1
- package/dist/ci-wait/client.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +83 -4
- package/dist/ci-wait/controller.js +76 -11
- package/dist/ci-wait/controller.js.map +1 -1
- package/dist/ci-wait/errors.d.ts +7 -1
- package/dist/ci-wait/errors.js +36 -0
- package/dist/ci-wait/errors.js.map +1 -1
- package/dist/ci-wait/github.d.ts +2 -0
- package/dist/ci-wait/github.js +3 -1
- package/dist/ci-wait/github.js.map +1 -1
- package/dist/ci-wait/mcp.d.ts +2 -98
- package/dist/ci-wait/mcp.js +11 -25
- package/dist/ci-wait/mcp.js.map +1 -1
- package/dist/ci-wait/supervisor.d.ts +2 -1
- package/dist/ci-wait/supervisor.js +2 -1
- package/dist/ci-wait/supervisor.js.map +1 -1
- package/dist/ci-wait/tools.d.ts +307 -0
- package/dist/ci-wait/tools.js +63 -0
- package/dist/ci-wait/tools.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/contract/agent-config.d.ts +5 -0
- package/dist/contract/agent-profiles.d.ts +15 -0
- package/dist/contract/automation-schedule.d.ts +60 -0
- package/dist/contract/automations.d.ts +208 -36
- package/dist/contract/delegation.d.ts +96 -0
- package/dist/contract/discovery.d.ts +7 -0
- package/dist/contract/github.d.ts +1 -0
- package/dist/contract/health.d.ts +6 -0
- package/dist/contract/index.d.ts +3 -0
- package/dist/contract/index.js +1445 -745
- package/dist/contract/preview.d.ts +508 -0
- package/dist/contract/runs.d.ts +716 -15
- package/dist/contract/skills.d.ts +39 -0
- package/dist/contract/workflows.d.ts +6 -0
- package/dist/contract/workspace.d.ts +65 -0
- package/dist/contract/zoned-time.d.ts +35 -0
- package/dist/core/agent-env.d.ts +11 -0
- package/dist/core/agent-env.js +27 -5
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-profiles.js +7 -0
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/agent-runner.d.ts +49 -1
- package/dist/core/agent-runner.js +2 -1
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/backend-detect.d.ts +3 -2
- package/dist/core/backend-detect.js +27 -1
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +1 -0
- package/dist/core/claude-cli-runner.js +69 -19
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +1 -0
- package/dist/core/codex-app-server-runner.js +200 -25
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.d.ts +7 -3
- package/dist/core/codex-app-server-transport.js +11 -9
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/cursor-acp-runner.d.ts +1 -0
- package/dist/core/cursor-acp-runner.js +24 -9
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/core/host-model-catalog.js +2 -0
- package/dist/core/host-model-catalog.js.map +1 -1
- package/dist/core/managed-session.js +2 -0
- package/dist/core/managed-session.js.map +1 -1
- package/dist/core/model-identity.js +2 -0
- package/dist/core/model-identity.js.map +1 -1
- package/dist/core/model-presets.js +3 -0
- package/dist/core/model-presets.js.map +1 -1
- package/dist/core/omp-model-catalog.d.ts +43 -0
- package/dist/core/omp-model-catalog.js +205 -0
- package/dist/core/omp-model-catalog.js.map +1 -0
- package/dist/core/omp-runner.d.ts +73 -0
- package/dist/core/omp-runner.js +990 -0
- package/dist/core/omp-runner.js.map +1 -0
- package/dist/core/omp-ui-mapper.d.ts +106 -0
- package/dist/core/omp-ui-mapper.js +882 -0
- package/dist/core/omp-ui-mapper.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +18 -4
- package/dist/core/opencode-server-runner.js +337 -96
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/opencode-session-error.d.ts +11 -0
- package/dist/core/opencode-session-error.js +26 -0
- package/dist/core/opencode-session-error.js.map +1 -0
- package/dist/core/opencode-ui-mapper.js +4 -36
- package/dist/core/opencode-ui-mapper.js.map +1 -1
- package/dist/core/pi-runner.d.ts +1 -0
- package/dist/core/pi-runner.js +75 -12
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.d.ts +9 -2
- package/dist/core/provider-auth.js +43 -6
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/core/runner-factory.js +3 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-model-catalog.js +1 -0
- package/dist/core/runner-model-catalog.js.map +1 -1
- package/dist/core/runner-stderr.d.ts +2 -0
- package/dist/core/runner-stderr.js +20 -0
- package/dist/core/runner-stderr.js.map +1 -0
- package/dist/core/session-process.d.ts +22 -0
- package/dist/core/session-process.js +202 -0
- package/dist/core/session-process.js.map +1 -0
- package/dist/core/ui-events.d.ts +1 -1
- package/dist/core/usage-limit.js +3 -60
- package/dist/core/usage-limit.js.map +1 -1
- package/dist/data-gitignore.d.ts +6 -0
- package/dist/data-gitignore.js +57 -0
- package/dist/data-gitignore.js.map +1 -0
- package/dist/delegation/capacity.d.ts +19 -0
- package/dist/delegation/capacity.js +34 -0
- package/dist/delegation/capacity.js.map +1 -0
- package/dist/delegation/cli.js +13 -4
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversations.d.ts +4 -2
- package/dist/delegation/conversations.js +8 -12
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/credentials.d.ts +2 -0
- package/dist/delegation/credentials.js +10 -0
- package/dist/delegation/credentials.js.map +1 -1
- package/dist/delegation/destroy-observation.d.ts +42 -0
- package/dist/delegation/destroy-observation.js +115 -0
- package/dist/delegation/destroy-observation.js.map +1 -0
- package/dist/delegation/execution-identity.d.ts +6 -0
- package/dist/delegation/execution-identity.js +1 -1
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/policy.d.ts +3 -2
- package/dist/delegation/policy.js +7 -5
- package/dist/delegation/policy.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +57 -20
- package/dist/delegation/process-liveness.js +114 -92
- package/dist/delegation/process-liveness.js.map +1 -1
- package/dist/delegation/provision.js +6 -6
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/results.js +4 -2
- package/dist/delegation/results.js.map +1 -1
- package/dist/delegation/retry-backoff.d.ts +23 -0
- package/dist/delegation/retry-backoff.js +18 -0
- package/dist/delegation/retry-backoff.js.map +1 -0
- package/dist/delegation/routes.d.ts +64 -58
- package/dist/delegation/scratch-cleanup.d.ts +29 -0
- package/dist/delegation/scratch-cleanup.js +143 -0
- package/dist/delegation/scratch-cleanup.js.map +1 -0
- package/dist/delegation/service.d.ts +20 -1
- package/dist/delegation/service.js +233 -70
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +12 -6
- package/dist/delegation/workspace.d.ts +23 -4
- package/dist/delegation/workspace.js +147 -31
- package/dist/delegation/workspace.js.map +1 -1
- package/dist/git-worktree-lock-helper.js +8 -3
- package/dist/git-worktree-lock-helper.js.map +1 -1
- package/dist/git-worktree-lock.d.ts +6 -1
- package/dist/git-worktree-lock.js +10 -4
- package/dist/git-worktree-lock.js.map +1 -1
- package/dist/git-worktree-release.d.ts +20 -0
- package/dist/git-worktree-release.js +27 -0
- package/dist/git-worktree-release.js.map +1 -0
- package/dist/git-worktree.d.ts +8 -2
- package/dist/git-worktree.js +19 -2
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +1 -1
- package/dist/index.js +109 -76
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +5 -1
- package/dist/paths.js.map +1 -1
- package/dist/preview/cdp.d.ts +13 -0
- package/dist/preview/cdp.js +69 -0
- package/dist/preview/cdp.js.map +1 -0
- package/dist/preview/chromium.d.ts +75 -0
- package/dist/preview/chromium.js +394 -0
- package/dist/preview/chromium.js.map +1 -0
- package/dist/preview/dev-server.d.ts +68 -0
- package/dist/preview/dev-server.js +341 -0
- package/dist/preview/dev-server.js.map +1 -0
- package/dist/preview/host.d.ts +154 -0
- package/dist/preview/host.js +681 -0
- package/dist/preview/host.js.map +1 -0
- package/dist/preview/registration.d.ts +63 -0
- package/dist/preview/registration.js +109 -0
- package/dist/preview/registration.js.map +1 -0
- package/dist/preview/session.d.ts +73 -0
- package/dist/preview/session.js +347 -0
- package/dist/preview/session.js.map +1 -0
- package/dist/preview/url.d.ts +6 -0
- package/dist/preview/url.js +17 -0
- package/dist/preview/url.js.map +1 -0
- package/dist/runs/agent-tmpdir-removal.d.ts +15 -0
- package/dist/runs/agent-tmpdir-removal.js +60 -0
- package/dist/runs/agent-tmpdir-removal.js.map +1 -0
- package/dist/runs/agent-tmpdir.d.ts +12 -1
- package/dist/runs/agent-tmpdir.js +123 -34
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/delegation-state.d.ts +5 -1
- package/dist/runs/delegation-state.js +9 -0
- package/dist/runs/delegation-state.js.map +1 -1
- package/dist/runs/event-history.d.ts +4 -4
- package/dist/runs/event-history.js +97 -117
- package/dist/runs/event-history.js.map +1 -1
- package/dist/runs/history-compressor.d.ts +29 -0
- package/dist/runs/history-compressor.js +116 -0
- package/dist/runs/history-compressor.js.map +1 -0
- package/dist/runs/history-file.d.ts +36 -0
- package/dist/runs/history-file.js +463 -0
- package/dist/runs/history-file.js.map +1 -0
- package/dist/runs/human-ask-summary.js +18 -13
- package/dist/runs/human-ask-summary.js.map +1 -1
- package/dist/runs/legacy-index.d.ts +62 -0
- package/dist/runs/legacy-index.js +168 -0
- package/dist/runs/legacy-index.js.map +1 -0
- package/dist/runs/raw-record.d.ts +52 -0
- package/dist/runs/raw-record.js +145 -0
- package/dist/runs/raw-record.js.map +1 -0
- package/dist/runs/retention.d.ts +13 -6
- package/dist/runs/retention.js +42 -13
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/run-claims.d.ts +23 -0
- package/dist/runs/run-claims.js +24 -0
- package/dist/runs/run-claims.js.map +1 -0
- package/dist/runs/run-database.d.ts +385 -0
- package/dist/runs/run-database.js +930 -0
- package/dist/runs/run-database.js.map +1 -0
- package/dist/runs/run-index.d.ts +35 -9
- package/dist/runs/run-index.js +200 -25
- package/dist/runs/run-index.js.map +1 -1
- package/dist/runs/run-row.d.ts +44 -0
- package/dist/runs/run-row.js +84 -0
- package/dist/runs/run-row.js.map +1 -0
- package/dist/runs/run-search.d.ts +29 -0
- package/dist/runs/run-search.js +63 -0
- package/dist/runs/run-search.js.map +1 -0
- package/dist/runs/store-open-error.d.ts +24 -0
- package/dist/runs/store-open-error.js +61 -0
- package/dist/runs/store-open-error.js.map +1 -0
- package/dist/runs/store.d.ts +667 -32
- package/dist/runs/store.js +2153 -324
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/transcript-facts.d.ts +77 -0
- package/dist/runs/transcript-facts.js +302 -0
- package/dist/runs/transcript-facts.js.map +1 -0
- package/dist/runs/webhook.js +5 -4
- package/dist/runs/webhook.js.map +1 -1
- package/dist/runs/worker-execution.d.ts +22 -0
- package/dist/runs/worker-execution.js +30 -0
- package/dist/runs/worker-execution.js.map +1 -0
- package/dist/server/capabilities.d.ts +1 -0
- package/dist/server/capabilities.js +2 -0
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/cockpit-ownership.d.ts +8 -0
- package/dist/server/cockpit-ownership.js +19 -0
- package/dist/server/cockpit-ownership.js.map +1 -1
- package/dist/server/forge/github.d.ts +1 -4
- package/dist/server/forge/github.js +47 -23
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/git.js +1 -1
- package/dist/server/git.js.map +1 -1
- package/dist/server/open-in-app.js +1 -0
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/preview-socket.d.ts +36 -0
- package/dist/server/preview-socket.js +126 -0
- package/dist/server/preview-socket.js.map +1 -0
- package/dist/server/project-context.d.ts +31 -4
- package/dist/server/project-context.js +73 -9
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-action-gate.js +1 -0
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/repo-branches.d.ts +4 -3
- package/dist/server/repo-branches.js +5 -4
- package/dist/server/repo-branches.js.map +1 -1
- package/dist/server/server.d.ts +4500 -2727
- package/dist/server/server.js +651 -202
- package/dist/server/server.js.map +1 -1
- package/dist/server/upgrade-router.d.ts +23 -0
- package/dist/server/upgrade-router.js +53 -0
- package/dist/server/upgrade-router.js.map +1 -0
- package/dist/server/validators.d.ts +6 -1
- package/dist/server/validators.js +4 -4
- package/dist/server/validators.js.map +1 -1
- package/dist/server/ws.d.ts +16 -16
- package/dist/server/ws.js +56 -54
- package/dist/server/ws.js.map +1 -1
- package/dist/skills-remote.d.ts +14 -0
- package/dist/skills-remote.js +91 -15
- package/dist/skills-remote.js.map +1 -1
- package/dist/task-cli/cli.js +40 -16
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/task-cli/discovery.d.ts +4 -3
- package/dist/task-cli/discovery.js +4 -3
- package/dist/task-cli/discovery.js.map +1 -1
- package/dist/task-cli/http.d.ts +2 -0
- package/dist/task-cli/http.js +10 -4
- package/dist/task-cli/http.js.map +1 -1
- package/dist/task-cli/projections.d.ts +5 -2
- package/dist/task-cli/projections.js +13 -0
- package/dist/task-cli/projections.js.map +1 -1
- package/dist/task-cli/watch.d.ts +15 -2
- package/dist/task-cli/watch.js +31 -9
- package/dist/task-cli/watch.js.map +1 -1
- package/dist/ui-state.d.ts +4 -3
- package/dist/ui-state.js +8 -3
- package/dist/ui-state.js.map +1 -1
- package/dist/workflows/grouped-command.d.ts +31 -0
- package/dist/workflows/grouped-command.js +143 -0
- package/dist/workflows/grouped-command.js.map +1 -0
- package/dist/workflows/run.d.ts +223 -42
- package/dist/workflows/run.js +1316 -398
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +12 -0
- package/dist/workflows/types.js +20 -0
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.d.ts +5 -1
- package/dist/workspace/agent-accounts.js +1 -0
- package/dist/workspace/agent-accounts.js.map +1 -1
- package/dist/workspace/agent-profiles.js +1 -1
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.d.ts +3 -1
- package/dist/workspace/config.js +1 -0
- package/dist/workspace/config.js.map +1 -1
- package/dist/worktree-setup.d.ts +85 -0
- package/dist/worktree-setup.js +164 -0
- package/dist/worktree-setup.js.map +1 -0
- package/package.json +7 -5
- package/scripts/benchmark-run-store-fixture.ts +428 -0
- package/scripts/benchmark-run-store.ts +743 -0
- package/scripts/benchmark-stuck-destroys.ts +143 -0
- package/scripts/mock-autonomous.mjs +11 -0
- package/scripts/mock-ci-tool.mjs +20 -5
- package/scripts/mock-claude.mjs +110 -1
- package/scripts/mock-codex-app-server.mjs +117 -2
- package/scripts/mock-codex-coalesce-steer.mjs +59 -0
- package/scripts/mock-codex-reverse-steer.mjs +130 -0
- package/scripts/mock-cursor-acp.mjs +75 -1
- package/scripts/mock-omp-rpc.mjs +605 -0
- package/scripts/mock-opencode-serve.mjs +312 -22
- package/scripts/mock-pi-rpc.mjs +109 -3
- package/scripts/mock-runner-crash.mjs +42 -0
- package/scripts/mock-silent-tail.mjs +78 -0
- package/scripts/mock-turn-messages.mjs +5 -0
- package/scripts/omp-ci-wait.mjs +29 -0
- package/scripts/omp-restrict-delegation.yml +4 -0
- package/scripts/pi-ci-wait.mjs +12 -9
- package/scripts/seed-archive-profile.ts +3 -3
- package/web/dist/assets/agent-accounts-CFOBMVHc.js +1 -0
- package/web/dist/assets/alert-dialog-BrpNUwMt.js +1 -0
- package/web/dist/assets/app-window-CSHwDX9N.js +1 -0
- package/web/dist/assets/button-C_rd7CPp.js +43 -0
- package/web/dist/assets/compare-variants-D6WXhvXA.js +1 -0
- package/web/dist/assets/diff-DrEARXTV.js +3 -0
- package/web/dist/assets/diff-controls-B1-j7nFg.js +1 -0
- package/web/dist/assets/{diff-view-DPn6bQ5W.js → diff-view-DvGLjdTk.js} +3 -3
- package/web/dist/assets/dropdown-menu-BegOZFrj.js +1 -0
- package/web/dist/assets/format-DpNe3S0A.js +1 -0
- package/web/dist/assets/git-toolbar-Cw4ljmhB.js +1 -0
- package/web/dist/assets/github-CfV5sqL0.js +1 -0
- package/web/dist/assets/{image-preview-DJ8cgb1Z.js → image-preview-FOEfqpZP.js} +1 -1
- package/web/dist/assets/index-DgWWlOLy.js +13 -0
- package/web/dist/assets/index-fBFnuvxu.css +1 -0
- package/web/dist/assets/{nav-row-styles-3j64kH5s.js → nav-row-styles-vp2JbhuJ.js} +1 -1
- package/web/dist/assets/play-CmVAj_fu.js +1 -0
- package/web/dist/assets/popover-BohP6WTx.js +1 -0
- package/web/dist/assets/preview-pane-connected-qTA5KNoJ.js +3 -0
- package/web/dist/assets/preview-state-vuMviq6q.js +1 -0
- package/web/dist/assets/prompt-templates-Cubdut_C.js +15 -0
- package/web/dist/assets/repo-git-Cf4t5PD0.js +1 -0
- package/web/dist/assets/{run-diff-5-RRdcVz.js → run-diff-BpkUW37Z.js} +3 -3
- package/web/dist/assets/run-header-68WHf9wV.js +1 -0
- package/web/dist/assets/skills-DiVIgKeU.js +1 -0
- package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
- package/web/dist/assets/status-dot-CqTJHSP9.js +1 -0
- package/web/dist/assets/{tab-link-K0hjzEXR.js → tab-link-B07Hu4QX.js} +1 -1
- package/web/dist/assets/task-changes--lQF6EYf.js +1 -0
- package/web/dist/assets/task-commits-Cx0qy4DN.js +1 -0
- package/web/dist/assets/task-files-D50s-gKW.js +2 -0
- package/web/dist/assets/task-github-item-DaqmSwYT.js +1 -0
- package/web/dist/assets/task-thread-BPQ64lui.js +7 -0
- package/web/dist/assets/{task-thread-Bw_nQuTx.css → task-thread-zNE2Q9E-.css} +1 -1
- package/web/dist/assets/textarea-D20O4Pw0.js +1 -0
- package/web/dist/assets/thread-state-DWcFMrvb.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-BLIGmwbd.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Cy9eyyfL.js +1 -0
- package/web/dist/assets/{utils-fzNfbPzA.js → utils-JsL3ZsJf.js} +1 -1
- package/web/dist/assets/workflows-jwG7uxqi.js +11 -0
- package/web/dist/assets/{zoomable-image-CDmZ_Rtl.js → zoomable-image-BJJ64KGc.js} +1 -1
- package/web/dist/cezarion-lockup-dark.svg +1 -13
- package/web/dist/cezarion-lockup-light.svg +1 -13
- package/web/dist/cezarion-mark-dark.svg +1 -12
- package/web/dist/cezarion-mark-light.svg +1 -12
- package/web/dist/index.html +16 -21
- package/web/dist/assets/agent-accounts-CU2ZDv24.js +0 -1
- package/web/dist/assets/alert-dialog-C-xYE_dg.js +0 -43
- package/web/dist/assets/chevron-right-BENZ-1ZN.js +0 -1
- package/web/dist/assets/collapsible-DD9J91Iv.js +0 -1
- package/web/dist/assets/compare-variants-5FmqpFSN.js +0 -1
- package/web/dist/assets/diff-controls-Bj0YrioE.js +0 -1
- package/web/dist/assets/diff-rE8rm75J2.js +0 -3
- package/web/dist/assets/diff-stat-BKDCSVfJ.js +0 -1
- package/web/dist/assets/dropdown-menu-Ch5BYQh_.js +0 -1
- package/web/dist/assets/format-dBiNDNVe.js +0 -1
- package/web/dist/assets/git-toolbar-ClVvf5iF.js +0 -1
- package/web/dist/assets/github-BkNOyour.css +0 -1
- package/web/dist/assets/github-DeZMeMwJ.js +0 -1
- package/web/dist/assets/github-item-detail-W5F6GVjF.js +0 -1
- package/web/dist/assets/github-sidebar-model-DcMu-IK2.js +0 -1
- package/web/dist/assets/highlighter-CdHqIwFr.js +0 -3
- package/web/dist/assets/index-CatemBEL.js +0 -8
- package/web/dist/assets/index-MvfD8bZJ.css +0 -1
- package/web/dist/assets/markdown-zdKeLIYA.js +0 -2
- package/web/dist/assets/mobile-run-bar-BCfmFi8V.js +0 -1
- package/web/dist/assets/prompt-templates-CBPp39IU.js +0 -15
- package/web/dist/assets/reference-chip-D6owncJT.js +0 -1
- package/web/dist/assets/repo-git-CtdkZFey.js +0 -1
- package/web/dist/assets/run-header-BcjoDi0W.js +0 -1
- package/web/dist/assets/sheet-ChnYVrp1.js +0 -1
- package/web/dist/assets/skills-C8YKp2vr.js +0 -1
- package/web/dist/assets/task-changes-BW8YdWG8.js +0 -1
- package/web/dist/assets/task-commits-q2kB2y6L.js +0 -1
- package/web/dist/assets/task-files-pPL6_3Cr.js +0 -2
- package/web/dist/assets/task-github-item-BXF5R52U.js +0 -1
- package/web/dist/assets/task-thread-DtkFL3EC.js +0 -10
- package/web/dist/assets/textarea-DxlkE-Yd.js +0 -1
- package/web/dist/assets/token-metrics-DIAjrPlM.js +0 -1
- package/web/dist/assets/use-desktop-CrDny2uG.js +0 -1
- package/web/dist/assets/use-submit-shortcut-KWJsC906.js +0 -1
- package/web/dist/assets/workflows-TmcPEj2K.js +0 -11
- /package/web/dist/assets/{lib-BQXq3kEf2.js → lib-BQXq3kEf.js} +0 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic `runs.json` fixtures for the run-store benchmark (#779,
|
|
3
|
+
* `scripts/benchmark-run-store.ts`). Pure data: no store, no file system.
|
|
4
|
+
*
|
|
5
|
+
* Modeled on the 712-run local sample recorded on #779: 18.5 MB, median record 6.2 KB, largest
|
|
6
|
+
* 363 KB, 698 archived, 701 with `delegation`; bytes by field: systemPrompt 7.75 MB, delegation
|
|
7
|
+
* 3.26 MB, agentInputs 2.39 MB, task 1.94 MB, steps 0.58 MB, lastCiWait 0.21 MB. Shapes follow
|
|
8
|
+
* a real index: roots own up to a handful of workers, root delegation carries the conversation
|
|
9
|
+
* (the long tail), workers carry their parent's inputs and, before #778, a copy of the parent's
|
|
10
|
+
* expanded skill as `systemPrompt` (12 distinct texts, 2-86 KB, the largest on 46 of 128 workers).
|
|
11
|
+
* At 712 runs with the default seed the legacy profile writes 17.2 MB (systemPrompt 8.0, delegation
|
|
12
|
+
* 3.0, agentInputs 2.5, task 1.7, steps 0.5 MB), median record 9.8 KB, largest 235 KB. The median
|
|
13
|
+
* runs above the sample's 6.2 KB and matches today's 875-run file (8.9 KB).
|
|
14
|
+
*
|
|
15
|
+
* Profiles share every random draw, so they differ only in worker `systemPrompt`:
|
|
16
|
+
* - `legacy`: workers spawned by a skill-driven parent copy its expanded skill (pre-#778).
|
|
17
|
+
* - `post-778`: #778 (cf17f693) did not deduplicate the copy, it dropped it. A worker inherits only
|
|
18
|
+
* the parent's extra system prompt, which few runs set; legacy records keep their inline copy
|
|
19
|
+
* until retention removes them, so this profile models a file written entirely after #778.
|
|
20
|
+
*
|
|
21
|
+
* The `runs` records are finished (`done`/`cancelled`/`failed`, `review` for the few unarchived
|
|
22
|
+
* rows). On top of them sits a live share of max(3, ceil(1% of runs)) records, newest first:
|
|
23
|
+
* repeating groups of one `waiting` root with up to two `running` workers, one `queued` run and one
|
|
24
|
+
* `running` run. It draws from its own seeded stream, so the finished records keep the bytes and
|
|
25
|
+
* ids the first benchmark table measured; `serve` opens with `keepLive`, which leaves them live.
|
|
26
|
+
*/
|
|
27
|
+
import type { RunRecord } from '../src/runs/store.ts';
|
|
28
|
+
|
|
29
|
+
export const FIXTURE_PROFILES = ['legacy', 'post-778'] as const;
|
|
30
|
+
export type FixtureProfile = typeof FIXTURE_PROFILES[number];
|
|
31
|
+
export const DEFAULT_FIXTURE_SEED = 779;
|
|
32
|
+
const LIVE_STATUSES: ReadonlyArray<RunRecord['status']> = ['queued', 'running', 'waiting'];
|
|
33
|
+
|
|
34
|
+
/** Live (`queued`/`running`/`waiting`) records added on top of `runs` finished ones. */
|
|
35
|
+
export const liveRunCount = (runs: number) => Math.max(3, Math.ceil(runs * 0.01));
|
|
36
|
+
export const isLiveRun = (run: RunRecord) => LIVE_STATUSES.includes(run.status);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The record the benchmark's save rows write: the finished one whose serialized size is closest
|
|
40
|
+
* to the median finished record, ties broken by id. A save costs what the changed record weighs,
|
|
41
|
+
* and the rows exist to show how save cost scales with HISTORY, so the target must not change
|
|
42
|
+
* shape with the size. The old pick, `finished[length / 2]`, landed on a 231 KB record (99.9th
|
|
43
|
+
* percentile; the median is ~7 KB) at 2,000 runs and on 2.5-16 KB ones at every other size,
|
|
44
|
+
* which is why only the 2,000-run save cells read 2.8-3 ms against ~0.5 ms.
|
|
45
|
+
*/
|
|
46
|
+
export function pickSaveTarget(finished: readonly RunRecord[]): RunRecord {
|
|
47
|
+
const sized = finished.map((run) => ({ run, bytes: JSON.stringify(run).length }));
|
|
48
|
+
const median = sized.map((entry) => entry.bytes).sort((a, b) => a - b)[Math.floor(sized.length / 2)]!;
|
|
49
|
+
return sized.reduce((best, entry) => {
|
|
50
|
+
const distance = Math.abs(entry.bytes - median);
|
|
51
|
+
const bestDistance = Math.abs(best.bytes - median);
|
|
52
|
+
return distance < bestDistance || (distance === bestDistance && entry.run.id < best.run.id) ? entry : best;
|
|
53
|
+
}).run;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Sizes (chars) and weights of the distinct worker skill prompts in the sample (#778). */
|
|
57
|
+
const SKILL_PROMPTS: ReadonlyArray<{ chars: number; weight: number }> = [
|
|
58
|
+
{ chars: 86_157, weight: 36 }, { chars: 83_049, weight: 18 }, { chars: 72_587, weight: 14 },
|
|
59
|
+
{ chars: 56_001, weight: 12 }, { chars: 51_315, weight: 10 }, { chars: 13_914, weight: 6 },
|
|
60
|
+
{ chars: 12_526, weight: 6 }, { chars: 11_870, weight: 6 }, { chars: 5_421, weight: 4 },
|
|
61
|
+
{ chars: 1_926, weight: 3 }, { chars: 1_839, weight: 2 }, { chars: 40, weight: 1 },
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
class Rng {
|
|
65
|
+
private state: number;
|
|
66
|
+
constructor(seed: number) { this.state = seed >>> 0; }
|
|
67
|
+
/** mulberry32 */
|
|
68
|
+
next(): number {
|
|
69
|
+
this.state = (this.state + 0x6d2b79f5) >>> 0;
|
|
70
|
+
let t = this.state;
|
|
71
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
72
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
73
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4_294_967_296;
|
|
74
|
+
}
|
|
75
|
+
int(min: number, max: number): number { return min + Math.floor(this.next() * (max - min + 1)); }
|
|
76
|
+
chance(p: number): boolean { return this.next() < p; }
|
|
77
|
+
pick<T>(items: readonly T[]): T { return items[this.int(0, items.length - 1)]!; }
|
|
78
|
+
weighted<T extends { weight: number }>(items: readonly T[]): T {
|
|
79
|
+
let roll = this.next() * items.reduce((sum, item) => sum + item.weight, 0);
|
|
80
|
+
for (const item of items) if ((roll -= item.weight) < 0) return item;
|
|
81
|
+
return items[items.length - 1]!;
|
|
82
|
+
}
|
|
83
|
+
/** Log-normal by median and 90th percentile, clamped: the long tail of real record sizes. */
|
|
84
|
+
logNormal(median: number, p90: number, min: number, max: number): number {
|
|
85
|
+
const u = Math.max(this.next(), 1e-12);
|
|
86
|
+
const z = Math.sqrt(-2 * Math.log(u)) * Math.cos(2 * Math.PI * this.next());
|
|
87
|
+
const value = median * Math.exp((Math.log(p90 / median) / 1.2816) * z);
|
|
88
|
+
return Math.round(Math.min(max, Math.max(min, value)));
|
|
89
|
+
}
|
|
90
|
+
hex(length: number): string {
|
|
91
|
+
let out = '';
|
|
92
|
+
while (out.length < length) out += Math.floor(this.next() * 0x1_0000_0000).toString(16).padStart(8, '0');
|
|
93
|
+
return out.slice(0, length);
|
|
94
|
+
}
|
|
95
|
+
uuid(): string {
|
|
96
|
+
const h = this.hex(32);
|
|
97
|
+
const variant = ((parseInt(h[16]!, 16) & 0x3) | 0x8).toString(16);
|
|
98
|
+
return `${h.slice(0, 8)}-${h.slice(8, 12)}-4${h.slice(13, 16)}-${variant}${h.slice(17, 20)}-${h.slice(20, 32)}`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const WORDS = ('the run worker parent task skill review issue branch commit test fixture store index save ' +
|
|
103
|
+
'open read write session agent prompt step delegation conversation request reply outcome wait ' +
|
|
104
|
+
'verify gate draft merge build typecheck cockpit project workspace event stream record field ' +
|
|
105
|
+
'`packages/cezar/src/runs/store.ts` `npm test` "quoted" **bold** - 1. ## Heading > note').split(' ');
|
|
106
|
+
|
|
107
|
+
let corpus: string | undefined;
|
|
108
|
+
/** 256 KB of markdown-ish text with newlines and quotes, so serialization has escaping to do. */
|
|
109
|
+
function textCorpus(): string {
|
|
110
|
+
if (corpus) return corpus;
|
|
111
|
+
const rng = new Rng(0xc0ffee);
|
|
112
|
+
const parts: string[] = [];
|
|
113
|
+
let length = 0;
|
|
114
|
+
while (length < 256 * 1024) {
|
|
115
|
+
const word = rng.pick(WORDS);
|
|
116
|
+
const sep = rng.chance(0.07) ? '\n' : ' ';
|
|
117
|
+
parts.push(word, sep);
|
|
118
|
+
length += word.length + 1;
|
|
119
|
+
}
|
|
120
|
+
return (corpus = parts.join(''));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function text(rng: Rng, chars: number): string {
|
|
124
|
+
const source = textCorpus();
|
|
125
|
+
let out = '';
|
|
126
|
+
let offset = rng.int(0, source.length - 1);
|
|
127
|
+
while (out.length < chars) {
|
|
128
|
+
out += source.slice(offset, offset + chars - out.length);
|
|
129
|
+
offset = 0;
|
|
130
|
+
}
|
|
131
|
+
return out.trim().length > 0 ? out : 'x'.repeat(Math.max(chars, 1));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const line = (rng: Rng, chars: number) => text(rng, chars).replace(/\s+/g, ' ').trim() || 'Task';
|
|
135
|
+
const iso = (ms: number) => new Date(ms).toISOString();
|
|
136
|
+
const REPO = 'https://github.com/example-org/example-repo';
|
|
137
|
+
const MINUTE = 60_000;
|
|
138
|
+
|
|
139
|
+
interface Draft { record: RunRecord; skillPrompt?: string; extraPrompt?: string }
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* `runs` finished records plus `liveRunCount(runs)` live ones, newest first (the order `RunStore`
|
|
143
|
+
* writes). Same inputs, same bytes.
|
|
144
|
+
*/
|
|
145
|
+
export function generateRunFixture(options: { runs: number; profile: FixtureProfile; seed?: number }): RunRecord[] {
|
|
146
|
+
const rng = new Rng((options.seed ?? DEFAULT_FIXTURE_SEED) * 1_000_003 + options.runs);
|
|
147
|
+
const skillPrompts = SKILL_PROMPTS.map((entry) => ({ weight: entry.weight, text: text(rng, entry.chars) }));
|
|
148
|
+
const drafts: Draft[] = [];
|
|
149
|
+
const end = Date.UTC(2026, 9, 1);
|
|
150
|
+
const createdAt = (seq: number) => end - (options.runs - seq) * 7 * MINUTE;
|
|
151
|
+
|
|
152
|
+
while (drafts.length < options.runs) {
|
|
153
|
+
if (rng.chance(0.015)) { drafts.push({ record: plainRun(rng, createdAt(drafts.length)) }); continue; }
|
|
154
|
+
const roll = rng.next();
|
|
155
|
+
const workers = roll < 0.5 ? 0 : roll < 0.66 ? 1 : roll < 0.78 ? 2 : roll < 0.87 ? 3 : roll < 0.93 ? 4 : rng.int(5, 8);
|
|
156
|
+
const skillDriven = rng.chance(0.28);
|
|
157
|
+
const rootId = rng.uuid();
|
|
158
|
+
const workerIds = Array.from({ length: Math.min(workers, options.runs - drafts.length - 1) }, () => rng.uuid());
|
|
159
|
+
drafts.push({ record: rootRun(rng, rootId, workerIds, createdAt(drafts.length)) });
|
|
160
|
+
for (const workerId of workerIds) {
|
|
161
|
+
const draft = workerRun(rng, workerId, rootId, createdAt(drafts.length));
|
|
162
|
+
// Always draw both, so the two profiles consume the same stream.
|
|
163
|
+
const skill = rng.weighted(skillPrompts).text;
|
|
164
|
+
const extra = rng.chance(0.1) ? text(rng, rng.logNormal(400, 2_000, 40, 4_000)) : undefined;
|
|
165
|
+
if (skillDriven) draft.skillPrompt = skill;
|
|
166
|
+
draft.extraPrompt = extra;
|
|
167
|
+
drafts.push(draft);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const unarchived = Math.ceil(options.runs * 0.02);
|
|
172
|
+
const finished = drafts.map((draft, index) => {
|
|
173
|
+
const record = withSystemPrompt(draft, options.profile);
|
|
174
|
+
if (index >= options.runs - unarchived) {
|
|
175
|
+
record.archived = false;
|
|
176
|
+
if (record.status === 'done') record.status = 'review';
|
|
177
|
+
} else {
|
|
178
|
+
record.archived = true;
|
|
179
|
+
record.archivedAt = iso(Date.parse(record.finishedAt ?? record.createdAt) + 3 * 24 * 60 * MINUTE);
|
|
180
|
+
}
|
|
181
|
+
return record;
|
|
182
|
+
}).reverse();
|
|
183
|
+
const live = liveRuns(new Rng((options.seed ?? DEFAULT_FIXTURE_SEED) * 1_000_003 + options.runs + 0x11fe),
|
|
184
|
+
skillPrompts, liveRunCount(options.runs), end).map((draft) => withSystemPrompt(draft, options.profile));
|
|
185
|
+
return [...live.reverse(), ...finished];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function withSystemPrompt(draft: Draft, profile: FixtureProfile): RunRecord {
|
|
189
|
+
const systemPrompt = profile === 'legacy' ? draft.skillPrompt ?? draft.extraPrompt : draft.extraPrompt;
|
|
190
|
+
if (systemPrompt !== undefined) draft.record.systemPrompt = systemPrompt;
|
|
191
|
+
return draft.record;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** `count` live records, oldest first, created after `end` (every finished record). */
|
|
195
|
+
function liveRuns(rng: Rng, skillPrompts: ReadonlyArray<{ weight: number; text: string }>, count: number, end: number): Draft[] {
|
|
196
|
+
const drafts: Draft[] = [];
|
|
197
|
+
const at = () => end + (drafts.length + 1) * MINUTE;
|
|
198
|
+
const goLive = (record: RunRecord, status: RunRecord['status']): RunRecord => {
|
|
199
|
+
record.status = status;
|
|
200
|
+
delete record.finishedAt;
|
|
201
|
+
delete record.error;
|
|
202
|
+
delete record.seenAt;
|
|
203
|
+
if (status === 'queued') delete record.startedAt;
|
|
204
|
+
for (const step of record.steps) {
|
|
205
|
+
step.status = status === 'queued' ? 'pending' : status;
|
|
206
|
+
delete step.finishedAt;
|
|
207
|
+
if (status === 'queued') delete step.startedAt;
|
|
208
|
+
}
|
|
209
|
+
return record;
|
|
210
|
+
};
|
|
211
|
+
for (let group = 0; drafts.length < count; group++) {
|
|
212
|
+
if (group % 3 !== 0) {
|
|
213
|
+
drafts.push({ record: goLive(plainRun(rng, at()), group % 3 === 1 ? 'queued' : 'running') });
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const skillDriven = rng.chance(0.28);
|
|
217
|
+
const rootId = rng.uuid();
|
|
218
|
+
const workerIds = Array.from({ length: Math.min(2, count - drafts.length - 1) }, () => rng.uuid());
|
|
219
|
+
drafts.push({ record: goLive(rootRun(rng, rootId, workerIds, at()), 'waiting') });
|
|
220
|
+
for (const workerId of workerIds) {
|
|
221
|
+
const draft = workerRun(rng, workerId, rootId, at());
|
|
222
|
+
goLive(draft.record, 'running');
|
|
223
|
+
const skill = rng.weighted(skillPrompts).text;
|
|
224
|
+
draft.extraPrompt = rng.chance(0.1) ? text(rng, rng.logNormal(400, 2_000, 40, 4_000)) : undefined;
|
|
225
|
+
if (skillDriven) draft.skillPrompt = skill;
|
|
226
|
+
drafts.push(draft);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return drafts;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function baseRun(rng: Rng, id: string, at: number, worker: boolean): RunRecord {
|
|
233
|
+
const runner = rng.chance(0.8) ? 'claude' as const : 'codex' as const;
|
|
234
|
+
const model = runner === 'claude' ? 'opus' : 'gpt-5.5';
|
|
235
|
+
const roll = rng.next();
|
|
236
|
+
const status = roll < 0.93 ? 'done' as const : roll < 0.98 ? 'cancelled' as const : 'failed' as const;
|
|
237
|
+
const durationMs = rng.logNormal(12, 90, 1, 600) * MINUTE;
|
|
238
|
+
const steps = worker ? 1 : rng.int(1, 2);
|
|
239
|
+
const tokens = rng.int(10_000, 4_000_000);
|
|
240
|
+
const record: RunRecord = {
|
|
241
|
+
id,
|
|
242
|
+
title: line(rng, rng.logNormal(70, 180, 12, 300)),
|
|
243
|
+
workflow: 'quick-task',
|
|
244
|
+
task: text(rng, rng.logNormal(500, 5_000, 30, 74_000)),
|
|
245
|
+
model,
|
|
246
|
+
modelIdentity: runner === 'claude' ? 'anthropic/claude-opus-5-5' : 'openai/gpt-5.5',
|
|
247
|
+
runner,
|
|
248
|
+
agentProfile: 'default',
|
|
249
|
+
effort: 'high',
|
|
250
|
+
generateFollowups: false,
|
|
251
|
+
autonomous: rng.chance(0.3),
|
|
252
|
+
status,
|
|
253
|
+
createdAt: iso(at),
|
|
254
|
+
startedAt: iso(at + 20_000),
|
|
255
|
+
finishedAt: iso(at + durationMs),
|
|
256
|
+
tokensUsed: tokens,
|
|
257
|
+
inputTokens: Math.round(tokens * 0.9),
|
|
258
|
+
outputTokens: Math.round(tokens * 0.1),
|
|
259
|
+
costUsd: Math.round(tokens * 0.000_004 * 10_000) / 10_000,
|
|
260
|
+
archived: false,
|
|
261
|
+
steps: Array.from({ length: steps }, (_, index) => ({
|
|
262
|
+
id: index === 0 ? 'task' : `continue-${index}`,
|
|
263
|
+
name: index === 0 ? 'Do the task' : 'Continue',
|
|
264
|
+
kind: 'agent' as const,
|
|
265
|
+
status: status === 'failed' && index === steps - 1 ? 'failed' as const : 'done' as const,
|
|
266
|
+
iterations: rng.int(1, 4),
|
|
267
|
+
tokensUsed: Math.round(tokens / steps),
|
|
268
|
+
inputTokens: Math.round((tokens / steps) * 0.9),
|
|
269
|
+
outputTokens: Math.round((tokens / steps) * 0.1),
|
|
270
|
+
usageInvocationEpoch: 1,
|
|
271
|
+
usageInvocationsStarted: 1,
|
|
272
|
+
usageInvocationsObserved: 1,
|
|
273
|
+
usageTurnsStarted: 1,
|
|
274
|
+
usageTurnsRecorded: 1,
|
|
275
|
+
startedAt: iso(at + 20_000),
|
|
276
|
+
finishedAt: iso(at + durationMs),
|
|
277
|
+
sessionId: rng.uuid(),
|
|
278
|
+
backend: runner,
|
|
279
|
+
profileId: 'default',
|
|
280
|
+
...(index > 0 ? { synthetic: 'continuation' as const } : {}),
|
|
281
|
+
})),
|
|
282
|
+
workflowDef: {
|
|
283
|
+
name: 'quick-task',
|
|
284
|
+
description: 'One agent run on your task — no ceremony.',
|
|
285
|
+
steps: [{ id: 'task', name: 'Do the task', prompt: '{{task}}', model, effort: 'high', runner, agentProfile: 'default',
|
|
286
|
+
allowedTools: ['Read', 'Edit', 'Write', 'Grep', 'Glob', 'Bash'] }],
|
|
287
|
+
source: 'built-in',
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
if (status === 'failed') record.error = line(rng, rng.logNormal(120, 600, 20, 2_000));
|
|
291
|
+
if (rng.chance(0.5)) { record.titleSummary = line(rng, rng.logNormal(45, 80, 10, 120)); record.titleOrigin = 'auto'; }
|
|
292
|
+
if (rng.chance(0.7)) record.seenAt = iso(at + durationMs + 10 * MINUTE);
|
|
293
|
+
if (rng.chance(0.3)) {
|
|
294
|
+
const candidates = Array.from({ length: rng.int(1, 3) }, () => `${REPO}/issues/${rng.int(1, 999)}`);
|
|
295
|
+
record.referencedIssueCandidates = candidates;
|
|
296
|
+
record.referencedIssueUrl = candidates[0];
|
|
297
|
+
record.issueNumber = Number(candidates[0]!.split('/').pop());
|
|
298
|
+
}
|
|
299
|
+
if (rng.chance(0.2)) {
|
|
300
|
+
const pr = rng.int(1, 999);
|
|
301
|
+
record.pullRequestUrl = `${REPO}/pull/${pr}`;
|
|
302
|
+
record.prNumber = pr;
|
|
303
|
+
record.referencedPrCandidates = [record.pullRequestUrl];
|
|
304
|
+
}
|
|
305
|
+
if (rng.chance(0.15)) record.markerRefs = { issue: rng.int(1, 999) };
|
|
306
|
+
return record;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function plainRun(rng: Rng, at: number): RunRecord {
|
|
310
|
+
const id = rng.uuid();
|
|
311
|
+
return { ...baseRun(rng, id, at, false), ...worktree(rng, id) };
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function worktree(rng: Rng, id: string) {
|
|
315
|
+
return {
|
|
316
|
+
worktreePath: `/home/dev/project/.ai/cezar/worktrees/${id}`,
|
|
317
|
+
branch: `cez/${id.slice(0, 8)}`,
|
|
318
|
+
baseBranch: 'main',
|
|
319
|
+
diffStat: { adds: rng.int(0, 900), dels: rng.int(0, 400), files: rng.int(0, 40) },
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function rootRun(rng: Rng, id: string, workerIds: readonly string[], at: number): RunRecord {
|
|
324
|
+
const record: RunRecord = { ...baseRun(rng, id, at, false), ...worktree(rng, id) };
|
|
325
|
+
const observedAt = iso(at + 40 * MINUTE);
|
|
326
|
+
const receipts = workerIds.map((workerId) => ({ requestId: rng.uuid(), workerId, requestHash: rng.hex(64) }));
|
|
327
|
+
const delegation: Extract<NonNullable<RunRecord['delegation']>, { role: 'root' }> = {
|
|
328
|
+
role: 'root',
|
|
329
|
+
permissions: ['spawn', 'inspect', 'steer', 'stop', 'destroy', 'diff', 'wait'],
|
|
330
|
+
receipts,
|
|
331
|
+
};
|
|
332
|
+
if (workerIds.length > 0) {
|
|
333
|
+
delegation.results = workerIds.filter(() => rng.chance(0.7)).map((workerId) => ({
|
|
334
|
+
workerId, revision: 0, snapshotId: rng.uuid(), observedAt, lastExecutionOutcome: 'completed' as const,
|
|
335
|
+
}));
|
|
336
|
+
if (rng.chance(0.4)) {
|
|
337
|
+
delegation.lastWait = {
|
|
338
|
+
id: rng.uuid(), workerIds: [...workerIds], deadline: iso(at + 50 * MINUTE), mode: 'all', reason: 'outcome',
|
|
339
|
+
phase: 'wake-pending',
|
|
340
|
+
outcomes: workerIds.map((workerId) => ({ workerId, status: 'done' as const, observedAt, revision: 0 })),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
// The conversation is where root delegation's long tail lives.
|
|
344
|
+
const target = rng.logNormal(4_500, 32_000, 600, 380_000);
|
|
345
|
+
const messages: NonNullable<typeof delegation.conversation>['messages'] = [];
|
|
346
|
+
const outcomes: NonNullable<typeof delegation.conversation>['outcomes'] = [];
|
|
347
|
+
let bytes = 0;
|
|
348
|
+
while (bytes < target && messages.length < 1_000) {
|
|
349
|
+
const workerId = rng.pick(workerIds);
|
|
350
|
+
const request = rng.uuid();
|
|
351
|
+
const chars = rng.logNormal(500, 3_000, 20, 20_000);
|
|
352
|
+
messages.push({ senderRunId: id, recipientRunId: workerId, kind: 'request', id: request, text: text(rng, chars),
|
|
353
|
+
createdAt: observedAt, deadline: iso(at + 50 * MINUTE), requestHash: rng.hex(64), state: 'accepted' });
|
|
354
|
+
bytes += chars + 450;
|
|
355
|
+
if (rng.chance(0.6)) {
|
|
356
|
+
const reply = rng.uuid();
|
|
357
|
+
const replyChars = rng.logNormal(400, 2_500, 20, 20_000);
|
|
358
|
+
messages.push({ senderRunId: workerId, recipientRunId: id, kind: 'reply', requestId: request, id: reply,
|
|
359
|
+
text: text(rng, replyChars), createdAt: observedAt, requestHash: rng.hex(64), state: 'accepted' });
|
|
360
|
+
outcomes.push({ requestId: request, status: 'replied', observedAt, replyId: reply });
|
|
361
|
+
bytes += replyChars + 600;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
delegation.conversation = { messages, outcomes };
|
|
365
|
+
if (rng.chance(0.35)) {
|
|
366
|
+
record.agentInputs = agentInputs(rng, id, rng.pick(workerIds), id, 'reply', at);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
record.delegation = delegation;
|
|
370
|
+
if (rng.chance(0.1)) record.lastCiWait = ciWait(rng, at);
|
|
371
|
+
return record;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function workerRun(rng: Rng, id: string, parentId: string, at: number): Draft {
|
|
375
|
+
const record = baseRun(rng, id, at, true);
|
|
376
|
+
const delegation: Extract<NonNullable<RunRecord['delegation']>, { role: 'worker' }> = {
|
|
377
|
+
role: 'worker',
|
|
378
|
+
permissions: [],
|
|
379
|
+
parentRunId: parentId,
|
|
380
|
+
workspace: {
|
|
381
|
+
ownerRunId: id, resourceId: rng.uuid(), kind: 'owned-isolated',
|
|
382
|
+
path: `/home/dev/project/.ai/cezar/worktrees/${id}`, branch: `cez/${id.slice(0, 8)}`, baselineSha: rng.hex(40),
|
|
383
|
+
},
|
|
384
|
+
executionRevision: rng.int(0, 2),
|
|
385
|
+
executionStartSeq: rng.int(0, 400),
|
|
386
|
+
};
|
|
387
|
+
if (rng.chance(0.4)) delegation.context = { text: text(rng, rng.logNormal(800, 6_000, 20, 60_000)), inputs: [] };
|
|
388
|
+
record.delegation = delegation;
|
|
389
|
+
if (rng.chance(0.5)) record.agentInputs = agentInputs(rng, parentId, parentId, id, 'request', at);
|
|
390
|
+
return { record };
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Inputs delivered to `recipient`, attributed to a conversation with `sender`. */
|
|
394
|
+
function agentInputs(rng: Rng, parentRunId: string, sender: string, recipient: string,
|
|
395
|
+
kind: 'request' | 'reply', at: number): NonNullable<RunRecord['agentInputs']> {
|
|
396
|
+
const target = rng.logNormal(3_000, 20_000, 400, 340_000);
|
|
397
|
+
const inputs: NonNullable<RunRecord['agentInputs']> = [];
|
|
398
|
+
let bytes = 0;
|
|
399
|
+
while (bytes < target) {
|
|
400
|
+
const chars = Math.min(100_000, Math.max(1, Math.min(target - bytes, rng.logNormal(1_500, 8_000, 20, 100_000))));
|
|
401
|
+
const createdAt = iso(at + (inputs.length + 1) * MINUTE);
|
|
402
|
+
inputs.push({
|
|
403
|
+
conversation: { senderRunId: sender, recipientRunId: recipient, kind, ...(kind === 'reply' ? { requestId: rng.uuid() } : {}) },
|
|
404
|
+
id: rng.uuid(), source: 'agent', parentRunId, text: text(rng, chars), createdAt, deliveredAt: createdAt, consumedAt: createdAt,
|
|
405
|
+
});
|
|
406
|
+
bytes += chars + 420;
|
|
407
|
+
}
|
|
408
|
+
return inputs;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function ciWait(rng: Rng, at: number): NonNullable<RunRecord['lastCiWait']> {
|
|
412
|
+
const pr = rng.int(1, 999);
|
|
413
|
+
const headSha = rng.hex(40);
|
|
414
|
+
const id = rng.uuid();
|
|
415
|
+
return {
|
|
416
|
+
prUrl: `${REPO}/pull/${pr}`, repository: 'example-org/example-repo', prNumber: pr, headSha, id,
|
|
417
|
+
generation: rng.uuid(), turnId: rng.uuid(), timeoutSeconds: 1_800,
|
|
418
|
+
registeredAt: iso(at + 30 * MINUTE), deadline: iso(at + 60 * MINUTE), phase: 'delivered',
|
|
419
|
+
result: {
|
|
420
|
+
outcome: 'passed', headSha, observedAt: iso(at + 45 * MINUTE), totalChecks: 21, truncated: false,
|
|
421
|
+
checks: Array.from({ length: 21 }, (_, index) => ({
|
|
422
|
+
name: `check-${index + 1} (ubuntu-latest)`, state: 'SUCCESS',
|
|
423
|
+
link: `${REPO}/actions/runs/${rng.int(1e10, 9e10)}/job/${rng.int(1e10, 9e10)}`,
|
|
424
|
+
})),
|
|
425
|
+
},
|
|
426
|
+
wakeId: id, deliveredAt: iso(at + 46 * MINUTE),
|
|
427
|
+
};
|
|
428
|
+
}
|