@amsterdamdatalabs/enact-operator 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lanes/autopilot/index.d.ts +95 -0
- package/dist/lanes/autopilot/index.d.ts.map +1 -0
- package/dist/lanes/autopilot/index.js +499 -0
- package/dist/lanes/autopilot/index.js.map +1 -0
- package/dist/lanes/ralph/index.d.ts +118 -0
- package/dist/lanes/ralph/index.d.ts.map +1 -0
- package/dist/lanes/ralph/index.js +680 -0
- package/dist/lanes/ralph/index.js.map +1 -0
- package/dist/lanes/team/index.d.ts +110 -0
- package/dist/lanes/team/index.d.ts.map +1 -0
- package/dist/lanes/team/index.js +748 -0
- package/dist/lanes/team/index.js.map +1 -0
- package/dist/lanes/team/roles.d.ts +15 -0
- package/dist/lanes/team/roles.d.ts.map +1 -0
- package/dist/lanes/team/roles.js +89 -0
- package/dist/lanes/team/roles.js.map +1 -0
- package/dist/lanes/ultrawork/burst.d.ts +69 -0
- package/dist/lanes/ultrawork/burst.d.ts.map +1 -0
- package/dist/lanes/ultrawork/burst.js +254 -0
- package/dist/lanes/ultrawork/burst.js.map +1 -0
- package/dist/lanes/ultrawork/index.d.ts +159 -0
- package/dist/lanes/ultrawork/index.d.ts.map +1 -0
- package/dist/lanes/ultrawork/index.js +919 -0
- package/dist/lanes/ultrawork/index.js.map +1 -0
- package/dist/lanes/ultrawork/phases.d.ts +57 -0
- package/dist/lanes/ultrawork/phases.d.ts.map +1 -0
- package/dist/lanes/ultrawork/phases.js +116 -0
- package/dist/lanes/ultrawork/phases.js.map +1 -0
- package/dist/mcp/activation.d.ts +5 -0
- package/dist/mcp/activation.d.ts.map +1 -0
- package/dist/mcp/activation.js +234 -0
- package/dist/mcp/activation.js.map +1 -0
- package/dist/mcp/cli.d.ts +11 -0
- package/dist/mcp/cli.d.ts.map +1 -0
- package/dist/mcp/cli.js +140 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/continuation.d.ts +5 -0
- package/dist/mcp/continuation.d.ts.map +1 -0
- package/dist/mcp/continuation.js +360 -0
- package/dist/mcp/continuation.js.map +1 -0
- package/dist/mcp/jobs.d.ts +5 -0
- package/dist/mcp/jobs.d.ts.map +1 -0
- package/dist/mcp/jobs.js +212 -0
- package/dist/mcp/jobs.js.map +1 -0
- package/dist/mcp/laneSupport.d.ts +19 -0
- package/dist/mcp/laneSupport.d.ts.map +1 -0
- package/dist/mcp/laneSupport.js +21 -0
- package/dist/mcp/laneSupport.js.map +1 -0
- package/dist/mcp/lanes/autopilot.d.ts +5 -0
- package/dist/mcp/lanes/autopilot.d.ts.map +1 -0
- package/dist/mcp/lanes/autopilot.js +227 -0
- package/dist/mcp/lanes/autopilot.js.map +1 -0
- package/dist/mcp/lanes/ralph.d.ts +5 -0
- package/dist/mcp/lanes/ralph.d.ts.map +1 -0
- package/dist/mcp/lanes/ralph.js +392 -0
- package/dist/mcp/lanes/ralph.js.map +1 -0
- package/dist/mcp/lanes/team.d.ts +5 -0
- package/dist/mcp/lanes/team.d.ts.map +1 -0
- package/dist/mcp/lanes/team.js +413 -0
- package/dist/mcp/lanes/team.js.map +1 -0
- package/dist/mcp/lanes/ultrawork.d.ts +5 -0
- package/dist/mcp/lanes/ultrawork.d.ts.map +1 -0
- package/dist/mcp/lanes/ultrawork.js +497 -0
- package/dist/mcp/lanes/ultrawork.js.map +1 -0
- package/dist/mcp/linkage.d.ts +5 -0
- package/dist/mcp/linkage.d.ts.map +1 -0
- package/dist/mcp/linkage.js +126 -0
- package/dist/mcp/linkage.js.map +1 -0
- package/dist/mcp/planning.d.ts +5 -0
- package/dist/mcp/planning.d.ts.map +1 -0
- package/dist/mcp/planning.js +584 -0
- package/dist/mcp/planning.js.map +1 -0
- package/dist/mcp/rpcTransport.d.ts +17 -0
- package/dist/mcp/rpcTransport.d.ts.map +1 -0
- package/dist/mcp/rpcTransport.js +90 -0
- package/dist/mcp/rpcTransport.js.map +1 -0
- package/dist/mcp/schemas/ralphVerify.d.ts +32 -0
- package/dist/mcp/schemas/ralphVerify.d.ts.map +1 -0
- package/dist/mcp/schemas/ralphVerify.js +20 -0
- package/dist/mcp/schemas/ralphVerify.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +176 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/system.d.ts +5 -0
- package/dist/mcp/system.d.ts.map +1 -0
- package/dist/mcp/system.js +445 -0
- package/dist/mcp/system.js.map +1 -0
- package/dist/mcp/toolFilter.d.ts +2 -0
- package/dist/mcp/toolFilter.d.ts.map +1 -0
- package/dist/mcp/toolFilter.js +2 -0
- package/dist/mcp/toolFilter.js.map +1 -0
- package/dist/mcp/toolPartitions.d.ts +20 -0
- package/dist/mcp/toolPartitions.d.ts.map +1 -0
- package/dist/mcp/toolPartitions.js +280 -0
- package/dist/mcp/toolPartitions.js.map +1 -0
- package/dist/mcp/toolRuntime.d.ts +9 -0
- package/dist/mcp/toolRuntime.d.ts.map +1 -0
- package/dist/mcp/toolRuntime.js +179 -0
- package/dist/mcp/toolRuntime.js.map +1 -0
- package/dist/mcp/workflow.d.ts +12 -0
- package/dist/mcp/workflow.d.ts.map +1 -0
- package/dist/mcp/workflow.js +723 -0
- package/dist/mcp/workflow.js.map +1 -0
- package/dist/operator/hooks/hookDispatcher.d.ts +39 -0
- package/dist/operator/hooks/hookDispatcher.d.ts.map +1 -0
- package/dist/operator/hooks/hookDispatcher.js +58 -0
- package/dist/operator/hooks/hookDispatcher.js.map +1 -0
- package/dist/operator/hooks/hookGating.d.ts +28 -0
- package/dist/operator/hooks/hookGating.d.ts.map +1 -0
- package/dist/operator/hooks/hookGating.js +61 -0
- package/dist/operator/hooks/hookGating.js.map +1 -0
- package/dist/operator/hooks/hooks.d.ts +20 -0
- package/dist/operator/hooks/hooks.d.ts.map +1 -0
- package/dist/operator/hooks/hooks.js +124 -0
- package/dist/operator/hooks/hooks.js.map +1 -0
- package/dist/operator/hooks/toolGuardHooks.d.ts +86 -0
- package/dist/operator/hooks/toolGuardHooks.d.ts.map +1 -0
- package/dist/operator/hooks/toolGuardHooks.js +163 -0
- package/dist/operator/hooks/toolGuardHooks.js.map +1 -0
- package/dist/operator/hud.d.ts +115 -0
- package/dist/operator/hud.d.ts.map +1 -0
- package/dist/operator/hud.js +229 -0
- package/dist/operator/hud.js.map +1 -0
- package/dist/operator/missions.d.ts +125 -0
- package/dist/operator/missions.d.ts.map +1 -0
- package/dist/operator/missions.js +304 -0
- package/dist/operator/missions.js.map +1 -0
- package/dist/operator/operatorCore.d.ts +11 -0
- package/dist/operator/operatorCore.d.ts.map +1 -0
- package/dist/operator/operatorCore.js +9 -0
- package/dist/operator/operatorCore.js.map +1 -0
- package/dist/operator/operatorRuntimeCore.d.ts +17 -0
- package/dist/operator/operatorRuntimeCore.d.ts.map +1 -0
- package/dist/operator/operatorRuntimeCore.js +17 -0
- package/dist/operator/operatorRuntimeCore.js.map +1 -0
- package/dist/operator/runtime.d.ts +74 -0
- package/dist/operator/runtime.d.ts.map +1 -0
- package/dist/operator/runtime.js +357 -0
- package/dist/operator/runtime.js.map +1 -0
- package/dist/shared/core/bootstrap.d.ts +16 -0
- package/dist/shared/core/bootstrap.d.ts.map +1 -0
- package/dist/shared/core/bootstrap.js +77 -0
- package/dist/shared/core/bootstrap.js.map +1 -0
- package/dist/shared/core/contract.d.ts +71 -0
- package/dist/shared/core/contract.d.ts.map +1 -0
- package/dist/shared/core/contract.js +452 -0
- package/dist/shared/core/contract.js.map +1 -0
- package/dist/shared/core/events.d.ts +57 -0
- package/dist/shared/core/events.d.ts.map +1 -0
- package/dist/shared/core/events.js +36 -0
- package/dist/shared/core/events.js.map +1 -0
- package/dist/shared/core/jobs.d.ts +46 -0
- package/dist/shared/core/jobs.d.ts.map +1 -0
- package/dist/shared/core/jobs.js +137 -0
- package/dist/shared/core/jobs.js.map +1 -0
- package/dist/shared/core/json.d.ts +12 -0
- package/dist/shared/core/json.d.ts.map +1 -0
- package/dist/shared/core/json.js +52 -0
- package/dist/shared/core/json.js.map +1 -0
- package/dist/shared/core/layoutMigration.d.ts +11 -0
- package/dist/shared/core/layoutMigration.d.ts.map +1 -0
- package/dist/shared/core/layoutMigration.js +56 -0
- package/dist/shared/core/layoutMigration.js.map +1 -0
- package/dist/shared/core/lifecycle.d.ts +61 -0
- package/dist/shared/core/lifecycle.d.ts.map +1 -0
- package/dist/shared/core/lifecycle.js +123 -0
- package/dist/shared/core/lifecycle.js.map +1 -0
- package/dist/shared/core/packagePaths.d.ts +2 -0
- package/dist/shared/core/packagePaths.d.ts.map +1 -0
- package/dist/shared/core/packagePaths.js +9 -0
- package/dist/shared/core/packagePaths.js.map +1 -0
- package/dist/shared/core/terminology.d.ts +38 -0
- package/dist/shared/core/terminology.d.ts.map +1 -0
- package/dist/shared/core/terminology.js +54 -0
- package/dist/shared/core/terminology.js.map +1 -0
- package/dist/shared/core/types.d.ts +30 -0
- package/dist/shared/core/types.d.ts.map +1 -0
- package/dist/shared/core/types.js +2 -0
- package/dist/shared/core/types.js.map +1 -0
- package/dist/shared/diagnostics/doctor.d.ts +19 -0
- package/dist/shared/diagnostics/doctor.d.ts.map +1 -0
- package/dist/shared/diagnostics/doctor.js +82 -0
- package/dist/shared/diagnostics/doctor.js.map +1 -0
- package/dist/shared/diagnostics/hostRollout.d.ts +16 -0
- package/dist/shared/diagnostics/hostRollout.d.ts.map +1 -0
- package/dist/shared/diagnostics/hostRollout.js +78 -0
- package/dist/shared/diagnostics/hostRollout.js.map +1 -0
- package/dist/shared/observability/emit.d.ts +3 -0
- package/dist/shared/observability/emit.d.ts.map +1 -0
- package/dist/shared/observability/emit.js +17 -0
- package/dist/shared/observability/emit.js.map +1 -0
- package/dist/shared/observability/testWorkspace.d.ts +4 -0
- package/dist/shared/observability/testWorkspace.d.ts.map +1 -0
- package/dist/shared/observability/testWorkspace.js +35 -0
- package/dist/shared/observability/testWorkspace.js.map +1 -0
- package/dist/shared/state/installRegistry.d.ts +22 -0
- package/dist/shared/state/installRegistry.d.ts.map +1 -0
- package/dist/shared/state/installRegistry.js +51 -0
- package/dist/shared/state/installRegistry.js.map +1 -0
- package/dist/shared/state/session.d.ts +18 -0
- package/dist/shared/state/session.d.ts.map +1 -0
- package/dist/shared/state/session.js +127 -0
- package/dist/shared/state/session.js.map +1 -0
- package/dist/shared/state/state.d.ts +16 -0
- package/dist/shared/state/state.d.ts.map +1 -0
- package/dist/shared/state/state.js +91 -0
- package/dist/shared/state/state.js.map +1 -0
- package/dist/shared/state/tasks.d.ts +113 -0
- package/dist/shared/state/tasks.d.ts.map +1 -0
- package/dist/shared/state/tasks.js +274 -0
- package/dist/shared/state/tasks.js.map +1 -0
- package/dist/shared/workflow/activation/activeSkill.d.ts +46 -0
- package/dist/shared/workflow/activation/activeSkill.d.ts.map +1 -0
- package/dist/shared/workflow/activation/activeSkill.js +158 -0
- package/dist/shared/workflow/activation/activeSkill.js.map +1 -0
- package/dist/shared/workflow/activation/gateProfiles.d.ts +26 -0
- package/dist/shared/workflow/activation/gateProfiles.d.ts.map +1 -0
- package/dist/shared/workflow/activation/gateProfiles.js +102 -0
- package/dist/shared/workflow/activation/gateProfiles.js.map +1 -0
- package/dist/shared/workflow/activation/modeMatrix.d.ts +28 -0
- package/dist/shared/workflow/activation/modeMatrix.d.ts.map +1 -0
- package/dist/shared/workflow/activation/modeMatrix.js +91 -0
- package/dist/shared/workflow/activation/modeMatrix.js.map +1 -0
- package/dist/shared/workflow/activation/skillActivation.d.ts +74 -0
- package/dist/shared/workflow/activation/skillActivation.d.ts.map +1 -0
- package/dist/shared/workflow/activation/skillActivation.js +485 -0
- package/dist/shared/workflow/activation/skillActivation.js.map +1 -0
- package/dist/shared/workflow/activation/skillVariant.d.ts +18 -0
- package/dist/shared/workflow/activation/skillVariant.d.ts.map +1 -0
- package/dist/shared/workflow/activation/skillVariant.js +44 -0
- package/dist/shared/workflow/activation/skillVariant.js.map +1 -0
- package/dist/shared/workflow/authority/authority.d.ts +34 -0
- package/dist/shared/workflow/authority/authority.d.ts.map +1 -0
- package/dist/shared/workflow/authority/authority.js +64 -0
- package/dist/shared/workflow/authority/authority.js.map +1 -0
- package/dist/shared/workflow/closure/closureManifest.d.ts +39 -0
- package/dist/shared/workflow/closure/closureManifest.d.ts.map +1 -0
- package/dist/shared/workflow/closure/closureManifest.js +62 -0
- package/dist/shared/workflow/closure/closureManifest.js.map +1 -0
- package/dist/shared/workflow/closure/closureRequirements.d.ts +12 -0
- package/dist/shared/workflow/closure/closureRequirements.d.ts.map +1 -0
- package/dist/shared/workflow/closure/closureRequirements.js +30 -0
- package/dist/shared/workflow/closure/closureRequirements.js.map +1 -0
- package/dist/shared/workflow/closure/contractParity.d.ts +24 -0
- package/dist/shared/workflow/closure/contractParity.d.ts.map +1 -0
- package/dist/shared/workflow/closure/contractParity.js +238 -0
- package/dist/shared/workflow/closure/contractParity.js.map +1 -0
- package/dist/shared/workflow/closure/contractParityContext.d.ts +8 -0
- package/dist/shared/workflow/closure/contractParityContext.d.ts.map +1 -0
- package/dist/shared/workflow/closure/contractParityContext.js +50 -0
- package/dist/shared/workflow/closure/contractParityContext.js.map +1 -0
- package/dist/shared/workflow/closure/scopeGuard.d.ts +11 -0
- package/dist/shared/workflow/closure/scopeGuard.d.ts.map +1 -0
- package/dist/shared/workflow/closure/scopeGuard.js +69 -0
- package/dist/shared/workflow/closure/scopeGuard.js.map +1 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.d.ts +13 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.d.ts.map +1 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.js +31 -0
- package/dist/shared/workflow/closure/ultragoalArtifact.js.map +1 -0
- package/dist/shared/workflow/closure/workflowReconcile.d.ts +70 -0
- package/dist/shared/workflow/closure/workflowReconcile.d.ts.map +1 -0
- package/dist/shared/workflow/closure/workflowReconcile.js +267 -0
- package/dist/shared/workflow/closure/workflowReconcile.js.map +1 -0
- package/dist/shared/workflow/continuation/continuation.d.ts +109 -0
- package/dist/shared/workflow/continuation/continuation.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuation.js +550 -0
- package/dist/shared/workflow/continuation/continuation.js.map +1 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.d.ts +17 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.js +88 -0
- package/dist/shared/workflow/continuation/continuationEventReservations.js.map +1 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.d.ts +114 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.js +330 -0
- package/dist/shared/workflow/continuation/continuationFollowUp.js.map +1 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.d.ts +66 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.js +144 -0
- package/dist/shared/workflow/continuation/continuationOrchestrator.js.map +1 -0
- package/dist/shared/workflow/continuation/hookContinuation.d.ts +44 -0
- package/dist/shared/workflow/continuation/hookContinuation.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/hookContinuation.js +85 -0
- package/dist/shared/workflow/continuation/hookContinuation.js.map +1 -0
- package/dist/shared/workflow/continuation/stopPolicy.d.ts +38 -0
- package/dist/shared/workflow/continuation/stopPolicy.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/stopPolicy.js +435 -0
- package/dist/shared/workflow/continuation/stopPolicy.js.map +1 -0
- package/dist/shared/workflow/continuation/stopVerdict.d.ts +31 -0
- package/dist/shared/workflow/continuation/stopVerdict.d.ts.map +1 -0
- package/dist/shared/workflow/continuation/stopVerdict.js +98 -0
- package/dist/shared/workflow/continuation/stopVerdict.js.map +1 -0
- package/dist/shared/workflow/delegation/delegatedSession.d.ts +118 -0
- package/dist/shared/workflow/delegation/delegatedSession.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/delegatedSession.js +496 -0
- package/dist/shared/workflow/delegation/delegatedSession.js.map +1 -0
- package/dist/shared/workflow/delegation/delegationPrompt.d.ts +3 -0
- package/dist/shared/workflow/delegation/delegationPrompt.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/delegationPrompt.js +15 -0
- package/dist/shared/workflow/delegation/delegationPrompt.js.map +1 -0
- package/dist/shared/workflow/delegation/sessionTasks.d.ts +40 -0
- package/dist/shared/workflow/delegation/sessionTasks.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/sessionTasks.js +73 -0
- package/dist/shared/workflow/delegation/sessionTasks.js.map +1 -0
- package/dist/shared/workflow/delegation/subagentRuntime.d.ts +26 -0
- package/dist/shared/workflow/delegation/subagentRuntime.d.ts.map +1 -0
- package/dist/shared/workflow/delegation/subagentRuntime.js +231 -0
- package/dist/shared/workflow/delegation/subagentRuntime.js.map +1 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.d.ts +79 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.js +166 -0
- package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.js.map +1 -0
- package/dist/shared/workflow/delivery/finalWave.d.ts +57 -0
- package/dist/shared/workflow/delivery/finalWave.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/finalWave.js +123 -0
- package/dist/shared/workflow/delivery/finalWave.js.map +1 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.d.ts +68 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.js +82 -0
- package/dist/shared/workflow/delivery/lifecyclePushMap.js.map +1 -0
- package/dist/shared/workflow/delivery/prSidecar.d.ts +7 -0
- package/dist/shared/workflow/delivery/prSidecar.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/prSidecar.js +4 -0
- package/dist/shared/workflow/delivery/prSidecar.js.map +1 -0
- package/dist/shared/workflow/delivery/reviewStaleness.d.ts +37 -0
- package/dist/shared/workflow/delivery/reviewStaleness.d.ts.map +1 -0
- package/dist/shared/workflow/delivery/reviewStaleness.js +94 -0
- package/dist/shared/workflow/delivery/reviewStaleness.js.map +1 -0
- package/dist/shared/workflow/planning/hyperplan.d.ts +40 -0
- package/dist/shared/workflow/planning/hyperplan.d.ts.map +1 -0
- package/dist/shared/workflow/planning/hyperplan.js +133 -0
- package/dist/shared/workflow/planning/hyperplan.js.map +1 -0
- package/dist/shared/workflow/planning/notepad.d.ts +17 -0
- package/dist/shared/workflow/planning/notepad.d.ts.map +1 -0
- package/dist/shared/workflow/planning/notepad.js +84 -0
- package/dist/shared/workflow/planning/notepad.js.map +1 -0
- package/dist/shared/workflow/planning/planFormat.d.ts +3 -0
- package/dist/shared/workflow/planning/planFormat.d.ts.map +1 -0
- package/dist/shared/workflow/planning/planFormat.js +14 -0
- package/dist/shared/workflow/planning/planFormat.js.map +1 -0
- package/package.json +155 -0
- package/runtime/hooks/_continuation.mjs +2 -0
- package/runtime/hooks/_lib.mjs +2 -0
- package/runtime/hooks/_toolGuards.mjs +2 -0
- package/runtime/hooks/lanes/resolveSkillActivation.mjs +241 -0
- package/runtime/hooks/lanes/user-prompt-submit.mjs +326 -0
- package/runtime/hooks/layout-dir.mjs +2 -0
- package/runtime/hooks/lifecycle/pre-compact.mjs +121 -0
- package/runtime/hooks/lifecycle/session-start.mjs +356 -0
- package/runtime/hooks/lifecycle/stop.mjs +223 -0
- package/runtime/hooks/observability.mjs +2 -0
- package/runtime/hooks/post-tool-use-failure.mjs +5 -0
- package/runtime/hooks/post-tool-use.mjs +4 -0
- package/runtime/hooks/pre-compact.mjs +4 -0
- package/runtime/hooks/pre-tool-use.mjs +4 -0
- package/runtime/hooks/resolveSkillActivation.mjs +4 -0
- package/runtime/hooks/root-dir.mjs +2 -0
- package/runtime/hooks/session-start.mjs +4 -0
- package/runtime/hooks/shared/_continuation.mjs +341 -0
- package/runtime/hooks/shared/_lib.mjs +60 -0
- package/runtime/hooks/shared/_toolGuards.mjs +237 -0
- package/runtime/hooks/shared/config.mjs +143 -0
- package/runtime/hooks/shared/layout-dir.mjs +12 -0
- package/runtime/hooks/shared/observability.mjs +257 -0
- package/runtime/hooks/shared/root-dir.mjs +9 -0
- package/runtime/hooks/stop.mjs +4 -0
- package/runtime/hooks/subagent-tracker.mjs +4 -0
- package/runtime/hooks/subagents/subagent-tracker.mjs +106 -0
- package/runtime/hooks/tools/post-tool-use-failure.mjs +251 -0
- package/runtime/hooks/tools/post-tool-use.mjs +205 -0
- package/runtime/hooks/tools/pre-tool-use.mjs +268 -0
- package/runtime/hooks/user-prompt-submit.mjs +4 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas-equivalent continuation orchestrator (Plan 12).
|
|
3
|
+
*
|
|
4
|
+
* TWIN note: runtime/hooks/_continuation.mjs is the runtime .mjs twin of this file.
|
|
5
|
+
* If logic changes here it MUST be reflected in _continuation.mjs, and vice-versa.
|
|
6
|
+
* The .mjs twin replicates isManualTaskCloseLedgerKind and isProtectedOperatorStatePath
|
|
7
|
+
* inline (those are TS-only; cannot be imported into .mjs at runtime).
|
|
8
|
+
*
|
|
9
|
+
* Single integration sink that wires together all five predecessor surfaces so
|
|
10
|
+
* active tasks, delegated sessions, and background work survive idle / stop /
|
|
11
|
+
* compaction boundaries.
|
|
12
|
+
*
|
|
13
|
+
* Per INV-031 the main enact-agent decides and orchestrates; runtime executes
|
|
14
|
+
* explicit graph nodes only. This module is therefore legitimately
|
|
15
|
+
* exported-only: the agent runtime (session-start.mjs / pre-compact.mjs hooks
|
|
16
|
+
* and the MCP operator tools) is the authoritative external caller. It is NOT
|
|
17
|
+
* dead code — it is the integration sink those callers import at runtime.
|
|
18
|
+
*
|
|
19
|
+
* Predecessor surfaces wired here:
|
|
20
|
+
* Slice 1 (subagent-tracker): recordSubagentStartedOnContinuation /
|
|
21
|
+
* recordSubagentStoppedOnContinuation — now reliable because
|
|
22
|
+
* subagent-tracker.mjs no longer crashes on SubagentStart/SubagentStop.
|
|
23
|
+
* Slice 2 (pre-compact): hasPendingLocalTasks — detects compaction survivors
|
|
24
|
+
* written by pre-compact.mjs's compaction-context.json write path.
|
|
25
|
+
* Slice 8 (protected-state): all state reads route through the Operator-owned
|
|
26
|
+
* broker (readContinuationState, readDelegatedSessionsState) rather than
|
|
27
|
+
* raw fs access.
|
|
28
|
+
* Slice 9 (team-transforms): captureActiveWorkflows + team-mailbox injection
|
|
29
|
+
* and role-gating layer is applied before re-enqueueing team work.
|
|
30
|
+
* Slice 10 (close-vocabulary): readContinuationFollowUpQueue /
|
|
31
|
+
* enqueueContinuationFollowUp — unified close-event vocabulary so both
|
|
32
|
+
* Factory workitem_manual_close and Operator task_manual_close unblock the
|
|
33
|
+
* follow-up queue.
|
|
34
|
+
*/
|
|
35
|
+
import { readContinuationState, writeContinuationState, buildContinuationGuidance, hasPendingLocalTasks, recordSubagentStartedOnContinuation, recordSubagentStoppedOnContinuation, } from '../../../shared/workflow/continuation/continuation.js';
|
|
36
|
+
import { captureActiveWorkflows } from '../../../shared/workflow/continuation/hookContinuation.js';
|
|
37
|
+
import { listSessionTasks, } from '../../../shared/workflow/delegation/sessionTasks.js';
|
|
38
|
+
import { buildDelegatedSessionResumePlan, reconcileDelegatedSessions, } from '../../../shared/workflow/delegation/delegatedSession.js';
|
|
39
|
+
import { readContinuationFollowUpQueue, enqueueContinuationFollowUp, buildSessionIdleDedupeKey, buildDelegatedFollowUpDedupeKey, } from '../../../shared/workflow/continuation/continuationFollowUp.js';
|
|
40
|
+
import { readOperatorAuthority } from '../../../shared/workflow/authority/authority.js';
|
|
41
|
+
/**
|
|
42
|
+
* Orchestrate continuation state across an idle / stop / compaction boundary.
|
|
43
|
+
*
|
|
44
|
+
* This is the single integration sink referenced by the atlas plan.
|
|
45
|
+
*/
|
|
46
|
+
export function orchestrateContinuation(root, trigger) {
|
|
47
|
+
const capturedAt = new Date().toISOString();
|
|
48
|
+
// ── Slice 9: capture active workflows (ralph/ultrawork/autopilot/team) ────
|
|
49
|
+
const activeWorkflows = captureActiveWorkflows(root);
|
|
50
|
+
// ── Slice 8: all state reads via Operator broker (continuation + delegated) ─
|
|
51
|
+
const contState = readContinuationState(root);
|
|
52
|
+
const authority = readOperatorAuthority(root);
|
|
53
|
+
const guidance = buildContinuationGuidance(authority);
|
|
54
|
+
// ── Slice 2: detect compaction survivors ─────────────────────────────────
|
|
55
|
+
const hasCompactionSurvivors = hasPendingLocalTasks(guidance);
|
|
56
|
+
// ── Slice 1: surface active subagent IDs from continuation state ──────────
|
|
57
|
+
const activeSubagentIds = contState.activeSubagentIds ?? [];
|
|
58
|
+
// ── Gap-close: re-enqueue sessionTasks into continuation pendingTaskIds ───
|
|
59
|
+
const allSessionTasks = listSessionTasks(root);
|
|
60
|
+
const pendingSessionTasks = allSessionTasks.filter((t) => t.status === 'pending' || t.status === 'active' || t.status === 'blocked');
|
|
61
|
+
const pendingSessionTaskIds = pendingSessionTasks.map((t) => t.id);
|
|
62
|
+
// Merge sessionTask IDs into continuation state pendingTaskIds so they
|
|
63
|
+
// survive the SessionStart restore (closing the gap proven by the red test).
|
|
64
|
+
if (pendingSessionTaskIds.length > 0) {
|
|
65
|
+
const merged = Array.from(new Set([...contState.pendingTaskIds, ...pendingSessionTaskIds]));
|
|
66
|
+
writeContinuationState(root, {
|
|
67
|
+
...contState,
|
|
68
|
+
pendingTaskIds: merged,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// ── Gap-close: detect + build resume plans for stale delegated sessions ───
|
|
72
|
+
const { state: delegatedState } = reconcileDelegatedSessions(root);
|
|
73
|
+
const resumableSessions = delegatedState.sessions.filter((s) => s.status === 'active' || s.status === 'stale');
|
|
74
|
+
const delegatedSessionResumePlans = resumableSessions.map((s) => buildDelegatedSessionResumePlan(root, s.continuationId));
|
|
75
|
+
// ── Slice 10: enqueue follow-ups via close-vocabulary queue ───────────────
|
|
76
|
+
let followUpQueuedCount = 0;
|
|
77
|
+
// Enqueue a session-idle follow-up for stale delegated sessions
|
|
78
|
+
for (const plan of delegatedSessionResumePlans) {
|
|
79
|
+
const lane = (contState.lane === 'none' ? 'none' : contState.lane);
|
|
80
|
+
const dedupeKey = buildDelegatedFollowUpDedupeKey(plan.continuationId, trigger);
|
|
81
|
+
const result = enqueueContinuationFollowUp(root, {
|
|
82
|
+
sessionId: contState.lastSessionId,
|
|
83
|
+
dedupeKey,
|
|
84
|
+
trigger: 'recovery',
|
|
85
|
+
lane,
|
|
86
|
+
laneId: contState.laneId,
|
|
87
|
+
prompt: `Continuation orchestrator (${trigger}): delegated session ${plan.continuationId} (${plan.session?.kind ?? 'unknown'}) needs attention. Decision: ${plan.decision}. ${plan.reason}`,
|
|
88
|
+
metadata: {
|
|
89
|
+
continuationId: plan.continuationId,
|
|
90
|
+
trigger,
|
|
91
|
+
source: 'atlas-continuation-orchestrator',
|
|
92
|
+
decision: plan.decision,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
if (result.outcome === 'queued') {
|
|
96
|
+
followUpQueuedCount += 1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// For idle/stop triggers, also enqueue a session-idle follow-up if there are
|
|
100
|
+
// pending session tasks that aren't yet covered by the guidance lane
|
|
101
|
+
if ((trigger === 'idle' || trigger === 'stop') && pendingSessionTaskIds.length > 0) {
|
|
102
|
+
const lane = (contState.lane === 'none' ? 'none' : contState.lane);
|
|
103
|
+
const dedupeKey = buildSessionIdleDedupeKey({
|
|
104
|
+
sessionId: contState.lastSessionId,
|
|
105
|
+
lane,
|
|
106
|
+
laneId: contState.laneId,
|
|
107
|
+
});
|
|
108
|
+
const sessionTaskResult = enqueueContinuationFollowUp(root, {
|
|
109
|
+
sessionId: contState.lastSessionId,
|
|
110
|
+
dedupeKey,
|
|
111
|
+
trigger: 'session-idle',
|
|
112
|
+
lane,
|
|
113
|
+
laneId: contState.laneId,
|
|
114
|
+
prompt: `Continuation orchestrator (${trigger}): ${pendingSessionTaskIds.length} pending session task(s) need re-enqueue after ${trigger} boundary. IDs: ${pendingSessionTaskIds.join(', ')}.`,
|
|
115
|
+
metadata: {
|
|
116
|
+
pendingSessionTaskIds,
|
|
117
|
+
trigger,
|
|
118
|
+
source: 'atlas-continuation-orchestrator',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
if (sessionTaskResult.outcome === 'queued') {
|
|
122
|
+
followUpQueuedCount += 1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Read final queue state to confirm counts (Slice 10 read surface)
|
|
126
|
+
const { counts } = readContinuationFollowUpQueue(root);
|
|
127
|
+
const totalQueued = counts.queued + counts.replayed;
|
|
128
|
+
return {
|
|
129
|
+
trigger,
|
|
130
|
+
capturedAt,
|
|
131
|
+
activeWorkflows,
|
|
132
|
+
pendingSessionTaskIds,
|
|
133
|
+
delegatedSessionResumePlans,
|
|
134
|
+
hasCompactionSurvivors,
|
|
135
|
+
followUpQueuedCount: Math.max(followUpQueuedCount, totalQueued > 0 ? followUpQueuedCount : 0),
|
|
136
|
+
activeSubagentIds,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Convenience re-exports so callers can use the Slice 1 subagent lifecycle
|
|
141
|
+
* surfaces through the orchestrator module without a separate import.
|
|
142
|
+
*/
|
|
143
|
+
export { recordSubagentStartedOnContinuation, recordSubagentStoppedOnContinuation };
|
|
144
|
+
//# sourceMappingURL=continuationOrchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuationOrchestrator.js","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/continuationOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,EAAE,8BAA8B,OAAO,MAAM,qBAAqB,CAAC,MAAM,kDAAkD,OAAO,mBAAmB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YAC9L,QAAQ,EAAE;gBACR,qBAAqB;gBACrB,OAAO;gBACP,MAAM,EAAE,iCAAiC;aAC1C;SACF,CAAC,CAAC;QACH,IAAI,iBAAiB,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC3C,mBAAmB,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,MAAM,EAAE,MAAM,EAAE,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAEpD,OAAO;QACL,OAAO;QACP,UAAU;QACV,eAAe;QACf,qBAAqB;QACrB,2BAA2B;QAC3B,sBAAsB;QACtB,mBAAmB,EAAE,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,OAAO,EAAE,mCAAmC,EAAE,mCAAmC,EAAE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface RalphSnapshot {
|
|
2
|
+
id: string;
|
|
3
|
+
phase: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
goal: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
gatesPassed: number;
|
|
8
|
+
gatesTotal: number;
|
|
9
|
+
pendingGateIds: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface UltraworkSnapshot {
|
|
12
|
+
id: string;
|
|
13
|
+
phase: string;
|
|
14
|
+
route: string;
|
|
15
|
+
active: boolean;
|
|
16
|
+
intent: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AutopilotSnapshot {
|
|
20
|
+
id: string;
|
|
21
|
+
phase: string;
|
|
22
|
+
route: string;
|
|
23
|
+
active: boolean;
|
|
24
|
+
intent: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
export interface TeamSnapshot {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
active: boolean;
|
|
31
|
+
executorCount: number;
|
|
32
|
+
queuedTaskCount: number;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ActiveWorkflowSnapshot {
|
|
36
|
+
autopilot: AutopilotSnapshot | null;
|
|
37
|
+
ralph: RalphSnapshot | null;
|
|
38
|
+
team: TeamSnapshot | null;
|
|
39
|
+
ultrawork: UltraworkSnapshot | null;
|
|
40
|
+
capturedAt: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function captureActiveWorkflows(root: string): ActiveWorkflowSnapshot;
|
|
43
|
+
export declare function formatContinuationContext(snapshot: ActiveWorkflowSnapshot): string;
|
|
44
|
+
//# sourceMappingURL=hookContinuation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hookContinuation.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/hookContinuation.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CA2D3E;AAOD,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,CAwClF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { getAutopilot } from '../../../lanes/autopilot/index.js';
|
|
2
|
+
import { getRalph } from '../../../lanes/ralph/index.js';
|
|
3
|
+
import { readTeam } from '../../../lanes/team/index.js';
|
|
4
|
+
import { getUltrawork } from '../../../lanes/ultrawork/index.js';
|
|
5
|
+
export function captureActiveWorkflows(root) {
|
|
6
|
+
const autopilotState = getAutopilot(root);
|
|
7
|
+
const ralphState = getRalph(root);
|
|
8
|
+
const teamState = readTeam(root);
|
|
9
|
+
const ultraworkState = getUltrawork(root);
|
|
10
|
+
const autopilot = autopilotState && autopilotState.active
|
|
11
|
+
? {
|
|
12
|
+
id: autopilotState.id,
|
|
13
|
+
phase: autopilotState.phase,
|
|
14
|
+
route: autopilotState.route,
|
|
15
|
+
active: autopilotState.active,
|
|
16
|
+
intent: autopilotState.intent,
|
|
17
|
+
updatedAt: autopilotState.updatedAt,
|
|
18
|
+
}
|
|
19
|
+
: null;
|
|
20
|
+
const ralph = ralphState && ralphState.active
|
|
21
|
+
? {
|
|
22
|
+
id: ralphState.id,
|
|
23
|
+
phase: ralphState.phase,
|
|
24
|
+
active: ralphState.active,
|
|
25
|
+
goal: ralphState.goal,
|
|
26
|
+
updatedAt: ralphState.updatedAt,
|
|
27
|
+
gatesPassed: ralphState.verificationGates.filter((g) => g.status === 'passed').length,
|
|
28
|
+
gatesTotal: ralphState.verificationGates.length,
|
|
29
|
+
pendingGateIds: ralphState.verificationGates
|
|
30
|
+
.filter((g) => g.status !== 'passed')
|
|
31
|
+
.map((g) => g.id),
|
|
32
|
+
}
|
|
33
|
+
: null;
|
|
34
|
+
const team = teamState && teamState.active
|
|
35
|
+
? {
|
|
36
|
+
id: teamState.id,
|
|
37
|
+
name: teamState.name,
|
|
38
|
+
active: teamState.active,
|
|
39
|
+
executorCount: teamState.executors.length,
|
|
40
|
+
queuedTaskCount: teamState.taskQueue.length,
|
|
41
|
+
updatedAt: teamState.updatedAt,
|
|
42
|
+
}
|
|
43
|
+
: null;
|
|
44
|
+
const ultrawork = ultraworkState && ultraworkState.active
|
|
45
|
+
? {
|
|
46
|
+
id: ultraworkState.id,
|
|
47
|
+
phase: ultraworkState.phase,
|
|
48
|
+
route: ultraworkState.route,
|
|
49
|
+
active: ultraworkState.active,
|
|
50
|
+
intent: ultraworkState.intent,
|
|
51
|
+
updatedAt: ultraworkState.updatedAt,
|
|
52
|
+
}
|
|
53
|
+
: null;
|
|
54
|
+
return { autopilot, ralph, team, ultrawork, capturedAt: new Date().toISOString() };
|
|
55
|
+
}
|
|
56
|
+
function truncate(text, limit = 80) {
|
|
57
|
+
if (text.length <= limit)
|
|
58
|
+
return text;
|
|
59
|
+
return `${text.slice(0, limit - 1)}…`;
|
|
60
|
+
}
|
|
61
|
+
export function formatContinuationContext(snapshot) {
|
|
62
|
+
const { autopilot, ralph, team, ultrawork } = snapshot;
|
|
63
|
+
if (!autopilot && !ralph && !team && !ultrawork) {
|
|
64
|
+
return 'No active workflows.';
|
|
65
|
+
}
|
|
66
|
+
const parts = [];
|
|
67
|
+
if (autopilot) {
|
|
68
|
+
parts.push(`Autopilot: ${autopilot.phase} (route=${autopilot.route}). Intent: "${truncate(autopilot.intent)}".`);
|
|
69
|
+
}
|
|
70
|
+
if (ralph) {
|
|
71
|
+
const gateSummary = ralph.gatesTotal > 0
|
|
72
|
+
? `gates ${ralph.gatesPassed}/${ralph.gatesTotal} passed`
|
|
73
|
+
: 'no gates registered';
|
|
74
|
+
const pendingSummary = ralph.pendingGateIds.length > 0 ? `, pending: ${ralph.pendingGateIds.join(', ')}` : '';
|
|
75
|
+
parts.push(`Ralph: ${ralph.phase} (${gateSummary}${pendingSummary}). Goal: "${truncate(ralph.goal)}".`);
|
|
76
|
+
}
|
|
77
|
+
if (ultrawork) {
|
|
78
|
+
parts.push(`Ultrawork: ${ultrawork.phase} (route=${ultrawork.route}). Intent: "${truncate(ultrawork.intent)}".`);
|
|
79
|
+
}
|
|
80
|
+
if (team) {
|
|
81
|
+
parts.push(`Team: "${truncate(team.name)}" (executors=${team.executorCount}, queuedTasks=${team.queuedTaskCount}).`);
|
|
82
|
+
}
|
|
83
|
+
return parts.join(' ');
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=hookContinuation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hookContinuation.js","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/hookContinuation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB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AAiB,IAAI,CAAC,eAAe,IAAI,CACzG,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 7 — Stop-hook closure gate.
|
|
3
|
+
* Pure evaluator: reads OperatorAuthority and returns a StopVerdict.
|
|
4
|
+
* No side effects; call from hook, MCP, or CLI for dry-run checks.
|
|
5
|
+
*
|
|
6
|
+
* Phase A+B scope: Ralph (B), Ultrawork (C), Team (G), task closure (I).
|
|
7
|
+
* Phase C/D scope now also enforces autopilot continuity, executor/reviewer handoff, ultragoal
|
|
8
|
+
* continuity, and staged wrapper skills through the existing durable activation
|
|
9
|
+
* log + review-handoff artifact + task/review/inbox state.
|
|
10
|
+
*/
|
|
11
|
+
import type { OperatorAuthority } from '../../../shared/workflow/authority/authority.js';
|
|
12
|
+
import { type EvidenceHorizon } from '../../../shared/core/events.js';
|
|
13
|
+
export type StopOutcome = 'allow' | 'deny';
|
|
14
|
+
export type BlockerCategory = 'gate-pending' | 'phase-not-terminal' | 'open-tasks' | 'open-reviews' | 'open-inbox' | 'closure-evidence-missing' | 'job-pending';
|
|
15
|
+
export type StopLane = 'ralph' | 'ultrawork' | 'autopilot' | 'team' | 'session' | 'executor' | 'reviewer' | 'ultragoal' | 'pipeline';
|
|
16
|
+
export interface StopReason {
|
|
17
|
+
lane: StopLane;
|
|
18
|
+
laneId?: string;
|
|
19
|
+
blocker: string;
|
|
20
|
+
blockerCategory?: BlockerCategory;
|
|
21
|
+
}
|
|
22
|
+
export interface StopVerdict {
|
|
23
|
+
outcome: StopOutcome;
|
|
24
|
+
reasons: StopReason[];
|
|
25
|
+
capturedAt: string;
|
|
26
|
+
evidenceHorizon: EvidenceHorizon;
|
|
27
|
+
/**
|
|
28
|
+
* transportCanBlock: true — verified in interactive Codex TUI on 2026-05-16.
|
|
29
|
+
* The minimal blocking Stop-hook payload shape is:
|
|
30
|
+
* { decision:"block", reason:"..." }.
|
|
31
|
+
*/
|
|
32
|
+
transportCanBlock: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function evaluateStopPolicy(input: {
|
|
35
|
+
authority: OperatorAuthority;
|
|
36
|
+
root: string;
|
|
37
|
+
}): StopVerdict;
|
|
38
|
+
//# sourceMappingURL=stopPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopPolicy.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/continuation/stopPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAGlF,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAOtF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,oBAAoB,GACpB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,0BAA0B,GAC1B,aAAa,CAAC;AAElB,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAErI,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAkcD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,WAAW,CAiDd"}
|