mixdog 1.3.5 → 1.4.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/NOTICE.md +2 -2
- package/README.md +2 -2
- package/package.json +2 -11
- package/scripts/daemon-stub.mjs +1 -1
- package/scripts/gate-local.mjs +4 -2
- package/scripts/native-release-status.mjs +2 -2
- package/scripts/recall-history-cases.json +1 -1
- package/scripts/suite-health.mjs +10 -1
- package/scripts/test.mjs +7 -11
- package/src/agents/reviewer/AGENT.md +7 -11
- package/src/agents/reviewer/agent.json +1 -1
- package/src/defaults/shipped-history.json +17 -1
- package/src/defaults/skills/browser-use/SKILL.md +59 -11
- package/src/defaults/skills/code-tidy/SKILL.md +142 -270
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +4 -4
- package/src/defaults/skills/code-tidy/references/cleanup-report.md +31 -76
- package/src/defaults/skills/code-tidy/references/dead-code.md +6 -12
- package/src/defaults/skills/computer-use/SKILL.md +33 -9
- package/src/defaults/skills/setup/SKILL.md +22 -0
- package/src/defaults/skills/setup/references/actions.md +39 -5
- package/src/defaults/skills/setup/references/surfaces.md +11 -2
- package/src/defaults/skills/visualize/SKILL.md +2 -1
- package/src/lib/rules-builder.cjs +10 -8
- package/src/rules/agent/AGENT.md +6 -6
- package/src/rules/lead/LEAD.md +18 -20
- package/src/rules/shared/05-tool-calls.md +5 -6
- package/src/rules/shared/10-tool-workflow.md +2 -0
- package/src/rules/shared/60-verification.md +7 -5
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -3
- package/src/runtime/agent/orchestrator/agent-runtime/title-completion.mjs +3 -1
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +3 -1
- package/src/runtime/agent/orchestrator/config.mjs +17 -1
- package/src/runtime/agent/orchestrator/context/collect.mjs +3 -0
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +72 -67
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +54 -1
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +3 -3
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +176 -72
- package/src/runtime/agent/orchestrator/mcp/client.mjs +19 -0
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +181 -133
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +42 -6
- package/src/runtime/agent/orchestrator/providers/anthropic-cache-warm.mjs +165 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/gzip-post.mjs +14 -14
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +145 -66
- package/src/runtime/agent/orchestrator/providers/anthropic-overload-fallback.mjs +25 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +64 -33
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +135 -87
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +123 -102
- package/src/runtime/agent/orchestrator/providers/cache-warm-admission.mjs +90 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-transport.mjs +25 -9
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +22 -13
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +17 -3
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +52 -10
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.d.mts +8 -1
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/npm-cli-version.mjs +11 -3
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +10 -9
- package/src/runtime/agent/orchestrator/providers/openai-ws-send/send-context.mjs +22 -3
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/attempt-context.mjs +43 -5
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/handshake-failure.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/stream-failure.mjs +6 -3
- package/src/runtime/agent/orchestrator/providers/provider-error-kind.mjs +65 -1
- package/src/runtime/agent/orchestrator/providers/quota-reading.mjs +38 -12
- package/src/runtime/agent/orchestrator/providers/registry.mjs +26 -0
- package/src/runtime/agent/orchestrator/providers/retry-executor.mjs +39 -7
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +6 -0
- package/src/runtime/agent/orchestrator/runtime-core/ask-user-tool-defs.mjs +12 -7
- package/src/runtime/agent/orchestrator/runtime-core/compaction-config-keys.mjs +62 -0
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +37 -16
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-delta.mjs +100 -23
- package/src/runtime/agent/orchestrator/runtime-core/session-text.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-bridge.mjs +19 -4
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +125 -30
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +792 -0
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +133 -22
- package/src/runtime/agent/orchestrator/session/compaction-archive-capture.mjs +475 -58
- package/src/runtime/agent/orchestrator/session/compaction-archive.mjs +42 -17
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/human-gate/gate.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/human-gate/outbound-policy.mjs +0 -2
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -4
- package/src/runtime/agent/orchestrator/session/human-gate/store.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +18 -22
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +32 -3
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +17 -3
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +7 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/after-hook.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +16 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +16 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs +10 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +3 -10
- package/src/runtime/agent/orchestrator/session/loop/tool-phase.mjs +12 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +12 -2
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +19 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +133 -90
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-state.mjs +31 -4
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +30 -18
- package/src/runtime/agent/orchestrator/session/manager/owner-route-fallbacks.mjs +23 -13
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/manager/provider-replay.mjs +13 -0
- package/src/runtime/agent/orchestrator/session/manager/route-fallback-chain.mjs +129 -0
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +20 -2
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +7 -2
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +102 -15
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +18 -5
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +19 -8
- package/src/runtime/agent/orchestrator/session/prompt-cache-idle-gaps.mjs +113 -0
- package/src/runtime/agent/orchestrator/session/prompt-cache-touch-store.mjs +127 -0
- package/src/runtime/agent/orchestrator/session/routine-result.mjs +36 -9
- package/src/runtime/agent/orchestrator/session/sensitive-projection.mjs +100 -0
- package/src/runtime/agent/orchestrator/session/sensitive-values.mjs +257 -0
- package/src/runtime/agent/orchestrator/session/side-question-store.mjs +20 -7
- package/src/runtime/agent/orchestrator/session/side-question.mjs +18 -0
- package/src/runtime/agent/orchestrator/session/skill-update-notice.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/store/live-state.mjs +6 -3
- package/src/runtime/agent/orchestrator/session/store/save-delta.mjs +9 -5
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +9 -8
- package/src/runtime/agent/orchestrator/session/store/session-persistence-events.mjs +29 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +8 -6
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +12 -2
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +44 -14
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +84 -3
- package/src/runtime/agent/orchestrator/session/stored-attachment-history.mjs +32 -0
- package/src/runtime/agent/orchestrator/session/thinking-binding.mjs +108 -0
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/tool-batch/record-outcome.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +18 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/tool-result-status.mjs +9 -7
- package/src/runtime/agent/orchestrator/session/transcript-restore/tool-result-text.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/turn-failure.mjs +5 -1
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +5 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/backgrounded-result.mjs +12 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/misuse-guard.mjs +240 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/result-format.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/shell-cwd.mjs +38 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +25 -5
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +65 -7
- package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +36 -13
- package/src/runtime/browser-bridge/action-schema.mjs +13 -2
- package/src/runtime/browser-bridge/client.mjs +73 -8
- package/src/runtime/browser-bridge/input-fields.mjs +8 -9
- package/src/runtime/browser-bridge/mail-links.mjs +107 -0
- package/src/runtime/browser-bridge/tool-defs.mjs +1 -1
- package/src/runtime/channels/lib/config.mjs +6 -61
- package/src/runtime/channels/lib/crash-log.mjs +1 -1
- package/src/runtime/channels/lib/event-pipeline.mjs +4 -19
- package/src/runtime/channels/lib/event-queue.mjs +3 -18
- package/src/runtime/channels/lib/owned-runtime/automation-services.mjs +2 -2
- package/src/runtime/channels/lib/owned-runtime/automation-start.mjs +3 -4
- package/src/runtime/channels/lib/owned-runtime/config-reload.mjs +4 -59
- package/src/runtime/channels/lib/owned-runtime/owned-start.mjs +33 -115
- package/src/runtime/channels/lib/owned-runtime/owned-stop.mjs +5 -22
- package/src/runtime/channels/lib/owned-runtime/state.mjs +2 -8
- package/src/runtime/channels/lib/owned-runtime.mjs +6 -23
- package/src/runtime/channels/lib/parent-bridge.mjs +2 -2
- package/src/runtime/channels/lib/runtime-paths.mjs +4 -43
- package/src/runtime/channels/lib/scheduler.mjs +33 -147
- package/src/runtime/channels/lib/schedules-db.mjs +34 -11
- package/src/runtime/channels/lib/status-snapshot.mjs +1 -1
- package/src/runtime/channels/lib/tool-dispatch.mjs +1 -2
- package/src/runtime/channels/lib/webhooks-db.mjs +5 -9
- package/src/runtime/channels/lib/worker-bootstrap.mjs +0 -1
- package/src/runtime/channels/lib/worker-ipc.mjs +0 -1
- package/src/runtime/channels/lib/worker-main.mjs +10 -34
- package/src/runtime/computer-bridge/action-schema.mjs +42 -1
- package/src/runtime/computer-bridge/actions.mjs +9 -1
- package/src/runtime/computer-bridge/client.mjs +180 -8
- package/src/runtime/computer-bridge/core-actions.mjs +2 -2
- package/src/runtime/computer-bridge/error-recovery.mjs +27 -2
- package/src/runtime/computer-bridge/linux-readiness.mjs +65 -23
- package/src/runtime/computer-bridge/pending-continuation.mjs +1 -1
- package/src/runtime/connectors/connector-accounts-mcp.mjs +230 -0
- package/src/runtime/connectors/gmail-app-password.mjs +172 -39
- package/src/runtime/connectors/google-mcp.mjs +10 -12
- package/src/runtime/memory/lib/pg/adapter.mjs +77 -70
- package/src/runtime/memory/lib/pg/supervisor.mjs +24 -12
- package/src/runtime/memory/lib/runtime-fetcher.mjs +23 -5
- package/src/runtime/session-search/session-search-db.mjs +73 -9
- package/src/runtime/session-search/session-search-ingest.mjs +110 -20
- package/src/runtime/shared/abort-race.mjs +89 -0
- package/src/runtime/shared/agent-avatar.d.mts +0 -1
- package/src/runtime/shared/agent-kind.mjs +4 -3
- package/src/runtime/shared/bounded-download.mjs +8 -3
- package/src/runtime/shared/config.mjs +2 -13
- package/src/runtime/shared/connector-accounts.mjs +20 -10
- package/src/runtime/shared/connector-catalog.d.mts +29 -0
- package/src/runtime/shared/connector-catalog.mjs +150 -0
- package/src/runtime/shared/connector-triggers.mjs +22 -19
- package/src/runtime/shared/defaults-separation.mjs +2 -14
- package/src/runtime/shared/delegated-approval-host.mjs +103 -11
- package/src/runtime/shared/err-text.mjs +24 -15
- package/src/runtime/shared/file-permissions.d.mts +0 -8
- package/src/runtime/shared/file-permissions.mjs +0 -11
- package/src/runtime/shared/git-direct.test-support.mjs +19 -0
- package/src/runtime/shared/heartbeat-interval.d.mts +4 -0
- package/src/runtime/shared/heartbeat-interval.mjs +19 -0
- package/src/runtime/shared/idle-auto-clear-gate.mjs +104 -0
- package/src/runtime/shared/llm/usage-rollup.mjs +1 -1
- package/src/runtime/shared/mixy-presence.mjs +22 -0
- package/src/runtime/shared/orchestration.d.mts +2 -0
- package/src/runtime/shared/pg-schema-db.mjs +27 -16
- package/src/runtime/shared/profile-config.cjs +1 -1
- package/src/runtime/shared/prompt-origin.d.mts +4 -0
- package/src/runtime/shared/prompt-origin.mjs +21 -0
- package/src/runtime/shared/provider-accounts.mjs +7 -1
- package/src/runtime/shared/provider-display-name.mjs +29 -0
- package/src/runtime/shared/provider-timeout-phase.mjs +2 -0
- package/src/runtime/shared/routine-trigger.d.mts +2 -0
- package/src/runtime/shared/routine-trigger.mjs +10 -0
- package/src/runtime/shared/sensitive-path-rules.d.mts +2 -10
- package/src/runtime/shared/sensitive-path-rules.mjs +19 -41
- package/src/runtime/shared/session-activity-signal.mjs +34 -1
- package/src/runtime/shared/session-sidebar-host.d.mts +1 -1
- package/src/runtime/shared/session-sidebar-host.mjs +7 -3
- package/src/runtime/shared/session-turn-prelude.mjs +18 -0
- package/src/runtime/shared/tool-result-summary.mjs +1 -14
- package/src/runtime/shared/worktrees/test-support.mjs +9 -4
- package/src/runtime/terminal-bridge/client.mjs +10 -1
- package/src/runtime/visualize-bridge/client.mjs +27 -8
- package/src/runtime/visualize-bridge/tool-defs.mjs +22 -8
- package/src/runtime/visualize-bridge/tool-meta.d.mts +5 -0
- package/src/runtime/visualize-bridge/tool-meta.mjs +22 -0
- package/src/runtime/web-search/lib/fetch-pipeline.mjs +2 -2
- package/src/session-runtime/agent-home-delivery.mjs +448 -185
- package/src/session-runtime/agent-task-sessions.mjs +329 -180
- package/src/session-runtime/boot/apis.mjs +9 -0
- package/src/session-runtime/boot/infrastructure.mjs +4 -0
- package/src/session-runtime/boot/providers.mjs +3 -0
- package/src/session-runtime/boot/tools.mjs +6 -1
- package/src/session-runtime/config-lifecycle.mjs +6 -0
- package/src/session-runtime/connector-merge-migration.mjs +305 -0
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +132 -28
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +2 -0
- package/src/session-runtime/lifecycle/inheritance.mjs +16 -3
- package/src/session-runtime/lifecycle/session-catalog.mjs +3 -1
- package/src/session-runtime/lifecycle/teardown/runtime-stops.mjs +50 -4
- package/src/session-runtime/lifecycle/teardown.mjs +23 -5
- package/src/session-runtime/mcp-glue/server-catalog.mjs +55 -3
- package/src/session-runtime/mcp-oauth-login.mjs +5 -3
- package/src/session-runtime/mixy-heartbeat.mjs +153 -33
- package/src/session-runtime/notification-bus.mjs +31 -117
- package/src/session-runtime/notification-completion-queue.mjs +54 -0
- package/src/session-runtime/notification-listeners.mjs +76 -0
- package/src/session-runtime/owned-automation-run.mjs +2 -1
- package/src/session-runtime/prewarm/channel-start.mjs +3 -7
- package/src/session-runtime/resource-mcp-api.mjs +143 -224
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +163 -0
- package/src/session-runtime/resource-mcp-oauth-api.mjs +217 -0
- package/src/session-runtime/resource-mcp-secrets.mjs +82 -0
- package/src/session-runtime/resource-mcp-servers.mjs +78 -0
- package/src/session-runtime/resource-mcp-store.mjs +49 -0
- package/src/session-runtime/routine-owner.mjs +40 -9
- package/src/session-runtime/services/agent-tool/close-flow.mjs +3 -0
- package/src/session-runtime/services/agent-tool/spawn-preset.mjs +7 -2
- package/src/session-runtime/services/agent-tool/tag-registry.mjs +1 -0
- package/src/session-runtime/services/agent-tool/worker-index/awaiting-user-sync.mjs +51 -0
- package/src/session-runtime/services/agent-tool/worker-index/disposal.mjs +55 -0
- package/src/session-runtime/services/agent-tool/worker-index/released-store.mjs +123 -0
- package/src/session-runtime/services/agent-tool/worker-index/restart-settlement.mjs +112 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-reads.mjs +36 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-shape.mjs +2 -0
- package/src/session-runtime/services/agent-tool/worker-index/row-store.mjs +17 -4
- package/src/session-runtime/services/agent-tool/worker-index/row-writes.mjs +58 -0
- package/src/session-runtime/services/agent-tool/worker-index.mjs +41 -241
- package/src/session-runtime/services/agent-tool/worker-rows.mjs +3 -0
- package/src/session-runtime/services/channel-admin.mjs +7 -13
- package/src/session-runtime/services/channel-session-router.mjs +4 -2
- package/src/session-runtime/services/seeds.mjs +0 -28
- package/src/session-runtime/session-compaction-sync.mjs +27 -0
- package/src/session-runtime/session-create/session-options.mjs +1 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +11 -0
- package/src/session-runtime/settings-compaction-api.mjs +2 -40
- package/src/session-runtime/settings-system-api.mjs +13 -1
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +65 -0
- package/src/session-runtime/setup-tool/executor.mjs +145 -22
- package/src/session-runtime/setup-tool/extended-actions.mjs +8 -3
- package/src/session-runtime/setup-tool/session-route-actions.mjs +152 -0
- package/src/session-runtime/setup-tool/settings-contract.mjs +4 -3
- package/src/session-runtime/setup-tool/tool-defs.mjs +64 -5
- package/src/session-runtime/tool-policy/agent-profile-fold.mjs +17 -13
- package/src/session-runtime/tool-policy/policy-stage.mjs +16 -2
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +1 -0
- package/src/session-runtime/workflow-agents-api/style-and-mode.mjs +4 -0
- package/src/standalone/channel-transport/client-registry/client-records.mjs +65 -0
- package/src/standalone/channel-transport/client-registry/client-registration.mjs +118 -0
- package/src/standalone/channel-transport/client-registry.mjs +24 -163
- package/src/standalone/channel-transport.mjs +1 -1
- package/src/standalone/daemon-channels-loader.mjs +10 -8
- package/src/standalone/daemon-session-control/list-page.mjs +72 -0
- package/src/standalone/daemon-session-control/request.mjs +51 -0
- package/src/standalone/daemon-session-control/room-host.mjs +57 -0
- package/src/standalone/daemon-session-control/route-control.mjs +48 -0
- package/src/standalone/daemon-session-control/send-turn.mjs +60 -0
- package/src/standalone/daemon-session-control/worktree-control.mjs +40 -0
- package/src/standalone/daemon-session-control.mjs +124 -188
- package/src/standalone/daemon.mjs +26 -3
- package/src/standalone/session-client.mjs +7 -3
- package/src/standalone/session-protocol.mjs +5 -0
- package/src/standalone/session-service/agent-tree/agent-child.mjs +1 -0
- package/src/standalone/session-service/quota-resume.mjs +3 -0
- package/src/standalone/session-service/retention/busy.mjs +65 -1
- package/src/standalone/session-service/session-calls/session-action.mjs +23 -2
- package/src/standalone/session-service/session-calls/session-views.mjs +8 -0
- package/src/standalone/session-tool-output.mjs +15 -7
- package/src/tui/app/model-options.mjs +3 -28
- package/src/tui/dist/index.mjs +58 -64
- package/src/tui/session/agent-job-feed/model-notification.mjs +3 -0
- package/src/tui/session/initial-state.mjs +3 -0
- package/src/tui/session/notice-surface.mjs +7 -1
- package/src/tui/session/queue-helpers.mjs +3 -42
- package/src/tui/session/session-api/routes-agent-definitions.mjs +14 -2
- package/src/tui/session/session-api/routes-write.mjs +5 -1
- package/src/tui/session/session-api/routes.mjs +1 -0
- package/src/tui/session/session-api/settings.mjs +17 -1
- package/src/tui/session/session-flow/auto-clear.mjs +4 -33
- package/src/tui/session/session-flow/drain-closed-queue.mjs +38 -0
- package/src/tui/session/session-flow/drain-enqueue.mjs +86 -0
- package/src/tui/session/session-flow/drain-retry.mjs +35 -0
- package/src/tui/session/session-flow/drain.mjs +118 -149
- package/src/tui/session/session-flow/queue/entry-shape.mjs +5 -0
- package/src/tui/session/session-flow/queue/take-entries.mjs +5 -2
- package/src/tui/session/tool-approval-delegation.mjs +64 -0
- package/src/tui/session/tool-approval-request.mjs +39 -0
- package/src/tui/session/tool-approval-settle.mjs +62 -0
- package/src/tui/session/tool-approval.mjs +69 -115
- package/src/tui/session/tui-steering-persist.mjs +8 -1
- package/src/tui/session/turn-stream.mjs +19 -2
- package/src/tui/session/turn.mjs +1 -0
- package/src/vendor/statusline/bin/statusline-route.mjs +1 -219
- package/src/vendor/statusline/src/gateway/route-meta.mjs +35 -13
- package/scripts/code-graph-description-contract.mjs +0 -188
- package/src/runtime/channels/lib/owned-runtime/ownership-refresh.mjs +0 -36
|
@@ -12,286 +12,158 @@ dependencies:
|
|
|
12
12
|
|
|
13
13
|
# Code tidy (tidy tool)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
New, non-ignored files are included without staging. Never widen the edit
|
|
58
|
-
scope silently.
|
|
59
|
-
4. Pass the current round's approved paths on every `scan`/`check`/`fix`;
|
|
60
|
-
use `paths:["."]` only for an explicitly requested whole project that fits
|
|
61
|
-
one round. Result: every layer sees the same round scope, which the report names.
|
|
62
|
-
5. **Establish the baseline before any edit** with the narrowest documented
|
|
63
|
-
tests and typecheck covering the current round's approved behavior. Reuse current results
|
|
64
|
-
when their inputs have not changed. Record pre-existing failures separately.
|
|
65
|
-
A broken runner blocks changes requiring it; continue independent work and
|
|
66
|
-
report the blocked scope as unfinished.
|
|
67
|
-
6. **Complete read-only investigation per round before cleanup.** Partition
|
|
68
|
-
scopes too large for one review (an explicitly requested whole project or
|
|
69
|
-
several directories) by directory or responsibility. Each partition is one
|
|
70
|
-
round: deterministic check on its paths (or the dry-run plan in section 3)
|
|
71
|
-
→ deletion ladder → lenses → apply by tier → verification → round close.
|
|
72
|
-
- **Size each partition so one round can actually finish it.** The round
|
|
73
|
-
owes the ladder on every source unit in the partition and the lenses on
|
|
74
|
-
every survivor; a partition that cannot get that pass is too big, so split
|
|
75
|
-
it further before starting. Hundreds of files in one partition is the
|
|
76
|
-
usual failure.
|
|
77
|
-
- **Run the whole set of partitions through to the end.** Start the next
|
|
78
|
-
partition as soon as a round closes. Do not pause for user input between
|
|
79
|
-
rounds — section 7 owns reporting.
|
|
80
|
-
- **Keep every round attributable.** Rounds in progress at the same time
|
|
81
|
-
edit disjoint files, and each round's verification reflects only its own
|
|
82
|
-
edits. Each round declares the test lane it uses (runner plus paths); two
|
|
83
|
-
rounds never share a lane that cannot run concurrently, because a
|
|
84
|
-
load-sensitive suite then fails for a reason neither round owns.
|
|
85
|
-
- **The partition list and the accumulated candidate inventory are durable
|
|
86
|
-
state**: they must survive turn boundaries instead of being rebuilt from
|
|
87
|
-
scratch.
|
|
88
|
-
- Finish all applicable read-only checks and lens analysis for the current
|
|
89
|
-
round before its edits, not for the whole scope. Accumulate registered
|
|
90
|
-
candidates across rounds using `references/cleanup-report.md`.
|
|
91
|
-
- Read per-rule and per-directory counts from check/fix/results first;
|
|
92
|
-
select the rules and directories relevant to this round, then page only
|
|
93
|
-
those with `tidy action:'results'` filters. Read every selected page of the
|
|
94
|
-
current round's cached run before another check/fix replaces it. Never
|
|
95
|
-
page a whole-project run row by row or treat unreviewed in-scope results
|
|
96
|
-
as clean. Pagination is not engine truncation; do not rerun engines just
|
|
97
|
-
to see remaining rows.
|
|
98
|
-
- Actual engine truncation, timeouts, failed diagnostic checks, or scope
|
|
99
|
-
leakage mark the affected partition **unfinished**, not clean; they do
|
|
100
|
-
not invalidate other partitions.
|
|
101
|
-
- Blocked checks stop dependent edits; continue only approved independent
|
|
102
|
-
work and report the unfinished portion.
|
|
15
|
+
Layers, cheapest and safest first: project formatters and linters through
|
|
16
|
+
`tidy`, structural rule packs, then agent-level cleanup. Every layer preserves
|
|
17
|
+
behavior and public API; this is not a bug hunt. The `tidy` schema owns action
|
|
18
|
+
fields; this file owns scope, order, and boundaries. Verification follows the
|
|
19
|
+
shared rule: finish all planned edits, then check once (section 5).
|
|
20
|
+
|
|
21
|
+
## 1. Job and mode
|
|
22
|
+
- Tidy owns format, lint, structure, and cleanup, not feature work. New
|
|
23
|
+
behavior and public-API refactors are out of scope. A correctness bug found
|
|
24
|
+
while cleaning goes under "Bugs found", never into a cleanup edit.
|
|
25
|
+
- Never invent a formatter config. A project with Biome, Prettier,
|
|
26
|
+
clang-format, rustfmt, gofmt, or equivalent keeps it; add or rewrite
|
|
27
|
+
`biome.json`, `.prettierrc`, `.clang-format` and the like only when asked.
|
|
28
|
+
- Mode is `apply` unless the user asks to check, review, or "just report";
|
|
29
|
+
report-only stays read-only on every layer and lists what would change.
|
|
30
|
+
- An explicit focus restricts every layer ("formatting only" excludes lint
|
|
31
|
+
and semantic cleanup; "only dead code" excludes unrelated formatting). If
|
|
32
|
+
the tool cannot isolate it, use targeted edits or report the limitation
|
|
33
|
+
and ask before widening.
|
|
34
|
+
|
|
35
|
+
## 2. Scope
|
|
36
|
+
1. Scope comes from the user: named files, directories, a feature area
|
|
37
|
+
resolved to confirmed paths, or an explicitly requested whole project. If
|
|
38
|
+
absent or ambiguous, ask first. Never infer it from a diff, branch,
|
|
39
|
+
commit, or recent activity.
|
|
40
|
+
2. Recommend (do not require, do not do it for them) that the user commit
|
|
41
|
+
existing work before an apply run. A dirty tree means preserve those edits.
|
|
42
|
+
3. Drop deleted, binary, generated, vendored files and lockfiles unless
|
|
43
|
+
explicitly included. Consumers and covering tests may be read; editing
|
|
44
|
+
them outside the scope needs approval. New non-ignored files are included.
|
|
45
|
+
4. Pass the approved paths on every `scan`/`check`/`fix`; `paths:["."]` only
|
|
46
|
+
for an explicitly requested whole project.
|
|
47
|
+
5. Too large to review in one pass (whole project, many directories):
|
|
48
|
+
partition by directory or responsibility so every source unit gets the
|
|
49
|
+
ladder and every survivor the lenses; hundreds of files per partition is
|
|
50
|
+
the usual failure. Work through all partitions without pausing for input.
|
|
51
|
+
Keep the partition list and candidate list across turns.
|
|
52
|
+
6. Read per-rule and per-directory counts first, then page only relevant
|
|
53
|
+
rows with `tidy action:'results'` filters; never treat unreviewed in-scope
|
|
54
|
+
results as clean. Real engine truncation, timeouts, or scope leakage mark
|
|
55
|
+
that partition **unfinished**, not clean. Blocked checks stop dependent
|
|
56
|
+
edits only.
|
|
103
57
|
|
|
104
58
|
## 3. Deterministic layers
|
|
105
|
-
1. `tidy action:'scan'` first
|
|
106
|
-
`installHint`). Scan never downloads
|
|
107
|
-
2.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
`approveDownloads`, or `action:'install'`). An ad-hoc `npx <engine>`, global
|
|
115
|
-
binary, or package script is not verification — the name can resolve to an
|
|
116
|
-
unrelated package and report a false clean. An engine tidy cannot resolve
|
|
59
|
+
1. `tidy action:'scan'` first (languages, engines used/missing,
|
|
60
|
+
`installHint`). Scan never downloads.
|
|
61
|
+
2. Downloads are automatic under the default `auto` policy. Only when
|
|
62
|
+
`tidy.downloads` is `ask` does a result carry `needsApproval`: ask once,
|
|
63
|
+
listing engines and bytes, then re-call with `approveDownloads:true`.
|
|
64
|
+
3. Engines run only through `tidy` and are never installed by hand
|
|
65
|
+
(rustfmt, gofmt, dart, swift, zig, mix, dotnet: report `installHint`). An
|
|
66
|
+
ad-hoc `npx <engine>`, global binary, or package script is not
|
|
67
|
+
verification and may report a false clean. An engine `tidy` cannot resolve
|
|
117
68
|
leaves its check blocked, never clean.
|
|
118
|
-
4. Plan
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
5. Treat the engine dry run as diagnostics and candidate files, not a preview
|
|
128
|
-
of the exact resulting patch. Apply recalculates work; it does not replay a
|
|
129
|
-
frozen preview. If inputs or approved operations change before writing,
|
|
130
|
-
refresh the affected plan. Use `apply:true` only after the current round's
|
|
131
|
-
complete plan is approved, then review the actual changes against that scope.
|
|
132
|
-
6. A dry run with no proposed fixes skips apply. Rules without a fix
|
|
133
|
-
(`no-empty-catch`, `no-nested-ternary`, `no-any-cast`,
|
|
69
|
+
4. Plan with `fix` without `apply:true`; no separate `check` first. The dry
|
|
70
|
+
run is diagnostics and candidate files, not a frozen patch; apply
|
|
71
|
+
recalculates. `structural:true` (default) also runs ordinary engines;
|
|
72
|
+
`structural:false` disables structural rules only, not engine lint fixes.
|
|
73
|
+
For a restricted focus, do not use a combined apply that touches unrelated
|
|
74
|
+
code.
|
|
75
|
+
5. Apply with `apply:true` once the plan for the scope is settled, then review
|
|
76
|
+
the actual changes. Skip apply when the dry run proposes nothing.
|
|
77
|
+
Rules without a fix (`no-empty-catch`, `no-nested-ternary`, `no-any-cast`,
|
|
134
78
|
`no-boolean-literal-compare`, `no-debug-statement`, `todo-marker`) are
|
|
135
|
-
diagnostics for the agent layer
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
report them as distinct change sets.
|
|
139
|
-
Stop affected writes on an engine or structural failure, truncation, or
|
|
140
|
-
rejected edit; a partial result is not success. Do not retry unchanged input
|
|
141
|
-
or apply findings from the failed portion of the plan.
|
|
79
|
+
diagnostics for the agent layer. Keep the engine pass a distinct change
|
|
80
|
+
set from semantic edits. On engine or structural failure, truncation, or a
|
|
81
|
+
rejected edit, stop affected writes; a partial result is not success.
|
|
142
82
|
|
|
143
83
|
## 4. Agent-level cleanup
|
|
144
|
-
Read `references/agent-cleanup.md`
|
|
145
|
-
lens checklists, the slop categories, and the risk tiers. Also read
|
|
84
|
+
Read `references/agent-cleanup.md` (ladder, lenses, slop, risk tiers); also
|
|
146
85
|
`references/test-suite-slop.md` when tests are in scope, and
|
|
147
|
-
`references/cleanup-report.md`
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
`git blame` is not a mandatory step for each removal. Unresolved intent
|
|
169
|
-
lowers confidence and blocks deletion, rather than justifying it.
|
|
170
|
-
The four lenses run over the ladder survivors and yield one merged,
|
|
171
|
-
deduplicated finding list.
|
|
172
|
-
3. **Execute in approved bounded rounds.**
|
|
173
|
-
- Use the partitions from section 2; accumulate the inventory across rounds,
|
|
174
|
-
close each round with its brief note, and start the next partition
|
|
175
|
-
immediately.
|
|
176
|
-
- Within one file or module, CAREFUL source units must be edited
|
|
177
|
-
sequentially. A round cut off mid-unit ends with that unit finished and
|
|
178
|
-
wired into its callers, or reverted: never leave behind a new module
|
|
179
|
-
nothing imports.
|
|
180
|
-
- Apply by tier: SAFE as one batch; CAREFUL one source unit at a time; RISKY
|
|
181
|
-
reported, never auto-applied. Within a tier: comments → dead code →
|
|
182
|
-
defensive code → duplication → complexity → abstraction → performance.
|
|
183
|
-
Use targeted checks at meaningful behavior boundaries and run the
|
|
184
|
-
documented final tests/typecheck once after the round. Targeted checks
|
|
185
|
-
include the tests that import each edited module (found with `code_graph`
|
|
186
|
-
dependents or grep). Do not rerun
|
|
187
|
-
unaffected checks after every comment or mechanical edit.
|
|
188
|
-
- Structural items from the table below are CAREFUL unless their row says
|
|
189
|
-
otherwise; dead code follows
|
|
190
|
-
`references/dead-code.md`.
|
|
191
|
-
- After the last tier lands in a round, re-run `tidy check` over the same
|
|
192
|
-
paths once: removals leave new unused imports and newly orphaned helpers
|
|
193
|
-
behind. Apply only SAFE findings from that cascade pass and add any
|
|
194
|
-
remaining findings to the inventory — one pass, never a loop.
|
|
195
|
-
4. **Stop rules.** Three failed attempts on one file → stop and escalate with
|
|
196
|
-
what was tried. A deeper fix larger than the cleanup → report it as its own
|
|
197
|
-
task. Principles cannot pick between two rewrites → apply neither, record
|
|
86
|
+
`references/cleanup-report.md` for recording and the closing report.
|
|
87
|
+
|
|
88
|
+
1. **Pin behavior (read-only).** Search the tests for source-text guards
|
|
89
|
+
(shapes in `agent-cleanup.md`) before extracting or moving anything. A file
|
|
90
|
+
whose touched behavior no test covers gets the narrowest regression test
|
|
91
|
+
that pins it, or only SAFE changes. Prose files have no behavior to pin.
|
|
92
|
+
2. **Ladder, then lenses.** Run the deletion ladder on every selected source
|
|
93
|
+
unit, then the four lenses on the survivors. Engine diagnostics point at
|
|
94
|
+
units; they do not define coverage. A partition reviewed only where an
|
|
95
|
+
engine flagged is unfinished. Each finding has a path+symbol location,
|
|
96
|
+
cost, action, confidence, and risk tier; drop findings without evidence.
|
|
97
|
+
Use history only when code, contracts, and tests leave intent unclear;
|
|
98
|
+
unresolved intent blocks deletion.
|
|
99
|
+
3. **Apply by tier.** SAFE as one batch; CAREFUL one source unit at a time,
|
|
100
|
+
each finished and wired into its callers (never leave a new module nothing
|
|
101
|
+
imports); RISKY is reported, never auto-applied. Order within a tier:
|
|
102
|
+
comments, dead code, defensive code, duplication, complexity, abstraction,
|
|
103
|
+
performance. Dead code follows `references/dead-code.md`.
|
|
104
|
+
4. **Stop rules.** Three failed attempts on one file: stop and escalate with
|
|
105
|
+
what was tried. A deeper fix larger than the cleanup: report it as its own
|
|
106
|
+
task. Principles cannot pick between two rewrites: apply neither, record
|
|
198
107
|
both.
|
|
199
108
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
and
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
109
|
+
Structural signals are leads, not candidates: file > 1,000 lines, function
|
|
110
|
+
> 50 lines or nesting > 3 (under ~100 lines, act only on a named symptom:
|
|
111
|
+
duplication, a defect, demonstrated difficulty of change), duplicated small
|
|
112
|
+
helpers (consolidate only when intent matches), history comments (remove only
|
|
113
|
+
if no protected content is lost), underscore-prefixed names exported across
|
|
114
|
+
modules (rename is RISKY). Do not improve names, control flow, or types
|
|
115
|
+
beyond the ladder, lenses, and these signals. A confirmed
|
|
116
|
+
responsibility-based split that preserves behavior and entry points is
|
|
117
|
+
CAREFUL; an extracted unit takes only the values it reads. Moving a whole
|
|
118
|
+
body elsewhere or cutting it into numbered chunks resolves nothing.
|
|
119
|
+
|
|
120
|
+
## 5. Check once, then fix
|
|
121
|
+
After every planned edit in the assigned scope is done, run the project's
|
|
122
|
+
documented tests/typecheck covering the touched behavior and `tidy check` on
|
|
123
|
+
the scope, once, in parallel. No check, build, lint, test, or formatter run
|
|
124
|
+
before that. If it fails, read the full logs, finish the fixes, and rerun only
|
|
125
|
+
the failed or invalidated checks. A failure on code you did not touch is
|
|
126
|
+
pre-existing: report it separately. A broken runner leaves its scope
|
|
127
|
+
unverified: say so. Skipped or failed checks never count as passed.
|
|
128
|
+
|
|
129
|
+
If checks fail and cannot be fixed, undo only this run's edits with targeted
|
|
130
|
+
patches, preserving prior or concurrent work. Never use `git checkout`,
|
|
131
|
+
`reset`, `restore`, or `stash` as rollback; if the edits cannot be separated
|
|
132
|
+
safely, leave them and report the blocker.
|
|
133
|
+
|
|
134
|
+
New findings from the final `tidy check` (e.g. imports orphaned by removals)
|
|
135
|
+
are fixed once if SAFE; others are reported.
|
|
136
|
+
|
|
137
|
+
## 6. Keep: never remove or rename
|
|
224
138
|
- Validation and error handling at a trust boundary (user input, external
|
|
225
139
|
API, file, network) unless an adversarial test proves the guard redundant.
|
|
226
140
|
- Export names, API routes, CLI flags, DB columns, config keys, event names,
|
|
227
|
-
wire strings
|
|
141
|
+
wire strings: contracts. A rename is RISKY even when the name is bad.
|
|
228
142
|
- Anything on the never-dead list in `references/dead-code.md`.
|
|
229
|
-
- An empty catch or ignored error that may be intentional
|
|
230
|
-
- Complexity serving a current compatibility obligation, staged migration,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
treat missing structural matches as clean. A per-language rule-pack error
|
|
257
|
-
leaves only that language's structural pass unfinished; results for other
|
|
258
|
-
languages and engines remain usable.
|
|
259
|
-
- A selected area too large for one review → default to directory or
|
|
260
|
-
responsibility partitions for every layer, one complete round at a time.
|
|
261
|
-
The inventory grows across rounds, not up front. Do not infer a smaller
|
|
262
|
-
scope from a diff or ask for commits to divide the review.
|
|
263
|
-
- A dead-code scanner report is a candidate list, not proof → verify per
|
|
264
|
-
`references/dead-code.md` before deleting.
|
|
265
|
-
|
|
266
|
-
## 7. Round close and final report
|
|
267
|
-
Close each round in the conversation with a few lines: the partition, its test
|
|
268
|
-
lane, what landed, the verification result including every check that could not
|
|
269
|
-
run, the round's function counts over 50, 100 and 150 lines (taken from the
|
|
270
|
-
function-length summary in the `tidy` check/fix result), and whether the
|
|
271
|
-
round is complete or unfinished. Report all three counts: decomposition moves
|
|
272
|
-
mass downward, so functions over 100 falling while functions over 50 rise is
|
|
273
|
-
progress, and a single threshold hides it. Keep the inventory in `references/cleanup-report.md` form as you go;
|
|
274
|
-
do not spend a full report on every round.
|
|
275
|
-
|
|
276
|
-
Deliver the full report once, after the last partition, using the
|
|
277
|
-
reconciliation, completion criteria, and report template in
|
|
278
|
-
`references/cleanup-report.md`. It carries one consolidated list of everything
|
|
279
|
-
that needs the user's decision — RISKY findings, bugs found, unresolved intent,
|
|
280
|
-
unfinished candidates — so those questions arrive together at the end instead
|
|
281
|
-
of interrupting the cycle. Do not create a separate report file unless
|
|
282
|
-
requested.
|
|
283
|
-
|
|
284
|
-
Interrupt the cycle only for a blocker that makes continuing impossible or an
|
|
285
|
-
approval the active workflow requires.
|
|
286
|
-
|
|
287
|
-
## 8. References
|
|
288
|
-
- `references/agent-cleanup.md` — before section 4: behavior boundary, ladder,
|
|
289
|
-
lenses, slop categories with keep/fix rules, risk tiers.
|
|
290
|
-
- `references/test-suite-slop.md` — during section 4 when tests are in scope:
|
|
291
|
-
redundant-coverage patterns and the evidence gate before deleting tests.
|
|
292
|
-
- `references/cleanup-report.md` — before registering the first candidate and
|
|
293
|
-
at section 7: inventory format, statuses, reconciliation, final report
|
|
294
|
-
template.
|
|
295
|
-
- `references/dead-code.md` — before removing any unused symbol, file, or
|
|
296
|
-
dependency, or retiring a legacy path: candidate sources, usage and side-effect
|
|
297
|
-
verification, compatibility retirement, never-dead list, removal order.
|
|
143
|
+
- An empty catch or ignored error that may be intentional: flag it.
|
|
144
|
+
- Complexity serving a current compatibility obligation, staged migration, or
|
|
145
|
+
vendored-code isolation (see legacy retirement in `dead-code.md`).
|
|
146
|
+
- License, copyright, SPDX notices; compiler, linter, bundler directives;
|
|
147
|
+
public API docs; security and compatibility explanations. Block comments
|
|
148
|
+
that may separate tokens or carry significant line breaks are left for
|
|
149
|
+
manual review.
|
|
150
|
+
- The project's own idioms (`AGENTS.md`/`CLAUDE.md`/lint config) over generic
|
|
151
|
+
ones; clarity over fewer lines; nested ternaries are flattened, never added.
|
|
152
|
+
|
|
153
|
+
## 7. Pitfalls
|
|
154
|
+
- Missing engine: `installHint` only; continue others; that check is blocked.
|
|
155
|
+
- User declines downloads: skip those engines and say so.
|
|
156
|
+
- Structural engine unavailable (missing or outdated mixdog-graph): `check`/
|
|
157
|
+
`fix` fail with a rebuild remedy; `scan` still works. Retry with
|
|
158
|
+
`structural:false` for formatters/linters only; missing structural matches
|
|
159
|
+
are never clean. A per-language rule-pack error leaves only that language
|
|
160
|
+
unfinished.
|
|
161
|
+
- A dead-code scanner report is a candidate list, not proof; verify per
|
|
162
|
+
`references/dead-code.md`.
|
|
163
|
+
|
|
164
|
+
## 8. Reporting
|
|
165
|
+
Report once, after the last partition, using `references/cleanup-report.md`.
|
|
166
|
+
Put everything needing the user's decision in one list at the end: RISKY
|
|
167
|
+
findings, bugs found, unresolved intent, unfinished candidates. Do not pause
|
|
168
|
+
between partitions except for a blocker or a required approval. No separate
|
|
169
|
+
report file unless requested.
|
|
@@ -40,7 +40,7 @@ evidence as `kept`.
|
|
|
40
40
|
## Deletion ladder
|
|
41
41
|
|
|
42
42
|
Run the ladder on every selected unit (function, class, module, config knob)
|
|
43
|
-
in
|
|
43
|
+
in scope before looking for smells. Only code that lands on the
|
|
44
44
|
last rung goes on to the lenses.
|
|
45
45
|
|
|
46
46
|
| Rung | Question | Typical win |
|
|
@@ -55,7 +55,7 @@ in-place cleanup; take it before analysing the unit's smells.
|
|
|
55
55
|
|
|
56
56
|
## Lenses
|
|
57
57
|
|
|
58
|
-
Each lens judges the
|
|
58
|
+
Each lens judges the units in scope and may search the whole
|
|
59
59
|
repository for evidence (an existing helper, a sibling call site); a finding
|
|
60
60
|
without a path-plus-symbol pointer is dropped. Run every lens unless the user named a focus.
|
|
61
61
|
Judge each selected function or class in its full context, including relevant
|
|
@@ -116,8 +116,8 @@ Every finding carries one tier:
|
|
|
116
116
|
|
|
117
117
|
| Tier | Meaning | Examples | Handling |
|
|
118
118
|
|---|---|---|---|
|
|
119
|
-
| SAFE | equivalence established, including initialization and parsing | verified unused binding with no initialization effects, nonsemantic comment, redundant type assertion | apply as one batch
|
|
120
|
-
| CAREFUL | same semantics, structure changes | rename a local, flatten a ternary, guard clause, verified wrapper inlining, extract a helper, split responsibilities while preserving entry points, consolidate duplicates, name a magic number | apply one source unit at a time (including required new modules);
|
|
119
|
+
| SAFE | equivalence established, including initialization and parsing | verified unused binding with no initialization effects, nonsemantic comment, redundant type assertion | apply as one batch |
|
|
120
|
+
| CAREFUL | same semantics, structure changes | rename a local, flatten a ternary, guard clause, verified wrapper inlining, extract a helper, split responsibilities while preserving entry points, consolidate duplicates, name a magic number | apply one source unit at a time (including required new modules); verified by the single final check; undo only this run's edits if it cannot be fixed |
|
|
121
121
|
| RISKY | may change behavior or a contract | public API or export rename, route/DB column/config key rename, error-handling change, concurrency change, N+1 restructuring, altitude fix in shared infrastructure | report only, with the test coverage status; never auto-apply |
|
|
122
122
|
|
|
123
123
|
Conflict resolution when lenses disagree: correctness > the user's stated
|