Conversation
Review status
|
# Conflicts: # docs/architecture/target-architecture/execution-plan/file-size-ratchet.json # packages/daemon/src/lib/space/evolution-episode-service.ts # packages/daemon/src/lib/space/runtime/task-agent-manager.ts # packages/daemon/src/lib/workflows/end-node-handlers.ts # packages/daemon/src/lib/workflows/post-approval-router.ts # packages/daemon/tests/unit/5-space/evolution/episode-service.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assembles the workflows subsystem as a flat top-level folder,
packages/daemon/src/lib/workflows/. Pure move + extraction: no logic changes, exported symbol names unchanged, every import rewritten acrosssrc/andtests/. Test files keep their CI shard directories (only basenames that mirrored a renamed source were renamed).Resulting layout (
src/lib/workflows/)Definitions and seeding
built-in-workflows.ts(110) — registry:getBuiltInWorkflows,resolveBuiltInWorkflowTemplate,builtInWorkflowRequiresPrMerge, legacy identities; re-exports the five definitionsbuilt-in-coding-workflows.ts(260),built-in-research-workflows.ts(116) — the five built-in definitions by familybuilt-in-legacy-slot-prompts.ts(264) — legacy stable-slot prompts +patchLegacyStableSlotPromptbuilt-in-prompt-drift.ts(472) — prompt-drift patch variants,patchKnownBuiltInPromptDrift,patchPinnedBuiltInPromptDriftbuilt-in-retired-prompts-{coder-owned-merge,coder-only,research}.ts(281/310/299) — one retired prompt family per filebuilt-in-template-merge.ts(360) — node/channel/hook merge-from-template + remap helpersbuilt-in-retired-post-approval.ts(124) — retired Post-Approval node strippingseed-built-in-workflows.ts(346) —seedBuiltInWorkflowsdefinition-version.ts,template-hash.ts,run-template-snapshot.ts,plan-run-snapshot-migration.ts,post-approval-template.ts,post-approval-merge-template.ts,post-approval-validator.ts,coding-artifact-profile.ts,artifact-profile.tsDefinition management
workflow-manager.ts(373) —SpaceWorkflowManagerCRUD; re-exports the error classes andisReservedWorkflowAgentNameworkflow-node-validation.ts(265),workflow-graph-validation.ts(207),workflow-identity-validation.ts(79),workflow-validation-error.ts(16)node-execution-manager.ts,node-execution-validation.tsHooks
hook-engine.ts(635) —WorkflowHookEngine(executeAction+ queued retryable-action state); re-exportswrapHandlerWithHooks,triggerRetryableHookAction,clearAllRetryableHookActionTimers,PR_READY_VALIDATED_IDENTITY_HOOK_IDhook-binding.ts(424) —wrapHandlerWithHooks+ retryable-action timers/replayhook-matching.ts(221) —resolveMatchingHooks,sortHooks, target resolutionhook-executor-context.ts(111) —buildExecutorContext, frozen PR URLhook-param-bounds.ts(132) — param/artifact/state bounding, patched-param schema validationhook-user-state.ts(65) — block/allow user-state buildershook-executor.ts(217) —HookExecutor,executeHookScript;hook-script-env.ts(225) — restricted env constructionhook-validation.ts(355) — definition-time hook validation, caller authorization;hook-result-validation.ts(72) —validateWorkflowHookResulthook-runtime-service.tsbuilt-in-validator-registry.ts,built-in-validators/{index,post-approval-only-validator,pr-ready-validator (267),pr-ready-gh-commands (315)}.tsRun execution
run-tick-pipeline.ts,run-tick-contract.ts,run-tick-admission-gates.ts,run-spawn-decisions.ts,run-completion-settlement.ts,run-status-machine.ts,completion-detector.tspost-approval-router.ts(344) —PostApprovalRouter; re-exports the pure helpers callers usepost-approval-route-selection.ts(110) — pure route selection / flag / warning mappingpost-approval-retry.ts,end-node-handlers.ts,workflow-executor.ts,workflow-selector.ts,llm-workflow-selector.tsRenames
workflow-hook-engine→hook-engine,workflow-hook-validation→hook-validation,workflow-hook-runtime-service→hook-runtime-service,workflow-node-execution-validation→node-execution-validation,workflow-run-status-machine→run-status-machine,space-workflow-manager→workflow-manager. Keptworkflow-executor/workflow-selector/llm-workflow-selector(a bareexecutor.ts/selector.tsnext tohook-executor.tsreads worse).Left in
space/runtime/on purposedecision-pipeline.ts— generic (deprecated)decisionRunhelper consumed byagent/,external-events/,model-service,storage/,goals/; not workflow execution.staged-run.ts— generic (deprecated)stagedRunsaga helper; its only consumers are the tasks lane (spawn-flow,verified-stop-flow,task-agent-manager). Moving it would point tasks-lane code atlib/workflows/.goal-outcome-wake-flag.ts— goal-outcome wake feature flag consumed bySpaceRuntimeService; not workflow.Left whole
hook-engine.ts(635):executeAction(~335 lines) is one procedure mutating shared accumulators; splitting it needs restructuring, not extraction.built-in-prompt-drift.ts(472): the ~60 unexported prompt-fragment constants only feedBUILT_IN_PROMPT_PATCH_VARIANTS; exporting them into a separate file would be size-fitting.hook-binding.ts(424): the retryable-action scheduler replays throughwrapHandlerWithHooks; splitting them creates a runtime import cycle.Config
knip.json/knip.tsignore keys re-keyed;scripts/shard-weights.tsventries for the four renamed tests updated;file-size-ratchet.jsonre-keyed (hook-engine.tsat 635,built-in-workflows/workflow-managerentries dropped as they are now under the ceiling).Verification
bunx tsc --build --noEmitclean;bun run checkpasses. Targeted daemon tests for the split modules: 810 pass; the 7 failures inspace-runtime.test.ts > standalone tasksreproduce identically on pristineorigin/dev.