mixdog 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/scripts/build-shipped-history.mjs +115 -33
- package/scripts/gate-local.mjs +172 -61
- package/scripts/lib/gate-scheduler.mjs +138 -32
- package/scripts/lib/gate-timing-reporter.mjs +16 -0
- package/scripts/lib/run-node-tests.mjs +54 -29
- package/scripts/lib/scoped-temp.mjs +1 -0
- package/scripts/lib/test-failure-records.mjs +14 -1
- package/scripts/lib/test-failure-summary.mjs +16 -4
- package/scripts/lib/test-spawn-ledger.mjs +12 -3
- package/scripts/pptx-kit-index.mjs +5 -6
- package/scripts/suite-health.mjs +110 -28
- package/scripts/test.mjs +9 -14
- package/src/agents/advisor/AGENT.md +4 -4
- package/src/agents/advisor/agent.json +1 -1
- package/src/agents/explore/AGENT.md +22 -0
- package/src/agents/explore/agent.json +6 -0
- package/src/cli.mjs +7 -0
- package/src/defaults/agents.json +7 -0
- package/src/defaults/shipped-history.json +18 -2
- package/src/defaults/skills/browser-use/SKILL.md +4 -1
- package/src/defaults/skills/code-tidy/SKILL.md +71 -102
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +66 -114
- package/src/defaults/skills/code-tidy/references/cleanup-report.md +19 -35
- package/src/defaults/skills/code-tidy/references/dead-code.md +3 -9
- package/src/defaults/skills/code-tidy/references/test-suite-slop.md +16 -27
- package/src/defaults/skills/computer-use/SKILL.md +12 -2
- package/src/defaults/skills/goal-management/SKILL.md +1 -1
- package/src/defaults/skills/setup/references/actions.md +12 -6
- package/src/defaults/skills/setup/references/surfaces.md +2 -2
- package/src/defaults/skills/setup-guide/SKILL.md +5 -2
- package/src/defaults/skills/setup-guide/model-recommendations.json +13 -0
- package/src/defaults/skills/skill-creator/SKILL.md +85 -190
- package/src/defaults/skills/skill-creator/references/design.md +70 -162
- package/src/defaults/skills/skill-creator/references/evaluation.md +33 -92
- package/src/defaults/skills/test-suite/SKILL.md +194 -0
- package/src/defaults/skills/test-suite/references/case-management.md +51 -0
- package/src/defaults/skills/test-suite/references/flaky-policy.md +39 -0
- package/src/defaults/skills/test-suite/references/reliability.md +49 -0
- package/src/defaults/skills/test-suite/references/suite-design.md +78 -0
- package/src/defaults/skills/test-suite/scripts/inventory.mjs +335 -0
- package/src/defaults/skills/visualize/SKILL.md +6 -2
- package/src/lib/rules-builder.cjs +6 -30
- package/src/rules/lead/LEAD.md +3 -3
- package/src/rules/shared/20-research.md +3 -6
- package/src/rules/shared/40-editing.md +1 -0
- package/src/rules/shared/60-verification.md +10 -9
- package/src/rules/shared/70-delivery.md +4 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +5 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +10 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +130 -21
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +13 -0
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +4 -1
- package/src/runtime/agent/orchestrator/config.mjs +12 -7
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +7 -7
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +5 -26
- package/src/runtime/agent/orchestrator/internal-agents.mjs +3 -14
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +122 -12
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +5 -3
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +13 -2
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +152 -58
- package/src/runtime/agent/orchestrator/mcp/client.mjs +51 -18
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +83 -52
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +42 -26
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +43 -8
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +30 -28
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +31 -21
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +40 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider-keys.mjs +34 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +14 -7
- package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +48 -31
- package/src/runtime/agent/orchestrator/providers/lib/oauth-page.mjs +0 -18
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +138 -6
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/model-cache.mjs +100 -33
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/oauth-secret-fields.fixtures.mjs +45 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +26 -28
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/opencode-go-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +33 -2
- package/src/runtime/agent/orchestrator/providers/vertex-ai-auth.mjs +622 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-maas.mjs +185 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-models.mjs +445 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai.mjs +567 -0
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +2 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +14 -5
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +30 -5
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +171 -37
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +94 -10
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +10 -5
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +5 -5
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +11 -1
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -6
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +5 -3
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +21 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +23 -1
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +13 -8
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +50 -28
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +3 -4
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +25 -14
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +17 -14
- package/src/runtime/agent/orchestrator/session/manager/session-scratch-environment.mjs +70 -0
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +0 -3
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +7 -3
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +47 -29
- package/src/runtime/agent/orchestrator/session/manager/turn-reap.mjs +125 -0
- package/src/runtime/agent/orchestrator/session/mixy-name.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +243 -38
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +163 -64
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +164 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +142 -18
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +36 -26
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +3 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +20 -15
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +96 -20
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +59 -10
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +99 -2
- package/src/runtime/agent/orchestrator/tools/lib/owned-shell-trees.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +103 -13
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +49 -15
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +45 -27
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +34 -10
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/wait-until-fixture.mjs +26 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +7 -2
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
- package/src/runtime/channels/lib/whisper-port.mjs +19 -10
- package/src/runtime/channels/lib/whisper-server.mjs +10 -1
- package/src/runtime/connectors/connector-accounts-mcp.mjs +236 -103
- package/src/runtime/connectors/gmail-app-password.mjs +3 -3
- package/src/runtime/explore/explorer.mjs +93 -0
- package/src/runtime/explore/tool-defs.mjs +35 -0
- package/src/runtime/explore/tool.mjs +123 -0
- package/src/runtime/memory/index.mjs +4 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +4 -1
- package/src/runtime/memory/lib/embedding-worker.mjs +4 -0
- package/src/runtime/office/quality/assurance-structure-docx.mjs +1 -1
- package/src/runtime/shared/agent-route-config.mjs +17 -2
- package/src/runtime/shared/atomic-file.mjs +103 -2
- package/src/runtime/shared/background-tasks.mjs +15 -6
- package/src/runtime/shared/connector-accounts.mjs +5 -5
- package/src/runtime/shared/connector-catalog.d.mts +11 -4
- package/src/runtime/shared/connector-catalog.mjs +60 -52
- package/src/runtime/shared/custom-provider-keys.mjs +20 -0
- package/src/runtime/shared/file-has-data.mjs +26 -2
- package/src/runtime/shared/file-lock.mjs +13 -15
- package/src/runtime/shared/git-launch.d.mts +9 -0
- package/src/runtime/shared/git-launch.mjs +213 -0
- package/src/runtime/shared/git-runner-worker.mjs +2 -1
- package/src/runtime/shared/llm/cost.mjs +6 -1
- package/src/runtime/shared/llm/http-agent.mjs +313 -29
- package/src/runtime/shared/llm/model-catalog-projection.mjs +3 -2
- package/src/runtime/shared/llm/model-catalog.mjs +46 -6
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +3 -0
- package/src/runtime/shared/llm/system-proxy.mjs +452 -0
- package/src/runtime/shared/provider-accounts.mjs +52 -2
- package/src/runtime/shared/staged-install-worker.mjs +5 -0
- package/src/runtime/shared/staged-update.mjs +47 -2
- package/src/runtime/shared/tool-surface.mjs +110 -36
- package/src/runtime/shared/tool-work-units.mjs +4 -0
- package/src/runtime/shared/turn-worktree-snapshot.mjs +414 -54
- package/src/runtime/shared/worktrees/activity-gate.mjs +215 -318
- package/src/runtime/shared/worktrees/activity-ledger-worker.mjs +56 -0
- package/src/runtime/shared/worktrees/activity-ledger.mjs +391 -0
- package/src/runtime/shared/worktrees/branch-management.mjs +9 -3
- package/src/runtime/shared/worktrees/git.mjs +57 -0
- package/src/runtime/shared/worktrees/manager.mjs +205 -137
- package/src/runtime/tidy/install.mjs +95 -15
- package/src/runtime/tidy/languages.mjs +17 -15
- package/src/runtime/tidy/process.mjs +7 -4
- package/src/runtime/tidy/resolve.mjs +19 -16
- package/src/runtime/tidy/runners/biome.mjs +3 -3
- package/src/runtime/tidy/tool.mjs +1 -1
- package/src/runtime/tidy/worktree.mjs +10 -6
- package/src/runtime/visualize-bridge/client.mjs +4 -1
- package/src/runtime/visualize-bridge/tool-defs.mjs +7 -2
- package/src/runtime/web-search/index.mjs +1 -1
- package/src/session-runtime/agent-task-sessions.mjs +410 -353
- package/src/session-runtime/boot/tools.mjs +2 -0
- package/src/session-runtime/bot-status.mjs +103 -103
- package/src/session-runtime/connector-merge-migration.mjs +18 -15
- package/src/session-runtime/conversation-import/discovery.mjs +159 -40
- package/src/session-runtime/conversation-import/service.mjs +9 -3
- package/src/session-runtime/handoff-attachments.mjs +1 -1
- package/src/session-runtime/held-requests.mjs +3 -1
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +2 -0
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +8 -0
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +143 -116
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +6 -1
- package/src/session-runtime/lifecycle/teardown.mjs +1 -1
- package/src/session-runtime/mcp-glue/server-catalog.mjs +16 -10
- package/src/session-runtime/mcp-glue/server-input.mjs +4 -1
- package/src/session-runtime/mixy-heartbeat.mjs +1 -1
- package/src/session-runtime/provider-auth/login.mjs +2 -2
- package/src/session-runtime/resource-mcp-api.mjs +98 -35
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +44 -31
- package/src/session-runtime/resource-mcp-secrets.mjs +28 -11
- package/src/session-runtime/resource-mcp-servers.mjs +5 -4
- package/src/session-runtime/services/agent-tool/send-flow.mjs +10 -2
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +8 -3
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +4 -1
- package/src/session-runtime/services/agent-watchdog-registry.mjs +32 -4
- package/src/session-runtime/services/channel-worker/daemon-spawn.mjs +2 -0
- package/src/session-runtime/services/daemon-candidate.mjs +4 -1
- package/src/session-runtime/services/memory-runtime-proxy/daemon-spawn.mjs +4 -0
- package/src/session-runtime/services/plugin-admin.mjs +10 -6
- package/src/session-runtime/services/provider-admin.mjs +281 -10
- package/src/session-runtime/session-turn-api.mjs +2 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +4 -1
- package/src/session-runtime/settings-system-api.mjs +1 -1
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +13 -3
- package/src/session-runtime/setup-tool/connector-widen-approval.mjs +96 -0
- package/src/session-runtime/setup-tool/executor.mjs +6 -2
- package/src/session-runtime/setup-tool/tool-defs.mjs +2 -1
- package/src/session-runtime/turn/agent-ops.mjs +23 -0
- package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +49 -11
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +10 -1
- package/src/session-runtime/workspace/activity-guards.mjs +176 -0
- package/src/session-runtime/workspace/session-view.mjs +149 -0
- package/src/session-runtime/workspace/side-checkouts.mjs +203 -0
- package/src/session-runtime/workspace/transition-runner.mjs +188 -0
- package/src/session-runtime/workspace/transitions.mjs +108 -1066
- package/src/session-runtime/workspace/workspace-merge.mjs +132 -0
- package/src/session-runtime/workspace/worktree-intents.mjs +242 -0
- package/src/session-runtime/workspace/worktree-maintenance.mjs +80 -0
- package/src/session-runtime/workspace/worktree-setup.mjs +85 -0
- package/src/session-runtime/workspace/worktree-tool.mjs +54 -54
- package/src/standalone/daemon-desktop-runtime.mjs +2 -0
- package/src/standalone/daemon-session-control.mjs +151 -136
- package/src/standalone/daemon.mjs +7 -0
- package/src/standalone/desktop-service-registry.mjs +9 -0
- package/src/standalone/local-session-runtime.mjs +5 -1
- package/src/standalone/session-client/daemon-unavailable.mjs +3 -0
- package/src/standalone/session-client.mjs +5 -1
- package/src/standalone/session-frame-stream.mjs +83 -11
- package/src/standalone/session-protocol.mjs +4 -0
- package/src/standalone/session-service/agent-tree.mjs +45 -9
- package/src/standalone/session-service/projection/transcript-window.mjs +700 -64
- package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
- package/src/standalone/session-service/stored-reader.mjs +127 -40
- package/src/tui/App.jsx +154 -164
- package/src/tui/app/app-view/floating-panel.jsx +3 -0
- package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
- package/src/tui/app/clipboard.mjs +21 -10
- package/src/tui/app/prompt-handlers/use-prompt-history-nav.mjs +1 -1
- package/src/tui/app/prompt-handlers/use-prompt-interrupt.mjs +3 -0
- package/src/tui/app/prompt-submit/provider-prompts.mjs +3 -1
- package/src/tui/app/provider-setup/api-key-actions.mjs +31 -1
- package/src/tui/app/provider-setup/oauth-actions.mjs +25 -6
- package/src/tui/app/provider-setup-picker.mjs +20 -13
- package/src/tui/app/shell-layout/row-budgets.mjs +12 -10
- package/src/tui/app/slash-commands.mjs +1 -0
- package/src/tui/app/slash-dispatch/session-commands.mjs +46 -0
- package/src/tui/app/slash-dispatch.mjs +1 -1
- package/src/tui/app/use-btw-panel.mjs +29 -0
- package/src/tui/app/use-context-panel-refresh.mjs +31 -0
- package/src/tui/app/use-model-catalog-cache.mjs +13 -10
- package/src/tui/app/use-mouse-input.mjs +11 -0
- package/src/tui/app/use-onboarding-start.mjs +8 -3
- package/src/tui/app/use-panel-transition.mjs +10 -1
- package/src/tui/app/use-pasted-buffers.mjs +28 -20
- package/src/tui/app/use-prompt-draft-flow.mjs +7 -0
- package/src/tui/app/use-prompt-layout-rows.mjs +3 -3
- package/src/tui/app/use-prompt-queue-history.mjs +3 -2
- package/src/tui/app/use-selection-focus.mjs +11 -2
- package/src/tui/app/use-selection-geometry.mjs +18 -9
- package/src/tui/app/use-selection-paint.mjs +4 -4
- package/src/tui/app/use-selection-stitch.mjs +3 -3
- package/src/tui/app/use-slash-palette.mjs +62 -0
- package/src/tui/app/use-terminal-chrome.mjs +2 -2
- package/src/tui/app/use-transcript-activity.mjs +47 -32
- package/src/tui/app/use-transcript-follow.mjs +12 -4
- package/src/tui/app/use-transcript-scroll.mjs +46 -17
- package/src/tui/app/use-transcript-swap-reset.mjs +27 -0
- package/src/tui/app/use-transcript-window/geometry.mjs +19 -5
- package/src/tui/app/use-transcript-window/instance-state.mjs +4 -0
- package/src/tui/app/use-transcript-window/selection-shift.mjs +5 -1
- package/src/tui/app/use-transcript-window.mjs +21 -11
- package/src/tui/app/use-tui-ready.mjs +18 -0
- package/src/tui/app/use-welcome-prompt-hint.mjs +5 -0
- package/src/tui/app/use-workflow-tab-cycle.mjs +5 -3
- package/src/tui/components/Picker.jsx +27 -3
- package/src/tui/components/SignInUrl.jsx +68 -0
- package/src/tui/components/TextEntryPanel.jsx +76 -46
- package/src/tui/components/sign-in-url-layout.mjs +24 -0
- package/src/tui/dist/index.mjs +1896 -1341
- package/src/tui/session/goal-turn-state.mjs +6 -2
- package/src/tui/session/session-api/controls.mjs +4 -0
- package/src/tui/session/session-api/extensions.mjs +8 -0
- package/src/tui/session/session-api/intake/abort.mjs +2 -1
- package/src/tui/session/session-api/intake.mjs +2 -0
- package/src/tui/session/session-api/integrations.mjs +2 -2
- package/src/tui/session/session-api/routes-agent-definitions.mjs +1 -0
- package/src/tui/session/session-api/settings.mjs +2 -2
- package/src/tui/session/transcript-spill/spill-writer.mjs +15 -0
- package/src/tui/session/transcript-spill.mjs +92 -4
- package/src/tui/session/transcript-store.mjs +2 -0
- package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
|
@@ -15,45 +15,37 @@ dependencies:
|
|
|
15
15
|
Layers, cheapest and safest first: project formatters and linters through
|
|
16
16
|
`tidy`, structural rule packs, then agent-level cleanup. Every layer preserves
|
|
17
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.
|
|
19
|
-
shared rule: finish all planned edits, then check once (section 5).
|
|
18
|
+
fields; this file owns scope, order, and boundaries.
|
|
20
19
|
|
|
21
20
|
## 1. Job and mode
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
clang-format, rustfmt, gofmt, or equivalent keeps it; add or rewrite
|
|
27
|
-
`biome.json`, `.prettierrc`, `.clang-format` and the like only when asked.
|
|
21
|
+
- New behavior and public-API refactors are out of scope. A correctness defect
|
|
22
|
+
found while cleaning is reported, never fixed in a cleanup edit.
|
|
23
|
+
- Never invent a formatter config; a project's own formatter stays. Add or
|
|
24
|
+
rewrite one only when asked.
|
|
28
25
|
- Mode is `apply` unless the user asks to check, review, or "just report";
|
|
29
26
|
report-only stays read-only on every layer and lists what would change.
|
|
30
|
-
- An explicit focus restricts every layer
|
|
31
|
-
|
|
32
|
-
the tool cannot isolate it, use targeted edits or report the limitation
|
|
33
|
-
and ask before widening.
|
|
27
|
+
- An explicit focus restricts every layer. If the tool cannot isolate it, use
|
|
28
|
+
targeted edits or report the limitation and ask before widening.
|
|
34
29
|
|
|
35
30
|
## 2. Scope
|
|
36
31
|
1. Scope comes from the user: named files, directories, a feature area
|
|
37
32
|
resolved to confirmed paths, or an explicitly requested whole project. If
|
|
38
33
|
absent or ambiguous, ask first. Never infer it from a diff, branch,
|
|
39
34
|
commit, or recent activity.
|
|
40
|
-
2. Recommend (do not require
|
|
41
|
-
|
|
35
|
+
2. Recommend (do not require) that the user commit existing work before an
|
|
36
|
+
apply run. A dirty tree means preserve those edits.
|
|
42
37
|
3. Drop deleted, binary, generated, vendored files and lockfiles unless
|
|
43
38
|
explicitly included. Consumers and covering tests may be read; editing
|
|
44
39
|
them outside the scope needs approval. New non-ignored files are included.
|
|
45
40
|
4. Pass the approved paths on every `scan`/`check`/`fix`; `paths:["."]` only
|
|
46
41
|
for an explicitly requested whole project.
|
|
47
|
-
5.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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.
|
|
42
|
+
5. For large scopes, review bounded partitions once. Preserve their
|
|
43
|
+
completion state; report blocked partitions without restarting completed
|
|
44
|
+
work.
|
|
45
|
+
6. Read per-rule and per-directory counts first, then page only relevant rows
|
|
46
|
+
with `tidy action:'results'` filters. Truncation, timeouts, or scope
|
|
47
|
+
leakage mark that partition **unfinished**, not clean. Blocked checks stop
|
|
48
|
+
dependent edits only.
|
|
57
49
|
|
|
58
50
|
## 3. Deterministic layers
|
|
59
51
|
1. `tidy action:'scan'` first (languages, engines used/missing,
|
|
@@ -61,109 +53,86 @@ shared rule: finish all planned edits, then check once (section 5).
|
|
|
61
53
|
2. Downloads are automatic under the default `auto` policy. Only when
|
|
62
54
|
`tidy.downloads` is `ask` does a result carry `needsApproval`: ask once,
|
|
63
55
|
listing engines and bytes, then re-call with `approveDownloads:true`.
|
|
64
|
-
3. Engines run only through `tidy` and are never installed by hand
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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`,
|
|
78
|
-
`no-boolean-literal-compare`, `no-debug-statement`, `todo-marker`) are
|
|
79
|
-
diagnostics for the agent layer. Keep the engine pass a distinct change
|
|
56
|
+
3. Engines run only through `tidy` and are never installed by hand; report
|
|
57
|
+
`installHint`. An ad-hoc `npx <engine>`, global binary, or package script
|
|
58
|
+
is not verification. An engine `tidy` cannot resolve leaves its check
|
|
59
|
+
blocked, never clean.
|
|
60
|
+
4. Plan with `fix` without `apply:true`. The dry run is diagnostics and
|
|
61
|
+
candidate files, not a frozen patch. `structural:false` disables
|
|
62
|
+
structural rules only. For a restricted focus, avoid a combined apply that
|
|
63
|
+
touches unrelated code.
|
|
64
|
+
5. Apply with `apply:true` once the plan is settled, then review the actual
|
|
65
|
+
changes; skip it when the dry run proposes nothing. Rules without a fix
|
|
66
|
+
are diagnostics for the agent layer. Keep the engine pass a distinct change
|
|
80
67
|
set from semantic edits. On engine or structural failure, truncation, or a
|
|
81
68
|
rejected edit, stop affected writes; a partial result is not success.
|
|
82
69
|
|
|
83
70
|
## 4. Agent-level cleanup
|
|
84
71
|
Read `references/agent-cleanup.md` (ladder, lenses, slop, risk tiers); also
|
|
85
72
|
`references/test-suite-slop.md` when tests are in scope, and
|
|
86
|
-
`references/cleanup-report.md` for
|
|
73
|
+
`references/cleanup-report.md` for the report.
|
|
87
74
|
|
|
88
|
-
1. **Pin behavior (read-only).**
|
|
89
|
-
(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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.
|
|
75
|
+
1. **Pin behavior (read-only).** Find the source-text guards a planned move
|
|
76
|
+
can affect (procedure in `agent-cleanup.md`). A unit whose touched behavior
|
|
77
|
+
no test covers gets only SAFE changes; report it instead of adding tests.
|
|
78
|
+
2. **Ladder, then lenses.** Run the deletion ladder on each selected source
|
|
79
|
+
unit, then the lenses on the survivors. Engine diagnostics point at units;
|
|
80
|
+
they do not define coverage. Findings need path+symbol evidence; drop the
|
|
81
|
+
rest. Use history only when code, contracts, and tests leave intent
|
|
82
|
+
unclear; unresolved intent blocks deletion.
|
|
99
83
|
3. **Apply by tier.** SAFE as one batch; CAREFUL one source unit at a time,
|
|
100
|
-
each
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
4. **Stop rules.**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
both.
|
|
84
|
+
each wired into its callers (never leave a new module nothing imports);
|
|
85
|
+
RISKY is reported with its evidence and applied only after the user
|
|
86
|
+
approves that item. Dead code follows
|
|
87
|
+
`references/dead-code.md`.
|
|
88
|
+
4. **Stop rules.** Follow the shared verification budget. Report correctness
|
|
89
|
+
defects and changes beyond cleanup scope; do not fix them here. When
|
|
90
|
+
principles cannot pick between two rewrites, apply neither and record both.
|
|
108
91
|
|
|
109
|
-
Structural signals
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
|
92
|
+
Structural signals (file > 1,000 lines, function > 50 lines or nesting > 3,
|
|
93
|
+
duplicated small helpers, history comments, exported underscore names) are
|
|
94
|
+
leads, not candidates: act only on a named symptom. Do not improve names,
|
|
95
|
+
control flow, or types beyond the ladder and lenses. A confirmed
|
|
116
96
|
responsibility-based split that preserves behavior and entry points is
|
|
117
|
-
CAREFUL;
|
|
118
|
-
|
|
97
|
+
CAREFUL; moving a whole body elsewhere or cutting it into numbered chunks
|
|
98
|
+
resolves nothing.
|
|
119
99
|
|
|
120
|
-
## 5.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
pre-existing: report it separately. A broken runner leaves its scope
|
|
127
|
-
unverified: say so. Skipped or failed checks never count as passed.
|
|
100
|
+
## 5. Verify
|
|
101
|
+
Use the shared evidence budget. Run scoped `tidy check`; select behavioral
|
|
102
|
+
checks and typechecking only where the edits can invalidate their contracts.
|
|
103
|
+
Reuse valid passes. Attribute failures from evidence, not from whether the
|
|
104
|
+
failing file was edited. A broken runner leaves its scope unverified; say so.
|
|
105
|
+
Skipped or failed checks never count as passed.
|
|
128
106
|
|
|
129
107
|
If checks fail and cannot be fixed, undo only this run's edits with targeted
|
|
130
108
|
patches, preserving prior or concurrent work. Never use `git checkout`,
|
|
131
109
|
`reset`, `restore`, or `stash` as rollback; if the edits cannot be separated
|
|
132
110
|
safely, leave them and report the blocker.
|
|
133
111
|
|
|
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
112
|
## 6. Keep: never remove or rename
|
|
138
|
-
- Validation and error handling at a trust boundary
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
wire strings
|
|
113
|
+
- Validation and error handling at a trust boundary unless an adversarial test
|
|
114
|
+
proves the guard redundant.
|
|
115
|
+
- Contracts: export names, routes, CLI flags, DB columns, config keys, event
|
|
116
|
+
names, wire strings. A rename is RISKY even when the name is bad.
|
|
142
117
|
- Anything on the never-dead list in `references/dead-code.md`.
|
|
143
118
|
- An empty catch or ignored error that may be intentional: flag it.
|
|
144
119
|
- Complexity serving a current compatibility obligation, staged migration, or
|
|
145
|
-
vendored-code isolation
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
manual review.
|
|
120
|
+
vendored-code isolation.
|
|
121
|
+
- Tool directives, public API docs, and security or compatibility
|
|
122
|
+
explanations. Comments that may separate tokens or carry significant line
|
|
123
|
+
breaks are left for manual review.
|
|
150
124
|
- The project's own idioms (`AGENTS.md`/`CLAUDE.md`/lint config) over generic
|
|
151
|
-
ones; clarity over fewer lines
|
|
125
|
+
ones; clarity over fewer lines.
|
|
152
126
|
|
|
153
127
|
## 7. Pitfalls
|
|
154
128
|
- Missing engine: `installHint` only; continue others; that check is blocked.
|
|
155
129
|
- User declines downloads: skip those engines and say so.
|
|
156
|
-
- Structural engine unavailable
|
|
157
|
-
`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
unfinished.
|
|
161
|
-
- A dead-code scanner report is a candidate list, not proof; verify per
|
|
162
|
-
`references/dead-code.md`.
|
|
130
|
+
- Structural engine unavailable: `check`/`fix` fail with a rebuild remedy;
|
|
131
|
+
`scan` still works. Retry with `structural:false`; missing structural
|
|
132
|
+
matches are never clean.
|
|
133
|
+
- A dead-code scanner report is a candidate list, not proof.
|
|
163
134
|
|
|
164
135
|
## 8. Reporting
|
|
165
|
-
Report once, after the last partition, using `references/cleanup-report.md
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
between partitions except for a blocker or a required approval. No separate
|
|
169
|
-
report file unless requested.
|
|
136
|
+
Report once, after the last partition, using `references/cleanup-report.md`,
|
|
137
|
+
with everything needing the user's decision in one list. Pause only for a
|
|
138
|
+
blocker or a required approval. No report file unless requested.
|
|
@@ -1,135 +1,87 @@
|
|
|
1
1
|
# Agent-level cleanup
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
body owns scope, order, approvals, and the list of things that are never
|
|
6
|
-
removed or renamed.
|
|
3
|
+
Owns the deletion ladder, lenses, slop categories, and risk tiers. The skill
|
|
4
|
+
body owns scope, order, approvals, and the never-remove list.
|
|
7
5
|
|
|
8
6
|
## Behavior boundary
|
|
9
7
|
|
|
10
|
-
Classify risk by evidence, not
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
`indexOf` chains, identifier-absence assertions) and record what each pins;
|
|
28
|
-
moving code across such a guard is a contract change, not a tidying.
|
|
29
|
-
|
|
30
|
-
**Dependency arrays.** A hook or watcher dependency array that contradicts its
|
|
31
|
-
own body — the body reads values the array does not key — is a defect
|
|
32
|
-
candidate, not an idiom to preserve and report. Verify reachability at the
|
|
33
|
-
producer: when the key can actually repeat (two publishers stamping
|
|
34
|
-
`Date.now()` in the same millisecond drop the second update), fix it by adding
|
|
35
|
-
the values the body reads while keeping the existing key, with a test that
|
|
36
|
-
fails without the fix, delivered as its own change set under "Bugs found".
|
|
37
|
-
When the producer makes repetition unreachable, leave the array and record that
|
|
38
|
-
evidence as `kept`.
|
|
8
|
+
Classify risk by evidence, not syntax. Equivalence includes observable outputs
|
|
9
|
+
and errors, side effects and module initialization, and any call identity,
|
|
10
|
+
receiver, or ordering consumers rely on. Removing an unused binding can remove
|
|
11
|
+
initialization; inlining a wrapper can change its call contract.
|
|
12
|
+
|
|
13
|
+
Establish equivalence from current callers, contracts, and tests that exercise
|
|
14
|
+
the affected behavior. An intended change to failures, returned values,
|
|
15
|
+
compatibility, or concurrency is RISKY: report it as a separate correction.
|
|
16
|
+
|
|
17
|
+
**Source-text guards.** Some tests assert on source text rather than behavior
|
|
18
|
+
(file reads of source paths, `indexOf` ordering chains, identifier-absence or
|
|
19
|
+
literal-presence assertions), so a move breaks them without changing behavior.
|
|
20
|
+
Search only for guards a proposed move can affect, and record what each pins.
|
|
21
|
+
Moving code across such a guard is a contract change, not a tidying.
|
|
22
|
+
|
|
23
|
+
**Dependency arrays.** A suspected correctness defect is outside cleanup;
|
|
24
|
+
report its evidence without changing behavior.
|
|
39
25
|
|
|
40
26
|
## Deletion ladder
|
|
41
27
|
|
|
42
|
-
Run
|
|
43
|
-
|
|
44
|
-
last rung goes on to the lenses.
|
|
28
|
+
Run on each selected unit before looking for smells; only code that lands on
|
|
29
|
+
the last rung goes on to the lenses.
|
|
45
30
|
|
|
46
|
-
| Rung | Question |
|
|
31
|
+
| Rung | Question | Result |
|
|
47
32
|
|---|---|---|
|
|
48
|
-
| Delete | Is there evidence the behavior is no longer needed
|
|
49
|
-
| Reuse | Does a helper
|
|
50
|
-
| Platform | Does the
|
|
51
|
-
| Simplify | It must exist
|
|
52
|
-
|
|
53
|
-
A unit replaced by one platform call is a larger and safer win than any
|
|
54
|
-
in-place cleanup; take it before analysing the unit's smells.
|
|
33
|
+
| Delete | Is there evidence the behavior is no longer needed (callers, requirements, flags, compatibility)? | remove the verified obsolete unit |
|
|
34
|
+
| Reuse | Does a repo helper already do it? | replaced by a call |
|
|
35
|
+
| Platform | Does the runtime, stdlib, or an installed dependency do it? | hand-rolled code replaced |
|
|
36
|
+
| Simplify | It must exist; make it smaller | proceeds to the lenses |
|
|
55
37
|
|
|
56
38
|
## Lenses
|
|
57
39
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
**Reuse** — new code
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
slop patterns from the table below.
|
|
77
|
-
|
|
78
|
-
**Efficiency** — redundant computation, repeated file reads, duplicate API
|
|
79
|
-
calls, N+1 access; independent operations run sequentially; heavy work on
|
|
80
|
-
startup or per-request paths; existence pre-checks instead of doing the
|
|
81
|
-
operation and handling the error; unbounded growth, missing cleanup,
|
|
82
|
-
listener/handle leaks; closures capturing a whole scope for long-lived
|
|
83
|
-
objects; whole-file reads where a slice would do. Only apply an efficiency
|
|
84
|
-
change whose behavioral equivalence is obvious; never restructure an
|
|
85
|
-
algorithm with subtle correctness implications without a test that pins it.
|
|
86
|
-
|
|
87
|
-
**Altitude** — a fix applied too shallowly: a caller-specific branch added to
|
|
88
|
-
a generic path (`if (caller === X)`, a magic-value escape hatch); a symptom
|
|
89
|
-
patched at one call site while siblings keep the same flaw; a workaround
|
|
90
|
-
stacked on a workaround; a wrapper added to avoid touching the thing that
|
|
91
|
-
needs changing; a flag introduced to route around a broken default. Name
|
|
92
|
-
the mechanism the change is dodging and the deeper fix. When the deeper fix
|
|
93
|
-
is larger than the cleanup, report it as its own task instead of doing it
|
|
94
|
-
here.
|
|
40
|
+
Use the lenses to identify supported improvements within scope; stop
|
|
41
|
+
investigating a candidate when its disposition is established. Each lens may
|
|
42
|
+
search the whole repository for evidence; a finding without a path+symbol
|
|
43
|
+
pointer is dropped. Judge units in full context, not only recently edited
|
|
44
|
+
lines, and never widen the edit scope to consumers. Skip lenses the user's
|
|
45
|
+
focus excludes.
|
|
46
|
+
|
|
47
|
+
- **Reuse** — new code duplicating an existing utility, constant, guard, or
|
|
48
|
+
installed library. Name the existing thing.
|
|
49
|
+
- **Quality** — redundant or derivable state, parameter sprawl (a boolean
|
|
50
|
+
selecting between behaviors), copy-paste-with-variation, leaky abstractions,
|
|
51
|
+
stringly-typed code where a constant or registry exists, slop below.
|
|
52
|
+
- **Efficiency** — redundant work, repeated reads, N+1 access, needless
|
|
53
|
+
sequencing, leaks, existence pre-checks instead of handling the error. Apply
|
|
54
|
+
only when equivalence is obvious; otherwise report it.
|
|
55
|
+
- **Altitude** — a fix applied too shallowly: a caller-specific branch in a
|
|
56
|
+
generic path, a symptom patched at one site, a workaround on a workaround.
|
|
57
|
+
Name the deeper fix; when it exceeds the cleanup, report it as its own task.
|
|
95
58
|
|
|
96
59
|
## Slop categories
|
|
97
60
|
|
|
98
61
|
| Category | Flag | Keep | Fix |
|
|
99
62
|
|---|---|---|---|
|
|
100
|
-
|
|
|
101
|
-
| Over-defensive code |
|
|
102
|
-
| Fake resilience | a fallback
|
|
103
|
-
| Excessive complexity | nesting
|
|
104
|
-
| Needless abstraction | pass-through wrappers, single-use helpers, speculative indirection
|
|
105
|
-
| Boundary violations | wrong-layer imports,
|
|
106
|
-
| Dead code | unused imports/locals/private functions, unreachable branches,
|
|
107
|
-
| Duplication | copy-pasted branches
|
|
108
|
-
| Type escapes | `
|
|
109
|
-
| Hardcoded config | environment-specific URLs
|
|
110
|
-
| Placeholder naming |
|
|
111
|
-
| Oversized modules | files past the
|
|
63
|
+
| Comments | restating the code, step narration, history or changelog notes, dividers, commented-out code, a comment the code contradicts, a TODO with no owner or issue | a non-obvious why (external constraint, invariant, tradeoff), directives, public API docs, issue links | delete or correct; a "do not change" comment gets a proposed test or type that enforces it, applied only with approval |
|
|
64
|
+
| Over-defensive code | checks on guaranteed values, try/catch around code that cannot throw, duplicated validation | I/O handling, trust boundaries, a logging top-level catch | remove only when a test proves the guard redundant; changing which errors propagate is RISKY |
|
|
65
|
+
| Fake resilience | a fallback turning missing input or failure into a plausible value; a catch that only rethrows or swallows | a default the contract names, documented retry or degraded mode | remove only proven redundant behavior; changing the error contract is RISKY |
|
|
66
|
+
| Excessive complexity | deep nesting, nested ternaries, long conditions, many params, clever one-liners, hand-rolled loops with an idiom | a deliberately dense hot path | guard clauses, early returns, lookup table, options object, extract by responsibility |
|
|
67
|
+
| Needless abstraction | pass-through wrappers, single-use helpers, speculative indirection | a real seam (tests, multiple implementers, framework boundary) | inline after the behavior boundary check |
|
|
68
|
+
| Boundary violations | wrong-layer imports, cycles, logic in handlers, reading another module's private state | an established pattern | move to the owning layer; flag when unsure |
|
|
69
|
+
| Dead code | unused imports/locals/private functions, unreachable branches, debug leftovers | the never-dead list | follow `dead-code.md` |
|
|
70
|
+
| Duplication | copy-pasted branches, two helpers doing one thing, redeclared types | similarity serving different intents | consolidate only when intents match |
|
|
71
|
+
| Type escapes | `any`, unexplained ignores and suppressions, redundant coercions | an escape whose comment names the upstream bug | narrow with a guard or precise type; fix the warning or record why silenced |
|
|
72
|
+
| Hardcoded config | environment-specific URLs, ids, absolute paths, unnamed thresholds | fixtures, docs, contract-fixed literals | use the project's config accessor; name the literal. A credential in source is a defect: report it |
|
|
73
|
+
| Placeholder naming | `data2`, `tmp`, `handleStuff` on new code | the project's own idioms | rename locals; an exported rename is RISKY |
|
|
74
|
+
| Oversized modules | files past the review threshold mixing responsibilities | a cohesive module | split confirmed independent responsibilities; no `utils`/`common` dumps |
|
|
112
75
|
|
|
113
76
|
## Risk tiers
|
|
114
77
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
|
118
|
-
|
|
119
|
-
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
rewrites of the same region remain, apply the one that touches less code and
|
|
126
|
-
record the alternative; when the principles cannot separate them, apply
|
|
127
|
-
neither and record both.
|
|
128
|
-
|
|
129
|
-
## Small tidyings (CAREFUL tier)
|
|
130
|
-
|
|
131
|
-
Structure-only moves the slop table does not already cover: normalize two
|
|
132
|
-
variants of the same pattern to one form; put coupled functions next to each
|
|
133
|
-
other; declare a variable where it is initialized; blank line between chunks
|
|
134
|
-
that do different things; merge over-fragmented pieces back into one readable
|
|
135
|
-
block before re-splitting. One tidying per change set.
|
|
78
|
+
| Tier | Meaning | Handling |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| SAFE | equivalence established, including initialization | apply as one batch |
|
|
81
|
+
| CAREFUL | same semantics, structure changes (local rename, guard clause, verified inlining, helper extraction, responsibility split, consolidation) | one source unit at a time, including required new modules |
|
|
82
|
+
| RISKY | may change behavior or a contract (public rename, error-handling or concurrency change, shared-infrastructure fix) | report with test coverage status; apply only the items the user approves |
|
|
83
|
+
|
|
84
|
+
When lenses disagree: correctness > the user's focus > readability and reuse >
|
|
85
|
+
micro-performance. Between two defensible rewrites, apply the one touching
|
|
86
|
+
less code and record the alternative; if principles cannot separate them,
|
|
87
|
+
apply neither.
|
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Report
|
|
2
2
|
|
|
3
|
-
Findings and
|
|
4
|
-
|
|
3
|
+
Findings and tiers come from `agent-cleanup.md`. Keep the list in the
|
|
4
|
+
conversation, not a file. Record only findings with a path+symbol, a cost, and
|
|
5
|
+
an action; threshold hits are signals, not findings.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
```text
|
|
11
|
-
[ID] path · symbol → problem → cost → action | tier: SAFE/CAREFUL/RISKY | confidence: high/medium/low | status: completed/kept/unfinished
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
- Register only a lens finding with a path+symbol location, a cost, and an
|
|
15
|
-
action. A finding that cannot name its cost is a nit: drop it. Threshold
|
|
16
|
-
hits (long files or functions, deep nesting) are signals, not candidates.
|
|
17
|
-
- Findings sharing a root cause group under one ID, each member keeping its
|
|
18
|
-
path and symbol. Code moved by an extraction keeps its origin ID.
|
|
19
|
-
- Confidence is `low` when callers, contracts, and tests do not explain why
|
|
20
|
-
the code exists; medium/low candidates stay unfinished until that question
|
|
21
|
-
is resolved. Approval to apply does not authorize guessing.
|
|
22
|
-
- `completed` carries evidence of what changed; `kept` carries a concrete
|
|
23
|
-
reason (keep rule or external contract); `unfinished` carries the blocker
|
|
24
|
-
(pending, blocked, deferred, unverified).
|
|
25
|
-
|
|
26
|
-
Overall cleanup is complete only when every partition is done, the final
|
|
27
|
-
check has passed, and every candidate is completed or kept with evidence.
|
|
28
|
-
Otherwise report "overall partial" with the remaining paths and IDs.
|
|
7
|
+
Each entry carries: path · symbol, action or blocker, risk tier, evidence
|
|
8
|
+
(what changed, why kept, or what blocks it). Findings sharing a root cause
|
|
9
|
+
group together. Unresolved intent stays unfinished; approval to apply does not
|
|
10
|
+
authorize guessing.
|
|
29
11
|
|
|
30
12
|
## Final report
|
|
31
13
|
|
|
14
|
+
Include only sections that have content:
|
|
15
|
+
|
|
32
16
|
```text
|
|
33
17
|
Scope: <paths | whole project> · Mode: report|apply · Overall: complete|partial
|
|
34
|
-
Deterministic: engines used/missing · files changed · diagnostics remaining
|
|
35
|
-
Completed
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Verification: tests <result> · typecheck <result> · tidy check <remaining diagnostics> · pre-existing failures <list|none>
|
|
41
|
-
Blocked or unverified: <check> — <reason> → <paths> (write "none" if none)
|
|
42
|
-
Needs your decision: <RISKY findings, bugs, unresolved intent, unfinished candidates>
|
|
18
|
+
Deterministic: engines used/missing · files changed · diagnostics remaining
|
|
19
|
+
Completed / Kept / Unfinished: entries as above
|
|
20
|
+
Noticed, not applied (RISKY or out of scope): entries · test coverage
|
|
21
|
+
Defects found (not fixed here): <issues>
|
|
22
|
+
Verification: checks run and results · failures and established attribution · blocked or unverified checks with reason
|
|
23
|
+
Needs your decision: <RISKY findings, defects, unresolved intent, unfinished items>
|
|
43
24
|
```
|
|
25
|
+
|
|
26
|
+
Complete means every partition was reviewed and the required checks passed or
|
|
27
|
+
are reported blocked; otherwise report partial with the remaining paths.
|
|
@@ -45,8 +45,6 @@ found" and never settle it by installing the package.
|
|
|
45
45
|
effectful initializers, and the last unused import binding can still load a
|
|
46
46
|
module for registration or initialization. Preserve required initialization
|
|
47
47
|
rather than deleting it with the binding.
|
|
48
|
-
5. Record the symbol, kind, classified usage and contract evidence, side-effect
|
|
49
|
-
result, and proposed action in the candidate list.
|
|
50
48
|
|
|
51
49
|
## Never dead
|
|
52
50
|
|
|
@@ -79,7 +77,7 @@ evidence. Apply this procedure before classifying an old path as dead:
|
|
|
79
77
|
4. For a verified obsolete path, inventory its callers, flags/config, tests,
|
|
80
78
|
docs, files, and dependencies. Remove only approved members in the order
|
|
81
79
|
below; request scope expansion before editing related files outside it.
|
|
82
|
-
5.
|
|
80
|
+
5. A still-required path is kept with its contract; an unknown obligation
|
|
83
81
|
leaves the candidate blocked, not assumed obsolete.
|
|
84
82
|
|
|
85
83
|
## Remove in order
|
|
@@ -94,9 +92,5 @@ evidence. Apply this procedure before classifying an old path as dead:
|
|
|
94
92
|
project's own package manager.
|
|
95
93
|
|
|
96
94
|
Group edits by file so one batch never touches a file another batch edits.
|
|
97
|
-
Verification and rollback follow the skill body (section 5).
|
|
98
|
-
|
|
99
|
-
## Report
|
|
100
|
-
|
|
101
|
-
Use the shared candidate list and closing report, with usage and side-effect
|
|
102
|
-
evidence per ID.
|
|
95
|
+
Verification and rollback follow the skill body (section 5). Record usage and
|
|
96
|
+
side-effect evidence in the common report format (`cleanup-report.md`).
|