arco-workbench 0.1.4 → 0.1.5
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/CONTRIBUTING.md +40 -8
- package/README.md +35 -21
- package/THIRD_PARTY_NOTICES +789 -0
- package/client/dist/assets/{PhosphorBackdrop-CNumba2X.js → PhosphorBackdrop-D6cbmLNY.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-DX5KyCt3.js → ThemedBackgroundShaderImpl-2dyerOi4.js} +1 -1
- package/client/dist/assets/{XtermView-DhS5g8Rt.js → XtermView-AIwo7O3D.js} +2 -2
- package/client/dist/assets/galleryEditor-DXAuxS8D.js +702 -0
- package/client/dist/assets/index-8j6p-pmQ.js +610 -0
- package/client/dist/assets/index-DD9kFGsF.css +1 -0
- package/client/dist/index.html +2 -2
- package/client/src/App.tsx +44 -55
- package/client/src/alerts/desktopAlerts.ts +20 -12
- package/client/src/alerts/desktopTest.ts +68 -0
- package/client/src/alerts/focusNotice.ts +16 -0
- package/client/src/buildCheck.ts +42 -2
- package/client/src/components/ArchitectureReviewDialog.tsx +98 -0
- package/client/src/components/ArtifactModal.tsx +4 -6
- package/client/src/components/ArtifactMoveDialog.tsx +11 -7
- package/client/src/components/AskUserQuestionNotice.tsx +2 -1
- package/client/src/components/AutomaticMessage.tsx +19 -0
- package/client/src/components/BriefControl.tsx +4 -2
- package/client/src/components/BrowserNotice.tsx +35 -0
- package/client/src/components/CatchMeUp.tsx +12 -6
- package/client/src/components/ChatMessage.tsx +15 -4
- package/client/src/components/ChatModeView.tsx +23 -16
- package/client/src/components/ChatPanel.tsx +33 -5
- package/client/src/components/CheckpointActions.tsx +91 -26
- package/client/src/components/ClusterActivityTab.tsx +4 -2
- package/client/src/components/ClusterMemberPicker.tsx +6 -3
- package/client/src/components/ClusterPlanTab.tsx +93 -62
- package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +16 -5
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +25 -14
- package/client/src/components/ClusterRightPanel/MailboxModal.tsx +7 -3
- package/client/src/components/ClusterRightPanel/MemberRow.tsx +5 -2
- package/client/src/components/ClusterRightPanel/MemberSettingsFields.tsx +104 -0
- package/client/src/components/ClusterRightPanel/MessageGuardControl.tsx +1 -1
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +85 -7
- package/client/src/components/ClusterRightPanel/index.tsx +90 -36
- package/client/src/components/ClusterRightPanel/memberSettings.ts +52 -0
- package/client/src/components/ClusterRightPanel/panels.ts +18 -0
- package/client/src/components/ClusterRightPanel/types.ts +9 -10
- package/client/src/components/ClusterTab.tsx +252 -62
- package/client/src/components/ClusterTaskBoardTab.tsx +22 -598
- package/client/src/components/CommandPalette.tsx +17 -6
- package/client/src/components/ComputerAgentPicker.tsx +1 -1
- package/client/src/components/ComputerPanel.tsx +4 -2
- package/client/src/components/Connections/Connections.tsx +5 -2
- package/client/src/components/Connections/EndpointEditor.tsx +2 -2
- package/client/src/components/Connections/connections.css +1 -1
- package/client/src/components/Connections/model.ts +5 -1
- package/client/src/components/ContextMeter.tsx +15 -4
- package/client/src/components/DeepSeekControls.tsx +7 -6
- package/client/src/components/DiagnosticsTab.tsx +3 -2
- package/client/src/components/DialogShell.tsx +19 -11
- package/client/src/components/FileExplorer.tsx +8 -9
- package/client/src/components/FileViewerModal.tsx +37 -12
- package/client/src/components/FirstRun.tsx +8 -7
- package/client/src/components/GateApprovalNotice.tsx +4 -2
- package/client/src/components/GitDialog.tsx +1 -0
- package/client/src/components/GitHubPanel/CodeView.tsx +35 -23
- package/client/src/components/GitHubPanel/IssueView.tsx +6 -4
- package/client/src/components/GitHubPanel/PullView.tsx +7 -6
- package/client/src/components/GitHubPanel/RunView.tsx +7 -5
- package/client/src/components/GitHubPanel/shared.tsx +23 -8
- package/client/src/components/HandoffSeedPill.tsx +5 -5
- package/client/src/components/HandoffSource.tsx +54 -0
- package/client/src/components/HeaderAuthChip.tsx +22 -1
- package/client/src/components/HeaderDropdown.tsx +5 -0
- package/client/src/components/HeaderVersionBox.tsx +3 -0
- package/client/src/components/HistoryTab.tsx +59 -32
- package/client/src/components/Home/AddProject.tsx +1 -1
- package/client/src/components/Home/HomeView.tsx +28 -19
- package/client/src/components/Home/LocationDialog.tsx +1 -1
- package/client/src/components/Home/ProjectCard.tsx +5 -3
- package/client/src/components/Home/home.css +4 -4
- package/client/src/components/KeepButton.tsx +22 -0
- package/client/src/components/LlamacppCatalogEditor.tsx +12 -3
- package/client/src/components/LocalRuntimeStatus.tsx +54 -0
- package/client/src/components/MdTuneupDialog.tsx +3 -1
- package/client/src/components/MemberCard.tsx +44 -42
- package/client/src/components/MemberPane.tsx +11 -10
- package/client/src/components/ModelHealthPanel.tsx +5 -4
- package/client/src/components/NativeSubagentControls.tsx +64 -0
- package/client/src/components/NeedsYouBadge.tsx +13 -6
- package/client/src/components/NorthStarBar.tsx +5 -3
- package/client/src/components/NotificationCenter.tsx +14 -2
- package/client/src/components/NotificationChannelsSettings.tsx +38 -30
- package/client/src/components/NotificationToasts.tsx +6 -8
- package/client/src/components/PendingQuestionsButton.tsx +4 -1
- package/client/src/components/PlanBodyRenderer.tsx +1 -0
- package/client/src/components/PlanCandidateBanner.tsx +20 -3
- package/client/src/components/PlanReviewPicker.tsx +6 -3
- package/client/src/components/PreviewTab.tsx +62 -25
- package/client/src/components/PrimaryStatus.tsx +20 -74
- package/client/src/components/ProjectsSettings.tsx +28 -2
- package/client/src/components/ProviderReleasesModal.tsx +13 -3
- package/client/src/components/ProvidersPopover.tsx +81 -23
- package/client/src/components/PublicProjectBox.tsx +10 -6
- package/client/src/components/PurgeConversationModal.tsx +7 -2
- package/client/src/components/QueuedMessagesIndicator.tsx +42 -150
- package/client/src/components/Recall/RecallResultRow.tsx +4 -2
- package/client/src/components/Recall/RecallView.tsx +12 -9
- package/client/src/components/ResearchDialog.tsx +1 -1
- package/client/src/components/ReviewDialog.tsx +12 -5
- package/client/src/components/RightPanel/ActivityTab.tsx +32 -16
- package/client/src/components/RightPanel/CodebaseMemorySection.tsx +3 -1
- package/client/src/components/RightPanel/ConfigTab.tsx +129 -140
- package/client/src/components/RightPanel/GenesisTab.tsx +67 -24
- package/client/src/components/RightPanel/HandoffsTab.tsx +4 -0
- package/client/src/components/RightPanel/KnowledgeTab.tsx +1 -1
- package/client/src/components/RightPanel/LedgerTab.tsx +1 -1
- package/client/src/components/RightPanel/McpRegistrySection.tsx +7 -6
- package/client/src/components/RightPanel/MoveTargetModal.tsx +6 -3
- package/client/src/components/RightPanel/OutputsPanel.tsx +40 -17
- package/client/src/components/RightPanel/PlanTab.tsx +109 -111
- package/client/src/components/RightPanel/ReviewTab.tsx +7 -4
- package/client/src/components/RightPanel/UsageTab.tsx +18 -5
- package/client/src/components/RightPanel/format.ts +3 -1
- package/client/src/components/RightPanel/index.tsx +10 -2
- package/client/src/components/RightPanel/types.ts +4 -2
- package/client/src/components/RunAsPicker.tsx +5 -3
- package/client/src/components/RuntimeStateBanner.tsx +13 -3
- package/client/src/components/SavedClustersList.tsx +30 -3
- package/client/src/components/ServicesTab.tsx +17 -34
- package/client/src/components/SettingsPanel.tsx +101 -337
- package/client/src/components/ShortcutCheatSheet.tsx +6 -4
- package/client/src/components/SkillEditorDialog.tsx +2 -1
- package/client/src/components/SkillsSettings.tsx +307 -0
- package/client/src/components/SpawnDialog.tsx +3 -3
- package/client/src/components/SpawnSeedPill.tsx +5 -4
- package/client/src/components/StaleBuildBanner.tsx +3 -1
- package/client/src/components/StorageWarnings.tsx +3 -1
- package/client/src/components/SystemHeader.tsx +17 -10
- package/client/src/components/SystemModal.tsx +6 -5
- package/client/src/components/TabBar.tsx +20 -10
- package/client/src/components/TabContextMenu.tsx +36 -10
- package/client/src/components/TaskCard.tsx +16 -11
- package/client/src/components/TasksPanel.tsx +13 -11
- package/client/src/components/Terminal/XtermView.tsx +2 -0
- package/client/src/components/TerminalInput.tsx +248 -447
- package/client/src/components/TerminalSessions.tsx +1 -1
- package/client/src/components/TokenBadge.tsx +20 -17
- package/client/src/components/ToolCallPill.tsx +5 -3
- package/client/src/components/ToolboxMenu.tsx +5 -5
- package/client/src/components/TranscriptSendDialog.tsx +1 -1
- package/client/src/components/TurnTimer.tsx +21 -0
- package/client/src/components/UpdateAction.tsx +4 -1
- package/client/src/components/UsageBar.tsx +32 -126
- package/client/src/components/UserManual/index.tsx +6 -4
- package/client/src/components/VoiceMenu.tsx +5 -1
- package/client/src/components/VoiceSetupSettings.tsx +21 -11
- package/client/src/components/WorkerCard.tsx +7 -1
- package/client/src/components/WorkerDetailModal.tsx +7 -3
- package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +6 -6
- package/client/src/components/WorkflowCreator/ProjectPicker.tsx +13 -12
- package/client/src/components/WorkflowCreator/index.tsx +237 -78
- package/client/src/components/WorkflowCreator/types.ts +5 -3
- package/client/src/components/WorkflowStatusChip.tsx +93 -13
- package/client/src/components/WorkflowView.tsx +55 -24
- package/client/src/components/WorkspaceRename.tsx +11 -1
- package/client/src/components/activityTime.ts +4 -0
- package/client/src/components/compare/CompareDialog.tsx +6 -3
- package/client/src/components/compare/CompareOverlay.tsx +10 -3
- package/client/src/components/composer/submitComposer.ts +191 -0
- package/client/src/components/diff/ChangesPanel.tsx +4 -2
- package/client/src/components/diff/LiveChangesPanel.tsx +18 -2
- package/client/src/components/editor/CodeEditor.tsx +17 -2
- package/client/src/components/headerPopoverState.ts +15 -0
- package/client/src/components/help/DocViewer.tsx +6 -4
- package/client/src/components/help/HelpCard.tsx +3 -2
- package/client/src/components/help/HelpPopover.tsx +3 -1
- package/client/src/components/media/AudioEditor/AudioOpsPanel.tsx +16 -2
- package/client/src/components/media/DirectoryPicker.tsx +18 -11
- package/client/src/components/media/ImageEditor/ImageEditor.tsx +2 -2
- package/client/src/components/media/MediaModalHost.tsx +7 -15
- package/client/src/components/media/MediaStemsControls.tsx +16 -2
- package/client/src/components/media/VideoEditor/VideoOpsPanel.tsx +16 -2
- package/client/src/components/media/launchers.ts +4 -0
- package/client/src/components/plans/PlanChooser.tsx +135 -0
- package/client/src/components/plans/PlanRefsSection.tsx +47 -28
- package/client/src/components/plans/planBodySave.ts +17 -0
- package/client/src/components/plans/planRefs.ts +21 -11
- package/client/src/components/plans/startPlanGenesis.ts +37 -0
- package/client/src/components/primitives/Panel.tsx +1 -0
- package/client/src/components/providerPanelState.ts +17 -0
- package/client/src/components/settings/AppVersionSection.tsx +5 -5
- package/client/src/components/settings/AppWindowBrowserSection.tsx +88 -0
- package/client/src/components/settings/PreviewPortsSection.tsx +31 -0
- package/client/src/components/settings/SettingsLayout.tsx +1 -1
- package/client/src/components/settings/appWindowBrowserReport.ts +23 -0
- package/client/src/components/settings/navigation.ts +5 -1
- package/client/src/components/settings/settings.css +6 -0
- package/client/src/components/terminalInput/planDraft.ts +5 -5
- package/client/src/components/usageVisibility.ts +3 -2
- package/client/src/components/workSurface/WorkSurfaceControls.tsx +125 -10
- package/client/src/components/workSurface/workSurface.css +10 -2
- package/client/src/explorer/ArtifactsLens.tsx +53 -17
- package/client/src/explorer/ExplorerApp.tsx +8 -6
- package/client/src/explorer/PlansLens.tsx +80 -20
- package/client/src/explorer/RecentsLens.tsx +22 -61
- package/client/src/explorer/StorageLens.tsx +10 -4
- package/client/src/explorer/changedAttribution.ts +23 -0
- package/client/src/explorer/launch.ts +6 -3
- package/client/src/explorer/treeReveal.ts +21 -0
- package/client/src/explorer/types.ts +3 -3
- package/client/src/help/content/chat.tsx +17 -10
- package/client/src/help/content/cluster.tsx +135 -104
- package/client/src/help/content/composer.tsx +124 -43
- package/client/src/help/content/gitOps.tsx +19 -19
- package/client/src/help/content/github.tsx +9 -4
- package/client/src/help/content/header.tsx +70 -51
- package/client/src/help/content/media.tsx +20 -20
- package/client/src/help/content/misc.tsx +347 -163
- package/client/src/help/content/recall.tsx +12 -12
- package/client/src/help/content/rightPanel.tsx +199 -102
- package/client/src/help/content/settings.tsx +117 -44
- package/client/src/help/content/shared.tsx +1 -1
- package/client/src/help/content/tabbar.tsx +1 -1
- package/client/src/help/manualSections/actions.tsx +24 -17
- package/client/src/help/manualSections/chat.tsx +28 -5
- package/client/src/help/manualSections/clusters.tsx +193 -131
- package/client/src/help/manualSections/configuration.tsx +232 -48
- package/client/src/help/manualSections/deepseek.tsx +7 -5
- package/client/src/help/manualSections/gettingStarted.tsx +74 -12
- package/client/src/help/manualSections/maintenance.tsx +60 -13
- package/client/src/help/manualSections/media.tsx +14 -12
- package/client/src/help/manualSections/plans.tsx +108 -25
- package/client/src/help/manualSections/powerFeatures.tsx +145 -50
- package/client/src/help/manualSections/providers.tsx +237 -42
- package/client/src/help/manualSections/reference.tsx +19 -11
- package/client/src/help/manualSections/strata.tsx +6 -6
- package/client/src/help/manualSections/troubleshooting.tsx +14 -8
- package/client/src/help/manualSections/voice.tsx +12 -7
- package/client/src/help/manualSections/workflows.tsx +76 -19
- package/client/src/help/manualSections/workspace.tsx +173 -46
- package/client/src/help/shortcuts.ts +1 -0
- package/client/src/hooks/useWebSocket.ts +49 -25
- package/client/src/layout/SlideOut.tsx +77 -0
- package/client/src/layout/ToolbarOverflow.tsx +97 -0
- package/client/src/layout/keepInWindow.ts +216 -0
- package/client/src/layout/layoutRange.ts +129 -0
- package/client/src/main.tsx +2 -0
- package/client/src/phosphor-demo/Demo.tsx +5 -13
- package/client/src/phosphor-demo/demo.css +1 -1
- package/client/src/stores/appStore.ts +65 -14
- package/client/src/stores/appStore.types.ts +35 -16
- package/client/src/stores/docEditStore.ts +13 -21
- package/client/src/stores/draftStore.ts +28 -4
- package/client/src/stores/knowledgeDistillStore.ts +4 -2
- package/client/src/stores/mdTuneupStore.ts +10 -5
- package/client/src/stores/notificationChannelsStore.ts +21 -11
- package/client/src/stores/planGenesisStore.ts +67 -0
- package/client/src/stores/recallStore.ts +6 -0
- package/client/src/stores/terminalStore.ts +1 -1
- package/client/src/styles/global.css +72 -0
- package/client/src/styles/matrix.css +7 -0
- package/client/src/themes/apply.ts +3 -3
- package/client/src/themes/bootstrap.ts +3 -0
- package/client/src/utils/activeProject.ts +6 -0
- package/client/src/utils/activityPresentation.ts +51 -0
- package/client/src/utils/browserFamily.ts +22 -0
- package/client/src/utils/chatFileLinks.ts +3 -2
- package/client/src/utils/chatText.ts +14 -6
- package/client/src/utils/checkedJson.ts +11 -0
- package/client/src/utils/checkpointChanges.ts +18 -0
- package/client/src/utils/clusterCreation.ts +39 -0
- package/client/src/utils/clusterNudge.ts +31 -0
- package/client/src/utils/displayMessages.ts +45 -7
- package/client/src/utils/effortDefaults.ts +4 -3
- package/client/src/utils/format.ts +11 -4
- package/client/src/utils/gateArgs.ts +3 -2
- package/client/src/utils/handoffSeeds.ts +13 -0
- package/client/src/utils/historyEvents.ts +21 -12
- package/client/src/utils/homeModel.ts +19 -3
- package/client/src/utils/memberReviewScope.ts +6 -0
- package/client/src/utils/outputNavigation.ts +16 -0
- package/client/src/utils/outputStyleText.ts +8 -0
- package/client/src/utils/publicProject.ts +102 -28
- package/client/src/utils/queuedMessageEdit.ts +40 -0
- package/client/src/utils/requestGeneration.ts +8 -0
- package/client/src/utils/rewindSupport.ts +17 -0
- package/client/src/utils/settingsRequests.ts +36 -0
- package/client/src/utils/settingsResponse.ts +8 -0
- package/client/src/utils/wsSession.ts +12 -5
- package/client/src/vendor/odysseus-editor/editor/clipboard-and-drop.js +9 -9
- package/client/src/vendor/odysseus-editor/editor/keyboard-shortcuts.js +2 -2
- package/client/src/vendor/odysseus-editor/editor/state.js +8 -0
- package/client/src/vendor/odysseus-editor/editor.css +13 -5
- package/client/src/vendor/odysseus-editor/galleryEditor.d.ts +1 -1
- package/client/src/vendor/odysseus-editor/galleryEditor.js +16 -5
- package/client/src/voice/executor.ts +4 -3
- package/client/src/voice/panels.ts +14 -3
- package/client/src/voice/screen.ts +48 -6
- package/client/src/voice/setupAudio.ts +5 -3
- package/client/src/ws/handleServerMessage.ts +154 -36
- package/client/src/ws/operatorQuestions.ts +2 -2
- package/docs/ARCHITECTURE.md +95 -55
- package/docs/ARCHITECTURE_REVIEW.md +47 -0
- package/docs/BACKUP.md +5 -2
- package/docs/CHAT.md +48 -37
- package/docs/CHECKPOINTS.md +43 -16
- package/docs/CLIENT.md +218 -82
- package/docs/CODEX_GPT56_CLUSTER_INCOMPAT.md +1 -1
- package/docs/DEEPSEEK.md +6 -6
- package/docs/DIAGNOSTICS.md +12 -7
- package/docs/EXTENDING.md +52 -48
- package/docs/FEATURES.md +33 -20
- package/docs/GENESIS.md +42 -6
- package/docs/GETTING_STARTED.md +59 -25
- package/docs/GIT_WORKBENCH.md +15 -9
- package/docs/GLOSSARY.md +42 -40
- package/docs/GOTCHAS.md +70 -57
- package/docs/HTTP_API.md +145 -47
- package/docs/INDEX.md +3 -4
- package/docs/KNOWLEDGE.md +6 -4
- package/docs/LOCAL_SERVICES.md +6 -6
- package/docs/LSP.md +4 -3
- package/docs/MCP_REGISTRY.md +16 -12
- package/docs/MEDIA_STUDIO.md +23 -16
- package/docs/NOTIFICATIONS.md +50 -17
- package/docs/OPERATIONS.md +211 -120
- package/docs/OPERATOR_ACTIONS.md +43 -24
- package/docs/OUTPUTS.md +27 -10
- package/docs/PERSISTENCE.md +88 -34
- package/docs/PHOSPHOR_DEMO.md +4 -4
- package/docs/PLAN_OR_BOARD.md +9 -4
- package/docs/PREVIEW_VERIFY.md +10 -8
- package/docs/PRIMITIVES.md +90 -87
- package/docs/PROTOCOL.md +100 -29
- package/docs/PROTOCOL_CLUSTER.md +77 -14
- package/docs/PROTOCOL_PRIMITIVES.md +9 -9
- package/docs/PROVIDERS.md +471 -82
- package/docs/RECALL.md +17 -12
- package/docs/REMOTE_MANAGEMENT.md +69 -8
- package/docs/REPO_LAYOUT.md +1 -1
- package/docs/RESUME_INDEX.md +16 -17
- package/docs/SERVICE_MODE.md +45 -10
- package/docs/SETTINGS.md +58 -7
- package/docs/STORAGE_PLAN.md +54 -49
- package/docs/STRATA.md +4 -4
- package/docs/TASK_LEDGER.md +33 -12
- package/docs/TERMINAL.md +14 -12
- package/docs/THIRD_PARTY.md +1 -3
- package/docs/VOICE.md +15 -7
- package/native/darwin-arm64/manifest.json +1 -1
- package/native/win32-arm64/manifest.json +1 -1
- package/node_modules/@arco/shared/dist/clusterCoordination.js +15 -7
- package/node_modules/@arco/shared/dist/clusterRolePresets.js +8 -6
- package/node_modules/@arco/shared/dist/codexChat.d.ts +2 -0
- package/node_modules/@arco/shared/dist/codexChat.js +5 -0
- package/node_modules/@arco/shared/dist/folderName.d.ts +1 -0
- package/node_modules/@arco/shared/dist/folderName.js +18 -0
- package/node_modules/@arco/shared/dist/index.d.ts +6 -0
- package/node_modules/@arco/shared/dist/index.js +6 -0
- package/node_modules/@arco/shared/dist/localRuntimeStatus.d.ts +23 -0
- package/node_modules/@arco/shared/dist/localRuntimeStatus.js +47 -0
- package/node_modules/@arco/shared/dist/notificationTitle.d.ts +9 -0
- package/node_modules/@arco/shared/dist/notificationTitle.js +23 -0
- package/node_modules/@arco/shared/dist/outputStyle.d.ts +10 -0
- package/node_modules/@arco/shared/dist/outputStyle.js +28 -0
- package/node_modules/@arco/shared/dist/outputs.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +2 -0
- package/node_modules/@arco/shared/dist/protocol/chat.d.ts +4 -0
- package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +24 -2
- package/node_modules/@arco/shared/dist/protocol/checkpoints.js +1 -0
- package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +9 -14
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +21 -4
- package/node_modules/@arco/shared/dist/protocol/clusters.js +3 -3
- package/node_modules/@arco/shared/dist/protocol/connections.d.ts +2 -0
- package/node_modules/@arco/shared/dist/protocol/diagnostics.js +1 -1
- package/node_modules/@arco/shared/dist/protocol/genesis.d.ts +9 -0
- package/node_modules/@arco/shared/dist/protocol/mcp.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/mcp.js +8 -5
- package/node_modules/@arco/shared/dist/protocol/mdTuneup.d.ts +2 -0
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +3 -1
- package/node_modules/@arco/shared/dist/protocol/models.js +19 -8
- package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/notifications.js +15 -3
- package/node_modules/@arco/shared/dist/protocol/plans.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/remoteManagement.d.ts +6 -0
- package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +69 -10
- package/node_modules/@arco/shared/dist/protocol/settings.d.ts +16 -4
- package/node_modules/@arco/shared/dist/protocol/settings.js +17 -1
- package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/usage.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/workers.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +73 -14
- package/node_modules/@arco/shared/dist/protocol/workflows.js +66 -0
- package/node_modules/@arco/shared/dist/publicGuardrails.d.ts +1 -1
- package/node_modules/@arco/shared/dist/publicGuardrails.js +1 -1
- package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +2 -0
- package/node_modules/@arco/shared/dist/runtimeVersions.js +13 -0
- package/node_modules/@arco/shared/dist/shellTool.d.ts +2 -0
- package/node_modules/@arco/shared/dist/shellTool.js +9 -0
- package/node_modules/@arco/shared/package.json +1 -1
- package/node_modules/xlsx/LICENSE +201 -0
- package/node_modules/xlsx/dist/cpexcel.js +1506 -0
- package/node_modules/xlsx/package.json +69 -0
- package/node_modules/xlsx/xlsx.js +28103 -0
- package/node_modules/xlsx/xlsx.mjs +28228 -0
- package/package.json +22 -3
- package/scripts/packaging/arco.mjs +3 -3
- package/scripts/packaging/browsers.mjs +366 -0
- package/scripts/packaging/launch.mjs +34 -20
- package/scripts/packaging/services.mjs +1 -1
- package/scripts/packaging/storage.mjs +39 -3
- package/server/dist/appBrowsers.d.ts +45 -0
- package/server/dist/appBrowsers.js +73 -0
- package/server/dist/architectureReview.d.ts +60 -0
- package/server/dist/architectureReview.js +347 -0
- package/server/dist/architectureSkill.d.ts +8 -0
- package/server/dist/architectureSkill.js +70 -0
- package/server/dist/arcoHome.d.ts +1 -0
- package/server/dist/arcoHome.js +43 -3
- package/server/dist/artifactCopy.d.ts +3 -0
- package/server/dist/artifactCopy.js +113 -36
- package/server/dist/atomicFile.d.ts +1 -1
- package/server/dist/atomicFile.js +6 -1
- package/server/dist/attention.d.ts +5 -1
- package/server/dist/attention.js +27 -16
- package/server/dist/auth.d.ts +1 -0
- package/server/dist/auth.js +19 -6
- package/server/dist/authLoginSession.d.ts +2 -0
- package/server/dist/authLoginSession.js +6 -1
- package/server/dist/boundedRead.d.ts +26 -0
- package/server/dist/boundedRead.js +246 -0
- package/server/dist/capabilities.d.ts +4 -1
- package/server/dist/capabilities.js +25 -8
- package/server/dist/catchUp.d.ts +7 -0
- package/server/dist/catchUp.js +20 -1
- package/server/dist/checkedFile.d.ts +5 -0
- package/server/dist/checkedFile.js +138 -0
- package/server/dist/claudeTransport.d.ts +7 -0
- package/server/dist/claudeTransport.js +14 -0
- package/server/dist/clusterAutoTurn.d.ts +7 -0
- package/server/dist/clusterAutoTurn.js +54 -7
- package/server/dist/clusterBusyReminder.d.ts +7 -0
- package/server/dist/clusterBusyReminder.js +45 -0
- package/server/dist/clusterDirector.js +6 -3
- package/server/dist/clusterIdleNudger.d.ts +6 -0
- package/server/dist/clusterIdleNudger.js +5 -0
- package/server/dist/clusterMailbox.d.ts +4 -2
- package/server/dist/clusterMailbox.js +104 -24
- package/server/dist/clusterPeerOps.js +9 -21
- package/server/dist/clusterPlanBridge.d.ts +6 -3
- package/server/dist/clusterPlanBridge.js +48 -45
- package/server/dist/clusterPresets.js +46 -32
- package/server/dist/clusterProgress.js +3 -0
- package/server/dist/clusterSnapshots.d.ts +1 -1
- package/server/dist/clusterSnapshots.js +17 -2
- package/server/dist/clusterStore.d.ts +3 -0
- package/server/dist/clusterStore.js +23 -13
- package/server/dist/clusterTurnTools.d.ts +4 -0
- package/server/dist/clusterTurnTools.js +9 -0
- package/server/dist/commandShell.d.ts +56 -0
- package/server/dist/commandShell.js +278 -0
- package/server/dist/compactionCounter.d.ts +6 -0
- package/server/dist/compactionCounter.js +73 -0
- package/server/dist/compactionReport.d.ts +8 -0
- package/server/dist/compactionReport.js +15 -0
- package/server/dist/contentSearch.js +16 -6
- package/server/dist/contextCalibrator.js +7 -2
- package/server/dist/contextEstimator.d.ts +4 -0
- package/server/dist/contextEstimator.js +76 -17
- package/server/dist/contextRefs.d.ts +1 -0
- package/server/dist/contextRefs.js +44 -9
- package/server/dist/conversationActivity.d.ts +3 -0
- package/server/dist/conversationActivity.js +27 -0
- package/server/dist/cursorUsage.js +15 -4
- package/server/dist/diagnostics/checks.js +4 -12
- package/server/dist/diagnostics/executableLookup.d.ts +2 -0
- package/server/dist/diagnostics/executableLookup.js +28 -0
- package/server/dist/diagnostics/modelHealth.js +3 -12
- package/server/dist/diagnostics/supportBundle.js +5 -13
- package/server/dist/eventLog.d.ts +19 -0
- package/server/dist/eventLog.js +299 -99
- package/server/dist/existingClusterMembers.d.ts +1 -0
- package/server/dist/existingClusterMembers.js +9 -0
- package/server/dist/explorerArtifacts.js +46 -12
- package/server/dist/explorerChanged.d.ts +7 -0
- package/server/dist/explorerChanged.js +116 -80
- package/server/dist/explorerDocs.d.ts +11 -0
- package/server/dist/explorerDocs.js +46 -48
- package/server/dist/explorerLaunch.d.ts +4 -0
- package/server/dist/explorerLaunch.js +9 -1
- package/server/dist/fileAccessPolicy.d.ts +21 -0
- package/server/dist/fileAccessPolicy.js +89 -1
- package/server/dist/fileContent/decodeSlots.d.ts +1 -0
- package/server/dist/fileContent/decodeSlots.js +50 -0
- package/server/dist/fileContent/detect.d.ts +2 -0
- package/server/dist/fileContent/detect.js +55 -0
- package/server/dist/fileContent/externalImage.d.ts +3 -0
- package/server/dist/fileContent/externalImage.js +68 -0
- package/server/dist/fileContent/icons.d.ts +4 -0
- package/server/dist/fileContent/icons.js +58 -0
- package/server/dist/fileContent/images.d.ts +15 -0
- package/server/dist/fileContent/images.js +182 -0
- package/server/dist/fileContent/legacyText.d.ts +3 -0
- package/server/dist/fileContent/legacyText.js +19 -0
- package/server/dist/fileContent/notebook.d.ts +2 -0
- package/server/dist/fileContent/notebook.js +54 -0
- package/server/dist/fileContent/office.d.ts +3 -0
- package/server/dist/fileContent/office.js +349 -0
- package/server/dist/fileContent/pdf.d.ts +2 -0
- package/server/dist/fileContent/pdf.js +76 -0
- package/server/dist/fileContent/pngRows.d.ts +4 -0
- package/server/dist/fileContent/pngRows.js +118 -0
- package/server/dist/fileContent/svg.d.ts +3 -0
- package/server/dist/fileContent/svg.js +60 -0
- package/server/dist/fileContent/types.d.ts +8 -0
- package/server/dist/fileContent/types.js +43 -0
- package/server/dist/fileContent/worker.d.ts +1 -0
- package/server/dist/fileContent/worker.js +68 -0
- package/server/dist/fileContent.d.ts +55 -0
- package/server/dist/fileContent.js +81 -0
- package/server/dist/fileContextReceipts.d.ts +12 -0
- package/server/dist/fileContextReceipts.js +53 -0
- package/server/dist/fileFetch.d.ts +17 -0
- package/server/dist/fileFetch.js +191 -0
- package/server/dist/fileVersion.d.ts +10 -0
- package/server/dist/fileVersion.js +43 -0
- package/server/dist/genesis/creative.js +28 -36
- package/server/dist/genesis/prompts.js +4 -0
- package/server/dist/genesis/savePlan.d.ts +5 -0
- package/server/dist/genesis/savePlan.js +49 -0
- package/server/dist/genesis/stages.js +4 -4
- package/server/dist/gitDiff.js +25 -5
- package/server/dist/gitSnapshots.d.ts +18 -0
- package/server/dist/gitSnapshots.js +280 -149
- package/server/dist/gitWorking.js +15 -13
- package/server/dist/github.js +5 -1
- package/server/dist/goalRun.d.ts +1 -1
- package/server/dist/goalRun.js +7 -5
- package/server/dist/handoffHistory.d.ts +26 -0
- package/server/dist/handoffHistory.js +80 -0
- package/server/dist/handoffHistoryProtocol.d.ts +59 -0
- package/server/dist/handoffHistoryProtocol.js +20 -0
- package/server/dist/handoffHistorySupport.d.ts +2 -0
- package/server/dist/handoffHistorySupport.js +11 -0
- package/server/dist/handoffHistoryTool.d.ts +29 -0
- package/server/dist/handoffHistoryTool.js +235 -0
- package/server/dist/handoffPrompts.js +6 -4
- package/server/dist/handoffReplay.d.ts +9 -0
- package/server/dist/handoffReplay.js +14 -0
- package/server/dist/handoffSeedCache.d.ts +3 -0
- package/server/dist/handoffSeedCache.js +26 -0
- package/server/dist/http/appBrowserRoutes.d.ts +3 -0
- package/server/dist/http/appBrowserRoutes.js +16 -0
- package/server/dist/http/architectureReviewRoutes.d.ts +3 -0
- package/server/dist/http/architectureReviewRoutes.js +117 -0
- package/server/dist/http/clusterRoutes.js +13 -1
- package/server/dist/http/clusterSnapshotRoutes.js +8 -3
- package/server/dist/http/connectionsRoutes.js +3 -1
- package/server/dist/http/diffRoutes.js +37 -3
- package/server/dist/http/explorerRoot.d.ts +3 -0
- package/server/dist/http/explorerRoot.js +22 -0
- package/server/dist/http/explorerRoutes.js +65 -12
- package/server/dist/http/fileRead.js +2 -3
- package/server/dist/http/fileWriteRoutes.js +4 -3
- package/server/dist/http/gitCompareRoutes.js +4 -6
- package/server/dist/http/gitDiffRoutes.js +3 -3
- package/server/dist/http/gitOpRoutes.js +3 -5
- package/server/dist/http/gitWorktreeRoutes.js +3 -3
- package/server/dist/http/handoffHistoryRoutes.d.ts +4 -0
- package/server/dist/http/handoffHistoryRoutes.js +59 -0
- package/server/dist/http/imageWriteRoutes.js +6 -2
- package/server/dist/http/knowledgeRoutes.js +2 -0
- package/server/dist/http/mediaOpsRoutes.js +2 -3
- package/server/dist/http/originGuard.d.ts +1 -1
- package/server/dist/http/originGuard.js +95 -12
- package/server/dist/http/outputRoutes.js +31 -6
- package/server/dist/http/projectBinding.d.ts +3 -0
- package/server/dist/http/projectBinding.js +133 -0
- package/server/dist/http/providerThrottleRoutes.d.ts +8 -0
- package/server/dist/http/providerThrottleRoutes.js +96 -0
- package/server/dist/http/publicProjectRoutes.js +50 -9
- package/server/dist/http/readConfinement.d.ts +2 -1
- package/server/dist/http/readConfinement.js +17 -15
- package/server/dist/http/router.js +224 -62
- package/server/dist/http/searchRoutes.js +4 -4
- package/server/dist/http/sessionTransport.d.ts +2 -0
- package/server/dist/http/sessionTransport.js +32 -0
- package/server/dist/http/skillManagementRoutes.d.ts +5 -0
- package/server/dist/http/skillManagementRoutes.js +166 -0
- package/server/dist/http/storageRoutes.js +20 -6
- package/server/dist/http/utilityAgentRoutes.js +27 -5
- package/server/dist/http/workflowDataRoutes.js +75 -14
- package/server/dist/http/writeConfinement.d.ts +5 -3
- package/server/dist/http/writeConfinement.js +37 -11
- package/server/dist/http/wsAuth.d.ts +3 -2
- package/server/dist/http/wsAuth.js +26 -8
- package/server/dist/imageTokens.d.ts +7 -0
- package/server/dist/imageTokens.js +85 -0
- package/server/dist/index.js +283 -178
- package/server/dist/inputDeliveryHistory.d.ts +21 -0
- package/server/dist/inputDeliveryHistory.js +146 -0
- package/server/dist/keepStore.d.ts +4 -0
- package/server/dist/keepStore.js +48 -0
- package/server/dist/knowledge/store.js +28 -20
- package/server/dist/legacyTarRestore.d.ts +1 -0
- package/server/dist/legacyTarRestore.js +240 -0
- package/server/dist/llamacppCatalog.d.ts +8 -1
- package/server/dist/llamacppCatalog.js +65 -13
- package/server/dist/localRuntimeStatus.d.ts +35 -0
- package/server/dist/localRuntimeStatus.js +136 -0
- package/server/dist/lsp/client.js +28 -9
- package/server/dist/lsp/servers.js +2 -2
- package/server/dist/managedPath.d.ts +2 -0
- package/server/dist/managedPath.js +47 -0
- package/server/dist/management/hubGuard.d.ts +23 -0
- package/server/dist/management/hubGuard.js +118 -0
- package/server/dist/management/hubLink.d.ts +4 -1
- package/server/dist/management/hubLink.js +8 -1
- package/server/dist/management/initHubLink.d.ts +12 -0
- package/server/dist/management/initHubLink.js +44 -22
- package/server/dist/manualCompactCapability.d.ts +2 -0
- package/server/dist/manualCompactCapability.js +7 -0
- package/server/dist/mcp/arcoMcpServer.js +4 -0
- package/server/dist/mcp/client.d.ts +4 -4
- package/server/dist/mcp/client.js +31 -10
- package/server/dist/mcp/clusterMcpLoopback.d.ts +4 -0
- package/server/dist/mcp/clusterMcpLoopback.js +21 -1
- package/server/dist/mcp/clusterMcpTools.js +25 -26
- package/server/dist/mcp/fileContent.d.ts +8 -0
- package/server/dist/mcp/fileContent.js +55 -0
- package/server/dist/mcp/fileMcpServer.d.ts +1 -0
- package/server/dist/mcp/fileMcpServer.js +13 -0
- package/server/dist/mcp/fileMcpTools.d.ts +2 -0
- package/server/dist/mcp/fileMcpTools.js +54 -0
- package/server/dist/mcp/handoffHistoryMcpTools.d.ts +3 -0
- package/server/dist/mcp/handoffHistoryMcpTools.js +27 -0
- package/server/dist/mcp/mcpConfigWriter.d.ts +5 -0
- package/server/dist/mcp/mcpConfigWriter.js +44 -12
- package/server/dist/mcp/planMcpTools.d.ts +6 -14
- package/server/dist/mcp/planMcpTools.js +6 -250
- package/server/dist/mcp/planReadMcpServer.d.ts +1 -0
- package/server/dist/mcp/planReadMcpServer.js +19 -0
- package/server/dist/mcp/registry.js +44 -38
- package/server/dist/mcp/registryWiring.js +4 -5
- package/server/dist/media/demucs.d.ts +5 -0
- package/server/dist/media/demucs.js +16 -4
- package/server/dist/media/ffmpeg.js +24 -16
- package/server/dist/media/scratch.js +24 -9
- package/server/dist/noticeSource.d.ts +2 -0
- package/server/dist/noticeSource.js +11 -0
- package/server/dist/notifications.d.ts +1 -0
- package/server/dist/notifications.js +7 -3
- package/server/dist/npmPlatformResolve.d.ts +9 -3
- package/server/dist/npmPlatformResolve.js +24 -5
- package/server/dist/ntfyTransport.d.ts +2 -1
- package/server/dist/ntfyTransport.js +15 -4
- package/server/dist/outputGrants.d.ts +9 -0
- package/server/dist/outputGrants.js +63 -0
- package/server/dist/outputs.js +78 -13
- package/server/dist/peerRecipientContext.js +22 -5
- package/server/dist/planStore.d.ts +11 -2
- package/server/dist/planStore.js +236 -64
- package/server/dist/planTools.d.ts +41 -0
- package/server/dist/planTools.js +259 -0
- package/server/dist/previewAutoDetect.js +31 -23
- package/server/dist/previewPortConfiguration.d.ts +2 -0
- package/server/dist/previewPortConfiguration.js +32 -0
- package/server/dist/previewPorts.d.ts +1 -0
- package/server/dist/previewPorts.js +3 -0
- package/server/dist/previewProxy.d.ts +30 -9
- package/server/dist/previewProxy.js +226 -183
- package/server/dist/primaryBackgroundTracker.d.ts +15 -2
- package/server/dist/primaryBackgroundTracker.js +172 -63
- package/server/dist/primitives/exportContext.d.ts +3 -0
- package/server/dist/primitives/exportContext.js +77 -15
- package/server/dist/primitives/localFileContext.d.ts +3 -0
- package/server/dist/primitives/localFileContext.js +38 -0
- package/server/dist/primitives/reviewContent.d.ts +2 -0
- package/server/dist/primitives/reviewContent.js +53 -6
- package/server/dist/primitives/runCompare.js +1 -1
- package/server/dist/primitives/runDocEdit.js +1 -1
- package/server/dist/primitives/runMdTuneup.d.ts +2 -1
- package/server/dist/primitives/runMdTuneup.js +20 -34
- package/server/dist/primitives/runResearch.js +1 -1
- package/server/dist/primitives/runReviewer.d.ts +2 -0
- package/server/dist/primitives/runReviewer.js +5 -2
- package/server/dist/primitives/seedWorker.d.ts +11 -2
- package/server/dist/primitives/seedWorker.js +26 -12
- package/server/dist/project/orchestrationProposals.d.ts +1 -0
- package/server/dist/project/orchestrationProposals.js +5 -1
- package/server/dist/project/taskLedger.d.ts +1 -0
- package/server/dist/project/taskLedger.js +17 -11
- package/server/dist/projectGlob.d.ts +1 -0
- package/server/dist/projectGlob.js +9 -0
- package/server/dist/projectIgnore.d.ts +1 -0
- package/server/dist/projectIgnore.js +24 -0
- package/server/dist/projectScan.d.ts +24 -0
- package/server/dist/projectScan.js +101 -0
- package/server/dist/projectStateIgnore.d.ts +13 -0
- package/server/dist/projectStateIgnore.js +36 -1
- package/server/dist/projects.d.ts +11 -3
- package/server/dist/projects.js +141 -40
- package/server/dist/prompts.js +7 -8
- package/server/dist/proportionateTestingSkill.d.ts +7 -0
- package/server/dist/proportionateTestingSkill.js +32 -0
- package/server/dist/providers/attachmentLabels.d.ts +4 -0
- package/server/dist/providers/attachmentLabels.js +9 -0
- package/server/dist/providers/attachments.d.ts +1 -3
- package/server/dist/providers/attachments.js +58 -173
- package/server/dist/providers/claude-native/apiEndpoint.d.ts +2 -0
- package/server/dist/providers/claude-native/apiEndpoint.js +8 -0
- package/server/dist/providers/claude-native/appendOnlyPrefix.js +21 -1
- package/server/dist/providers/claude-native/catalog.js +17 -15
- package/server/dist/providers/claude-native/contentBlocks.d.ts +22 -2
- package/server/dist/providers/claude-native/contentBlocks.js +31 -8
- package/server/dist/providers/claude-native/contextBudget.d.ts +0 -4
- package/server/dist/providers/claude-native/contextBudget.js +0 -2
- package/server/dist/providers/claude-native/editApply.js +6 -1
- package/server/dist/providers/claude-native/fileContent.d.ts +15 -0
- package/server/dist/providers/claude-native/fileContent.js +120 -0
- package/server/dist/providers/claude-native/filterConfigs/bash-cargo-test.js +2 -0
- package/server/dist/providers/claude-native/filterConfigs/bash-jest-vitest.js +2 -0
- package/server/dist/providers/claude-native/filterConfigs/bash-pytest.js +2 -0
- package/server/dist/providers/claude-native/filterConfigs/index.js +2 -1
- package/server/dist/providers/claude-native/foldDigest.js +10 -2
- package/server/dist/providers/claude-native/gateReview.d.ts +1 -1
- package/server/dist/providers/claude-native/gateReview.js +0 -0
- package/server/dist/providers/claude-native/hookIf.d.ts +28 -0
- package/server/dist/providers/claude-native/hookIf.js +590 -0
- package/server/dist/providers/claude-native/hooks.d.ts +77 -7
- package/server/dist/providers/claude-native/hooks.js +344 -52
- package/server/dist/providers/claude-native/imageRead.d.ts +15 -0
- package/server/dist/providers/claude-native/imageRead.js +108 -0
- package/server/dist/providers/claude-native/index.d.ts +4 -1
- package/server/dist/providers/claude-native/index.js +32 -2
- package/server/dist/providers/claude-native/mediaLimits.d.ts +6 -0
- package/server/dist/providers/claude-native/mediaLimits.js +15 -0
- package/server/dist/providers/claude-native/mediaRetention.d.ts +11 -0
- package/server/dist/providers/claude-native/mediaRetention.js +66 -0
- package/server/dist/providers/claude-native/mediaRetirementNotice.d.ts +1 -0
- package/server/dist/providers/claude-native/mediaRetirementNotice.js +12 -0
- package/server/dist/providers/claude-native/modelParams.d.ts +6 -0
- package/server/dist/providers/claude-native/modelParams.js +21 -3
- package/server/dist/providers/claude-native/oauth.js +9 -8
- package/server/dist/providers/claude-native/outputAccumulator.d.ts +2 -0
- package/server/dist/providers/claude-native/outputAccumulator.js +29 -18
- package/server/dist/providers/claude-native/peerTools.js +3 -158
- package/server/dist/providers/claude-native/pretoolGuards.js +92 -9
- package/server/dist/providers/claude-native/registryTools.js +4 -2
- package/server/dist/providers/claude-native/resumeSummary.d.ts +23 -2
- package/server/dist/providers/claude-native/resumeSummary.js +135 -28
- package/server/dist/providers/claude-native/sandboxExecutor.js +26 -19
- package/server/dist/providers/claude-native/taskAdmission.d.ts +21 -0
- package/server/dist/providers/claude-native/taskAdmission.js +75 -0
- package/server/dist/providers/claude-native/toolChecks.d.ts +38 -0
- package/server/dist/providers/claude-native/toolChecks.js +96 -0
- package/server/dist/providers/claude-native/toolPosture.js +5 -3
- package/server/dist/providers/claude-native/toolResultEviction.d.ts +4 -3
- package/server/dist/providers/claude-native/toolResultEviction.js +18 -29
- package/server/dist/providers/claude-native/tools.d.ts +17 -4
- package/server/dist/providers/claude-native/tools.js +248 -135
- package/server/dist/providers/claude-native/usageContext.d.ts +30 -0
- package/server/dist/providers/claude-native/usageContext.js +70 -0
- package/server/dist/providers/claude-native/wireFingerprint.d.ts +2 -2
- package/server/dist/providers/claude-native/wireFingerprint.js +2 -2
- package/server/dist/providers/claude-native/worker.d.ts +63 -1
- package/server/dist/providers/claude-native/worker.js +1103 -324
- package/server/dist/providers/claude-native/workerHelpers.d.ts +13 -0
- package/server/dist/providers/claude-native/workerHelpers.js +117 -6
- package/server/dist/providers/claude-native/workspaceFacts.js +2 -2
- package/server/dist/providers/claude.d.ts +1 -0
- package/server/dist/providers/claude.js +69 -85
- package/server/dist/providers/clusterTaskToolDefinitions.d.ts +11 -0
- package/server/dist/providers/clusterTaskToolDefinitions.js +161 -0
- package/server/dist/providers/codex-appserver/catalog.js +26 -20
- package/server/dist/providers/codex-appserver/index.js +10 -3
- package/server/dist/providers/codex-appserver/jsonRpc.d.ts +2 -1
- package/server/dist/providers/codex-appserver/jsonRpc.js +11 -3
- package/server/dist/providers/codex-appserver/worker.d.ts +5 -0
- package/server/dist/providers/codex-appserver/worker.js +119 -81
- package/server/dist/providers/codex.js +55 -58
- package/server/dist/providers/codexChatBoundary.d.ts +11 -0
- package/server/dist/providers/codexChatBoundary.js +60 -0
- package/server/dist/providers/codexCodeMode.js +2 -2
- package/server/dist/providers/codexContextWindow.js +2 -2
- package/server/dist/providers/codexHome.d.ts +1 -0
- package/server/dist/providers/codexHome.js +6 -0
- package/server/dist/providers/codexImageTool.d.ts +6 -0
- package/server/dist/providers/codexImageTool.js +21 -0
- package/server/dist/providers/codexVersion.d.ts +1 -0
- package/server/dist/providers/codexVersion.js +14 -0
- package/server/dist/providers/codexWebSearch.d.ts +2 -0
- package/server/dist/providers/codexWebSearch.js +4 -0
- package/server/dist/providers/cursor/acpJsonRpc.d.ts +1 -0
- package/server/dist/providers/cursor/acpJsonRpc.js +3 -1
- package/server/dist/providers/cursor/authState.d.ts +10 -0
- package/server/dist/providers/cursor/authState.js +78 -0
- package/server/dist/providers/cursor/catalog.js +22 -14
- package/server/dist/providers/cursor/chatSandbox.d.ts +11 -0
- package/server/dist/providers/cursor/chatSandbox.js +81 -0
- package/server/dist/providers/cursor/filePlugin.d.ts +4 -0
- package/server/dist/providers/cursor/filePlugin.js +31 -0
- package/server/dist/providers/cursor/index.d.ts +1 -0
- package/server/dist/providers/cursor/index.js +30 -4
- package/server/dist/providers/cursor/modelMap.d.ts +35 -0
- package/server/dist/providers/cursor/modelMap.js +180 -0
- package/server/dist/providers/cursor/print.js +95 -30
- package/server/dist/providers/cursor/worker.d.ts +4 -1
- package/server/dist/providers/cursor/worker.js +169 -89
- package/server/dist/providers/errorClassifier.js +6 -2
- package/server/dist/providers/handoffHistoryBinding.d.ts +11 -0
- package/server/dist/providers/handoffHistoryBinding.js +43 -0
- package/server/dist/providers/index.d.ts +1 -1
- package/server/dist/providers/index.js +10 -5
- package/server/dist/providers/llamacpp.d.ts +1 -0
- package/server/dist/providers/llamacpp.js +102 -192
- package/server/dist/providers/llamacppManager.d.ts +5 -0
- package/server/dist/providers/llamacppManager.js +68 -32
- package/server/dist/providers/llamacppVersion.d.ts +1 -0
- package/server/dist/providers/llamacppVersion.js +5 -0
- package/server/dist/providers/lmstudio.d.ts +3 -3
- package/server/dist/providers/lmstudio.js +133 -207
- package/server/dist/providers/localFileMedia.d.ts +25 -0
- package/server/dist/providers/localFileMedia.js +302 -0
- package/server/dist/providers/localMcp.d.ts +17 -0
- package/server/dist/providers/localMcp.js +85 -0
- package/server/dist/providers/localShellLifecycle.d.ts +7 -0
- package/server/dist/providers/localShellLifecycle.js +33 -0
- package/server/dist/providers/localToolDispatch.d.ts +28 -0
- package/server/dist/providers/localToolDispatch.js +90 -0
- package/server/dist/providers/ollama.d.ts +2 -1
- package/server/dist/providers/ollama.js +180 -181
- package/server/dist/providers/ollamaDurableCompaction.js +5 -4
- package/server/dist/providers/ollamaExecutionHistory.d.ts +1 -1
- package/server/dist/providers/ollamaExecutionHistory.js +55 -14
- package/server/dist/providers/ollamaFencedTools.js +10 -11
- package/server/dist/providers/ollamaResilience.js +9 -13
- package/server/dist/providers/ollamaTokens.js +3 -4
- package/server/dist/providers/ollamaToolSubset.d.ts +2 -0
- package/server/dist/providers/ollamaToolSubset.js +11 -40
- package/server/dist/providers/ollamaTools.d.ts +13 -0
- package/server/dist/providers/ollamaTools.js +225 -219
- package/server/dist/providers/outputStyle.d.ts +2 -1
- package/server/dist/providers/outputStyle.js +70 -76
- package/server/dist/providers/providerFileContent.d.ts +40 -0
- package/server/dist/providers/providerFileContent.js +151 -0
- package/server/dist/providers/renderedTranscript.d.ts +1 -0
- package/server/dist/providers/renderedTranscript.js +3 -0
- package/server/dist/providers/requestDeadline.d.ts +1 -0
- package/server/dist/providers/requestDeadline.js +26 -0
- package/server/dist/providers/sessionScope.d.ts +2 -0
- package/server/dist/providers/sessionScope.js +8 -0
- package/server/dist/providers/types.d.ts +1 -0
- package/server/dist/publicProject.d.ts +10 -2
- package/server/dist/publicProject.js +59 -13
- package/server/dist/publicProjectChoice.d.ts +4 -0
- package/server/dist/publicProjectChoice.js +46 -0
- package/server/dist/quota.d.ts +10 -7
- package/server/dist/quota.js +49 -19
- package/server/dist/recall/search.js +9 -32
- package/server/dist/recall/transcriptSearch.d.ts +4 -0
- package/server/dist/recall/transcriptSearch.js +29 -0
- package/server/dist/recentFilesLedger.js +9 -7
- package/server/dist/recentProjectActivity.d.ts +11 -0
- package/server/dist/recentProjectActivity.js +69 -0
- package/server/dist/scanDeadline.d.ts +4 -0
- package/server/dist/scanDeadline.js +48 -0
- package/server/dist/searchText.d.ts +1 -0
- package/server/dist/searchText.js +22 -0
- package/server/dist/server/broadcast.d.ts +2 -2
- package/server/dist/server/broadcast.js +130 -58
- package/server/dist/sessionJsonl.js +45 -19
- package/server/dist/settings.d.ts +6 -1
- package/server/dist/settings.js +183 -56
- package/server/dist/skillManagement.d.ts +125 -0
- package/server/dist/skillManagement.js +709 -0
- package/server/dist/skillMutation.d.ts +1 -0
- package/server/dist/skillMutation.js +6 -0
- package/server/dist/skills.d.ts +75 -1
- package/server/dist/skills.js +254 -75
- package/server/dist/smartPickup.d.ts +1 -0
- package/server/dist/smartPickup.js +2 -1
- package/server/dist/smartPickupAdapters.d.ts +1 -0
- package/server/dist/smartPickupAdapters.js +31 -8
- package/server/dist/storageActions.d.ts +2 -2
- package/server/dist/storageArchive.js +55 -24
- package/server/dist/storageRoot.d.ts +5 -0
- package/server/dist/storageRoot.js +38 -0
- package/server/dist/storageTurnWatch.d.ts +6 -0
- package/server/dist/storageTurnWatch.js +36 -0
- package/server/dist/taskDispatcher.js +69 -41
- package/server/dist/templates/store.js +75 -59
- package/server/dist/terminal/ptyManager.d.ts +3 -1
- package/server/dist/terminal/ptyManager.js +44 -37
- package/server/dist/terminal/ptyPidRegistry.d.ts +4 -2
- package/server/dist/terminal/ptyPidRegistry.js +9 -63
- package/server/dist/thirdPartySkills.d.ts +4 -0
- package/server/dist/thirdPartySkills.js +80 -0
- package/server/dist/toolPath.d.ts +1 -0
- package/server/dist/toolPath.js +38 -0
- package/server/dist/toolboxWorkflow.js +2 -1
- package/server/dist/uploadImages.d.ts +6 -0
- package/server/dist/uploadImages.js +155 -0
- package/server/dist/voice/computerContext.js +2 -0
- package/server/dist/voice/conditionSchema.d.ts +1 -0
- package/server/dist/voice/conditionSchema.js +3 -1
- package/server/dist/voice/conditions.js +1 -1
- package/server/dist/workers/StreamParser.d.ts +3 -0
- package/server/dist/workers/StreamParser.js +45 -11
- package/server/dist/workers/WorkerManager.d.ts +9 -2
- package/server/dist/workers/WorkerManager.js +18 -18
- package/server/dist/workers/durablePidRegistry.d.ts +53 -0
- package/server/dist/workers/durablePidRegistry.js +289 -0
- package/server/dist/workers/limits.js +1 -1
- package/server/dist/workers/pidRegistry.d.ts +6 -9
- package/server/dist/workers/pidRegistry.js +13 -101
- package/server/dist/workers/processActivity.d.ts +6 -0
- package/server/dist/workers/processActivity.js +13 -0
- package/server/dist/workers/processKill.d.ts +30 -0
- package/server/dist/workers/processKill.js +174 -0
- package/server/dist/workers/processStartTime.d.ts +21 -5
- package/server/dist/workers/processStartTime.js +127 -50
- package/server/dist/workflowMeta.d.ts +15 -12
- package/server/dist/workflowMeta.js +42 -10
- package/server/dist/workflowStore.d.ts +1 -0
- package/server/dist/workflowStore.js +194 -23
- package/server/dist/workflows/modelTitles.js +4 -3
- package/server/dist/workflows/sessionIndex.d.ts +2 -0
- package/server/dist/workflows/sessionIndex.js +24 -2
- package/server/dist/workflows/types.d.ts +15 -5
- package/server/dist/workspace.d.ts +1 -0
- package/server/dist/workspace.js +5 -0
- package/server/dist/ws/afterTurn.d.ts +9 -0
- package/server/dist/ws/afterTurn.js +25 -0
- package/server/dist/ws/clusterHandlers.d.ts +7 -2
- package/server/dist/ws/clusterHandlers.js +361 -407
- package/server/dist/ws/clusterMembers.d.ts +42 -0
- package/server/dist/ws/clusterMembers.js +165 -0
- package/server/dist/ws/compactHandlers.js +38 -28
- package/server/dist/ws/gateHandlers.js +2 -1
- package/server/dist/ws/genesisHandlers.js +171 -116
- package/server/dist/ws/handoffHandlers.d.ts +3 -1
- package/server/dist/ws/handoffHandlers.js +367 -196
- package/server/dist/ws/previewCaptureHandlers.js +1 -4
- package/server/dist/ws/taskLedgerHandlers.d.ts +6 -1
- package/server/dist/ws/taskLedgerHandlers.js +28 -12
- package/server/dist/ws/taskLifecycle.d.ts +15 -0
- package/server/dist/ws/taskLifecycle.js +39 -0
- package/server/dist/ws/turnEngine.d.ts +27 -8
- package/server/dist/ws/turnEngine.js +1790 -1637
- package/server/dist/ws/turnPrompt.d.ts +17 -0
- package/server/dist/ws/turnPrompt.js +47 -0
- package/server/dist/ws/turnSettings.d.ts +41 -0
- package/server/dist/ws/turnSettings.js +61 -0
- package/server/dist/ws/updatePrimaryConfig.js +63 -40
- package/server/dist/ws/workflowHandlers.d.ts +2 -1
- package/server/dist/ws/workflowHandlers.js +220 -180
- package/server/package.json +1 -1
- package/server/src/appBrowsers.ts +95 -0
- package/server/src/architectureReview.ts +327 -0
- package/server/src/architectureSkill.ts +71 -0
- package/server/src/arcoHome.ts +42 -3
- package/server/src/artifactCopy.ts +90 -24
- package/server/src/atomicFile.ts +6 -1
- package/server/src/attention.ts +24 -17
- package/server/src/auth.ts +20 -6
- package/server/src/authLoginSession.ts +7 -2
- package/server/src/boundedRead.ts +172 -0
- package/server/src/capabilities.ts +26 -9
- package/server/src/catchUp.ts +19 -2
- package/server/src/checkedFile.ts +90 -0
- package/server/src/claudeTransport.ts +14 -0
- package/server/src/clusterAutoTurn.ts +55 -7
- package/server/src/clusterBusyReminder.ts +45 -0
- package/server/src/clusterDirector.ts +6 -3
- package/server/src/clusterIdleNudger.ts +6 -0
- package/server/src/clusterMailbox.ts +96 -26
- package/server/src/clusterPeerOps.ts +6 -19
- package/server/src/clusterPlanBridge.ts +37 -45
- package/server/src/clusterPresets.ts +44 -31
- package/server/src/clusterProgress.ts +3 -0
- package/server/src/clusterSnapshots.ts +16 -2
- package/server/src/clusterStore.ts +25 -14
- package/server/src/clusterTurnTools.ts +11 -0
- package/server/src/commandShell.ts +287 -0
- package/server/src/compactionCounter.ts +69 -0
- package/server/src/compactionReport.ts +20 -0
- package/server/src/contentSearch.ts +8 -3
- package/server/src/contextCalibrator.ts +6 -1
- package/server/src/contextEstimator.ts +71 -16
- package/server/src/contextRefs.ts +41 -11
- package/server/src/conversationActivity.ts +26 -0
- package/server/src/cursorUsage.ts +13 -3
- package/server/src/diagnostics/checks.ts +4 -11
- package/server/src/diagnostics/executableLookup.ts +20 -0
- package/server/src/diagnostics/modelHealth.ts +3 -11
- package/server/src/diagnostics/supportBundle.ts +5 -13
- package/server/src/eventLog.ts +228 -81
- package/server/src/existingClusterMembers.ts +9 -0
- package/server/src/explorerArtifacts.ts +27 -10
- package/server/src/explorerChanged.ts +99 -67
- package/server/src/explorerDocs.ts +37 -31
- package/server/src/explorerLaunch.ts +10 -2
- package/server/src/fileAccessPolicy.ts +82 -1
- package/server/src/fileContent/decodeSlots.ts +31 -0
- package/server/src/fileContent/detect.ts +28 -0
- package/server/src/fileContent/externalImage.ts +49 -0
- package/server/src/fileContent/icons.ts +37 -0
- package/server/src/fileContent/images.ts +140 -0
- package/server/src/fileContent/legacyText.ts +16 -0
- package/server/src/fileContent/notebook.ts +37 -0
- package/server/src/fileContent/office.ts +234 -0
- package/server/src/fileContent/pdf.ts +59 -0
- package/server/src/fileContent/pngRows.ts +54 -0
- package/server/src/fileContent/svg.ts +42 -0
- package/server/src/fileContent/types.ts +39 -0
- package/server/src/fileContent/worker.ts +43 -0
- package/server/src/fileContent.ts +108 -0
- package/server/src/fileContextReceipts.ts +44 -0
- package/server/src/fileFetch.ts +167 -0
- package/server/src/fileVersion.ts +36 -0
- package/server/src/genesis/creative.ts +27 -33
- package/server/src/genesis/prompts.ts +3 -0
- package/server/src/genesis/savePlan.ts +45 -0
- package/server/src/genesis/stages.ts +4 -4
- package/server/src/gitDiff.ts +20 -5
- package/server/src/gitSnapshots.ts +288 -191
- package/server/src/gitWorking.ts +11 -11
- package/server/src/github.ts +3 -1
- package/server/src/goalRun.ts +7 -4
- package/server/src/handoffHistory.ts +89 -0
- package/server/src/handoffHistoryProtocol.ts +20 -0
- package/server/src/handoffHistorySupport.ts +10 -0
- package/server/src/handoffHistoryTool.ts +192 -0
- package/server/src/handoffPrompts.ts +6 -4
- package/server/src/handoffReplay.ts +20 -0
- package/server/src/handoffSeedCache.ts +22 -0
- package/server/src/http/appBrowserRoutes.ts +17 -0
- package/server/src/http/architectureReviewRoutes.ts +86 -0
- package/server/src/http/clusterRoutes.ts +13 -1
- package/server/src/http/clusterSnapshotRoutes.ts +8 -3
- package/server/src/http/connectionsRoutes.ts +5 -1
- package/server/src/http/diffRoutes.ts +36 -3
- package/server/src/http/explorerRoot.ts +20 -0
- package/server/src/http/explorerRoutes.ts +59 -12
- package/server/src/http/fileRead.ts +2 -1
- package/server/src/http/fileWriteRoutes.ts +3 -2
- package/server/src/http/gitCompareRoutes.ts +4 -5
- package/server/src/http/gitDiffRoutes.ts +3 -2
- package/server/src/http/gitOpRoutes.ts +3 -4
- package/server/src/http/gitWorktreeRoutes.ts +3 -2
- package/server/src/http/handoffHistoryRoutes.ts +42 -0
- package/server/src/http/imageWriteRoutes.ts +5 -1
- package/server/src/http/knowledgeRoutes.ts +2 -0
- package/server/src/http/mediaOpsRoutes.ts +2 -1
- package/server/src/http/originGuard.ts +71 -14
- package/server/src/http/outputRoutes.ts +26 -5
- package/server/src/http/projectBinding.ts +108 -0
- package/server/src/http/providerThrottleRoutes.ts +76 -0
- package/server/src/http/publicProjectRoutes.ts +40 -8
- package/server/src/http/readConfinement.ts +16 -9
- package/server/src/http/router.ts +173 -60
- package/server/src/http/searchRoutes.ts +4 -4
- package/server/src/http/sessionTransport.ts +27 -0
- package/server/src/http/skillManagementRoutes.ts +120 -0
- package/server/src/http/storageRoutes.ts +19 -6
- package/server/src/http/utilityAgentRoutes.ts +19 -5
- package/server/src/http/workflowDataRoutes.ts +68 -16
- package/server/src/http/writeConfinement.ts +31 -12
- package/server/src/http/wsAuth.ts +27 -9
- package/server/src/imageTokens.ts +60 -0
- package/server/src/index.ts +265 -178
- package/server/src/inputDeliveryHistory.ts +122 -0
- package/server/src/keepStore.ts +37 -0
- package/server/src/knowledge/store.ts +27 -19
- package/server/src/legacyTarRestore.ts +177 -0
- package/server/src/llamacppCatalog.ts +47 -12
- package/server/src/localRuntimeStatus.ts +121 -0
- package/server/src/lsp/client.ts +19 -11
- package/server/src/lsp/servers.ts +2 -2
- package/server/src/managedPath.ts +38 -0
- package/server/src/management/hubGuard.ts +135 -0
- package/server/src/management/hubLink.ts +8 -2
- package/server/src/management/initHubLink.ts +45 -37
- package/server/src/manualCompactCapability.ts +8 -0
- package/server/src/mcp/arcoMcpServer.ts +4 -0
- package/server/src/mcp/client.ts +28 -11
- package/server/src/mcp/clusterMcpLoopback.ts +27 -1
- package/server/src/mcp/clusterMcpTools.ts +24 -25
- package/server/src/mcp/fileContent.ts +34 -0
- package/server/src/mcp/fileMcpServer.ts +12 -0
- package/server/src/mcp/fileMcpTools.ts +51 -0
- package/server/src/mcp/handoffHistoryMcpTools.ts +21 -0
- package/server/src/mcp/mcpConfigWriter.ts +43 -12
- package/server/src/mcp/planMcpTools.ts +9 -285
- package/server/src/mcp/planReadMcpServer.ts +19 -0
- package/server/src/mcp/registry.ts +41 -35
- package/server/src/mcp/registryWiring.ts +4 -5
- package/server/src/media/demucs.ts +11 -4
- package/server/src/media/ffmpeg.ts +21 -16
- package/server/src/media/scratch.ts +17 -10
- package/server/src/noticeSource.ts +11 -0
- package/server/src/notifications.ts +8 -4
- package/server/src/npmPlatformResolve.ts +25 -8
- package/server/src/ntfyTransport.ts +12 -4
- package/server/src/outputGrants.ts +53 -0
- package/server/src/outputs.ts +54 -11
- package/server/src/peerRecipientContext.ts +16 -5
- package/server/src/planStore.ts +201 -55
- package/server/src/planTools.ts +303 -0
- package/server/src/previewAutoDetect.ts +26 -19
- package/server/src/previewPortConfiguration.ts +28 -0
- package/server/src/previewPorts.ts +2 -0
- package/server/src/previewProxy.ts +156 -189
- package/server/src/primaryBackgroundTracker.ts +151 -61
- package/server/src/primitives/exportContext.ts +67 -16
- package/server/src/primitives/localFileContext.ts +31 -0
- package/server/src/primitives/reviewContent.ts +42 -7
- package/server/src/primitives/runCompare.ts +1 -1
- package/server/src/primitives/runDocEdit.ts +1 -1
- package/server/src/primitives/runMdTuneup.ts +17 -27
- package/server/src/primitives/runResearch.ts +1 -1
- package/server/src/primitives/runReviewer.ts +6 -2
- package/server/src/primitives/seedWorker.ts +36 -17
- package/server/src/project/orchestrationProposals.ts +6 -1
- package/server/src/project/taskLedger.ts +17 -11
- package/server/src/projectGlob.ts +9 -0
- package/server/src/projectIgnore.ts +19 -0
- package/server/src/projectScan.ts +76 -0
- package/server/src/projectStateIgnore.ts +40 -1
- package/server/src/projects.ts +114 -36
- package/server/src/prompts.ts +5 -8
- package/server/src/proportionateTestingSkill.ts +31 -0
- package/server/src/providers/attachmentLabels.ts +8 -0
- package/server/src/providers/attachments.ts +52 -174
- package/server/src/providers/claude-native/apiEndpoint.ts +9 -0
- package/server/src/providers/claude-native/appendOnlyPrefix.ts +17 -1
- package/server/src/providers/claude-native/catalog.ts +16 -14
- package/server/src/providers/claude-native/contentBlocks.ts +39 -8
- package/server/src/providers/claude-native/contextBudget.ts +0 -6
- package/server/src/providers/claude-native/editApply.ts +6 -1
- package/server/src/providers/claude-native/fileContent.ts +98 -0
- package/server/src/providers/claude-native/filterConfigs/bash-cargo-test.ts +1 -0
- package/server/src/providers/claude-native/filterConfigs/bash-jest-vitest.ts +1 -0
- package/server/src/providers/claude-native/filterConfigs/bash-pytest.ts +1 -0
- package/server/src/providers/claude-native/filterConfigs/index.ts +2 -1
- package/server/src/providers/claude-native/foldDigest.ts +9 -2
- package/server/src/providers/claude-native/gateReview.ts +0 -0
- package/server/src/providers/claude-native/hookIf.ts +414 -0
- package/server/src/providers/claude-native/hooks.ts +398 -54
- package/server/src/providers/claude-native/imageRead.ts +92 -0
- package/server/src/providers/claude-native/index.ts +32 -1
- package/server/src/providers/claude-native/mediaLimits.ts +14 -0
- package/server/src/providers/claude-native/mediaRetention.ts +49 -0
- package/server/src/providers/claude-native/mediaRetirementNotice.ts +8 -0
- package/server/src/providers/claude-native/modelParams.ts +23 -2
- package/server/src/providers/claude-native/oauth.ts +9 -8
- package/server/src/providers/claude-native/outputAccumulator.ts +29 -17
- package/server/src/providers/claude-native/peerTools.ts +3 -169
- package/server/src/providers/claude-native/pretoolGuards.ts +76 -9
- package/server/src/providers/claude-native/registryTools.ts +4 -2
- package/server/src/providers/claude-native/resumeSummary.ts +138 -28
- package/server/src/providers/claude-native/sandboxExecutor.ts +24 -16
- package/server/src/providers/claude-native/taskAdmission.ts +62 -0
- package/server/src/providers/claude-native/toolChecks.ts +127 -0
- package/server/src/providers/claude-native/toolPosture.ts +5 -3
- package/server/src/providers/claude-native/toolResultEviction.ts +17 -7
- package/server/src/providers/claude-native/tools.ts +228 -130
- package/server/src/providers/claude-native/usageContext.ts +93 -0
- package/server/src/providers/claude-native/wireFingerprint.ts +2 -2
- package/server/src/providers/claude-native/worker.ts +1056 -334
- package/server/src/providers/claude-native/workerHelpers.ts +133 -6
- package/server/src/providers/claude-native/workspaceFacts.ts +2 -2
- package/server/src/providers/claude.ts +65 -93
- package/server/src/providers/clusterTaskToolDefinitions.ts +180 -0
- package/server/src/providers/codex-appserver/catalog.ts +26 -19
- package/server/src/providers/codex-appserver/index.ts +8 -3
- package/server/src/providers/codex-appserver/jsonRpc.ts +9 -2
- package/server/src/providers/codex-appserver/worker.ts +108 -77
- package/server/src/providers/codex.ts +49 -57
- package/server/src/providers/codexChatBoundary.ts +55 -0
- package/server/src/providers/codexCodeMode.ts +2 -2
- package/server/src/providers/codexContextWindow.ts +2 -2
- package/server/src/providers/codexHome.ts +6 -0
- package/server/src/providers/codexImageTool.ts +22 -0
- package/server/src/providers/codexVersion.ts +13 -0
- package/server/src/providers/codexWebSearch.ts +5 -0
- package/server/src/providers/cursor/acpJsonRpc.ts +3 -1
- package/server/src/providers/cursor/authState.ts +72 -0
- package/server/src/providers/cursor/catalog.ts +20 -13
- package/server/src/providers/cursor/chatSandbox.ts +71 -0
- package/server/src/providers/cursor/filePlugin.ts +27 -0
- package/server/src/providers/cursor/index.ts +29 -4
- package/server/src/providers/cursor/modelMap.ts +182 -0
- package/server/src/providers/cursor/print.ts +80 -27
- package/server/src/providers/cursor/worker.ts +156 -84
- package/server/src/providers/errorClassifier.ts +7 -2
- package/server/src/providers/handoffHistoryBinding.ts +40 -0
- package/server/src/providers/index.ts +12 -6
- package/server/src/providers/llamacpp.ts +93 -176
- package/server/src/providers/llamacppManager.ts +62 -33
- package/server/src/providers/llamacppVersion.ts +4 -0
- package/server/src/providers/lmstudio.ts +124 -190
- package/server/src/providers/localFileMedia.ts +229 -0
- package/server/src/providers/localMcp.ts +76 -0
- package/server/src/providers/localShellLifecycle.ts +30 -0
- package/server/src/providers/localToolDispatch.ts +111 -0
- package/server/src/providers/ollama.ts +161 -171
- package/server/src/providers/ollamaCtxFallback.ts +1 -2
- package/server/src/providers/ollamaDurableCompaction.ts +5 -4
- package/server/src/providers/ollamaExecutionHistory.ts +40 -13
- package/server/src/providers/ollamaFencedTools.ts +10 -11
- package/server/src/providers/ollamaResilience.ts +10 -13
- package/server/src/providers/ollamaTokens.ts +4 -7
- package/server/src/providers/ollamaToolSubset.ts +14 -2
- package/server/src/providers/ollamaTools.ts +212 -200
- package/server/src/providers/outputStyle.ts +72 -72
- package/server/src/providers/providerFileContent.ts +133 -0
- package/server/src/providers/renderedTranscript.ts +2 -0
- package/server/src/providers/requestDeadline.ts +27 -0
- package/server/src/providers/sessionScope.ts +9 -0
- package/server/src/providers/types.ts +3 -0
- package/server/src/publicProject.ts +54 -13
- package/server/src/publicProjectChoice.ts +39 -0
- package/server/src/quota.ts +48 -23
- package/server/src/recall/search.ts +9 -32
- package/server/src/recall/transcriptSearch.ts +27 -0
- package/server/src/recentFilesLedger.ts +10 -8
- package/server/src/recentProjectActivity.ts +56 -0
- package/server/src/scanDeadline.ts +26 -0
- package/server/src/searchText.ts +16 -0
- package/server/src/server/broadcast.ts +120 -54
- package/server/src/sessionJsonl.ts +31 -17
- package/server/src/settings.ts +137 -41
- package/server/src/skillManagement.ts +585 -0
- package/server/src/skillMutation.ts +6 -0
- package/server/src/skills.ts +195 -25
- package/server/src/smartPickup.ts +3 -2
- package/server/src/smartPickupAdapters.ts +31 -10
- package/server/src/storageActions.ts +1 -1
- package/server/src/storageArchive.ts +42 -22
- package/server/src/storageRoot.ts +30 -0
- package/server/src/storageTurnWatch.ts +39 -0
- package/server/src/taskDispatcher.ts +22 -2
- package/server/src/templates/store.ts +72 -57
- package/server/src/terminal/ptyManager.ts +37 -27
- package/server/src/terminal/ptyPidRegistry.ts +10 -58
- package/server/src/thirdPartySkills.ts +79 -0
- package/server/src/toolPath.ts +31 -0
- package/server/src/toolboxWorkflow.ts +2 -1
- package/server/src/uploadImages.ts +124 -0
- package/server/src/voice/computerContext.ts +2 -1
- package/server/src/voice/conditionSchema.ts +3 -1
- package/server/src/voice/conditions.ts +1 -1
- package/server/src/workers/StreamParser.ts +42 -11
- package/server/src/workers/WorkerManager.ts +32 -35
- package/server/src/workers/durablePidRegistry.ts +266 -0
- package/server/src/workers/limits.ts +1 -1
- package/server/src/workers/pidRegistry.ts +15 -89
- package/server/src/workers/processActivity.ts +14 -0
- package/server/src/workers/processKill.ts +175 -1
- package/server/src/workers/processStartTime.ts +137 -49
- package/server/src/workflowMeta.ts +59 -19
- package/server/src/workflowStore.ts +177 -22
- package/server/src/workflows/modelTitles.ts +4 -3
- package/server/src/workflows/sessionIndex.ts +24 -3
- package/server/src/workflows/types.ts +20 -10
- package/server/src/workspace.ts +6 -0
- package/server/src/ws/afterTurn.ts +34 -0
- package/server/src/ws/clusterHandlers.ts +198 -276
- package/server/src/ws/clusterMembers.ts +204 -0
- package/server/src/ws/compactHandlers.ts +38 -11
- package/server/src/ws/gateHandlers.ts +2 -1
- package/server/src/ws/genesisHandlers.ts +49 -6
- package/server/src/ws/handoffHandlers.ts +168 -53
- package/server/src/ws/previewCaptureHandlers.ts +1 -4
- package/server/src/ws/taskLedgerHandlers.ts +22 -13
- package/server/src/ws/taskLifecycle.ts +41 -0
- package/server/src/ws/turnEngine.ts +488 -366
- package/server/src/ws/turnPrompt.ts +60 -0
- package/server/src/ws/turnSettings.ts +95 -0
- package/server/src/ws/updatePrimaryConfig.ts +55 -31
- package/server/src/ws/workflowHandlers.ts +187 -158
- package/shared/dist/clusterCoordination.js +15 -7
- package/shared/dist/clusterRolePresets.js +8 -6
- package/shared/dist/codexChat.d.ts +2 -0
- package/shared/dist/codexChat.js +5 -0
- package/shared/dist/folderName.d.ts +1 -0
- package/shared/dist/folderName.js +18 -0
- package/shared/dist/index.d.ts +6 -0
- package/shared/dist/index.js +6 -0
- package/shared/dist/localRuntimeStatus.d.ts +23 -0
- package/shared/dist/localRuntimeStatus.js +47 -0
- package/shared/dist/notificationTitle.d.ts +9 -0
- package/shared/dist/notificationTitle.js +23 -0
- package/shared/dist/outputStyle.d.ts +10 -0
- package/shared/dist/outputStyle.js +28 -0
- package/shared/dist/outputs.d.ts +1 -0
- package/shared/dist/protocol/autoPickup.d.ts +2 -0
- package/shared/dist/protocol/chat.d.ts +4 -0
- package/shared/dist/protocol/checkpoints.d.ts +24 -2
- package/shared/dist/protocol/checkpoints.js +1 -0
- package/shared/dist/protocol/clientMessages.d.ts +9 -14
- package/shared/dist/protocol/clusters.d.ts +21 -4
- package/shared/dist/protocol/clusters.js +3 -3
- package/shared/dist/protocol/connections.d.ts +2 -0
- package/shared/dist/protocol/diagnostics.js +1 -1
- package/shared/dist/protocol/genesis.d.ts +9 -0
- package/shared/dist/protocol/mcp.d.ts +1 -0
- package/shared/dist/protocol/mcp.js +8 -5
- package/shared/dist/protocol/mdTuneup.d.ts +2 -0
- package/shared/dist/protocol/models.d.ts +3 -1
- package/shared/dist/protocol/models.js +19 -8
- package/shared/dist/protocol/notifications.d.ts +2 -1
- package/shared/dist/protocol/notifications.js +15 -3
- package/shared/dist/protocol/plans.d.ts +2 -1
- package/shared/dist/protocol/remoteManagement.d.ts +6 -0
- package/shared/dist/protocol/serverMessages.d.ts +69 -10
- package/shared/dist/protocol/settings.d.ts +16 -4
- package/shared/dist/protocol/settings.js +17 -1
- package/shared/dist/protocol/tasks.d.ts +1 -0
- package/shared/dist/protocol/usage.d.ts +1 -0
- package/shared/dist/protocol/workers.d.ts +1 -0
- package/shared/dist/protocol/workflows.d.ts +73 -14
- package/shared/dist/protocol/workflows.js +66 -0
- package/shared/dist/publicGuardrails.d.ts +1 -1
- package/shared/dist/publicGuardrails.js +1 -1
- package/shared/dist/runtimeVersions.d.ts +2 -0
- package/shared/dist/runtimeVersions.js +13 -0
- package/shared/dist/shellTool.d.ts +2 -0
- package/shared/dist/shellTool.js +9 -0
- package/shared/src/clusterCoordination.ts +12 -7
- package/shared/src/clusterRolePresets.ts +8 -6
- package/shared/src/codexChat.ts +8 -0
- package/shared/src/folderName.ts +11 -0
- package/shared/src/index.ts +8 -0
- package/shared/src/localRuntimeStatus.ts +53 -0
- package/shared/src/notificationTitle.ts +23 -0
- package/shared/src/outputStyle.ts +35 -0
- package/shared/src/outputs.ts +3 -0
- package/shared/src/protocol/autoPickup.ts +2 -0
- package/shared/src/protocol/chat.ts +5 -0
- package/shared/src/protocol/checkpoints.ts +40 -8
- package/shared/src/protocol/clientMessages.ts +11 -11
- package/shared/src/protocol/clusters.ts +40 -10
- package/shared/src/protocol/connections.ts +6 -0
- package/shared/src/protocol/diagnostics.ts +1 -1
- package/shared/src/protocol/genesis.ts +11 -0
- package/shared/src/protocol/mcp.ts +12 -7
- package/shared/src/protocol/mdTuneup.ts +4 -2
- package/shared/src/protocol/models.ts +22 -8
- package/shared/src/protocol/notifications.ts +16 -3
- package/shared/src/protocol/plans.ts +5 -7
- package/shared/src/protocol/remoteManagement.ts +10 -3
- package/shared/src/protocol/serverMessages.ts +88 -7
- package/shared/src/protocol/settings.ts +35 -5
- package/shared/src/protocol/tasks.ts +1 -0
- package/shared/src/protocol/usage.ts +3 -3
- package/shared/src/protocol/workers.ts +5 -0
- package/shared/src/protocol/workflows.ts +133 -21
- package/shared/src/publicGuardrails.ts +1 -1
- package/shared/src/runtimeVersions.ts +15 -0
- package/shared/src/shellTool.ts +9 -0
- package/client/dist/assets/galleryEditor-fPb76Cjv.js +0 -702
- package/client/dist/assets/index-CjkHb-_n.js +0 -592
- package/client/dist/assets/index-DIbh3ae5.css +0 -1
- package/client/src/components/ConversationMenu.tsx +0 -467
- package/client/src/stores/sessionIndexStore.ts +0 -92
package/docs/GOTCHAS.md
CHANGED
|
@@ -75,8 +75,7 @@ For the architecture map, see [Architecture](ARCHITECTURE.md). For chronological
|
|
|
75
75
|
- **Snapshots must never touch the user's real index / HEAD / working tree.** `server/src/gitSnapshots.ts` snapshots via a **unique per-operation `GIT_INDEX_FILE`** (`$TMPDIR/arco-snapshot-<cwd-hash>-<pid>-<uuid>.index`; the shadow repo uses an equally unique index inside its bare gitdir) and only ever writes `refs/arco/<wfid>/<seq>`. The unique name is load-bearing because checkpoint capture is fire-and-forget and multiple workflows can share one cwd; a fixed `snap.index` races on `snap.index.lock`. The repo scratch file must stay outside the worktree too, or one concurrent capture can stage another's scratch when `.arco` is not ignored. No `reset`/`checkout`/`stash`/`add` against the real index - the operator's `git status` must stay byte-identical. The smoke (`npm run smoke:checkpoints`) asserts isolation, cleanup, and concurrency; don't weaken it. All git calls use `execFile` arg arrays (no shell-string interpolation).
|
|
76
76
|
- **The pre-turn checkpoint hook lives in `turnEngine.handleUserMessage`, not `seedWorker.ts`.** `runPrimaryTurn` is shared by reviewers / handoff seeds / `exportContext` / Task children, which must **not** checkpoint the operator tree. Snapshot only on operator turns, skipped in `armPlanMode`, fire-and-forget so it never blocks/fails the turn. See `docs/CHECKPOINTS.md`.
|
|
77
77
|
- **Checkpoints are never exposed to the LLM** - no tool, no system-prompt mention. Pure operator infra.
|
|
78
|
-
-
|
|
79
|
-
- **Revert's seed must be `add -A` + `rm --cached -- .arco`, not an exclude pathspec.** `add -A -- ':!.arco' ':!.git'` makes git treat matched-but-ignored dirs as explicitly requested; with a global `**/.arco/` ignore rule (the operator's `~/.config/git/ignore`) the add REFUSES and every revert in a repo containing `.arco` fails (found 2026-08-19; pinned by `npm run smoke:checkpoint-revert`).
|
|
78
|
+
- Shadow-checkpoint isolation depends on unique temporary indexes outside the project tree. Keep per-operation index files separate and remove them after use.
|
|
80
79
|
|
|
81
80
|
## A2 checkpoints vs I3 real git mutation (keep the code paths separate)
|
|
82
81
|
|
|
@@ -90,11 +89,11 @@ For the architecture map, see [Architecture](ARCHITECTURE.md). For chronological
|
|
|
90
89
|
|
|
91
90
|
These guardrails bound worker memory use and prevent a runaway subprocess from destabilizing the server. Do not loosen them without reviewing the risk.
|
|
92
91
|
|
|
93
|
-
- `MAX_WORKER_OUTPUT_BYTES =
|
|
92
|
+
- `MAX_WORKER_OUTPUT_BYTES` = 50 MB per worker by default (`ARCO_MAX_WORKER_OUTPUT_BYTES`; capped in per-provider accumulators).
|
|
94
93
|
- `RSS_KILL_BYTES = 32GB` tree-RSS auto-kill via `WorkerManager.startActivityPoll`. Per-workflow opt-out exists via `meta.json` `disableRssGuard` for legitimate heavy jobs (kernel compiles, big LTO links). Reviewers and handoff reflections always run under the global cap regardless.
|
|
95
94
|
- Subprocesses spawn `detached: true`; `killProcessTree` takes down descendants on cancel.
|
|
96
95
|
- Linux `/proc`-based activity probe (`processActivity.ts`, polled 1.5s) drives the CPU-pulse UI + silent-exit supervision. See `server/src/workers/limits.ts`.
|
|
97
|
-
- **Operator-terminal (PTY) reaping mirrors worker reaping, but with NO RSS auto-kill (§K2).** node-pty children are *not* `detached`, so a clean exit reaps them - but a hard kill reparents them to init and leaks them. So they get the same durable-registry treatment: `server/src/terminal/ptyPidRegistry.ts` persists pids to `~/.arco/terminal-pids.json` (a **separate** file from `worker-pids.json`, so the two reap sets can't clobber each other), and `reapOrphanTerminals()` runs
|
|
96
|
+
- **Operator-terminal (PTY) reaping mirrors worker reaping, but with NO RSS auto-kill (§K2).** node-pty children are *not* `detached`, so a clean exit reaps them - but a hard kill reparents them to init and leaks them. So they get the same durable-registry treatment: `server/src/terminal/ptyPidRegistry.ts` persists pids to `~/.arco/terminal-pids.json` (a **separate** file from `worker-pids.json`, so the two reap sets can't clobber each other), and `reapOrphanTerminals()` runs alongside `reapOrphanWorkers()`, awaited before `listen()`, SIGKILLing stale pids via the shared `forceKillPid`. **Crucial difference: do NOT add an RSS auto-kill of operator shells.** A worker is autonomous and bounded by `RSS_KILL_BYTES`; a terminal runs processes the *operator started intentionally* (dev server, build, REPL), so SIGKILLing their shell on a memory threshold would be destructive and violate the operator-in-control fence. Orphan reaping (a *prior crashed run's* leak) is safe; killing a *live* operator session on a heuristic is not. Any future guard must default to observation-only. Two windows can attach to one session (multi-listener `Set` in `PtySession`); closing one window disposes only its listener, not the co-viewer's.
|
|
98
97
|
- **The §3.1 stuck-worker breaker pauses a worker that keeps FAILING THE SAME WAY - error-persistence, not action-pattern.** `workers/stuckBreaker.ts` keys per workflow on the signature `toolName|inputHash|outputHash` (the watchdog's NORMALIZED `outputHash` from `providers/outputSignature.ts`, so "the same error" with drifting digits/timestamps collapses to one signature) and counts a streak of FAILING results (`failed` status OR non-zero `exitCode` OR an `[error]` sentinel) with no success interleaved: ≥`DETECT_AT` (3) → `nudge`, ≥`ESCALATE_AT` (5) → recommend a reversible `pause`; any success or different signature → `recovered`. It NEVER kills/prompts a worker itself - it returns a verdict `seedWorker` turns into a visible `worker_stuck` event. A model may legitimately repeat an action pattern, so detection requires repeated failures. Cross-turn + cross-provider (consumes `worker_tool_use` from any transport carrying `outputHash` - claude-native + codex today). Composes with the in-turn Native H9 guard.
|
|
99
98
|
- **H46 RSS/heap trend logging is OFF by default and observation-only.** `memoryMonitor.ts` samples `process.memoryUsage()` every ~5 min (plus a `boot` baseline and a `shutdown` high-water line) into a file log ONLY when file logging is enabled - a cheap trend the operator greps, never a kill trigger. The `RSS_KILL_BYTES` tree-RSS guard above stays the only auto-kill. Don't wire an action onto the trend.
|
|
100
99
|
|
|
@@ -130,19 +129,17 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
130
129
|
gets only `WebSearch` / `WebFetch`. Codex/Cursor must remain
|
|
131
130
|
read-only and isolated. Removed providers remain rejected server-side even if a stale client crafts a create request.
|
|
132
131
|
|
|
133
|
-
- **Web access is the
|
|
132
|
+
- **Web access is the only tool category a Chat tab may hold, and it is per-tab operator
|
|
134
133
|
state.** `chatWebArmed(config, provider)` in `server/src/chatMode.ts` is the
|
|
135
134
|
single source of truth: unset `chatWebAccess` means armed for a saved Chat and
|
|
136
135
|
disarmed for Incognito (the query leaves the machine), and only
|
|
137
|
-
`CHAT_WEB_PROVIDERS` (claude, codex, ollama, strata) can honor it.
|
|
138
|
-
states
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
SearXNG-backed `WebSearch` / `WebFetch` pair and auto-executes that narrowed
|
|
145
|
-
pair even though Chat has no Agent AUTO toggle. `ollamaToolCallAllowed()`
|
|
136
|
+
`CHAT_WEB_PROVIDERS` (claude, codex, ollama, strata, deepseek) can honor it.
|
|
137
|
+
Every transport states the mode explicitly: CLI Claude passes
|
|
138
|
+
`--tools WebSearch,WebFetch`; Native uses `buildChatWebTools()` (`web_search`,
|
|
139
|
+
`web_fetch` and `read_url`) without `code_execution`; Codex sets
|
|
140
|
+
`web_search="live"|"disabled"`; Ollama, Strata and DeepSeek use Arco's local
|
|
141
|
+
SearXNG-backed `WebSearch` / `WebFetch` pair. Ollama narrows and auto-executes
|
|
142
|
+
that pair even though Chat has no Agent AUTO toggle. `ollamaToolCallAllowed()`
|
|
146
143
|
repeats the web-only check at dispatch because a model can invent a known but
|
|
147
144
|
unadvertised tool name; never rely on `tools[]` alone as the Chat boundary.
|
|
148
145
|
Ollama Chat transcript replay must use `preserveThinking:false`: hidden
|
|
@@ -203,11 +200,14 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
203
200
|
- **Claude effort levels use doc overrides on top of `/v1/models`.** The live Anthropic catalog can lag newly-published model behavior; on 2026-05-30 it reported Opus 4.8 without `xhigh` while the current API and Claude Code docs list `low/medium/high/xhigh/max`. `effortsForModel()` unions live catalog levels with `CLAUDE_MODEL_EFFORTS` for known Claude IDs so pickers match the documented surface. Fable 5 / Mythos 5 and Opus 4.7/4.8 are adaptive-thinking models with `low/medium/high/xhigh/max`; keep 4.6/Sonnet 4.6 at `low/medium/high/max` (no `xhigh`). `ultracode` is intentionally not in `EffortLevel`: it is a Claude Code session setting (`xhigh` plus dynamic workflow permission), not an API effort value.
|
|
204
201
|
- **ARG_MAX overflow on `--append-system-prompt`** (Claude). Long appendSystemPrompts can push argv past Linux's per-arg limit (~128 KB); the CLI `E2BIG`s the spawn. Mitigation in claude.ts: above `APPEND_SP_ARG_MAX` (64 KB) it writes the value to `/tmp/arco-prompts/append-sp-<id>-<pid>.txt` and passes it via the **separate** `--append-system-prompt-file` flag (a documented peer of `--append-system-prompt` in the CLI's bare help) - not the same flag with a path. If the tmpfile write fails it falls back to inline `--append-system-prompt`. Tmpfiles are cleaned up on settle and on server exit.
|
|
205
202
|
- **A CLI that is installed but crashing must NOT collapse into "not installed" - `probeVersion` returns `'unknown'` (absent, ENOENT) vs `'broken'` (present, non-zero exit), and the PROVIDERS popover hides only the former.** 2026-09-03: the popover's own codex update command (`npm install -g @openai/codex@latest`, `capabilities.ts` `UPDATE_COMMAND`) silently skipped the 129 MB `@openai/codex-linux-x64` platform binary - it's an **optional** dependency, so npm exited 0 and reported success - leaving a launcher that threw `Missing optional dependency` on every invocation. `probeVersion` caught the throw and returned `'unknown'`, the popover's `version === 'unknown'` filter dropped the row, and CODEX vanished from the UI entirely: no error, no version, nothing to click. Auth compounded it - `getCodexAuthStatus` shells `codex login status`, so every profile reported logged-out despite intact `auth.json` files, sending the operator after a credential problem that did not exist. Three invariants: (1) keep the absent/broken distinction in `probeVersion` - collapsing them is what made the failure invisible; (2) `runCliUpdate` must not infer success from the version string merely *changing* (`'unknown' !== '0.153.1'` read as `updated: true` and rendered `→ vunknown`) - a post-update probe that can't report a version is a **failure**, and `probeFailureReason` re-runs the binary to surface its first `Error:` line; (3) an update failure is sticky in the popover (it survives the 6 s auto-clear) - auto-dismissing the only line that explains the breakage is how this stayed unexplained. Note the recovery trap: capabilities re-probe only at boot and every 4 h (`index.ts periodicCapabilityProbe`), and the sole manual re-probe is clicking the provider row - which is hidden while broken, so a service restart was the only way out.
|
|
206
|
-
- **Provider updates resolve an installable version BEFORE installing - `@latest` is not automatically installable.** `npmPlatformResolve.ts` (`resolveInstallableVersion`, called from `runCliUpdate`) asks the registry whether the `latest` wrapper's **self-published** platform build exists for this `platform-arch` and, if it doesn't, walks back to the newest version that has one and reports a `notice`. This closes the 2026-09-03 / 2026-09-04 codex breakage at the cause rather than after the fact. The cause is a **publish race**, which is why it recurs: upstream moves the `latest` dist-tag when the wrapper is published and the six platform tarballs land separately. Observed directly on 2026-09-04 - at 19:12 local `@openai/codex@0.153.3` was `latest` with no `0.153.3-linux-x64` in the registry (the `linux-x64` dist-tag still read `0.153.2`); by 19:35 the build had appeared and the identical install succeeded. Anyone clicking update inside that window gets a broken codex; clicking again later silently fixes it. Three invariants: (1) **the `ownPackage` narrowing in `findPlatformDep` is load-bearing** - some CLIs optionally depend on third-party platform packages and run fine without them. Resolve only a platform build published by the CLI package itself; do not downgrade a working CLI based on an unrelated optional dependency. (2) **Never infer success from npm's exit code** - a skipped optional dep exits 0; success is "the binary runs afterwards," which is why `runCliUpdate` still probes and still keeps the post-flight `--force` retry for the case where npm skips a build that *does* exist. (3) **A walk-back is a downgrade, not a fix** - it is capped at `MAX_WALK_BACK` (25) so a package that genuinely stopped shipping this platform fails loudly instead of silently installing something ancient, and the operator-facing notice says to re-run once upstream finishes publishing. Registry lookups are pure HTTP against `registry.npmjs.org`; the abbreviated packument (~4 MB for codex) is fetched **only** on the walk-back path, and
|
|
203
|
+
- **Provider updates resolve an installable version BEFORE installing - `@latest` is not automatically installable.** `npmPlatformResolve.ts` (`resolveInstallableVersion`, called from `runCliUpdate`) asks the registry whether the `latest` wrapper's **self-published** platform build exists for this `platform-arch` and, if it doesn't, walks back to the newest version that has one and reports a `notice`. This closes the 2026-09-03 / 2026-09-04 codex breakage at the cause rather than after the fact. The cause is a **publish race**, which is why it recurs: upstream moves the `latest` dist-tag when the wrapper is published and the six platform tarballs land separately. Observed directly on 2026-09-04 - at 19:12 local `@openai/codex@0.153.3` was `latest` with no `0.153.3-linux-x64` in the registry (the `linux-x64` dist-tag still read `0.153.2`); by 19:35 the build had appeared and the identical install succeeded. Anyone clicking update inside that window gets a broken codex; clicking again later silently fixes it. Three invariants: (1) **the `ownPackage` narrowing in `findPlatformDep` is load-bearing** - some CLIs optionally depend on third-party platform packages and run fine without them. Resolve only a platform build published by the CLI package itself; do not downgrade a working CLI based on an unrelated optional dependency. (2) **Never infer success from npm's exit code** - a skipped optional dep exits 0; success is "the binary runs afterwards," which is why `runCliUpdate` still probes and still keeps the post-flight `--force` retry for the case where npm skips a build that *does* exist. (3) **A walk-back is a downgrade, not a fix** - it is capped at `MAX_WALK_BACK` (25) so a package that genuinely stopped shipping this platform fails loudly instead of silently installing something ancient, and the operator-facing notice says to re-run once upstream finishes publishing. Registry lookups are pure HTTP against `registry.npmjs.org`; the abbreviated packument (~4 MB for codex) is fetched **only** on the walk-back path, and an unknown registry result before a missing build is established returns null for the existing `@latest` fallback. Once the registry confirms a missing platform build, an unreadable or unusable fallback list defers the update without running npm or replacing the working CLI. Parser shape pinned by `npmPlatformResolve.test.ts`.
|
|
207
204
|
- **Multiple Codex CLI installs can coexist.** Arco invokes bare `codex` from `PATH`, so path order determines which binary runs. The provider updater installs through npm global; after an update, confirm that `codex` still resolves to the intended executable before removing or reordering installs.
|
|
208
205
|
|
|
209
206
|
## Claude Native transport
|
|
210
207
|
|
|
208
|
+
- **Ripgrep stdout mixes matches and binary warnings.** Native Grep parses each newline-delimited record before looking for its NUL filename separator. A binary warning has no separator and must be skipped by itself; consuming through the next separator would discard the following text match. The bounded-read regression sorts filenames so the binary warning precedes a readable file.
|
|
209
|
+
|
|
210
|
+
- **Agent shell commands and hooks go through `commandShell()`.** `server/src/commandShell.ts` returns `/bin/sh` on Linux and macOS, Git Bash on Windows and PowerShell on Windows without Git Bash; never spawn `/bin/sh` or `bash` directly for the Bash tools, hooks or sandbox shell scripts, and build the arguments with `shellInvocation()` (PowerShell gets an encoded command, or a temporary script that `cleanup()` removes). Start such children with `spawnShellChild()` and kill them with `signalChildTree()` from `server/src/workers/processKill.ts`: `process.kill(-pid)` does not exist on Windows, `taskkill /T` misses an MSYS background job whose forked parent has exited (the child's `ARCO_PROCESS_TREE` tag finds it through Git Bash's `/proc`), and Node's own argument quoting halves a pair of backslashes on the way into Git Bash (`msysQuote()` with a verbatim command line does not). A hook that cannot start never blocks (`notRun`).
|
|
211
211
|
- **Cache discipline is load-bearing.** The forced first system block (`"You are Claude Code, ..."`) is byte-stable across every Native tab; the appendSystemPrompt block is byte-stable across iterations within a turn. Never insert per-turn-variable content (timestamps, request IDs, operator name) above the cache marker - that invalidates every prior turn's cache on every tab. System-block ordering is fixed (canonical list in the `buildSystemBlocks` header comment: FORCED_FIRST_BLOCK → north-star → cluster plan → role → efficiency/progress doctrine → delegation contract → sandbox nudge → env note → turn discipline → workspace facts → appendSystemPrompt → systemPrompt → output style; a Chat tab short-circuits to FORCED_FIRST_BLOCK → chat prompt); reordering on a deploy invalidates every active tab's cache. The hardcoded `FORCED_FIRST_BLOCK` constant in `worker.ts` is the single source of truth - operator overrides were intentionally rejected (§14 Q4). On the OAuth subscription path, requests and diagnostics must include the identity block; omitting it can produce a rate-limit error.
|
|
212
212
|
- **Stateless Native helpers live in siblings, re-exported from `worker.ts` (P0 carve-out).** To stay under the 2000-line cap, the pure leaf helpers were moved to `modelParams.ts` (token/thinking/effort/ctx), `contentBlocks.ts` (content-block types + image/message/server-tool/context-mgmt/strip-thinking helpers), and `workerHelpers.ts` (`replayMessagesFromEvents`, `mergeUsage`, `truncateOutput`, `planParserAdvisories`, `sleepWithSignal`). `worker.ts` re-exports the previously-public names so `from './worker.js'` imports (including the test files) keep working - **add new pure helpers to the sibling modules, not back into `worker.ts`**; only stateful class logic belongs there. The `FORCED_FIRST_BLOCK` constant stays in `worker.ts` (single source of truth, see cache-discipline bullet above).
|
|
213
213
|
- **Replay-on-restart is the canonical recovery path.** On `ensureStarted` the worker tail-reads `events.jsonl` and reconstructs `messages[]` from `user_message_echo` + `primary_text` entries. Tool_use / tool_result events are NOT replayed (the model gets a clean USER/ASSISTANT view; reconstructing tool ids with full fidelity is deferred - §14 Q7). Don't add a periodic snapshot path without first measuring whether replay cost actually bites. The reconstruction logs to stderr under `[claude-native:<wfid>]`; that's the forensic surface.
|
|
@@ -221,19 +221,20 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
221
221
|
- **COMPACT summarizes a clean conversational projection, never raw live tool protocol.** A cancelled/interrupted Native tool loop can leave an assistant `tool_use` without the immediately-following user `tool_result` Anthropic requires. Normal turns call `pruneOrphanToolUse()` before appending the next operator prompt; `compactInPlace()` must do the same before its summary round and emit the same visible `ctx_action`. The summary request then uses `projectCompactSummaryMessages()` so even older completed `tool_use` / `tool_result` blocks are stripped before hitting `messages.create`; replay never reconstructs those protocol blocks either, and the compact summary only needs the visible user/assistant text.
|
|
222
222
|
- **Arco keep-last-N tail rides the EVENT, not the post-marker event stream.** The kept verbatim tail (last ~3 user/assistant pairs, `projectKeptTail` in `workerHelpers.ts`) consists of messages that occur BEFORE the marker, so replay (which resets at the marker) would lose them - they're persisted in `native_compacted.keptTail` and re-appended via the SAME `compactSummarySeed(summary, keptTail)` at both sites. The projection mirrors replay's own shape: it skips tool_use/tool_result/image-only/empty messages (replay never reconstructs those), collapses consecutive same-role messages to the most recent, and drops any leading assistant so the tail starts on a `user` boundary (the seed ends on an assistant ack - a leading assistant would invert the order Anthropic rejects). Don't persist raw `messages[]` (tool_use blocks) into `keptTail` and don't change the projection on only one of the two sites - the live `messages[]` and the replayed array must consume the SAME persisted `keptTail`. Byte-identity is pinned by `npm run test:resume-summary -w server` ("compact keep-tail: live seed and replay reseed are byte-identical").
|
|
223
223
|
- ** compaction takeover must always have a clear path - it can't strand.** `native_compacting` (emitted from `compactInPlace` BEFORE the summary round, once for both the manual button and the auto path) flips the client `JobState.compacting` overlay. The flag is cleared on FOUR signals so it can never stick: `native_compacted` (success), a compaction-failure `system_notice` (the no-`native_compacted` path - the empty/failed summary leaves history untouched and emits ONLY a `Compact failed` / `Compaction skipped` notice; matched by `isCompactionFailureNotice`, unit-pinned by `npm run test:compacting-notice -w client`), `primary_turn_started` (a real turn resumed), and `turn_cancelled`. Do NOT clear it on `primary_turn_ended` - the manual COMPACT path fires a transient `primary_turn_ended` right after `native_compacted`, and clearing there would wipe the post-compaction "Continue" affordance the operator hasn't clicked yet. `native_compacting` is advisory on replay (the takeover is live-only; replay never re-opens it).
|
|
224
|
-
- **Auto-continue is opt-in and goes through the normal operator path.** `nativeCompactAutoContinue` (default false) is the ONLY thing that makes `maybeAutoContinueAfterCompact` dispatch the continuance turn (`COMPACT_CONTINUE_PROMPT`) after a successful compaction - via `handleUserMessage`, so it's a real, visible turn in `events.jsonl`. Default is MANUAL (the operator clicks
|
|
224
|
+
- **Auto-continue is opt-in and goes through the normal operator path.** `nativeCompactAutoContinue` (default false) is the ONLY thing that makes `maybeAutoContinueAfterCompact` dispatch the continuance turn (`COMPACT_CONTINUE_PROMPT`) after a successful compaction - via `handleUserMessage`, so it's a real, visible turn in `events.jsonl`. It applies only to automatic compactions (`handleCompactWorkflow` with `autoDetail`); the manual COMPACT button never auto-continues. Default is MANUAL (the operator clicks COMPACTED: CONTINUE in the composer) because between-turn compaction ends the turn, so auto-continuing is autonomous continuation (CLAUDE.md autonomy fence). The auto path only fires when `ws`/`session` are in scope (the operator's connection) - the `__debug_native_auto_compact_probe` smoke passes neither, so it never auto-continues (no API spend). Only the automatic path (`handleCompactWorkflow` reached from `maybeAutoCompactPolicy` with `autoDetail`) calls `maybeAutoContinueAfterCompact`; the COMPACT button must not.
|
|
225
|
+
- **In-turn auto-compaction keeps the in-progress round raw.** `maybeCompactInTurn` runs in the tool loop after the round's `tool_result` message is appended and before the steer drain and the next request. Everything before the round's assistant message is summarized; the round itself (thinking, `tool_use`, `tool_result`) is re-appended after `inTurnCompactedHistory`'s user note, so no tool call loses its result and roles keep alternating. `turnMessageStart` moves to the note, since end-of-turn telemetry and evidence pruning index from it. One compaction per crossing (`inTurnCompact.fired`, cleared by a request below the threshold or a manual COMPACT); do not loop on a compaction that did not bring usage down. Replay resets at the `native_compacted` marker and rebuilds the note from `continueNote` so the rest of that turn's text pairs with it.
|
|
225
226
|
- **Between-turn auto-compaction uses the manual COMPACT path.** Provider defaults to 90% for Claude Native and Ollama, leaving 10% headroom; explicit policies take precedence. A fresh reading and ownership checks guard Native compaction, and auto-fold consumes the boundary before a second action. Claude API compaction is a separate per-tab beta and stays opt-in.
|
|
226
227
|
- **OAuth refresh races.** `proper-lockfile` serializes the read-refresh-write cycle on `~/.arco/auth.json`. The lock is **not** held across the SDK call - only across the token rewrite. Two workers refreshing simultaneously: both acquire the lock in turn, the second sees the freshly-written token from the first and skips its own refresh. Don't hold the lock across `messages.create`; you'll deadlock the second worker against a 30-second SDK request.
|
|
227
228
|
- **Anthropic SDK pins `authToken` at construction; rebuild on rotation.** `new Anthropic({ authToken })` captures the token by value - refreshing the token file on disk does NOT update an existing client. A long-lived Native worker that survived a RE-LOGIN keeps its stale token and 401s every subsequent call until the tab closes. `ClaudeNativeWorker.ensureStarted()` stamps `clientTokenObtainedAt` from `ensureLiveTokens()` and rebuilds the SDK client on mismatch (logs `tokens rotated - rebuilding Anthropic client`). The rotation path skips `discoverHooks` and the `init` emit - both are first-time-wiring concerns. Don't pin the SDK client across a token rotation; the auto-refresh path inside `ensureLiveTokens` benefits from the same rebuild.
|
|
228
229
|
- **Callback port (53692) EADDRINUSE.** When the local OAuth callback server can't bind, `oauth.ts` falls back to manual-paste mode automatically and surfaces a flag the UI shows. Don't try a different port - Anthropic's redirect URI is registered against the constant.
|
|
229
230
|
- **H10: the Native worker honors Anthropic's OWN retry timing on 429/529/overload - and with the SDK's internal retries off (`maxRetries:0`) this ladder is the ONLY backoff.** `rateLimit.ts resolveRateLimitWait` reads `retry-after` (delta-seconds or HTTP-date) first, else the soonest `anthropic-ratelimit-*-reset` RFC-3339 timestamp; `classifyRateLimit` distinguishes a genuine rate limit from an overload. When no usable header is present (mid-stream SSE errors carry none) it falls back to the fixed 15/30/60s ladder. Don't re-enable SDK `maxRetries` to "help" - you'd double the backoff and lose the header-honoring wait.
|
|
230
|
-
- **Wire fingerprint pin is deliberate, not tracked.** `claude-cli/2.1.
|
|
231
|
+
- **Wire fingerprint pin is deliberate, not tracked.** `claude-cli/2.1.319` today (`wireFingerprint.ts`; 2.1.75 from Pi -> 2.1.257 for Fable 5.1 -> 2.1.280 for Opus 5.5; 2.1.319 for Fable 5.2, which requires at least 2.1.290). Bumping is a deliberate revalidation against an observed Anthropic-side rejection - not a routine `npm update` or `claude update`. Same rule for `@anthropic-ai/sdk@^0.91.1` (verify `Anthropic({ authToken })` field name + stream-event shape on bumps).
|
|
231
232
|
- **`anthropic-dangerous-direct-browser-access` IS sent on Claude Native OAuth requests.** Current Pi sends it on the SDK `authToken` path together with `x-app: cli`; Arco follows that wire fingerprint. Older Arco docs said Pi did not send it - that was stale after re-checking `earendil-works/pi` on 2026-05-31.
|
|
232
233
|
- **Native web search/fetch are Anthropic server tools, and their response `usage` is NOT the CTX bar.** `buildToolDefs()` appends Anthropic `web_search_20260209` / `web_fetch_20260309` plus `code_execution_20260120` (required for the efficient 2026 dynamic-filtering path). The response usage fields can include internal search/fetch processing tokens from a single request; those are real billing/processing telemetry but they can be hundreds of thousands of tokens larger than the retained conversation context. Do not drive `CTX: N / window` from `response.usage` on server-tool turns. Worker code prunes completed-turn server-tool evidence / citation metadata / hidden thinking from retained Native history, then uses `messages.countTokens()` with client tools only to estimate the next-turn prompt footprint. Do not add local `WebSearch` / `WebFetch` to `tools.ts` unless the product goal changes to operator-owned search providers; that would route browsing through Arco's dispatcher instead of Claude's native server-tool path.
|
|
233
|
-
- **Never edit the LATEST assistant message - not its thinking blocks, not the blocks around them.** Anthropic freezes the last assistant message in `messages[]`: *"`thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."* This is a much wider rule than the whole-prefix binding `enforcesPreservedThinking()` gates on (Fable/Mythos 5.1) - Opus 4.8 enforces it too - so protection must be unconditional, not model-keyed. The trap: Anthropic server tools return their evidence INSIDE the same assistant message that carries the final answer, so `pruneServerToolEvidenceAfterTurn` (which deletes `server_tool_use` / `*_tool_result` blocks and appends a retained-history note) was rewriting exactly that message. It now skips the latest assistant message; mid-turn assistant messages are still prunable. **The one intentional opt-out is `scrubServerToolEvidenceOnAbort` (`protectLatestAssistant: false`)** - an aborted round leaves a partial assistant message Arco assembled from a truncated stream, and its dangling `server_tool_use` is itself a guaranteed 400, so there the edit is mandatory. Same helper, opposite requirement; `npm run test:orphan-tooluse -w server` pins the abort side and `test:append-only` pins the settled side. **Symptom when regressed (2026-09-05, workflows `1f308e4c` / `b27a3dce` on opus-4-8):** the prune logs normally, `count_tokens` 400s ~150ms later, and the tab is then dead - every subsequent turn replays the same rejected history, and COMPACT can't rescue it because `generateCompactSummary` replays that history too. REWIND / rehydrate is the escape hatch (replay never reconstructs thinking blocks). **Protecting that message is necessary but not sufficient - see the mirror invariant below.** The same rule constrains `stripTrailingThinkingBlocks`, which mutates `this.messages` in place across the whole unsent tail - it has never actually fired in production (0 occurrences in 1466 opus-4-8 turns; `display:'omitted'` rarely ends a message on thinking), so it was left alone, but it is a live source of the identical 400 if that changes.
|
|
234
|
+
- **Never edit the LATEST assistant message - not its thinking blocks, not the blocks around them.** Anthropic freezes the last assistant message in `messages[]`: *"`thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."* This is a much wider rule than the whole-prefix binding `enforcesPreservedThinking()` gates on (Fable/Mythos 5.2 / 5.1) - Opus 4.8 enforces it too - so protection must be unconditional, not model-keyed. The trap: Anthropic server tools return their evidence INSIDE the same assistant message that carries the final answer, so `pruneServerToolEvidenceAfterTurn` (which deletes `server_tool_use` / `*_tool_result` blocks and appends a retained-history note) was rewriting exactly that message. It now skips the latest assistant message; mid-turn assistant messages are still prunable. **The one intentional opt-out is `scrubServerToolEvidenceOnAbort` (`protectLatestAssistant: false`)** - an aborted round leaves a partial assistant message Arco assembled from a truncated stream, and its dangling `server_tool_use` is itself a guaranteed 400, so there the edit is mandatory. Same helper, opposite requirement; `npm run test:orphan-tooluse -w server` pins the abort side and `test:append-only` pins the settled side. **Symptom when regressed (2026-09-05, workflows `1f308e4c` / `b27a3dce` on opus-4-8):** the prune logs normally, `count_tokens` 400s ~150ms later, and the tab is then dead - every subsequent turn replays the same rejected history, and COMPACT can't rescue it because `generateCompactSummary` replays that history too. REWIND / rehydrate is the escape hatch (replay never reconstructs thinking blocks). **Protecting that message is necessary but not sufficient - see the mirror invariant below.** The same rule constrains `stripTrailingThinkingBlocks`, which mutates `this.messages` in place across the whole unsent tail - it has never actually fired in production (0 occurrences in 1466 opus-4-8 turns; `display:'omitted'` rarely ends a message on thinking), so it was left alone, but it is a live source of the identical 400 if that changes.
|
|
234
235
|
- **The 400-recovery matcher must cover BOTH preserved-thinking wordings.** `isThinkingBindingError` originally matched only the signature form (*"Invalid `signature` in `thinking` block"* / *"bound to a different conversation"* / `prefix_mismatch_behavior`). The latest-assistant-message form shares none of that vocabulary, so it fell through to the fatal branch and wedged the tab instead of triggering the one-shot `stripAllThinkingBlocks` retry. Any new Anthropic wording for "you edited history we froze" belongs in that matcher - the recovery is the same either way. Relatedly, `bindingStripUsed` re-arms per turn (`runTurn`), not per worker lifetime: it exists to stop a strip-retry loop within a round (already bounded by `attempt`), and a worker that self-healed once must not spend the rest of its life unable to recover again.
|
|
235
236
|
- **Edit refuses if file wasn't Read this turn.** Mirrors Claude Code's "blind edit" footgun - operators sometimes report "the model wrote a file it never looked at" on CLI; Native enforces the discipline at the dispatcher level. Per-turn read-set is reset at the top of `runTurn`. Reads from a prior turn don't carry over.
|
|
236
|
-
- **Background Bash → KillShell registry.** `Bash(run_in_background:true)` returns a `shellId` and registers `{kill, backgrounded:true}` on the worker's per-turn shell map. Foreground Bash also registers (cleared on close) so KillShell can interrupt a stuck foreground command. The map is per-worker (not per-turn) so a background shell started in turn N is killable from turn N+5. Operator cancel + tab close also iterate the map and kill everything.
|
|
237
|
+
- **Background Bash → KillShell registry.** `Bash(run_in_background:true)` returns a `shellId` and registers `{kill, backgrounded:true}` on the worker's per-turn shell map. Foreground Bash also registers (cleared on close) so KillShell can interrupt a stuck foreground command. The map is per-worker (not per-turn) so a background shell started in turn N is killable from turn N+5. Operator cancel + tab close also iterate the map and kill everything; `dispose()` then awaits each registration's `ended` promise (process closed and tree kill finished, capped at 15 s), so nothing keeps the project folder open on Windows.
|
|
237
238
|
- **Hooks fire inside the dispatcher; they're not the steer-drain hook.** `PreToolUse` / `PostToolUse` fire around each tool call inside `dispatchTool(...)`. The steer-drain hook fires between tool-result append and the next API round-trip in the agent loop. Both can fire on the same iteration without conflict - they have separate purposes (settings.json hooks observe individual tool calls; steer drain delivers operator-typed mid-turn input).
|
|
238
239
|
- **Handoff disposes the cached worker.** After `handoff_complete`, `disposeProviderResources(workflowId)` is called which tears down the cached `ClaudeNativeWorker`. The next operator turn rebuilds the messages array from the post-handoff transcript. Don't skip this - the worker's in-memory `messages[]` array would otherwise still reference the pre-handoff thread.
|
|
239
240
|
- **Original-worker handoff may fall back to fresh-summarizer.** Native original-worker reflection can fail after a long/expensive turn when Anthropic terminates the stream (`Anthropic HTTP 0: terminated`) or the source session is otherwise degraded. `runExportContext` keeps the same handoffId/artifactName and falls back to the configured fresh summarizer when original-worker returns an error. It also enforces a bounded original-worker reflection timeout (`ARCO_HANDOFF_ORIGINAL_WORKER_TIMEOUT_MS`, default 180s, clamped 30s-600s) so a degraded old session cannot hold Handoff for minutes before the fallback path starts. This is still operator-initiated Handoff, not an autonomous second-LLM loop: the operator clicked the primitive, the fallback is visible as a system notice, and the final artifact flows through the normal `handoff_artifact_ready` / `handoff_complete` path. Client upsert must clear a prior handoff error if the same handoffId later succeeds.
|
|
@@ -273,10 +274,10 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
273
274
|
- **The Native system prompt carries a standing turn-discipline block - don't remove it as "prompt bloat."** The forced first block is only the one-line Claude Code identity; the real CLI ships extensive turn-completion doctrine that Native historically lacked, which is why a model could checkpoint mid-task ("Continuing now." → end_turn → idle) where Claude Code would keep working. `buildSystemBlocks` appends the doctrine after the env note and before operator prompts: keep working until done or blocked, never end a turn on a status update/promise, report failed Task delegations explicitly. Cache-stable, unconditional, no cache breakpoint of its own.
|
|
274
275
|
- **Adaptive-thinking display defaults to `omitted` - a long Fable/Opus think is invisible by design.** `buildThinkingParams` sends `thinking: {type: 'adaptive', display: 'omitted'}` (Claude Code parity), so during an adaptive-thinking stretch the SSE stream carries only `ping` events - nothing bumps `lastPrimaryEventAt` and the client's 30s stuck banner fires on a perfectly healthy worker (a long adaptive-thinking stretch can be legitimately silent for minutes). The per-tab CONFIG `THINKING VISIBILITY` picker (`claudeNativeThinkingDisplay`, `'omitted' | 'summarized'`) flips to `summarized`, streaming thinking deltas into the Activity tab (`primary_thinking` rows) which also refresh the stuck clock. The stream pipeline (`thinking_delta` → `emit('thinking')` → `primary_thinking`) already existed for budget-thinking models - don't "optimize" it away for adaptive ones. Primitives (reviewers / handoff seeds / DOCS / GIT) leave the field unset ⇒ omitted, mirroring outputStyle's forced `'normal'`.
|
|
275
276
|
- **Interleaved-thinking beta is skipped for adaptive-thinking models by default.** Current Pi comments that adaptive-thinking models have interleaved thinking built in, so it appends `interleaved-thinking-2025-05-14` only for non-adaptive Anthropic thinking paths. Arco mirrors that by default. The CONFIG tab has a Native-only debug toggle (`claudeNativeForceInterleavedThinkingBeta`) that forces the legacy beta anyway on the next turn for A/B testing if a future model starts repeating searches or missing tool-result evidence. Keep the default off unless a fresh failing transcript justifies the experiment.
|
|
276
|
-
- **
|
|
277
|
+
- **Attachment labels accompany decoded content.** Native prepares images, PDFs, Office documents and notebooks through the shared decoder. Local and CLI adapters prepare fitted images and document text; unsupported binaries provide a note. Source-path labels identify each attachment alongside its content. Saved Native context retains file receipts and attachment references; use Read again for exact detail after reload or compaction.
|
|
277
278
|
- **Tool-loop iteration cap is a runaway-loop safety net, not an expected workload boundary.** Default `MAX_TOOL_TURNS = 1000` (override via `ARCO_CLAUDE_NATIVE_MAX_TOOL_TURNS` up to 10000). CLI is unbounded; the cap exists purely to catch a stuck model burning tokens indefinitely on a multi-tab Arco. Real workloads top out in the low hundreds; if you ever see this fire on a legitimate task, the cap should go away entirely.
|
|
278
|
-
- **The §2.3 budget meter (`context_budget`) reads against the EFFECTIVE window, not the raw one.** `contextBudget.ts` computes `pct = usedTokens / (windowSize
|
|
279
|
-
- **§2.1 Fold (`context_folded`) is a deterministic in-place trim - and like COMPACT it MUST re-seed from the SAME helper at the live and replay sites.** `foldClaudeNativeWorker` replaces a mid-history prefix with a deterministic `foldDigest` (NO model call - task / files / cmds / searches / errors / recent-asks / open-todos extracted from the folded prefix + the live todo list) plus a verbatim token-bounded tail, persists `context_folded { summary, keptTail }`, and continues the SAME session. Replay resets at that marker and re-seeds via `compactSummarySeed(summary, keptTail)` - the exact dual-site byte-identity rule as `native_compacted` (don't fork the wording between sites). It is a DISTINCT event from `native_compacted` so the UI/transcript can tell an instant deterministic Fold from an LLM `/compact`. Manual via the composer FOLD button (`fold_workflow`, idle + Native-gated); auto via the per-tab `autoFold` config (default OFF, set through `update_primary_config`) whose `foldAt`
|
|
279
|
+
- **The §2.3 budget meter (`context_budget`) reads against the EFFECTIVE window, not the raw one.** `contextBudget.ts` computes `pct = usedTokens / (windowSize - reservedOutput)` - the reserved output tokens (`chooseMaxTokens`) are unusable for input, so a percent against the raw window under-reports how close the prompt is to the wall the API enforces. Pure + LLM-free (the worker passes three ground-truth numbers: `lastPromptTokens`, `KNOWN_CTX`, `chooseMaxTokens`). This meter - NOT the CTX bar's `context_usage` - is the signal the Fold/auto-fold trigger reads. Emitted alongside every `primary_complete`; transient (derived per turn, not persisted).
|
|
280
|
+
- **§2.1 Fold (`context_folded`) is a deterministic in-place trim - and like COMPACT it MUST re-seed from the SAME helper at the live and replay sites.** `foldClaudeNativeWorker` replaces a mid-history prefix with a deterministic `foldDigest` (NO model call - task / files / cmds / searches / errors / recent-asks / open-todos extracted from the folded prefix + the live todo list) plus a verbatim token-bounded tail, persists `context_folded { summary, keptTail }`, and continues the SAME session. Replay resets at that marker and re-seeds via `compactSummarySeed(summary, keptTail)` - the exact dual-site byte-identity rule as `native_compacted` (don't fork the wording between sites). It is a DISTINCT event from `native_compacted` so the UI/transcript can tell an instant deterministic Fold from an LLM `/compact`. Manual via the composer FOLD button (`fold_workflow`, idle + Native-gated); auto via the per-tab `autoFold` config (default OFF, set through `update_primary_config`) whose `foldAt` is **FOLD AT** on the budget meter. A Fold is not counted toward auto-handoff (which fires after N compactions). Anti-thrash: a fold whose `byteDelta < MIN_EFFECTIVE_FOLD_BYTES` increments `foldIneffectiveCount`; ≥2 ineffective folds (`MAX_INEFFECTIVE_FOLDS`) stop auto-fold.
|
|
280
281
|
- **`tool_evicted` (§2.2 aggregate spill) is DISTINCT from `tool_filtered` (per-pack tool-result trim) - don't conflate them.** `toolResultEviction.planTurnSpill` fires only when a turn's SUMMED tool-result token cost exceeds the turn budget, then replaces the largest results with a semantic 1-liner receipt (`[Bash] npm test → exit 0 · 47 lines`) largest-first until the retained sum is back under budget. Operator-armed via the `ARCO_TOOL_EVICT` env var (`toolEvictEnabled()` - `on`/`1`/`true`; a per-tab CONFIG toggle is the planned layer on top of this floor). Cache-safe: rewrites only the just-finished turn's results before they form a cache breakpoint. The cross-turn `planTailEviction` (which DOES rewrite prior turns - a deliberate cache break) runs ONLY inside the §2.1 Fold path. Both gzip the raw output to `rawArtifactPath` (fully reversible), same convention as `tool_filtered`.
|
|
281
282
|
- **§4.1 tool posture filters `buildToolDefs()` to a DETERMINISTIC bundle; `toolPosture.ts` is the single source of truth (clusterEfficiency.ts pattern).** `full` (default) is a no-op (byte-identical tab). `coding`/`review`/`chat` keep a curated CORE set - but tools OUTSIDE the known universe (operator-opted-in `mcp__*` / `peer_*` / `ctx_*` dynamic tools) ALWAYS pass through: a posture must never silently strip an explicit operator opt-in. Two guards: a non-empty fallback (a bundle that would empty the set falls back to `full` + logs, so a turn never bricks on zero tools) and `scrubCrossRefs` (drops "X is still available" clauses in surviving descriptions that name a now-removed tool). Session-local on `WorkflowState` (NEVER meta.json - a reload returns to `full`), but the pick IS broadcast/persisted in events.jsonl via `tool_posture_set` for review. Flipping posture re-breaks the cached `tools[]` prefix once, then re-warms. Native-only; `set_tool_posture` takes effect next turn.
|
|
282
283
|
- **H50 fuzzy Edit apply NEVER writes back the model's drifted `old_string` - it splices the file's ACTUAL bytes.** `editApply.ts` runs an exact-first chain (`exact` → `escape-drift` → `trailing-ws` → `indent`); each fuzzy strategy must be UNAMBIGUOUS (exactly one match) unless `replace_all`, and the splice replaces the matched region's real bytes (so a one-space / re-indent / over-escaped-`\n` drift applies cleanly instead of returning "old_string not found" and burning a turn). On total no-match it returns a "closest lines" hint so the model corrects without re-Reading. MultiEdit/batch is out of scope. Don't let a fuzzy strategy write the drifted string - that would corrupt the file with the model's mis-remembered whitespace.
|
|
@@ -285,17 +286,17 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
285
286
|
- **DD2 Bash output NEVER kills on the cap - it spills the COMPLETE output to a tempfile and keeps a bounded RAM tail.** `outputAccumulator.ts` decodes with a streaming `TextDecoder` (UTF-8 chars don't straddle pipe-chunk boundaries → no mojibake), keeps a bounded tail in RAM, and once total output exceeds the cap spills the full stream from byte 0 to a tempfile the model can re-read. The spill sink is INJECTED (the bash tool wires a real tempfile; tests wire an in-memory sink) so the accumulator does no I/O itself. Don't restore a kill-on-cap path - a truncated-and-killed command loses the very tail (compiler/test errors land at the end) the operator and model need.
|
|
286
287
|
- **DD3: Native Write/Edit serialize per real file path through a MODULE-LEVEL mutation queue - the fix for silent lost writes between cluster members on one cwd.** `file-mutation-queue.ts` keys `withFileMutationLock` by `realpath()` (symlink aliases collapse to one queue), and the queue `Map` is module-level so every Native worker in the process (all members of one cluster) serializes against each other, not just a worker against itself - distinct files still run in parallel. The enqueue critical section (async `realpath` + tail read/write) is itself serialized via `registrationTail` to close a registration race for a brand-new path. Emits `file_mutation_queued` ONLY when a write actually waited (its presence in events.jsonl IS the contention signal). NOT proper-lockfile (that's cross-process; DD3 is in-process - CLI claude edits in a child and is out of scope).
|
|
287
288
|
- **H62: a Write after only a PARTIAL Read of the file this turn surfaces a non-blocking warning (cluster-correctness).** A `Write` replaces the whole file; if the model Read only a slice (`offset`/`limit`) it never saw the tail, and the write silently destroys the unseen lines. The worker's `partialReadSet` (paths Read with offset/limit this turn; a later FULL Read of the same path clears it) drives a warning note on the tool result + a `tool_gate_triggered` event - NOT a gate (a wholesale rewrite is sometimes intended). `Edit` is exempt (targeted splice). Reset per turn alongside `readSet`.
|
|
288
|
-
- **H30: a Task child inherits the parent's `outputStyle` - thread it through `runPrimaryTurn`, NOT `derivePrimaryConfig`.** `derivePrimaryConfig` drops `outputStyle`, so the child silently ran `normal` regardless of the parent's OUTPUT STYLE pick until the child turn passed
|
|
289
|
+
- **H30: a Task child inherits the parent's `outputStyle` - thread it through `runPrimaryTurn`, NOT `derivePrimaryConfig`.** `derivePrimaryConfig` drops `outputStyle`, so the child silently ran `normal` regardless of the parent's OUTPUT STYLE pick until the child turn passed the parent's level explicitly (now `resolveOutputStyle(parent.config.outputStyle)`, so a parent with no saved style passes the default). The Task tool description also instructs the child to END with a verifiable self-report (files changed / verify commands + outcome / anything undone) so the parent can trust the result without re-deriving it.
|
|
289
290
|
- **H9 in-turn tool-loop guard (`toolLoopGuard.ts`, Native) is warnings-only by default; hard-stop is opt-in.** Two per-turn signals (reset at `primary_turn_started`): identical-repeat (same `tool`+`argsHash` N×, higher threshold - paging/polling is legitimate) and no-progress (same `tool`+`argsHash`+normalized `outputHash` - the model re-calls on a byte-identical result, lower threshold). Default `warn` emits a `tool_loop_warning` + `system_notice`; `ARCO_TOOL_LOOP_GUARD=stop` aborts the loop on first trip; `off` disables detection. Event metadata is `{toolName, argsHash}` ONLY - never raw args (secrets / large pastes). Sibling of the cross-turn §3.1 stuck breaker (see § Worker safety) - the two compose: H9 catches a tight same-turn spin in a few iterations, §3.1 catches a worker failing the same way across turns.
|
|
290
291
|
- **H8 aggregate `@`-ref budget gate (`contextRefs.ts`, all providers) soft-warns at ~25% and HARD-REFUSES any ref past ~50% of the window.** The per-ref 64 KB cap bounds ONE ref; H8 sums estimated tokens across every `@file:` / `@diff` / `@git` ref in a turn and, once the running aggregate would cross the hard ceiling, refuses that ref AND every ref after it - so a stack of pastes can't bury the operator's actual instruction. Conservative default window (200k) for unknown models so the gate still bites. Runs at the send path in `handleUserMessage`, not in a provider - so it's transport-agnostic.
|
|
291
292
|
|
|
292
|
-
- **The Native request prefix is FROZEN per worker and only ever extended.** Claude Fable 5.1 binds every thinking block's signature to the top-level `system`, the name-sorted `tools` set, and every earlier message; editing any of them invalidates every later block (`drop_block` degradation applies when the request opts in - Arco opts in). `resolvePrefixForRequest()` snapshots `system` + `tools` on the worker's FIRST `messages.create` and puts that snapshot on the wire forever after. `buildSystemBlocks()` / `buildToolDefs()` still run per request, but their output is DIFFED (`appendOnlyPrefix.ts`), not sent: a changed system block set becomes an appended `{role:'system'}` message (`ctx_action system_delta`), a changed tool set becomes `tool_addition` / `tool_removal` blocks (`ctx_action tool_set_change`, beta `mid-conversation-tool-changes-2026-07-01`; newly-seen tools are appended to the frozen array with `defer_loading:true`, never inserted). Models without `role:'system'` support (Sonnet 5, Opus 4.7 and older) keep the old rebuild-per-request path - they don't enforce binding. **Never "fix" a stale system prompt by rebuilding it mid-worker, and never reset the freeze on a config change** - `resetPrefixFreeze()` is only for a conversation restart (Fold, Compact, replay, seed). Description-text changes on a still-present tool (posture `scrubCrossRefs`, `webSearchMaxUses`) are ignored while frozen and logged.
|
|
293
|
+
- **The Native request prefix is FROZEN per worker and only ever extended.** Claude Fable 5.2 / 5.1 binds every thinking block's signature to the top-level `system`, the name-sorted `tools` set, and every earlier message; editing any of them invalidates every later block (`drop_block` degradation applies when the request opts in - Arco opts in). `resolvePrefixForRequest()` snapshots `system` + `tools` on the worker's FIRST `messages.create` and puts that snapshot on the wire forever after. `buildSystemBlocks()` / `buildToolDefs()` still run per request, but their output is DIFFED (`appendOnlyPrefix.ts`), not sent: a changed system block set becomes an appended `{role:'system'}` message (`ctx_action system_delta`), a changed tool set becomes `tool_addition` / `tool_removal` blocks (`ctx_action tool_set_change`, beta `mid-conversation-tool-changes-2026-07-01`; newly-seen tools are appended to the frozen array with `defer_loading:true`, never inserted). Models without `role:'system'` support (Sonnet 5, Opus 4.7 and older) keep the old rebuild-per-request path - they don't enforce binding. **Never "fix" a stale system prompt by rebuilding it mid-worker, and never reset the freeze on a config change** - `resetPrefixFreeze()` is only for a conversation restart (Fold, Compact, replay, seed). Description-text changes on a still-present tool (posture `scrubCrossRefs`, `webSearchMaxUses`) are ignored while frozen and logged.
|
|
293
294
|
- **Per-turn text goes on the USER message, never in `system` (`WorkerConfig.turnNotice`).** The peer-mailbox notice and the plan-mode arm nudge used to be `firstIteration`-gated folds into `appendSystemPrompt`, which flipped the system prompt between consecutive requests of one auto-continued turn. On Native they now ride `turnNotice` → `appendTextToLastUserMessage` (a trailing `text` block on the operator's message, kept in history for good - deleting it next turn would be the same edit). CLI / Codex still get them inside `appendSystemPrompt`. Don't add a new per-turn reminder to `buildSystemBlocks()`; add it to `turnNoticeParts` in turnEngine.
|
|
294
|
-
- **Thinking blocks are never deleted from history; on binding-enforcing models the end-of-turn evidence prune is skipped.** `pruneServerToolEvidenceAfterTurn` keeps `thinking` / `redacted_thinking` on every model (the pre-2026-09 shape deleted them, so no reasoning ever crossed a turn and Fable/Opus 5 started every turn cold). On `fable-5-1` / `mythos-5-1` / `opus-5-5` the whole prune is skipped after a normal turn - removing server-tool evidence from the turn's own messages would invalidate that turn's later thinking. The abort-path `scrubServerToolEvidenceOnAbort` still runs everywhere (an orphan `server_tool_use` is a guaranteed 400 - correctness beats cache). Pre-request scrubs (`scrubEmptyTextContent`, `stripTrailingThinkingBlocks`) walk only `unsentTail()` - messages past `sentThrough`, which advances after every accepted request.
|
|
295
|
+
- **Thinking blocks are never deleted from history; on binding-enforcing models the end-of-turn evidence prune is skipped.** `pruneServerToolEvidenceAfterTurn` keeps `thinking` / `redacted_thinking` on every model (the pre-2026-09 shape deleted them, so no reasoning ever crossed a turn and Fable/Opus 5 started every turn cold). On `fable-5-2` / `fable-5-1` / `mythos-5-2` / `mythos-5-1` / `opus-5-5` the whole prune is skipped after a normal turn - removing server-tool evidence from the turn's own messages would invalidate that turn's later thinking. The abort-path `scrubServerToolEvidenceOnAbort` still runs everywhere (an orphan `server_tool_use` is a guaranteed 400 - correctness beats cache). Pre-request scrubs (`scrubEmptyTextContent`, `stripTrailingThinkingBlocks`) walk only `unsentTail()` - messages past `sentThrough`, which advances after every accepted request.
|
|
295
296
|
- **A `role:'system'` message directly followed by a user message is a 400.** `runTurn` calls `popTrailingSystemMessages` before pushing the operator turn; `resolvePrefixForRequest` only appends when the last message is a user turn (else the delta waits a round and logs `pending`). Arco's own system messages carry a private `arco:` marker that `toWireMessages` strips - Fold / Compact / replay projections already skip non-user/assistant roles, so they never leak into a summary seed.
|
|
296
|
-
- **Binding controls are on for Fable 5.
|
|
297
|
-
- **`claudeNativeThinkingDisplay:'updates'` is a third display mode (Fable 5 / 5.1 / Mythos 5.1 / Opus 5.5 only).** On Opus 5.5 the between-tool-call notes Opus 5 returned as `text` come back as thinking blocks, so under the default `omitted` an Opus 5.5 tab's Activity goes quiet during long tool loops - use `summarized` (or try `updates`). Sends `display:'updates'` + beta `thinking-display-updates-2026-08-18`; the model's between-tool-call progress notes come back as non-empty `thinking` blocks (reasoning stays hidden) and stream through the existing `primary_thinking` rows. `resolveThinkingDisplay` degrades it to `omitted` on any other model so an unknown enum value never 400s. Echo them back unchanged like any thinking block. The stream handler forwards non-empty `thinking_delta` values; the provider may return empty blocks.
|
|
298
|
-
- **The Claude-Code wire fingerprint (`user-agent: claude-cli/<ver>`) is model-gated by Anthropic - `wireFingerprint.ts` is the single source of truth.** Fable 5.
|
|
297
|
+
- **Binding controls are on for Fable 5.2 / 5.1 and Mythos 5.2 / 5.1 / Opus 5.5 (`enforcesPreservedThinking`): `thinking.block_binding.prefix_mismatch_behavior:'drop_block'` + beta `thinking-binding-controls-2026-08-01`.** Opus 5.5 (2026-09-22) ships the same preserved-thinking check as Fable 5.1; Opus 5 does NOT and 400s on `block_binding` - every gate keys on `opus-5-5` explicitly because `includes('opus-5')` matches both (pinned in `appendOnlyPrefix.test.ts`). Every `message_start` then carries `input_transformations`; the worker logs `input_transformations=N` per round and emits `ctx_action { action:'thinking_dropped_by_api', trigger:'api' }` when N>0. **Empty on every round is the proof the harness is append-only** - a `prefix_binding_mismatch` entry is a bug to chase (something before `path` changed since the previous request); `model_binding_mismatch` right after a live model swap is expected and unbilled. Two 400 recoveries in `handleApiError`: a signature/binding rejection strips every thinking block once and retries (`strip_thinking_binding_mismatch`); a rejection naming `tool_addition` / `tool_reference` / `role 'system'` / `block_binding` / `clear_at` THAWS the worker (`prefixThawed`, Arco system messages removed, rebuild-per-request for the rest of its life) and retries - worst case is the pre-plan behaviour, never a dead tab.
|
|
298
|
+
- **`claudeNativeThinkingDisplay:'updates'` is a third display mode (Fable 5 / 5.1 / 5.2 / Mythos 5.1 / 5.2 / Opus 5.5 only).** On Opus 5.5 the between-tool-call notes Opus 5 returned as `text` come back as thinking blocks, so under the default `omitted` an Opus 5.5 tab's Activity goes quiet during long tool loops - use `summarized` (or try `updates`). Sends `display:'updates'` + beta `thinking-display-updates-2026-08-18`; the model's between-tool-call progress notes come back as non-empty `thinking` blocks (reasoning stays hidden) and stream through the existing `primary_thinking` rows. `resolveThinkingDisplay` degrades it to `omitted` on any other model so an unknown enum value never 400s. Echo them back unchanged like any thinking block. The stream handler forwards non-empty `thinking_delta` values; the provider may return empty blocks.
|
|
299
|
+
- **The Claude-Code wire fingerprint (`user-agent: claude-cli/<ver>`) is model-gated by Anthropic - `wireFingerprint.ts` is the single source of truth.** Fable 5.2 requires CLI version 2.1.290 or newer. The pin prevents a local CLI update from silently changing the wire fingerprint. Update the constant rather than its call sites (worker `messages.create`, `catalog.ts` `/v1/models`, and the diagnostic probe), and validate supported models.
|
|
299
300
|
|
|
300
301
|
## Codex
|
|
301
302
|
|
|
@@ -303,7 +304,7 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
303
304
|
- **Codex context size has a conservative default and a larger catalog maximum.** As of 2026-09-11, Astra and the GPT-5.6 workers (and GPT-6 Sol / Luna from 2026-09-22) advertise `context_window:272000`, `max_context_window:872000`, and `effective_context_window_percent:95`, producing 258.4K STANDARD or 828.4K MAX. Arco defaults per-tab `codexContextPolicy` to MAX and reads these values from the selected account's live `$CODEX_HOME/models_cache.json`; never hardcode the override because model/account entitlements can change. Both exec and app-server must receive the same policy. Changing policy/model/account must change the app-server bootstrap signature so the child recycles and resumes the durable thread on the next turn. Missing metadata omits the override and fails safe to Codex's own default. The stream-reported `model_context_window` still wins in the CTX bar.
|
|
304
305
|
- **No concurrent-writer guard for Codex rollouts (yet).** Claude's JSONL watcher detects foreign `claude --resume <uuid>` writes and refuses turns for 60s. Codex doesn't have an equivalent. Probe (2026-04-26): every rollout file at `~/.codex/sessions/<y>/<m>/<d>/rollout-*.jsonl` carries a unique UUID in its filename - strong evidence that each `codex exec` and `codex exec resume <uuid>` invocation creates a NEW rollout file rather than appending to the existing one (the long 1k-line rollouts in the wild are from the interactive `codex` TUI, not from `exec --json`). If that holds for current Codex CLI versions, two concurrent `exec resume` calls against the same `thread_id` produce two separate rollout files and there's no interleaved-write corruption to worry about. **Caveat: this hasn't been verified by triggering the race directly.** If a future Codex CLI version flips to append-mode, port the Claude pattern from `sessionJsonl.ts` (entrypoint-detection + 60s refusal). For now, the operator-self-inflicted concurrent-resume risk is treated as acceptable and the guard is deferred.
|
|
305
306
|
- **Codex `cached_input_tokens` is a SUBSET of `input_tokens`, not disjoint.** OpenAI and Anthropic report cache fields with opposite semantics. For **Anthropic/Claude**, `input`, `cacheRead`, and `cacheCreate` are disjoint and sum to the total prompt - Arco's ctx for Claude is `input + cacheCreate`. For **OpenAI/Codex**, `input_tokens` IS the full prompt size and `cached_input_tokens` is informational ("of those input_tokens, this many were served from cache"). Confirmed against real rollout: `input=8402, cached=7296, total=8641` - math only checks out if cached is a subset of input. Arco's ctx for Codex is therefore just `input`. Adding cacheRead would double-count the cached portion. The client's `contextTokens(usage, provider)` branches accordingly; don't unify the formula and don't flip Codex back to a sum.
|
|
306
|
-
- **
|
|
307
|
+
- **Use the Codex-reported context window when available.** Propagate the observed value to the context meter instead of relying on a fallback estimate, and keep per-call context usage separate from aggregate billing usage.
|
|
307
308
|
- **TokenUsage carries Codex-only fields too.** `reasoningOutput` is a subset of `output` representing the model's hidden reasoning trace (high-effort GPT-5.x turns can put significant tokens here, and they roll forward into the next turn's prompt - explains why session ctx grows faster than visible chat would suggest). `total` is the provider-reported total when present. Both are captured from `turn.completed.usage.reasoning_output_tokens` / `total_tokens` and from `event_msg::token_count.info.last_token_usage` if Codex emits the TUI envelope. Don't sum them with input/output manually - they're informational subsets/totals, not additive.
|
|
308
309
|
- **`codex exec --json`'s `turn.completed.usage` aggregates across internal LLM calls within an operator turn - that's a billing number, not a context-window-fill number.** GPT-5.5 high is agentic: one operator turn can drive 5+ internal model calls (think → tool → think → tool → respond). The `usage` block on `turn.completed` reports `input_tokens` summed across all those internal calls. For a 60-character prompt that triggered a heavy investigation, this can land at 400k while the model's actual per-call context fill was ~80k. To recover the per-call reality, the server tails `~/.codex/sessions/<y>/<m>/<d>/rollout-*-<thread_id>.jsonl` after `turn.settled` and reads the latest `event_msg::token_count.info.last_token_usage` (per-call snapshot) and `model_context_window` (the only honest source - exec --json doesn't surface it). Broadcast as `codex_token_snapshot`; client overrides `lastTurnTokens` so the CTX bar reflects per-call reality. `totalTokens` (cumulative billing) keeps the aggregated number - that's the right metric for "you've burned X input tokens this turn" reporting. The post-settle read is awaited before `maybeAutoHandoff()` so threshold checks use the fresh percentage. Code: `server/src/workflows/transcripts.ts` + the post-settle path in `server/src/ws/turnEngine.ts`. Don't simplify back to using `turn.completed.usage` for the CTX bar.
|
|
309
310
|
- **Original-worker Handoff on a near-full Codex thread will fail at `exec resume`.** Arco's reflection prompt is fixed-length (a few KB), so prompt size isn't the bottleneck. The risk is the thread itself: `codex exec resume <thread_id>` loads the full prior context internally, and if that context already saturates the model's window, the resume errors out before reflection runs. Not original-worker-specific - any `exec resume` on a near-full thread has the same limit. Mitigation if it bites: fall back to `fresh-summarizer` mode (renders the transcript through a fresh Codex worker, which sees only the rendered text + summary prompt). The mode picker exposes both; operator picks. No automatic threshold-based fallback today.
|
|
@@ -341,9 +342,9 @@ These guardrails bound worker memory use and prevent a runaway subprocess from d
|
|
|
341
342
|
|
|
342
343
|
`server/src/media/ffmpeg.ts::resolveMediaInput` / `resolveMediaOutputDir` widen the studio from "cwd-only" to a general tool - **carefully**. The fence is the security core; don't loosen a tier or skip a gate.
|
|
343
344
|
|
|
344
|
-
- **Three tiers, in order:** (1) inside the workflow cwd → always; (2) inside Arco's `media-scratch` (`server/src/media/scratch.ts::isWithinScratch`) → always; (3)
|
|
345
|
+
- **Three tiers, in order:** (1) inside the workflow cwd → always; (2) inside Arco's `media-scratch` (`server/src/media/scratch.ts::isWithinScratch`) → always; (3) inside a folder listed in `mediaAllowedRoots` → **only** when `mediaUnconfined === true`. A path clearing none throws `bad-path`. The output dir is gated by the **same** `gate()`.
|
|
345
346
|
- **`unconfined: false` MUST reproduce the pre-N2 fence exactly** (cwd + scratch only). The positional `runMediaOp(cwd, path, spec)` form passes no `opts`, so `unconfined` defaults to `false` - this is what keeps the `audio-ops`/`video-ops` smokes' path-escape assertions (`/etc/hosts`, `../../`) green. Don't flip the default to open.
|
|
346
|
-
- **Default-
|
|
347
|
+
- **Default-CONFINED, and global settings only.** `mediaUnconfined` undefined ⇒ confined (the routes test `=== true`), and outside access also needs the folder in `mediaAllowedRoots` (at most 32). The routes read both from the global settings (`readSettings()` without a cwd), so a project `.arco/settings.json` cannot widen access. Keep the Settings controls + the `bad-path` message that points at them.
|
|
347
348
|
- **Scratch is always allowed but bounded.** Upload writes to a **fresh per-upload dir** under a **sanitized** basename (can't escape regardless of `?name=`), with a per-upload byte cap, a 24h TTL, and a total-size cap (oldest evicted). `isWithinScratch` is a pure path-containment check - we wrote the bytes, so no symlink-following is needed. Don't gate uploads behind `mediaUnconfined` (imported-file conversion must work even when CONFINED).
|
|
348
349
|
- **Operator-chosen output never escapes the never-overwrite invariant.** `outputBasenameFor` keeps the stem but **forces** the op's target ext (`targetOutputExt`); `uniqueBasename` + the `outputAbs === inputAbs` refusal + ffmpeg `-n` still hold. `relPath` is returned **only** for an in-cwd output (drives REVEAL IN FILES); out-of-cwd returns the absolute `outputPath` only.
|
|
349
350
|
|
|
@@ -420,7 +421,7 @@ The N3 ops (`framegrab` / `gif` / `geometry` / `speed` / `gain` / `spectrogram`
|
|
|
420
421
|
- **Think-tag streaming, two paths.** Native-parser models (qwen3.5/qwen3.6 with `RENDERER qwen3.5` / `PARSER qwen3.5`, qwen3-vl-thinking, deepseek3, gpt-oss) emit reasoning in `message.thinking` separate from `message.content`. `ollama.ts` reads both: `message.thinking` is forwarded straight to the `thinking` event channel; `message.content` runs through `ThinkSplitter` for legacy non-native-parser models (heretic-tools, qwopus) that still embed `<think>...</think>` in content. Native-parser models also need `think: true` in the request body - `ollama.ts` sends this as `effort !== 'low'`. Don't reintroduce a hand-rolled TEMPLATE that omits the qwen3.5 RENDERER/PARSER directives - capability detection breaks (no `thinking` advertised) and reasoning silently disappears.
|
|
421
422
|
- **`config.tools` is now an allowlist for Ollama.** Reviewer spawns pass `READ_ONLY_OLLAMA_TOOLS = ['Read','Grep','Glob','WebSearch','WebFetch']` to restrict the registry. Primary spawns pass `tools: undefined` to get the full kit. The Ollama reviewer also overrides `skipPermissions: true` so tools execute (SAFE mode would otherwise return denial strings, defeating the purpose of a code-reading reviewer). Allowlist is the safety net; AUTO/SAFE doesn't apply when no destructive tools are on the menu.
|
|
422
423
|
- **Read tool cap is 32 KB, not 256 KB.** Local model windows are smaller than Claude's; a single big Read can overflow context, and 5 parallel Reads definitely will. Models that need more from a file should use the Claude-shape `offset` (1-based start line) and `limit` (max lines) args. Don't bump the cap without a similar bump to `num_ctx` in every Modelfile.
|
|
423
|
-
- **Vision
|
|
424
|
+
- **Vision support depends on the selected backend.** A model can advertise image input while a backend lacks the matching architecture or projector support. Use a model and loadout the selected backend supports.
|
|
424
425
|
- **Tool runtime is server-side.** Ollama's `/api/chat` returns `tool_calls`; Arco executes them in `OllamaWorkerProcess.dispatchToolCalls()` (see `ollamaTools.ts`). Path validation lives in the executor, not the loop. v1 allowlist is Read/Glob/Grep/Write/Bash/WebSearch/WebFetch - don't expand without a security pass on the new tool's blast radius.
|
|
425
426
|
- **SAFE mode = denial string, not protocol pause.** SAFE mode (operator's `skipPermissions: false`) returns a denial string as the tool result so the loop converges without a new approval-protocol surface. Operator-level cancel still works at any point. This is intentional per plan §5.4 design choice (a).
|
|
426
427
|
- **Stream EOF drains the trailing buffer.** `streamOneTurn`'s NDJSON loop synthesizes a `\n` and re-splits when `reader.read()` returns `done:true` with non-empty `buf`. Without this, daemons that close the stream right after the final `done:true` envelope (no trailing newline) drop token counts (`prompt_eval_count` / `eval_count`) and `total_duration`, breaking the CTX-bar denominator. Don't simplify the loop back to plain `if (done) break`.
|
|
@@ -478,7 +479,7 @@ The utility/summarizer call is `stream:false`, and two non-obvious facts make it
|
|
|
478
479
|
|
|
479
480
|
**MEASURE, don't guess.** Max-num_ctx capacity depends on the daemon's KV-cache quant (`OLLAMA_KV_CACHE_TYPE` - f16/q8_0/q4_0 swing it ~4×) and flash attention, which a static arch formula can't know. Two earlier static approaches were both wrong: a param-count heuristic (off ~50% on GQA), then an exact-arch f16 calc (still 4×+ low for an operator running q4_0 KV, which is the *normal* "maximize context" setup). The only reliable signal is the model's actual VRAM.
|
|
480
481
|
|
|
481
|
-
- **`estimateMethod: 'measured-live'` is the trusted path.** When the model is loaded, `/api/ps` gives its real `size_vram` at its real `context_length`. Back out KV/token = `(size_vram
|
|
482
|
+
- **`estimateMethod: 'measured-live'` is the trusted path.** When the model is loaded, `/api/ps` gives its real `size_vram` at its real `context_length`. Back out KV/token = `(size_vram - weights) / context_length` (base = on-disk weights, NOT weights+overhead - overhead falls into the slope, which keeps it conservative and, critically, never negative so a tiny q4_0 KV doesn't false-negative to 'needs-load'). Then `maxNumCtx = (totalVram - weights) / kvPerTok`, capped at `contextMax`. This reflects q4_0/q8_0/flash-attention automatically. ONLY this path drives SET TO FIT + the warning.
|
|
482
483
|
- **`'needs-load'`** - dense model not loaded. Don't fabricate a number (can't know the KV quant). Tell the operator to run a turn so it can be measured. No warning.
|
|
483
484
|
- **`'sliding-window'`** (gemma: `*.attention.sliding_window` in `model_info`) - KV is window-bounded, context isn't the VRAM limiter; report the full trained `contextMax`, never warn. (gemma also omits `head_count_kv`, so even a dense calc is impossible.)
|
|
484
485
|
- **`'unknown'`** - no GPU / no metadata. Informational only.
|
|
@@ -489,14 +490,16 @@ The utility/summarizer call is `stream:false`, and two non-obvious facts make it
|
|
|
489
490
|
|
|
490
491
|
Cursor is an ACP provider (`cursor-agent acp`). Current transport details are summarized in `docs/PROVIDERS.md`; these are the load-bearing traps.
|
|
491
492
|
|
|
493
|
+
- **`cursor-agent acp` ignores `--model`; select the model over ACP and confirm it.** A new session reports `default[]` whatever was passed, and only the advertised ids (one per model, with the Cursor CLI's saved settings) are accepted by `session/set_config_option` / `session/set_model`. Never record a model as applied without a confirmed `currentValue`, and never map a catalog variant by model name alone: effort, fast and thinking must match (`modelMap.ts`). Anything else gets a notice naming both models. A successful selection also rewrites the Cursor CLI's saved default model.
|
|
494
|
+
- **Sign-in failures are not start failures.** `Authentication required` (session/new, stderr) must not bump the start-failure breaker, or signing in again leaves the tab blocked. A failed start must also end its child (`ensureStarted` catch), and a worker ignores exit events from a child it already let go of.
|
|
492
495
|
- **Cluster peer tools ride a loopback HTTP MCP, never stdio.** Cursor ACP advertises `mcpCapabilities:{http:true,sse:true}` and **no stdio** - the stdio child Claude-CLI/Codex members spawn is silently ignored (a stdio `mcpServers` entry is accepted but its tool never called). Cursor members get peer tools from an in-process loopback **StreamableHTTP** MCP server (`server/src/mcp/clusterMcpLoopback.ts`). Don't try to route Cursor through `mcpConfigWriter` / the stdio child.
|
|
493
496
|
- **`clusterMcpTools.ts` is the single source of truth for the tool set.** The stdio child (`clusterMcpServer.ts`) and the loopback both call `registerClusterTools(server, ctx)`. Don't fork tool names / descriptions / REST wiring between transports - edit the factory once.
|
|
494
|
-
- **Fresh-only membership - the exclusion is deliberate.** `mcpServers` is fixed at `session/new`, so the loopback URL can only be injected at worker bootstrap. A Cursor member must be spawned already inside the cluster (cluster creator / FRESH-spawn). A standalone Cursor tab is excluded from `AddWorkerSection`'s EXISTING candidates on purpose - joining it would produce a mute member (session opened without the MCP). **Do not "fix" this by adding cursor to the EXISTING candidates without also solving ACP session re-attach** (session/load with a populated `mcpServers`, preserving the transcript) - otherwise you ship a peer-toolless member.
|
|
497
|
+
- **Fresh-only membership - the exclusion is deliberate.** `mcpServers` is fixed at `session/new`, so the loopback URL can only be injected at worker bootstrap. A Cursor member must be spawned already inside the cluster (cluster creator / FRESH-spawn). The server refuses existing Cursor sessions in cluster creation and add-existing requests, including HTTP cluster creation. A standalone Cursor tab is excluded from `AddWorkerSection`'s EXISTING candidates on purpose - joining it would produce a mute member (session opened without the MCP). **Do not "fix" this by adding cursor to the EXISTING candidates without also solving ACP session re-attach** (session/load with a populated `mcpServers`, preserving the transcript) - otherwise you ship a peer-toolless member.
|
|
495
498
|
- **The loopback listener is per-member, not per-cluster.** `peer_send` stamps `from: workflowId`, so each member bakes its own identity + can't share a URL. It's torn down on `dispose` (`closeClusterLoopbackMcp`); the ctx is refreshed each `beginTurn` so a mid-life task-board attach/detach lands.
|
|
496
499
|
- **`resolveClusterOverrideProvider` skips the mismatch check for explicit `cursor` picks.** Cursor proxies the claude-\*/gpt-\*/glm-\* model families, so a Cursor member on `claude-4-opus` is legitimate - inferring `claude` from the id and rejecting it would be wrong. Only bare `auto` + `grok-*` infer to `cursor`. The reverse (requesting `claude` with a grok id) still trips the mismatch, correctly.
|
|
497
500
|
- **`GET /api/usage-summary` is the ONLY endpoint carrying the included-allocation denominator - don't re-derive it.** The "Included in Pro" gauge (`CursorIncludedGauge`) needs a used/limit denominator that the other dashboard endpoints don't expose for individual accounts: `get-hard-limit` returns only `{noUsageBasedAllowed}`, the legacy `/api/usage` has `maxRequestUsage: null` on usage-based plans, and the endpoint list can't be scraped from the JS bundle (paths built dynamically; the authed page 307s through a separate web-auth). `/api/usage-summary` (GET, session cookie, no CSRF) → `individualUsage.plan.{used,limit,remaining}` cents + `{total,auto,api}PercentUsed` + billing-cycle bounds. `fetchIncludedUsage` is **non-fatal** - if it drifts, `included` is absent and the card falls back to the charged-$ line; don't make it throw.
|
|
498
501
|
- **The gauge bar fills from Cursor's `totalPercentUsed`, NOT `used/limit` - don't "fix" it.** Cursor weights first-party vs API usage differently, so `totalPercentUsed` (0.23 with used=44¢, limit=2000¢) is deliberately not `44/2000`. Filling the bar from `used/limit` would disagree with cursor.com's own Spending page. The dollar caption uses `used`/`limit`; only the *fill* uses the blended percent. `fmtPct` shows `<1%` for a real-but-sub-1% value rather than rounding live usage to `0%`.
|
|
499
|
-
- **Cursor's separate `Other Models` meter is `apiPercentUsed`, not a share of local event totals.** The
|
|
502
|
+
- **Cursor's separate `Other Models` meter is `apiPercentUsed`, not a share of local event totals.** The X-dot (Cursor) hover renders it as a second bar alongside the blended included-plan gauge. Keep both percentages sourced directly from `/api/usage-summary`; dashboard events are bounded/display-oriented and cannot reconstruct either quota safely.
|
|
500
503
|
- **Cursor bakes reasoning effort into the model id - the worker IGNORES `config.primaryEffort`.** Catalog ids carry the effort (`grok-4.5-xhigh`, `-low`/`-high`/`-max`), so there is no separate effort surface. The picker (`CursorModelSelect`) moves family×effort×flags coordinates and then LOOKS UP the exact catalog id (`resolveCursorModelId`) - it never concatenates one; effort display parses the effort back OUT of the id (`parseCursorModelId`), never `config.primaryEffort`. The worker maps the bare id to the ACP bracket-param form (`grok-4.5[effort=high,fast=true]`, Auto = `default[]`). Don't synthesize model ids or thread `primaryEffort` into a Cursor turn.
|
|
501
504
|
- **Cursor COMPACT must send `/compress` as the ENTIRE ACP prompt.** Normal Cursor turns prepend north-star + cluster plan/role/doctrine before `session/prompt`; sending `/compress` through `beginTurn()` therefore bypasses Cursor's slash-command parser and wastes a model turn. `compressConversation()` is the dedicated unprefixed path, gated by the cached `available_commands_update` snapshot when one has arrived. The worker header says `CTX: Cursor-managed` because Cursor ACP still emits no `usage_update` / retained prompt count; dashboard billing totals are not a context-fill signal. No signal means no Cursor threshold auto-handoff - don't manufacture a percentage from bytes or billed tokens.
|
|
502
505
|
- **`sandbox: 'read-only'` is the exclusive signal that routes a Cursor turn to the stateless print path - primitives MUST NOT reuse the ACP worker cache.** Reviewer / fresh-summarizer / DOCS / research / compare primitives carry the *initiating* tab's `workflowId`; the ACP worker is cached per `workflowId` (`workersByWorkflow`), so reusing it would run the primitive INSIDE the operator's live Cursor session (transcript pollution, primary model, read-write). The dispatcher routes `name === 'cursor' && config.sandbox === 'read-only'` to `CursorPrintProvider` (`cursor-agent -p --mode ask`, read-only Q&A) instead. Primary turns never set `sandbox: 'read-only'`; the handoff/summarizer spawn does (`exportContext.ts`, load-bearing for this routing). Task-child / spawn-from-here tabs carry their own `workflowId` and no read-only sandbox, so they keep the full ACP worker.
|
|
@@ -517,13 +520,13 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
517
520
|
- **Passthrough-bubble dedup has two paths, not one.** Exact-prefix match against `sessionAssistantConcat` is the fast path; when it fails (whitespace drift between streamed deltas and JSONL writes, or a `tool_use` interleave collapsing a gap in the concat), a whitespace-normalized coverage check decides whether to drop the streaming bubble or keep it pinned. Dropping when normalized `sessionChat` covers ≥90% of the streaming content loses a few in-flight tokens for one frame (until `primary_complete` flips `isStreaming: false`) but avoids rendering the whole turn twice, which is what the old pin-to-bottom fallback did. Don't simplify back to exact-prefix-only.
|
|
518
521
|
- **Optimistic user `timestamp` is carried onto the sessionChat echo**, not just `attachments`. The optimistic add uses client `Date.now()`; the sessionChat echo uses Claude's JSONL wall-clock (different clock, can land seconds later). Sorting by the echo's timestamp caused large pastes to visually reorder relative to streaming/system messages already above them. Same content-prefix + 5s proximity key used for the attachments merge.
|
|
519
522
|
- **Both render paths sort by timestamp.** The merged path (sessionChat + extras) sorts at the end. The early-return path (when `sessionChat` is empty - non-Claude providers, or fresh workflow before JSONL is populated) **also** sorts. Without this, frames that arrive out of order on the wire (long pauses between text chunks, reconnect replay) render in arrival order and the chat looks scrambled. Both branches must stay sorted.
|
|
520
|
-
- **
|
|
523
|
+
- **PENDING's source of truth is `job.queue`, not `job.messages.queued`.** The server emits `queue_update` on every mutation (enqueue / drain / cancel-one / cancel-all), and `QueuedMessagesIndicator.tsx` renders a **PENDING** chip in the composer status line from `job.queue.steering` + `job.queue.followUp`. Opening PENDING shows the list and cancel controls; there is no per-message chip row with its own × above the composer. The optimistic `ChatMessage.queued` flag is still set on the originating tab so the operator sees their own send echoed instantly, but PENDING no longer reads from there. This gives replay-on-reconnect coherence (the latest `queue_update` in events.jsonl is the definitive state) AND survives the 30 s `onRehydrateStorage` rule that prunes stale optimistic queued messages on reload.
|
|
521
524
|
- **Interrupt and send preserves the primary claim through provider teardown.** `kind:'interrupt'` is a priority entry in the steering bucket, excluded from `drainSteerForWorker`; its correction runs separately before older queued messages. Never implement this as client CANCEL + resend: CANCEL clears the queue and revokes the claim before asynchronous teardown. CLI interrupt waits for actual child exit; Native waits for `runTurn` and carries forward a correction cancelled before `turnInputAccepted`; Codex app-server deduplicates concurrent interrupt/STOP waiters. STOP/removal must still prevent a queued correction from starting. Interrupted work never arms or extends Goal Run. Queued picks, refs, attachments and IDs follow their own instruction. Pinned by `test:interrupt-send` + isolated `smoke:interrupt-send`.
|
|
522
525
|
- **Steer vs follow-up delivery depends on transport.** Claude Native and local loops drain between tool results and the next API request; Codex app-server drains on `item/completed`. Single-shot transports drain after completion. The server orders pending interrupts first, then remaining steering before follow-ups. A normal steer never aborts an API request to arrive sooner.
|
|
523
526
|
- **Mid-turn steer delivery boundaries (Ollama + llama.cpp).** The hook lives in `OllamaWorkerProcess.run` / `LlamacppWorkerProcess.run` between `messages.push(...toolResults)` and the next `streamOneTurn`. Server-side `drainSteerForWorker` *splices* the whole steering bucket (drain-all, not shift-one) and broadcasts `queue_update` + `queued_messages_drained`; the originator's `user_message_echo` was emitted at enqueue time in `handleUserMessage` (shape, unchanged) and is the authoritative transcript record - the drain hook does not re-echo. Three invariants here that future edits must not break:
|
|
524
527
|
- **Splice is destructive; same-iteration re-call returns `[]`.** This is the only mechanism preventing double-deliver under llama.cpp's auto-continue path (which fires on the same iteration after the drain). If you replace `splice(0)` with a non-destructive read, you must also gate the call site against re-entry.
|
|
525
528
|
- **Recovery arms in llamacpp.ts (`reasoning_runaway` / `stall` / `wall_clock` / `empty_completion`) `continue` *before* reaching the drain hook.** They inject their own synthetic user message and intentionally don't see the queue; they're conversation-repair flows, not normal-flow delivery points. If a future recovery arm wants to flush pending steers, it must call the drain hook explicitly - placing the hook above the recovery branches would cause their injected messages to interleave incorrectly.
|
|
526
|
-
- **Mid-turn
|
|
529
|
+
- **Mid-turn steering uses the same attachment preparation as initial messages.** Documents and notebooks provide decoded text alongside their path labels; other binaries provide a note. Fitted images use Ollama `images` or OpenAI `image_url` parts when the serving model reports vision support, and an image note otherwise.
|
|
527
530
|
- Steer pending while a worker is mid-API-call delivers on the *next* iteration. Arco does not abort in-flight provider calls to land a steer faster - same posture as the post-turn drain.
|
|
528
531
|
- **Pinned Arco skills store references, never body snapshots.** `WorkflowConfig` / `meta.json` carry only `{scope, slug}`; `turnEngine` re-runs `resolvePinnedSkills` and rebuilds the standing system block every primary turn. This is what makes SKILL.md edits immediate and lets pins survive Native Fold/compaction, Handoff, reload, and restart. Keep one-shot `pickedSkills` in the user-prompt path and pinned skills in the system-prompt path. Pin replacement is bounded (`MAX_PINNED_SKILLS` + aggregate byte cap), persisted before `pinned_skills_set`, and project pins intentionally bypass DD7 discovery suppression because clicking PIN is the operator's explicit vouch. Missing/deleted skills are skipped visibly, never silently auto-unpinned.
|
|
529
532
|
- **The composer's busy-Enter / Alt+Enter / Alt+↑ / Esc bindings are load-bearing.** `TerminalInput.tsx` `handleKeyDown` checks `isComposing` (IME guard - Enter inside an open candidate window must commit, not submit) and disambiguates by modifier:
|
|
@@ -535,7 +538,7 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
535
538
|
- `Alt+↑` → recall most recent queued message into the editor (last follow-up else last steer)
|
|
536
539
|
- Busy + `Esc` → cancel turn; if queue non-empty, `window.confirm("Drop N queued messages?")` first
|
|
537
540
|
- Busy + `Shift+Esc` → force-cancel without the prompt
|
|
538
|
-
- Idle + `Esc` (empty composer) → cancel last queued message (legacy muscle-memory; rare since
|
|
541
|
+
- Idle + `Esc` (empty composer) → cancel last queued message (legacy muscle-memory; rare since PENDING's list cancel is the primary path)
|
|
539
542
|
|
|
540
543
|
Cancelling an in-flight turn drops the queue too - this matches today's behaviour but is now made explicit (the confirm prompt names the count). Don't add additional Enter behaviours without rechecking IME composition + modifier disambiguation.
|
|
541
544
|
- **Queued interjections are hidden from the chat log, not just tagged.** `ChatPanel.tsx` filters `m.queued === true` out of `displayMessages` in both the normal extras pipeline AND the `sessionChat.length === 0` early-return path (both filters must stay - the early-return window covers fresh workflows, post-reload replay gaps, and non-Claude providers that never emit `session_entry`). Queued entries surface only in the composer-adjacent `QueuedMessagesIndicator` (pill + preview modal) until the corresponding `session_entry` (Claude's JSONL user-turn write) arrives - at that point the `session_entry` case in `client/src/ws/handleServerMessage.ts` removes every queued optimistic whose 120-char content prefix appears as a substring anywhere in the drained prompt, and lets the sessionChat entry render as the sole visible copy. Removal-on-`session_entry`, not flip-on-echo: the server's `user_message_echo` fires at enqueue time, minutes before Claude actually processes the drained prompt, so using it to flip `queued:false` would (a) surface the message in chat during the wait, and (b) leave the later sessionChat entry to double-render once the 5s content-prefix dedup proximity window blows. The match rule is **substring, not equality**, because the server merges the entire queue into one `\n\n`-joined follow-up turn - a single `session_entry` can resolve N queued optimistic entries at once. Scanning is `queued:true`-only, so a regular (non-queued) send that happens to quote an old queued prefix can never accidentally remove one. Do NOT route queued messages through the 5s sessionChat dedup by unhiding them and relying on proximity; that window cannot span an arbitrary queue wait. The one-turn merge and its client-side matching rules must be changed together.
|
|
@@ -553,7 +556,7 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
553
556
|
- **`ChatMessage.tsx` ReactMarkdown overrides `a → target="_blank" rel="noopener noreferrer"`** so URLs the primary emits don't navigate the Arco tab away. Other ReactMarkdown sites (modals/dialogs) deliberately unchanged until a concrete report hits them.
|
|
554
557
|
- **`TerminalInput.isBusy` is a three-way OR**: `(job.busy === true) || hasActiveWorkers || hasStreaming`. Any code path that ends a turn must clear all three, or the composer stays locked in interjection mode. Normal turn-end works because `primary_complete` fires `finalizeMessage` (flips the live message's `isStreaming: false`) and `primary_turn_ended` fires `endPrimaryTurn` (flips `busy: false`). The cancel path skips `primary_complete` - `endPrimaryTurn` therefore also walks `job.messages` and finalizes any `isStreaming: true` entries itself (matches `applyWorkflowSnapshot`'s behavior when it sees `busy: false`). `recordTurnCancelled` does the same defensive clear so the cancel path doesn't depend on a trailing `primary_turn_ended` to unstick the composer. If you add a new "turn ended" event, either route it through `endPrimaryTurn` or replicate the streaming-finalize step explicitly.
|
|
555
558
|
- **The composer diagnostic chip (`b·w·s`) is intentional, not debug noise.** Renders next to CANCEL whenever `isBusy` is true. Tells the operator (and the next agent debugging a stuck composer) which of `busy` / `activeWorkers` / `streaming` is keeping the composer in queue mode. If you remove it, you lose the one-glance diagnostic for stuck-composer reports.
|
|
556
|
-
- **Late `primary_text` frames must be finalized AND coalesced, not opened as fresh streams nor split one-bubble-per-delta.** The server's turn-settle path resolves on a microtask, so a `worker_text` event dispatched between the parser's `result` and that microtask broadcasts AFTER `primary_turn_ended` has already cleared `isStreaming` and `busy` on the client. The naive `if (!ref[key]) { mintFreshStreamingMessage(...) }` path created a new `isStreaming: true` message that nothing would ever finalize (`primary_complete` already fired), and the composer stayed pinned in queue mode (`b0·w0·s1`) until the next turn.
|
|
559
|
+
- **Late `primary_text` frames must be finalized AND coalesced, not opened as fresh streams nor split one-bubble-per-delta.** The server's turn-settle path resolves on a microtask, so a `worker_text` event dispatched between the parser's `result` and that microtask broadcasts AFTER `primary_turn_ended` has already cleared `isStreaming` and `busy` on the client. The naive `if (!ref[key]) { mintFreshStreamingMessage(...) }` path created a new `isStreaming: true` message that nothing would ever finalize (`primary_complete` already fired), and the composer stayed pinned in queue mode (`b0·w0·s1`) until the next turn. An earlier fix pushed each not-in-progress chunk as its own *finalized* message - which unstuck the composer but introduced a worse symptom: a late burst is rarely one chunk (the final answer can stream as dozens of deltas after `primary_turn_ended`), so the answer fragmented into a stack of one-token `< ARCO :: PASSTHROUGH` rows. That fragmented state then persisted to localStorage and reappeared verbatim on reload, while a clean seq-ordered RESUME replay (where the text sits *before* `primary_turn_ended` on disk) showed it coalesced: a reload looked fragmented while a resume looked correct. Current fix in `handleServerMessage.ts`'s `primary_text` handler: in the not-in-progress branch, reuse `ref[key]` as a coalesce target - first chunk mints ONE `isStreaming:false` bubble, subsequent chunks append. Same path also covers a `rehydrate_workflows` replay whose window opens mid-turn (`clientLastSeq` fell between turn start/end, so the bracketing `primary_turn_started` was never re-sent → `turnInProgress` stays false for the whole replayed burst). Because the late branch now SETS `ref[key]`, `primary_turn_started` must also null the phase refs (it didn't before) so a stale late ref can't leak into the next turn and absorb its text. Don't simplify back to per-delta messages. Regression guard: `client/src/ws/lateText.test.ts` (`npm run test:late-text -w client`).
|
|
557
560
|
- **Help-mode CSS depends on the `help-system-ui` escape hatch class.** When `body.help-mode` is set, `styles/contextual-help.css` rules disable pointer events on `#root` and re-enable them only on `[data-help]` and `.help-system-ui` elements. The help-system-ui class is the only thing keeping `HelpButton`, `HelpBanner`, `HelpPopover`, and `DocViewer` interactive while help mode is on - rename or drop it without rewriting the CSS and the help system itself goes inert (button click does nothing, no way to exit besides Esc). The class also survives the `[data-help] *` pointer-events:none cascade because the CSS rule applies to `.help-system-ui` and all descendants. Nested native button/select help targets need a noninteractive wrapper:
|
|
558
561
|
the help-mode CSS deliberately disables native controls inside `[data-help]`.
|
|
559
562
|
ProvidersPopover's outside-click handler must ignore `.help-system-ui` so
|
|
@@ -601,7 +604,7 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
601
604
|
- **Calibration `{ratio, overhead, lastGroundTruth}` is persisted to `meta.json`**; `lastContextPercent` and `zonesCalibrated` are in-memory only. Both the `handleRehydrateWorkflows` and `handleCreateWorkflow` resume paths read calibration back into `wf.calibration`. `zonesCalibrated` is deliberately reset on restart so the next zone crossing re-samples against whatever the session has grown into; every successful calibration (auto or manual) calls `writeCalibrationToMeta` to update disk.
|
|
602
605
|
- **Two `cwd → ~/.claude/projects/<hash>` encoders must agree**: `resolveSessionJsonlPath` (`server/src/sessionJsonl.ts`) and `encodeProjectDir` (`server/src/http/fileRead.ts`, imported by `workflowDataRoutes.ts` / `purgeWorkflow.ts` / `sessionDiscovery.ts` / `recall/index.ts`). Claude replaces any non-`[A-Za-z0-9-]` char with `-` (so `Sample_Project` → `Sample-Project`). Earlier versions of one or the other only replaced `/`, which silently broke context-fill + session watching + the Resume picker for any project path with `_`, `.`, or whitespace. If you touch one, check the other.
|
|
603
606
|
- **Snapshot-only fallback on rotation** (`workflowStore.ts`): when `clientLastSeq + 1 < firstSeq`, events have rotated/fallen off disk and partial replay isn't possible. Server sends `workflow_state_snapshot` with `snapshotOnly: true` and `snapshotReason: 'events-rotated'`; client force-sets its `lastSeq` to the server's head, accepting that some history is lost. Don't try to "be helpful" by falling back to partial replay - it strands streaming events without their completes.
|
|
604
|
-
- **Worker PID registry persists** to `~/.arco/worker-pids.json` and is read on every boot's `reapOrphanWorkers()`. **H44 - each entry now pairs the pid with its process START TIME (`{ procs: [{ pid, startTime }] }`); `reapProc` (`workers/pidRegistry.ts`) only SIGKILLs when the live process's start time matches the recorded one** (a recycled pid that now belongs to an unrelated process is left alone -> `reused`; a missing pid is `gone`). Windows queries
|
|
607
|
+
- **Worker PID registry persists** to `~/.arco/worker-pids.json` and is read on every boot's `reapOrphanWorkers()`. **H44 - each entry now pairs the pid with its process START TIME (`{ procs: [{ pid, startTime }] }`); `reapProc` (`workers/pidRegistry.ts`) only SIGKILLs when the live process's start time matches the recorded one** (a recycled pid that now belongs to an unrelated process is left alone -> `reused`; a missing pid is `gone`). Never read a start time with a synchronous process probe on the server thread: only the Linux `/proc` read is synchronous; macOS and Windows queries are asynchronous and batched (`durablePidRegistry.ts`), and the result is accepted only while the caller reports the child as not yet exited (until then its pid cannot be reused). Shutdown kills held children without a query. Unknown start-time on either side, including a timed-out query, leaves the process alive and retains its record for a later check. A legacy `{ pids: [...] }` file still reads, but a missing recorded token cannot establish identity. The same start-time-verified reaping applies to the operator-terminal pid registry (`reapOrphanTerminals`). Don't revert to "SIGKILL anything still listed" - a boot can land on a reused pid. Don't disable or skip the reap - orphan workers from a server crash eat CPU until the kernel reaps them, and they hold detached file descriptors on their session JSONLs.
|
|
605
608
|
|
|
606
609
|
## Server-authoritative workspace (mirrored tabs)
|
|
607
610
|
|
|
@@ -618,7 +621,7 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
618
621
|
## Plans
|
|
619
622
|
|
|
620
623
|
- **`handleNativeEnterPlanModeSet` must NEVER write the shared cluster plan.** For a cluster member it emits `plan_candidate_ready` and lets the operator pick via `PlanCandidateBanner` (save-to-worker / attach-to-cluster / discard); ATTACH TO CLUSTER routes to `cluster_plan_set` → `handleClusterPlanSet`. `plan_set` still fires either way for the events.jsonl audit.
|
|
621
|
-
- **Why this is load-bearing:**
|
|
624
|
+
- **Why this is load-bearing:** an earlier version called `setClusterPlanBody()` directly, which bypassed every guard the deliberate model-driven path enforces. `peerPlanWrite` (the `cluster_plan_write` peer tool) denies mailbox-only members and rejects a destructive body with `destructive_write_requires_operator` via `validatePlanWritePreservesCheckboxes` - doctrine: a model may author or non-destructively restructure the plan but "must preserve existing checkbox tasks and their status". EnterPlanMode did a wholesale body replace with none of that, so one member could wipe every task and its status for every other member - the cluster plan is folded into all of their system prompts.
|
|
622
625
|
- It was collateral in a plan-storage refactor, not a decision: the same commit updated `PlanCandidateBanner.tsx`'s ATTACH TO CLUSTER semantics, `plan_candidate_ready` survived only in the `catch` block, and the function's own doc comment still described the gate. `scripts/smoke/phase-2.6.ts` caught it (17/18); it is back to 18/18.
|
|
623
626
|
- The two legitimate write paths are the operator's (`cluster_plan_set`) and the guarded peer tool (`peerPlanWrite`). Do not add a third.
|
|
624
627
|
- **Never open `events.jsonl` directly; read through `eventLog.ts`.** Since 0.1.4 older records live in sealed `events.<first>-<last>.jsonl.br` segments and the live file holds only the newest part (plus a copy of the newest sealed record). A direct `readFile` or tail read silently misses history; byte offsets into the live file reset when it is sealed (`outputs.ts` keeps a `seq` cursor for that reason).
|
|
@@ -650,7 +653,7 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
650
653
|
|
|
651
654
|
## Handoff prompt overrides
|
|
652
655
|
|
|
653
|
-
- **The `[HANDOFF
|
|
656
|
+
- **The `[HANDOFF - ` seed-prefix is load-bearing across four call sites.** Three of them are detection-only (`HandoffSeedPill` `startsWith` match, `ChatPanel` PRIOR-SESSIONS compression, `reviewContent.ts` `current-session` scope) and the fourth (`server/src/index.ts` `handleHandoffRequest`) is the *emitter* that produces the seed turn. The literal string is also exported from `server/src/handoffPrompts.ts` as `HANDOFF_SEED_PREFIX` and exposed to operator-edited prompts as the `{{seedPrefix}}` substitution variable so a custom prompt referencing the prefix doesn't fork the constant. **Do not let the prompt editor rewrite the seed itself** - only the *reflection / summarizer* prompts are operator-editable; the seed-prompt assembly lives in `handleHandoffRequest` and stays hard-coded. Changing the prefix means coordinated edits at all five sites; left it untouched.
|
|
654
657
|
- **Handoff prompt validation is advisory.** The editor warns when an original-worker override omits `[HANDOFF_COMPLETE]`; saves are not blocked. Arco collects the read-only writer reply and writes the handoff artifact. An empty reply fails the handoff.
|
|
655
658
|
- **Empty / whitespace-only override files are treated as absent.** `loadEffectivePrompt` falls through to the next tier (project → global → default) when a file exists but `body.trim().length === 0`. Saving an empty body via the UI is therefore *not* the way to "blank out" an inherited prompt - use [RESET TO DEFAULT] (which calls DELETE on the override file) instead. This rule exists so an accidental empty save can't silently strip the agent's instructions and produce empty handoff documents.
|
|
656
659
|
- **`runExportContext`'s `ctx.cwd` is the override-resolution cwd in both Handoff and Spawn paths.** For Handoff this is the workflow being rotated; for Spawn-from-here it's the *new* workflow's cwd, which is normally the same as the parent's (Spawn doesn't change cwd). If a future feature lets Spawn target a different cwd, the override resolution will follow the new cwd - that's the desired behaviour, but worth knowing.
|
|
@@ -682,7 +685,7 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
682
685
|
## Plan-review parsing invariants
|
|
683
686
|
|
|
684
687
|
- **H2 closes plan sections.** An `##` header inside a plan section ends that section; intervening content (until the next `###`) is silently discarded. Without this, headers like `## Open Questions / Blockers` between plan sections leak into the preceding section's preamble and corrupt review bodies. If prose must appear between sections, place it inline in the preceding section, not as an H2 section.
|
|
685
|
-
- **Numbered-bullet fallback recognizes naked numbered tasks.** `parsePlan()` treats `- **N.M** Task` (no checkbox) as an unchecked task. This is a foot-gun mitigation - agents (especially Qwen) sometimes strip checkboxes when "updating" a plan, and review surfaces would otherwise break silently. Indented variant `
|
|
688
|
+
- **Numbered-bullet fallback recognizes naked numbered tasks.** `parsePlan()` treats `- **N.M** Task` (no checkbox) as an unchecked task. This is a foot-gun mitigation - agents (especially Qwen) sometimes strip checkboxes when "updating" a plan, and review surfaces would otherwise break silently. Indented variant ` - **1**` is a subtask. Plain indented bullets (` - Some text` with no checkbox or numbered prefix) are continuation prose, not separate tasks. Don't tighten the regex to require checkboxes - that re-introduces the foot-gun.
|
|
686
689
|
- **Preamble is reviewable in VERIFY mode.** A phase with zero `[x]` items but containing prose (e.g., " Completed: we did X, Y, Z") renders the prose for the reviewer. Completion-claims-as-prose is a valid claim. Decision rule: render phase if `taskCount > 0 OR preambleLength > 0`; don't reject only because there are no checked items. Only reject VERIFY scope when both the checked-task count AND the preamble are empty.
|
|
687
690
|
- **Item ID instability.** `${phaseIdx}/${taskIdx}` IDs are stable across check-state toggles but break on reorder/delete. If the operator edits a plan between selecting items in the picker and dispatching the review, unresolvable IDs trigger a reject naming the missing items. Don't try to "rescue" by fuzzy-matching surviving items - operator must re-pick.
|
|
688
691
|
- **Mode doesn't filter `plan-items`.** VERIFY/CRITIQUE filtering (show only `[x]` vs show all) applies only to `plan-whole` and `plan-phase`. For `plan-items`, the operator's explicit selection is authoritative; mode only affects the reviewer's framing/instructions. All selected items render regardless of check state.
|
|
@@ -702,11 +705,13 @@ Cursor is an ACP provider (`cursor-agent acp`). Current transport details are su
|
|
|
702
705
|
|
|
703
706
|
## Operator session-cookie gate (WS + HTTP)
|
|
704
707
|
|
|
708
|
+
- **Browser approval uses exact origins, not hostname classes.** Scheme, host and port must match a served local origin, enabled development frontend or explicitly configured remote origin. `ARCO_ALLOWED_HOSTS` wildcards apply to Host validation only. Custom proxy ports use `ARCO_ALLOWED_ORIGINS`. Same-site browser subresources without Origin cannot use the API.
|
|
709
|
+
|
|
705
710
|
- **`/ws`, `/terminal`, `/upload` and every non-agent `/api/*` route need the browser session cookie** (`server/src/http/wsAuth.ts`). Origin guard alone admitted every Origin-less local process - a local script could otherwise drive `cluster_dispatch_once` and `update_primary_config { goalRun }` over a Node `ws` connection with every automation toggle OFF. Don't add an Origin-less or cookie-less bypass for convenience; scripted clients use a test server with `ARCO_WS_AUTH=off`.
|
|
706
711
|
- **The signing key is memory-only and per-boot.** Never persist it or put it in env/a file - anything an agent can `cat` defeats the gate. Consequence: every restart invalidates cookies, so every client connect path must `await ensureWsSession()` first (both `useWebSocket.ts` and `XtermView.tsx` do). A new socket opener that skips it works until the first deploy, then 401-loops.
|
|
707
712
|
- **Mint requires browser fetch metadata** (`Sec-Fetch-Site: same-origin`, `Sec-Fetch-Mode: cors|same-origin`, `Sec-Fetch-Dest: empty`, `Origin`). Not an OS sandbox: a same-user process that forges those headers can mint. The gate makes scripting the control plane deliberate circumvention, and logs every refusal.
|
|
708
713
|
- **Cookie name carries the server port** (`arco_session_<port>`) - cookies ignore ports, so dev and prod on one host would otherwise clobber each other.
|
|
709
|
-
- **Agent
|
|
714
|
+
- **Agent plan exceptions name both method and exact path.** `GET/POST /api/plans`, `POST /api/plans/attach`, `GET/PUT /api/plans/refs` and `GET /api/plans/refs/body` serve the six MCP plan tools without a browser cookie. PATCH and DELETE remain operator-session operations, including requests on the attach path. Cluster peer operations and the voice relay retain their own guards. A new MCP callback must declare its intended method/path pair; never exempt a prefix or every method on a plan path.
|
|
710
715
|
- **Cookie is session-only (no `Max-Age`)** so it never lands in the on-disk cookie DB. The client keeps it alive itself: `installSessionFetch` (401 → re-mint → retry once), `startSessionRefresh` (20 min + on tab focus), both called from `main.tsx` before any window renders. `<a href>`/`<img>` loads of `/api/*` can't retry - they rely on the refresh.
|
|
711
716
|
|
|
712
717
|
## Goal run (north-star auto-continue)
|
|
@@ -718,8 +723,9 @@ Operator-armed, per tab, default OFF; while armed, one continuation turn is disp
|
|
|
718
723
|
- **`remaining` is decremented BEFORE the dispatch await.** A fast re-entrant settle would otherwise read the pre-decrement count and spend one iteration twice.
|
|
719
724
|
- **Counters are NOT mirrored to meta.json.** A server restart ends any armed run. This is deliberate: the restart already killed the turn, and a deploy silently resuming an unattended loop is precisely the surprise the feature is designed to avoid. Don't "fix" this by persisting the counters.
|
|
720
725
|
- **Busy / queued is a skip, not a stop** - no iteration consumed, next settle re-evaluates. Only the six reasons in `GOAL_RUN_STOP_TEXT` end a run, and each one is announced with its reason.
|
|
721
|
-
- **`maybeGoalRun` runs LAST** among the post-settle armed actions (after auto-
|
|
726
|
+
- **`maybeGoalRun` runs LAST** among the post-settle armed actions (after auto-handoff, auto-fold, native auto-compaction; a due auto-handoff replaces the other two at that boundary). Each of those reshapes the context the tick would run against.
|
|
722
727
|
- **Arming requires a north star**, and clearing the north star mid-run stops it (`no_north_star`) - otherwise the loop dispatches turns pointing at nothing.
|
|
728
|
+
- **Codex goal budgets count cached input once.** Codex input already includes cached tokens; the goal counter adds output without adding the cache subset again. Claude reports uncached input and cache categories separately, so those categories are added.
|
|
723
729
|
- **Operator messages don't disarm.** Steering mid-run is expected; stopping is always explicit (the chip or `/goal run stop`). The chip renders only while armed, so an unattended loop can never be running without a visible counter and a one-click stop above the composer - don't hide it behind a panel.
|
|
724
730
|
|
|
725
731
|
## Project trust
|
|
@@ -804,7 +810,7 @@ Operator-armed HITL approval gate. Native-only. When `WorkflowConfig.reviewSafeM
|
|
|
804
810
|
## LSP diagnostics
|
|
805
811
|
|
|
806
812
|
- **The post-write hook is fire-and-forget and MUST NOT be able to break a Write/Edit.** `claude-native/tools.ts` calls `try { ctx.onFileWritten?.(abs); } catch { /* best-effort */ }` AFTER the successful `fs.writeFile` in both `Write` and `Edit` - never awaited, never allowed to throw into the write path (the write path is P0). The worker's wiring additionally `void`s the returned promise and `.catch()`es it so an async rejection can't surface as an unhandled rejection. Don't make the hook awaited, don't move it before the write, and don't let any LSP error propagate to the tool's return.
|
|
807
|
-
- **Absent language server = silent no-op.** When no LSP server is on PATH for the changed file's language, `resolveServer` returns null and the subsystem does nothing - NO error, NO crash, NO chat notice. This is intentional (bring-your-own-upstream
|
|
813
|
+
- **Absent language server = silent no-op.** When no LSP server is on PATH for the changed file's language, `resolveServer` returns null and the subsystem does nothing - NO error, NO crash, NO chat notice. This is intentional (bring-your-own-upstream). Don't "helpfully" surface an error when a server is missing; that would spam every operator who hasn't installed `typescript-language-server` et al. `tsserver` is NOT a candidate - it speaks the TSServer protocol, not LSP.
|
|
808
814
|
- **0-based → 1-based conversion happens exactly once, in `mapPublishDiagnostics` (`server/src/lsp/client.ts`).** LSP positions are 0-based; the protocol `DiagnosticItem.line/column` are 1-based (`+1` at that boundary). The client never re-converts. If you add another consumer of LSP positions, convert at the same boundary - don't push raw 0-based numbers across the wire.
|
|
809
815
|
- **Server lifecycle mirrors `llamacppManager`: one process per `(cwd, languageId)`, dedup, idle-reap, shutdown-kill.** `lspManager.shutdown()` is wired into the server's SIGTERM/SIGINT handler (`server/src/index.ts`) and SIGTERM+SIGKILLs every live child. Idle-reap evicts after `ARCO_LSP_KEEPALIVE_MS` (default 5 min). **Orphan gap (noted, accepted):** unlike worker subprocesses, LSP servers have NO durable pid registry / boot-sweep - a hard `kill -9` of the Node server can leak a language-server child until the OS reaps it. Acceptable because they burn no API tokens and idle-reap bounds them; if it ever matters, mirror `pidRegistry.ts`. See `docs/LSP.md`.
|
|
810
816
|
- **An empty `items[]` clears the file's diagnostics.** `store.setDiagnostics` drops the per-file key on an empty array, so "fix the error → badge drops" just works. Don't change `diagnostics` to accumulate - each message is the authoritative full set for its `file`.
|
|
@@ -829,6 +835,8 @@ Operator-armed HITL approval gate. Native-only. When `WorkflowConfig.reviewSafeM
|
|
|
829
835
|
## HISTORY tab
|
|
830
836
|
|
|
831
837
|
- **Lifecycle events re-broadcast on rehydrate regardless of `clientLastSeq`.** `task_started` / `task_status` and `operator_label` are persisted on the parent workflow but the client-side state they drive (`taskChildren`, the HISTORY filter) is rebuilt from the events themselves. A workflow whose only Task fan-out happened pre-refresh would otherwise come up showing `0s · RUNNING` forever (events sit below the seq cutoff). Re-broadcast is safe because the corresponding store actions are idempotent - `recordTaskStarted` / `recordTaskStatus` on `taskId`, and `operator_label` flows through `narrativeEventFromMessage` → `appendHistoryEvent`, which dedupes on `seq`. Don't add a "skip if seq <= clientLastSeq" gate to lifecycle replay - it'll silently regress the refresh path.
|
|
838
|
+
- **Task statuses outlive the turn that started them.** STOP revokes the parent turn synchronously (`revokeBusy`), and `turnEngine`'s `dispatchCurrent()` gate then drops that turn's messages. A child's cancelled status that arrives in a later microtask used to be dropped there, leaving the card RUNNING with a ticking timer forever. `ClaudeNativeWorker.cancel()` now reports unsettled children before the revoke, and the gate lets `task_status` through (`deliverAfterTurnRevoked`). Don't add other message types to that exception: they would leak a stopped turn's output into the next one.
|
|
839
|
+
- Claude Native Task cancellation treats a streaming SDK abort as cancellation when the worker was explicitly stopped; the card shows CANCELLED while its siblings continue.
|
|
832
840
|
- **Pinned label anchors are by `targetEventSeq`, not by chat-row id.** A label pins to the seq of an event in `events.jsonl`; if the chat-row id changes (e.g. session JSONL renames it), the label still resolves because HistoryTab reads `event.seq → row` rather than chasing the row id. Don't try to "stabilize" labels by switching to row ids - the seq is the load-bearing identity.
|
|
833
841
|
- **`since-event` Review framing names the operator label.** When `anchorEventSeq` points at an `operator_label` event, `buildReviewContent` lifts the label's `text` into the framing (`research checkpoint` becomes the named anchor); otherwise the framing falls back to the bare seq. If you change the label-event shape, update `buildReviewContent` too - silent fallback to the bare seq is honest but loses operator context.
|
|
834
842
|
- **Spawn cutoff is honored in fresh-summarizer + Native original-worker, IGNORED in CLI original-worker.** `cutoffEventSeq` filters the rendered transcript and stops Native pre-warm replay at the cutoff; CLI `--resume` carries the parent's full session and there's no clean way to retroactively trim its view. The dialog tells the operator to choose fresh-summarizer when a hard cutoff matters; don't try to enforce the cutoff CLI-side without rebuilding the resume mechanism.
|
|
@@ -877,6 +885,7 @@ Load-bearing invariants - relaxing any one re-opens the §1 trust boundary:
|
|
|
877
885
|
The live Arco *service* reporting workflows + applying reply/stop/continue. `server/src/management/{hubLink,initHubLink,identity}.ts` + the hub's service socket. Invariants:
|
|
878
886
|
|
|
879
887
|
- **INERT unless `ARCO_HUB_URL` is set.** `initHubLink` returns immediately with no env - an ordinary `npm run dev` / production boot must stay byte-unchanged. Never make the hub link connect by default.
|
|
888
|
+
- **A home in the temporary folder never joins the hub.** Every hub user reads the URL through `hubUrlForServer()` in `server/src/management/hubGuard.ts`, never from `process.env` directly. When the Arco home resolves inside `os.tmpdir()` (both through `realpath`), the URL is withheld and one log line names `ARCO_ALLOW_TEMP_HOME=1` (the older `ARCO_HUB_ALLOW_TEMP_HOME=1` still works). A server started for a check with a temporary home therefore stays off the hub even when the shell sets `ARCO_HUB_URL`; still start such servers with a cleared environment.
|
|
880
889
|
- **Two connections, one card.** The agent (lifecycle, role `agent`) and the service (workflows, role `service`) both register under the SAME `instanceId` (shared `~/.arco/instance-id`). The hub keeps `agentSockets` + `serviceSockets` separately but ONE registry entry. Lifecycle commands route to the agent socket; workflow actions to the service socket. Don't collapse the two socket maps.
|
|
881
890
|
- **The local instance re-validates - the hub only routes.** `initHubLink.applyAction` looks up the live workflow and checks state (stop requires `busy`; reply requires non-empty body) BEFORE applying. The hub's `routeWorkflowAction` never decides validity. Keep validity logic server-side.
|
|
882
891
|
- **Apply via the existing turn primitives, synthetic ws+session.** stop → `handleCancel`; reply/continue → `handleUserMessage` with a `readyState: CLOSED` fake ws + a synthetic `Session` (mirrors the cluster auto-turn dispatch in `clusterAutoTurn.ts` - persistence runs, socket writes skip, events land in the workflow's events.jsonl). Don't invent a parallel turn path.
|
|
@@ -895,6 +904,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
895
904
|
- **The SSH path is NOT Ed25519-signed - that's intentional.** The agent path is signed because the agent verifies; over SSH there's no agent, so the **tailnet + ACLs are the auth** and `nonce:'ssh'` is a sentinel (it correlates nothing). Don't try to sign the SSH path or route it through `pending`.
|
|
896
905
|
- **Same allowlist template, wrapped - never a shell string.** `renderSshLifecycle` calls the SAME `renderLifecycleCommand` and passes the remote argv after `ssh … -- `, so there's no interpolation surface. It returns `null` for an off-platform/off-allowlist command (e.g. `arco-agent.restart` on macOS) and the hub reports `instance-offline` rather than running anything. Don't build the remote command as a string.
|
|
897
906
|
- **Targets are operator-supplied, never discovered, never committed.** `~/.arco/hub/ssh-targets.json` keyed by instanceId OR friendly name (`sshTargetFor` tries id then name). `parseSshTargets` drops malformed entries / bad platforms / non-JSON → empty map (no SSH fallback). The file holds host/user identity → keep it out of git.
|
|
907
|
+
- **A macOS SSH target needs `uid`.** launchctl addresses `gui/<uid>/<label>` and the hub cannot learn the remote user id, so without `uid` every macOS command renders `null` and the hub reports `instance-offline` instead of addressing another user's domain. The label defaults to the packaged `arco-workbench`; set `macLabel` for a hand-maintained job.
|
|
898
908
|
- **`systemctl --user` over SSH needs the owning user session.** Connect as the account that owns the Arco user units, not root, so `systemctl --user` reaches that account's bus. An active session or `enable-linger` must keep the user manager available; root would target the system manager instead.
|
|
899
909
|
|
|
900
910
|
## ntfy external transport
|
|
@@ -902,6 +912,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
902
912
|
`server/src/ntfyTransport.ts` + the `registerNoticeTransport` seam on `server/src/notifications.ts`. Invariants:
|
|
903
913
|
|
|
904
914
|
- **INERT unless `ARCO_NTFY_URL` is set.** `initNtfyTransport` returns `false` and registers nothing with no env - an ordinary `npm run dev` must stay byte-unchanged (same gating contract as `initHubLink`). Never push by default.
|
|
915
|
+
- **A home in the temporary folder ignores inherited ntfy settings.** `initNtfyTransport` and `resolvePhoneTarget` in `attention.ts` ask `environmentNtfyAllowed()` in `server/src/management/hubGuard.ts` before using `ARCO_NTFY_URL`; anything new that sends to ntfy from environment settings must ask it too. A phone address saved in Settings is not inherited and is never held back. `ARCO_ALLOW_TEMP_HOME=1` is the override.
|
|
905
916
|
- **Mute is enforced UPSTREAM - never re-check it in the transport.** `emit()` returns `null` for a muted category *before* the transport fan-out, so a transport only ever sees surviving notices. This is the load-bearing single-chokepoint promise: muting an in-app category suppresses the push for free. Don't add mute logic to `ntfyTransport.ts`.
|
|
906
917
|
- **Transports are fire-and-forget; they can never break the in-app path.** `emit()` calls each transport in a try/catch (sync throws caught) and swallows async rejections (`.catch(()=>{})`). A slow/down ntfy must not delay or fail the `workbench_notice` broadcast. Don't `await` transports inside `emit()`.
|
|
907
918
|
- **ntfy header values are ascii-safe + single-line.** `headerSafe()` transliterates em/en-dashes + smart quotes to ASCII, strips remaining non-ascii, collapses whitespace, caps 200 chars - because ntfy `Title`/etc. are latin-1 HTTP headers and a unicode title (Arco uses em-dashes liberally) would otherwise break the request. The body (POST payload, not a header) keeps unicode. Don't pass raw titles as headers.
|
|
@@ -937,9 +948,8 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
937
948
|
## Preview tab
|
|
938
949
|
|
|
939
950
|
- **Stale `vite.config.js` shadows `vite.config.ts`.** Vite resolves `.js` before `.ts`. A stray `tsc` run that compiles `client/vite.config.ts` to `vite.config.js` (and `.d.ts`/`.js.map`) means every subsequent edit to the `.ts` is silently ignored - Vite loads the frozen `.js`. The three artifacts are gitignored but easy to forget. Symptom: Vite changes don't take effect even after restart; `npx vite --debug config` shows the old shape. If you see this, delete `client/vite.config.{js,js.map,d.ts}`. The repo's typecheck script must use `tsc --noEmit`; don't introduce a build step that emits next to the source.
|
|
940
|
-
- **
|
|
941
|
-
- **
|
|
942
|
-
- **Preview proxy responses set `cache-control: no-store` + `connection: close` + drop the upstream `etag`.** Earlier symptoms were "iframe stays white after restart": Firefox had cached previous empty-MIME failures (when the proxy or port wasn't ready) under the canonical URL, then Etag-revalidated to 304 against Vite's index.html and kept the bad cached body. `no-store` prevents future caching, dropping etag prevents revalidation reuse, `connection: close` prevents response-boundary misalignment on parallel keep-alive fetches through the double-proxy chain (5173 → 3001 → 5181). All three together. If you remove any, expect a regression. The proxy also strips RFC 7230 hop-by-hop headers (`connection`, `keep-alive`, `transfer-encoding`, `upgrade`, `proxy-*`, `te`, `trailer`) in both directions - forwarding them confuses HTTP parsers.
|
|
951
|
+
- **Preview content must stay on separate listeners.** No prefix proxy or Referer fallback runs on Arco's control address or its Vite frontend. HTTP assets and HMR use the allocated preview address. Arco cookies and Authorization never reach the app. Cross-port cookie sharing requires explicit Origin and fetch-site checks between previews.
|
|
952
|
+
- **Preview ports are leased by mounted views.** Keep asynchronous acquisition and release scoped to the original workflow. Multiple observers share one listener; closing one must preserve the others. Refuse service workers so a reused port cannot retain the previous app's worker.
|
|
943
953
|
- **Iframe is given a fixed logical viewport (width 1920, height per operator-selected aspect ratio: 1440 / 1200 / 1080 for 4:3 / 16:10 / 16:9), CSS-scaled to the largest fitting box-of-that-ratio.** Don't change the iframe to `width: 100%; height: 100%`; the dev server inside renders to its viewport size and most apps assume a desktop-class width. The fixed logical size + scale is what gives "no clipping at any pane size." `ResizeObserver` on the wrapper recomputes scale on every pane resize AND on aspect change. Aspect choice persists to localStorage `arco.preview.aspect` (global, not per-workflow). Width was originally 1280 - bumped to 1920 on 2026-04-28 because real desktop apps overflowed at 1280. Frame is centered in the pane both axes (`alignItems: center`); top-aligning leaves a tall black band below short content.
|
|
944
954
|
- **`previewAutoDetect` never overrides `manual: true`.** When the operator types a port and hits BIND, the binding is sticky - Layer 1 / Layer 2 detection still runs (in case the agent later spins up a fresh server) but cannot replace a manual entry. Don't unify the paths; the operator's choice always wins.
|
|
945
955
|
- **`freshlyBound: true` only on real binds, not hydration replay.** The auto-flip-to-PREVIEW UX hinges on this flag: replays stamp `false`. If you ever broadcast `preview_set` from a path that isn't a fresh operator/auto bind (e.g. a periodic refresh), set `freshlyBound: false` or the user gets yanked into the preview tab on every server restart.
|
|
@@ -958,8 +968,9 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
958
968
|
|
|
959
969
|
## Efficiency behavior
|
|
960
970
|
|
|
961
|
-
- **Hook
|
|
962
|
-
-
|
|
971
|
+
- **Hook results are read in one place.** `evaluateHooks()` (`server/src/providers/claude-native/hooks.ts`) turns exit codes and stdout into a verdict as Claude Code's hooks reference describes; callers act on the verdict and never read `exitCode` or stdout themselves. Stdout that is not one JSON object is plain text, never an exception: a hook that prints log lines is safe. Exit 1 is a non-blocking error on every event; only exit 2, a JSON blocking decision or an `onFailure` failure blocks. A handler's `if` rule is checked in `fireHooks()` before it starts (`hookIf.ts`, best-effort like Claude Code's: a command it cannot take apart runs the hook).
|
|
972
|
+
- **The shell tool has two names.** On Windows without Git Bash the model's shell tool is `PowerShell`, elsewhere `Bash`. Any check, card or summary that special-cases the shell tool uses `isShellToolName()` from `@arco/shared`, never `=== 'Bash'`, or the PowerShell tool slips past it.
|
|
973
|
+
- **`hook_rewrote_input` must fire on every PreToolUse rewrite.** Without the event, transcript review can't tell why a tool input differs from what the model emitted - looks like a model hallucination of the input. The chain is: `evaluateHooks(...).rewrites` non-empty → `workflowEventBroadcast({type: 'hook_rewrote_input', ...})` → `broadcastWorkflow` → `events.jsonl`. If you add a new rewrite-capable surface (e.g. PostToolUse input rewrites in a future revision), emit the same event.
|
|
963
974
|
- **Last-write-wins across multiple hooks for `updatedInput`.** `{ ...input, ...updatedInput }` is applied in hook iteration order; each rewrite emits its own `hook_rewrote_input` event so the operator can see the chain. Matches Claude Code's documented behavior - don't switch to first-write-wins or deep-merge.
|
|
964
975
|
- **`config-protection` matches by basename, not regex on the full path.** `checkConfigProtection` (`pretoolGuards.ts`) resolves the input path against `cwd` then matches `basename()` against `PROTECTED_BASENAMES` plus a small regex set for `tsconfig.*.json`. A nested package's `tsconfig.json` is just as protected as the root's. Don't over-broaden the patterns (regression risk: blocking a source file named `eslint.config.ts` in user code). Don't use absolute-path globs unless we're explicitly carving out an exception path - they hide where the gate fires.
|
|
965
976
|
- **`config-protection` is per-tab relaxable via `efficiencyConfigProtection` - default ON, opt-out is explicit.** The gate now reads `(this.config.efficiencyConfigProtection ?? 'on') === 'on'` in `worker.ts:dispatchTool` before calling `checkConfigProtection`. Absent field ⇒ gate ON (safety default), so a missing value never silently disables it; only an operator flip to `'off'` (CONFIG-tab → CONFIG-PROTECTION GATE, Native-only) relaxes it. Wired exactly like `efficiencyFactForce` (protocol → meta.json → updatePrimaryConfig live-set + rehydrate restore → turnEngine per-turn resolve → seedWorker/WorkerManager) **except** there is NO new-tab default stamp: fact-force explicitly stamps `'off'` for new tabs so the workflow-created echo and saved metadata agree, while config-protection's `?? 'on'` fallback means its default is uniform and needs no stamping. Don't add a config-protection stamp - it would make an absent field and an explicit `'on'` indistinguishable on disk for no behavior gain. The gate is Native-only because `checkConfigProtection` only runs in the in-process Native `dispatchTool` (same protocol limit as fact-force - see the Codex note below); `turnEngine` hard-zeros non-Native transports to `'off'` so the flag is never a meaningless no-op flag on a CLI/Codex tab.
|
|
@@ -983,9 +994,9 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
983
994
|
- **Fact-force defaults OFF (2026-09-02).** It is a cognitive nudge, not a verifier: the synthetic failed tool result makes the model recite importers, API surface, and the operator instruction, but Arco does not check whether those statements are true. The per-file failure, prose and retry add content to the transcript and append-only context. New workflows explicitly stamp `'off'`; absent values also resolve off; a saved or newly supplied explicit `'on'` remains honored. Keep it available as a per-tab CONFIG opt-in, but do not restore a default-on path without measured operator evidence.
|
|
984
995
|
- **Pre-tool-use guard order is load-bearing: config-protection first, fact-force second.** Two reasons: (1) config-protection is a cheap path-shape check (no state), so running it first short-circuits without touching the fact-force state. (2) If both rules fire on the same path (e.g. operator armed fact-force AND the model edits `tsconfig.json`), the operator gets the more specific config-protection message - "fix your code instead of weakening the config" beats "list importers and re-issue." Don't reverse the order; the model's re-issued edit after fact-force would then bounce off config-protection on the second pass, which is twice the synthetic-result churn.
|
|
985
996
|
- **Fact-force is Native-only at first ship - CLI parity is F4 deferred.** The gate lives inside `claude-native/dispatchTool`, which only runs on the Native transport. CLI Claude reaches the same surface via the `.arco/<wfid>/hooks.json` shim when this parity path is enabled. Don't add a CLI codepath inside `pretoolGuards.ts`; the canonical site for CLI parity is the hooks shim, not the gate function. If operator data shows CLI tabs need it before F4 ships, prefer the shim over a parallel implementation - the gate semantics MUST match Native exactly or transcript review on cross-transport sessions will be confusing.
|
|
986
|
-
- **Fact-force (and most other Native-only efficiency knobs) being absent for Codex is a protocol limit, not an oversight - don't "port" it.** The Native gate works because tool dispatch is synchronous and in-process: Arco returns a synthetic `tool_result` *before* the edit lands. Codex gives no equivalent pre-execution gate - `exec` only surfaces tool calls in the final aggregated output (no mid-turn hook at all), and `appserver` *has* approval bindings (`FileChangeRequestApprovalParams`, `CommandExecutionRequestApprovalParams`) but they're dropped in `onNotification`'s `default` case and there is **no approval-response RPC path** wired to send a denial back. Wiring it is ~500 LOC against an undocumented approval-response shape (needs a live Codex harness to pin down) and would bolt a pre-execution gate onto Codex's async-after-completion event model. Same root reason server-side compaction, interleaved-thinking beta, tool-result filter, and sandbox tools can't exist for Codex today: they all mutate the in-process Anthropic request (body / beta headers / `tools[]` / system blocks), which an external subprocess doesn't expose. Output style is the narrow exception for Codex
|
|
997
|
+
- **Fact-force (and most other Native-only efficiency knobs) being absent for Codex is a protocol limit, not an oversight - don't "port" it.** The Native gate works because tool dispatch is synchronous and in-process: Arco returns a synthetic `tool_result` *before* the edit lands. Codex gives no equivalent pre-execution gate - `exec` only surfaces tool calls in the final aggregated output (no mid-turn hook at all), and `appserver` *has* approval bindings (`FileChangeRequestApprovalParams`, `CommandExecutionRequestApprovalParams`) but they're dropped in `onNotification`'s `default` case and there is **no approval-response RPC path** wired to send a denial back. Wiring it is ~500 LOC against an undocumented approval-response shape (needs a live Codex harness to pin down) and would bolt a pre-execution gate onto Codex's async-after-completion event model. Same root reason server-side compaction, interleaved-thinking beta, tool-result filter, and sandbox tools can't exist for Codex today: they all mutate the in-process Anthropic request (body / beta headers / `tools[]` / system blocks), which an external subprocess doesn't expose. Output style is the narrow exception for Codex because Arco owns the stable prompt prefix on both transports. If fact-force on Codex ever becomes worth it, it's a standalone initiative starting from the approval protocol, not a parity shim. (The F4 hooks shim above is for **Claude CLI**, which Codex does not read.)
|
|
987
998
|
- **`ctx_action` sentinels must be emitted from every code path that mutates `messages[]` in a way the operator should see during transcript review.** Today's emit sites (`worker.ts`): `prune_orphan_tool_use` (trigger: recovery) on the orphan-drop at the top of `runTurn`, and `compact` (trigger: auto-threshold) inside `maybeEmitAutoThreshold`. Normal turn-flow pushes (operator message, assistant message, tool_results, drainSteer items) do NOT emit ctx_action - they're additions, not reshapes. `seedMessages` (Spawn-from-here init), `replayMessagesFromEvents` (rehydrate), and `dispose` (tear-down) are lifecycle paths that also don't emit. Server-side `compact_20260112` mutates Anthropic's prompt prefix, not our local `messages[]`, so it doesn't emit ctx_action from Arco either - it rides as a per-turn body field, not an event. Same rule applies if `clear_thinking` / `clear_tool_uses` ever return behind an explicit operator action. Forgetting the sentinel on a NEW path that does mutate local `messages[]` (e.g. a future "cancel-the-last-turn-and-reissue" surface) breaks transcript review silently; the operator sees turn N+1 without knowing turn N was rewound.
|
|
988
|
-
- **`primary_tool_counter` is
|
|
999
|
+
- **`primary_tool_counter` is worker-authoritative.** `JobState.toolCallsSinceCompact` mirrors the worker counter. Worker rebuild and auto-threshold compaction reset it; the separate client recount remains available.
|
|
989
1000
|
- **The per-tab sandbox database MUST be cleared on tab close (`remove_workflow`) or the operator's explicit Clear-DB click.** `destroySandbox(cwd, wfId)` closes the cached `better-sqlite3` handle and unlinks `sandbox.db` + `sandbox.db-wal` + `sandbox.db-shm`. Skipping the tear-down on tab close would leak per-tab state across workflows that share a cwd - defeating the per-tab opt-in contract. The teardown path is in `handleRemoveWorkflow` (`server/src/index.ts`) and the operator clear hits `POST /api/workflows/:wfId/sandbox/clear`. Both fire WS events (`sandbox_db_cleared`) so transcript review can see the truncation. If a future code path adds another lifecycle endpoint that should also clear (e.g. a hypothetical "reset workflow"), call `destroySandbox` from there too.
|
|
990
1001
|
- **Sandbox subprocess executor MUST kill the process group on timeout, not just the immediate child.** `sandboxExecutor.ts` spawns with `detached: true` so the child becomes the process-group leader, and the timeout path calls `process.kill(-child.pid, 'SIGTERM')` (negative PID - the kernel interprets that as the process group) with a 1 s SIGKILL escalation. A python script that forks workers or a shell script that `&`-launches background jobs would leak grandchildren past a naive `child.kill('SIGTERM')`. Don't refactor to the simpler form - the test that surfaced this on context-mode's PolyglotExecutor (the inspiration) was a `python -c "import multiprocessing; multiprocessing.Pool(4).map(time.sleep, [60]*4)"` script that leaked 4 sleepers per call.
|
|
991
1002
|
- **`node:sqlite` (Node 22+ builtin) has NO FTS5 module - the sandbox uses `better-sqlite3` instead.** The plan brief listed `node:sqlite` as a fallback option; in practice Node 22.14.0's bundled SQLite is compiled without FTS5 so `CREATE VIRTUAL TABLE … USING fts5(…)` returns `Error: no such module: fts5`. Don't switch back to `node:sqlite` without verifying FTS5 availability on the target Node version. The `SandboxStore` class encapsulates the choice; if a future Node release lights up FTS5 (or someone wants a loadable-extension build), swapping is a single-file refactor.
|
|
@@ -998,6 +1009,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
998
1009
|
|
|
999
1010
|
- **Addendum text is checked into the repo - not LLM-generated, not session-modified.** `outputStyleAddendum(level)` (`server/src/providers/outputStyle.ts`) is the single source of truth for the per-level provider-prompt text. Editing it requires a code change + commit; no operator-facing knob can mutate the body. This is the autonomy-test guardrail: an LLM can't curate its own instructions. If a future "let the model self-tune the addendum" idea surfaces, that's the canonical bad pattern from `CLAUDE.md`'s hard fences - reject without a plan-doc update + operator sign-off.
|
|
1000
1011
|
- **Review / Handoff seed / DOCS / GIT primitives MUST run with `outputStyle: 'normal'` regardless of source-tab pick.** Hard-coded at four sites (plan §6): `runReviewer.ts` (reviewer WorkerConfig), `exportContext.ts` (CLI handoff path, Native handoff path, fresh-summarizer path), and `handleUserMessage` (overrides outputStyle when `UserMessage.primitive === 'docs' | 'git'`, set by the in-tab DOCS / GIT composer dialogs). DOCS / GIT new-tab spawn forces normal client-side via `spawnConfigFromRunAs`. Terse-style reviews regress operator comprehension; terse handoff seeds reduce the *next* worker's input fidelity. Don't make this a per-spawn knob. If a future operator argues for a terse review, treat it as operator data toward changing the default - not as a config-knob escape hatch.
|
|
1012
|
+
- **An unset output style means the default, but only on a tab's own turns.** `resolveTurnSettings` turns an unset `WorkflowConfig.outputStyle` into `DEFAULT_OUTPUT_STYLE` (`shared/src/outputStyle.ts`, `'plain'`); `outputStyleAddendum(undefined)` returns null, so a worker spawned without a level (a primitive, a utility call) gets no addendum. Don't resolve the default inside a worker. Every fallback uses the constant (`resolveOutputStyle`), never a literal `?? 'normal'`; stores write the default as unset (`storedOutputStyle`), so 0.1.4 never meets `'plain'` in `meta.json`, presets or templates, and a later change of the default reaches every tab that never chose.
|
|
1001
1013
|
- **Spawn-from-here DOES inherit the parent's `outputStyle`.** Different from the four primitives above. `SpawnDialog` spreads `...parentConfig`, so `outputStyle` flows through; the operator can flip in the child tab. Don't add an opt-out at `SpawnDialog` for `outputStyle` - terse → terse is the explicit operator pick on the parent and they kept it for a reason. Inheritance is the right default for a fresh-but-related tab.
|
|
1002
1014
|
- **Addendum text MUST preserve code blocks / error strings / file paths verbatim AND MUST NOT compress security warnings, irreversible operations, or order-sensitive multi-step sequences.** Each level's text leads with explicit "auto-clarity" rules and a verbatim-preserve list. A new level (e.g., a hypothetical `ultra`) shipped without these rules will silently regress technical correctness - the model will compress a sed command's flags or shorten an error string. Don't ship a new level without the verbatim list; review the existing levels' text as the floor.
|
|
1003
1015
|
|
|
@@ -1056,7 +1068,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
1056
1068
|
- **`task_run_recover` mutates exactly one selected run.** Reclaim / terminate / reassign / fail all look up `runId` inside the per-cwd lock and reject if it does not belong to `taskId`. Never "recover the task" by bulk-closing every open run; sibling attempts must stay intact unless the operator targets them too. Reclaim returns the task to `ready` and clears assignee, reassign resolves the target cluster member and sets assignee, terminate blocks immediately, and fail blocks only after the configured consecutive-failure limit. None of these actions may set `done` / `archived`.
|
|
1057
1069
|
- **Stale reclaim must be checked server-side, not only by the button state.** The BOARD UI disables `RECLAIM` until an open run has no heartbeat for five minutes, but the authoritative guard is `staleOnly` in `handleTaskRunRecover`, using `lastHeartbeatAt ?? startedAt` under the lock. Keep that check even if the UI grows better stale indicators; otherwise a stale-looking row from an old snapshot could reclaim a fresh heartbeat.
|
|
1058
1070
|
- **Stage I swarm creation is graph construction, not orchestration.** `cluster_swarm_create` should create ordinary ledger tasks and dependencies: root blackboard, N workers, verifier depending on all workers, synthesizer depending on verifier. It must not create a parallel swarm store, infer assignees through a model, or mark non-root tasks `done`. If the operator asks to dispatch after creation, call the existing deterministic dispatcher path and keep the same terminal-status fence; the smoke target is `scripts/smoke/task-swarm.ts`.
|
|
1059
|
-
- **Stage K orchestration assist is proposal-only until explicit accept.** Assist requests may
|
|
1071
|
+
- **Stage K orchestration assist is proposal-only until explicit accept.** Assist requests may carry supplied task, assignment, recovery, synthesis, swarm, and provider suggestions; they do not invoke a model, but they must not mutate task state, dispatcher settings, member config, or worktrees by themselves. Reject is audit-only. Accept selected items by calling the normal task-kernel mutation path so ordinary `task_ledger_event` rows are emitted; provider/model/effort suggestions stay inert unless their own selected items are accepted. Smoke target: `scripts/smoke/task-orchestration-assist.ts`.
|
|
1060
1072
|
|
|
1061
1073
|
### Board interaction overhaul
|
|
1062
1074
|
|
|
@@ -1066,7 +1078,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
1066
1078
|
- **Drag-to-restatus routes through `onUpdateTaskStatus` (the operator path) with a done/archived confirm - dnd-kit, pointer-only.** `BoardCard` is `useDraggable`, `BoardColumn` is `useDroppable`, `handleDragEnd` → `moveTask(active.id, over.id)`. The 4px PointerSensor activation distance is load-bearing: it lets a plain click still open the drawer (the card is a `<button onClick>` with `{...listeners}`). Touch has no drag path - the drawer status dropdown is the fallback. Don't drop the 4px constraint (clicks would start drags) and don't move terminal-status drops off the confirm.
|
|
1067
1079
|
- **The editable drawer reuses DEBAG's *visual* edit pattern, not the `GateApprovalNotice` component.** §10.7 said "build against DEBAG's shared proposal component"; in practice the gate card carries approve/reject/remember + arg-parsing semantics that don't fit task authoring. The drawer uses inline `editLabelStyle` / `editInputStyle` (accent-on-dirty) matching the gate look. This was a deliberate, documented call (plan §13 2026-06-26) - not an oversight; don't force a shared component that would couple task editing to gate semantics.
|
|
1068
1080
|
- **The plan/peer→task bridges are board-attached-only and reuse `task_ledger_create`.** `PlanBodyRenderer.onPromoteTask` (→ TASK pill on unchecked checkboxes) and `MailboxModal.onMakeTask` (→ TASK per pending peer message) both fire `task_ledger_create` on the first member with `cluster.taskBoardKey`, gated on `cluster.taskBoardMode !== 'none'`. The peer bridge lives on the pending-mailbox surface (it has cluster context); a delivered-chat `PeerMessageBlock` bridge is deferred (needs per-workflow cluster context). Don't wire the bridges when the board is detached - the task would land on a board the operator can't see.
|
|
1069
|
-
- **The automation header
|
|
1081
|
+
- **The automation header is collapsed by default.** It contains dispatcher and swarm controls. DRAFT ASSIST is hidden in this version.
|
|
1070
1082
|
|
|
1071
1083
|
### Director sign-off + per-card actions
|
|
1072
1084
|
|
|
@@ -1150,7 +1162,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
1150
1162
|
- **The Director contract delegates and lands; it never tells the director to keep working until the plan is done.** `clusterDirector.ts` gives a role starting with Director/Coordinator: delegate implementation/builds/tests via peer_send, don't write code, read the full diff + peer gate evidence, then commit/push; edit plan tasks but keep status on the board. The Director delegates, reviews evidence, and does not continue implementation or record progress in the plan. Don't reintroduce continue-until-done or evidence-into-plan wording (CLAUDE.md fence: model proposes/delegates, operator owns "is this done?"). Pinned by `smoke:astra-cluster-director` + `test:codex-code-mode`.
|
|
1151
1163
|
- **Cluster plan + role + mailbox prologue ride through `WorkerConfig.appendSystemPrompt` for both Codex transports.** Native still injects forced system blocks. Codex app-server also duplicates the stable role/tool/Director contract at developer level because its built-in `/root` framing otherwise outranks the user-text prefix. The app-server fold cap is 48 KB; CLI stays 16 KB.
|
|
1152
1164
|
- **Codex CLI's `-c` value is parsed as TOML.** Strings need quoting, arrays use TOML array syntax. We emit via `JSON.stringify` because TOML strings and arrays are a strict superset of JSON's quoting rules for `string | string[]` shapes - handy. If you ever extend `buildCodexMcpOverrides` to emit non-string-non-array values (booleans, integers), JSON.stringify still works for those primitives because TOML accepts the JSON literal forms.
|
|
1153
|
-
- **`SpawnDialog` / `TabContextMenu` / `ClusterRightPanel` candidate filters now accept `provider === 'codex'` alongside `'claude'`.** A polish pass should rename the still-misleadingly-named `anchorIsNative` local in `TabContextMenu.tsx` to something provider-agnostic; left as-is to keep the diff scoped.
|
|
1165
|
+
- **`SpawnDialog` / `TabContextMenu` / `ClusterRightPanel` candidate filters now accept `provider === 'codex'` alongside `'claude'`.** `TabContextMenu` uses the shared `isClusterMemberProvider` less Cursor; do not reintroduce a hand-written provider list there. Cursor stays out on purpose, as in `AddWorkerSection`'s ADD EXISTING: an open Cursor tab's ACP session fixed its `mcpServers` without the loopback peer-tools MCP, so it would join as a member that cannot read or send mail until its worker restarts. A polish pass should rename the still-misleadingly-named `anchorIsNative` local in `TabContextMenu.tsx` to something provider-agnostic; left as-is to keep the diff scoped.
|
|
1154
1166
|
|
|
1155
1167
|
### gotchas (Polish - rehydrate · detach · activity · idle nudger)
|
|
1156
1168
|
|
|
@@ -1222,7 +1234,7 @@ The live Arco *service* reporting workflows + applying reply/stop/continue. `ser
|
|
|
1222
1234
|
- **The server's `workflows` map does NOT register cluster members on boot - it fills lazily from client `rehydrate_workflows`.** So `workflows.get(memberWfid)` returns `undefined` after a restart for any member no connected client rehydrated. The first-pass fix (a `cluster_member_rehydrate` message that only sent `workflow_created` for a member already in `workflows`) therefore bailed silently on exactly the stuck case. The shipped handler (`handleClusterMemberRehydrate`) now reconstructs the member's `WorkflowConfig` from its persisted `meta.json` (config is stored field-by-field there - `primaryProvider`/`primaryModel`/`primaryEffort`/`cwd`/`name`/`providerAccountRef`/`efficiencyToolFilter` - NOT under a `config` key; `skipPermissions` defaults `true`) and registers the `WorkflowState` (WorkerManager + `derivePrimaryConfig` + `deriveAutoHandoff` + restored `cliSessions` primarySessionId) before sending `workflow_created` + `rehydrateOneWorkflow(…, 0)`. Per-branch `console.log` on every early return - the silent bail cost a debug round-trip; keep the logging.
|
|
1223
1235
|
- **The client request is deduped by `workflowId` and cleared ONLY on `workflow_created` (`requestedMemberRehydrate` in `handleServerMessage.ts`).** A failed attempt (server bailed, no `workflow_created`) leaves the guard set, so a plain WS auto-reconnect won't retry - a **page reload** is required to reset the module-level Set. This is why the recovery needs a hard refresh after a fix-deploy, not just a reconnect. If you make this retry on reconnect, clear the guard on a timeout or on `cluster_state` instead.
|
|
1224
1236
|
- **Eager boot-time member registration is now the primary fix (2026-07-10 followup).** `registerAllClusterMembersOnBoot` (`handoffHandlers.ts`, fired failure-isolated in the `index.ts` listen() epilogue alongside the recall backfill) walks `clusterStore.loadAllClustersFromDisk()` and registers every member's `WorkflowState` from `meta.json` so the `workflows` map never drifts across a restart - no more lazy-fill gap. It also warms `clusterStore`'s `memberIndex` (via `readCluster` per cluster) so a member's first post-restart turn resolves its `clusterId` for peer-tool wiring. `cluster_member_rehydrate` stays as the client-driven job-materialization channel (boot registration makes the server side complete; the client still needs `workflow_created` to build its job) AND the dynamic-add path (a member added mid-session that this browser has no job for).
|
|
1225
|
-
- **Config reconstruction lives in ONE mapper - `workflowConfigFromMeta` (`workflowMeta.ts`).** Shared by the boot path and the on-demand handler (via `materializeMemberFromMeta`) so they can't drift. It carries EVERY turn-relevant persisted field, NOT just provider/model/effort - dropping `claudeTransport`/`codexTransport` alone silently runs a Native member on CLI / an appserver Codex member on exec (the latent bug the first pass shipped). Falsy-but-valid values must use type checks, not truthiness: `webSearchMaxUses: 0` (`typeof === 'number'`), `claudeNativeCompact: false` (`!== undefined`), efficiency `'off'` (truthy string).
|
|
1237
|
+
- **Config reconstruction lives in ONE mapper - `workflowConfigFromMeta` (`workflowMeta.ts`).** Shared by the boot path and the on-demand handler (via `materializeMemberFromMeta`) so they can't drift. It carries EVERY turn-relevant persisted field, NOT just provider/model/effort - dropping `claudeTransport`/`codexTransport` alone silently runs a Native member on CLI / an appserver Codex member on exec (the latent bug the first pass shipped). Falsy-but-valid values must use type checks, not truthiness: `webSearchMaxUses: 0` (`typeof === 'number'`), `claudeNativeCompact: false` (`!== undefined`), efficiency `'off'` (truthy string). Legacy outputStyle values are aliased in the mapper (`lite` to `plain`, `caveman` to `terse`; `normalizeOutputStyle`).
|
|
1226
1238
|
- **`meta.json` cannot carry client-only config fields - `advanced` (fallbackModel / additionalDirectories), `fastMode`, `allowedProviders`, `skipPermissions`.** A boot/on-demand materialization forces `skipPermissions: true` (the cluster-member default) and resets the rest. Two load-bearing consequences: (1) a member materialized from meta is marked `wf.bootMaterialized = true`, and the `existing` branch of `handleRehydrateWorkflows` REPLACES that placeholder config with the client's full one + re-derives `primary` when the client reconnects (`!busy` guarded) - this is what restores a SAFE-mode member's `skipPermissions: false` and a `fallbackModel`. Without it, boot registration wins the race against the client reconnect and the client's authoritative config is silently discarded. (2) A **boot-only member** (no client ever reconnects with its config - e.g. an armed dispatcher fires a turn on a browserless member) still runs with `skipPermissions: true`; the durable fix is to persist `skipPermissions`/`advanced` into `WorkflowMeta` (deferred follow-up).
|
|
1227
1239
|
- **`materializeMemberFromMeta` re-checks `workflows.get()` AFTER its `await readMeta` (TOCTOU).** The boot scan runs fire-and-forget concurrently with client reconnects; the top-of-function guard fires before the await, so a concurrent `rehydrate_workflows` could register the member in the window and the unconditional `workflows.set` would clobber it - dropping the client's observer (→ the exact frozen-pane symptom) and resetting an in-flight `WorkerManager` (→ defeated busy guard, double-turn). The post-await re-check closes it. Never remove it.
|
|
1228
1240
|
- **Dynamic membership (frequent add/remove) is handled by the existing paths, not by this fix.** Every add/remove path (add-existing, spawn-join, fresh-workers, detach/remove) already registers/deregisters in the `workflows` map at the moment of the change AND pushes a fresh `cluster_state`, so `requestMissingMemberJobs` materializes a runtime-added member and a removed member drops from the roster. Boot registration + the on-demand message only close the RESTART gap; both key off the atomically-maintained `members[]`, so add/remove between restarts is reflected automatically. Known minor edges (follow-ups): a client job for a removed member lingers (no `workflow_removed`; `cluster_member_removed` is a client no-op), and the `requestedMemberRehydrate` dedup guard clears only on `workflow_created` (a genuinely-unreadable-meta member stays stuck for the session).
|
|
@@ -1740,3 +1752,4 @@ Smoke: `npm run smoke:bakeoff`.
|
|
|
1740
1752
|
- [WebSocket protocol](PROTOCOL.md)
|
|
1741
1753
|
- [Operations](OPERATIONS.md)
|
|
1742
1754
|
- [Documentation style](STYLE.md)
|
|
1755
|
+
|