@opengsd/gsd-pi 1.4.0-dev.c18009cd → 1.5.0-dev.553dc518
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 +10 -10
- package/dist/resources/.managed-resources-content-hash +1 -1
- package/dist/resources/extensions/gsd/auto/closeout.js +97 -5
- package/dist/resources/extensions/gsd/auto/orchestrator.js +4 -3
- package/dist/resources/extensions/gsd/auto/pre-dispatch.js +6 -3
- package/dist/resources/extensions/gsd/auto/unit-phase.js +5 -9
- package/dist/resources/extensions/gsd/auto-direct-dispatch.js +4 -5
- package/dist/resources/extensions/gsd/auto-start.js +3 -2
- package/dist/resources/extensions/gsd/auto-worktree-branch-lifecycle.js +189 -0
- package/dist/resources/extensions/gsd/auto-worktree-cleanup.js +133 -0
- package/dist/resources/extensions/gsd/auto-worktree-conflict-auto-resolve.js +35 -0
- package/dist/resources/extensions/gsd/auto-worktree-creation.js +130 -0
- package/dist/resources/extensions/gsd/auto-worktree-entry.js +118 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-already-merged.js +98 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-branch-head.js +52 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-cleanup.js +87 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-code-changes.js +46 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-db-ready.js +68 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-integration-branch.js +51 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-message.js +106 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-pre-teardown.js +64 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge-stash.js +168 -0
- package/dist/resources/extensions/gsd/auto-worktree-merge.js +302 -0
- package/dist/resources/extensions/gsd/auto-worktree-milestone-shelter.js +119 -0
- package/dist/resources/extensions/gsd/auto-worktree-path-resolution.js +5 -0
- package/dist/resources/extensions/gsd/auto-worktree-path-utils.js +5 -0
- package/dist/resources/extensions/gsd/auto-worktree-resource-version.js +41 -0
- package/dist/resources/extensions/gsd/auto-worktree-runtime-cleanup.js +99 -0
- package/dist/resources/extensions/gsd/auto-worktree-session-registry.js +57 -0
- package/dist/resources/extensions/gsd/auto-worktree-sync.js +249 -0
- package/dist/resources/extensions/gsd/auto-worktree-teardown.js +120 -0
- package/dist/resources/extensions/gsd/auto-worktree.js +20 -2073
- package/dist/resources/extensions/gsd/auto.js +9 -3
- package/dist/resources/extensions/gsd/bootstrap/dynamic-tools.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +19 -1
- package/dist/resources/extensions/gsd/bootstrap/system-context.js +1 -1
- package/dist/resources/extensions/gsd/bootstrap/tool-call-loop-guard.js +118 -21
- package/dist/resources/extensions/gsd/commands-handlers.js +1 -1
- package/dist/resources/extensions/gsd/commands-workflow-templates.js +3 -3
- package/dist/resources/extensions/gsd/db/queries.js +9 -9
- package/dist/resources/extensions/gsd/doctor-engine-checks.js +93 -11
- package/dist/resources/extensions/gsd/flat-phase-migration.js +14 -3
- package/dist/resources/extensions/gsd/forensics.js +1 -1
- package/dist/resources/extensions/gsd/git-conflict-resolve.js +2 -2
- package/dist/resources/extensions/gsd/git-service.js +45 -0
- package/dist/resources/extensions/gsd/gsd-db.js +11 -0
- package/dist/resources/extensions/gsd/guided-flow.js +6 -10
- package/dist/resources/extensions/gsd/markdown-renderer.js +15 -3
- package/dist/resources/extensions/gsd/milestone-merge-transaction.js +11 -0
- package/dist/resources/extensions/gsd/milestone-settlement.js +1 -1
- package/dist/resources/extensions/gsd/parallel-merge.js +1 -1
- package/dist/resources/extensions/gsd/parallel-orchestrator.js +3 -1
- package/dist/resources/extensions/gsd/preferences-types.js +1 -0
- package/dist/resources/extensions/gsd/preferences-validation.js +82 -0
- package/dist/resources/extensions/gsd/prompts/system.md +6 -6
- package/dist/resources/extensions/gsd/quick.js +12 -3
- package/dist/resources/extensions/gsd/slice-parallel-orchestrator.js +2 -1
- package/dist/resources/extensions/gsd/state/derive/from-db.js +88 -153
- package/dist/resources/extensions/gsd/tool-contract.js +14 -0
- package/dist/resources/extensions/gsd/unit-registry.js +12 -2
- package/dist/resources/extensions/gsd/unmerged-milestone-guard.js +1 -1
- package/dist/resources/extensions/gsd/validation-block-guard.js +2 -1
- package/dist/resources/extensions/gsd/workspace-git-preflight.js +2 -2
- package/dist/resources/extensions/gsd/worktree-command.js +1 -1
- package/dist/resources/extensions/gsd/worktree-lifecycle.js +14 -9
- package/dist/resources/extensions/gsd/worktree-reentry.js +2 -1
- package/dist/tsconfig.extensions.tsbuildinfo +1 -1
- package/dist/web/standalone/.next/BUILD_ID +1 -1
- package/dist/web/standalone/.next/app-path-routes-manifest.json +8 -8
- package/dist/web/standalone/.next/build-manifest.json +2 -2
- package/dist/web/standalone/.next/prerender-manifest.json +3 -3
- package/dist/web/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.html +1 -1
- package/dist/web/standalone/.next/server/app/index.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/web/standalone/.next/server/app-paths-manifest.json +8 -8
- package/dist/web/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/web/standalone/.next/server/pages/404.html +1 -1
- package/dist/web/standalone/.next/server/pages/500.html +1 -1
- package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/web/standalone/node_modules/@gsd/native/package.json +1 -1
- package/dist/web/standalone/node_modules/node-pty/build/Makefile +1 -1
- package/integrations/hermes/open_gsd_hermes/gsd_client.py +24 -35
- package/integrations/hermes/tests/test_gsd_client_timeout.py +4 -4
- package/package.json +6 -6
- package/packages/cloud-mcp-gateway/package.json +2 -2
- package/packages/contracts/package.json +1 -1
- package/packages/daemon/package.json +4 -4
- package/packages/gsd-agent-core/dist/export-html/template.js +53 -4
- package/packages/gsd-agent-core/package.json +5 -5
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.d.ts.map +1 -1
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js +3 -2
- package/packages/gsd-agent-modes/dist/modes/interactive/controllers/chat-controller.js.map +1 -1
- package/packages/gsd-agent-modes/package.json +7 -7
- package/packages/mcp-server/package.json +4 -4
- package/packages/native/package.json +1 -1
- package/packages/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/packages/pi-agent-core/dist/agent-loop.js +14 -9
- package/packages/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/packages/pi-agent-core/package.json +1 -1
- package/packages/pi-ai/dist/index.d.ts +1 -0
- package/packages/pi-ai/dist/index.d.ts.map +1 -1
- package/packages/pi-ai/dist/index.js +1 -0
- package/packages/pi-ai/dist/index.js.map +1 -1
- package/packages/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
- package/packages/pi-ai/dist/providers/transform-messages.js +7 -3
- package/packages/pi-ai/dist/providers/transform-messages.js.map +1 -1
- package/packages/pi-ai/dist/tool-result-content.d.ts +3 -0
- package/packages/pi-ai/dist/tool-result-content.d.ts.map +1 -0
- package/packages/pi-ai/dist/tool-result-content.js +62 -0
- package/packages/pi-ai/dist/tool-result-content.js.map +1 -0
- package/packages/pi-ai/dist/types.d.ts +8 -20
- package/packages/pi-ai/dist/types.d.ts.map +1 -1
- package/packages/pi-ai/dist/types.js.map +1 -1
- package/packages/pi-ai/package.json +1 -1
- package/packages/pi-coding-agent/package.json +7 -7
- package/packages/pi-tui/package.json +2 -2
- package/packages/rpc-client/package.json +2 -2
- package/pkg/dist/core/export-html/template.js +53 -4
- package/pkg/package.json +1 -1
- package/src/resources/extensions/gsd/auto/closeout.ts +114 -7
- package/src/resources/extensions/gsd/auto/orchestrator.ts +4 -3
- package/src/resources/extensions/gsd/auto/pre-dispatch.ts +6 -3
- package/src/resources/extensions/gsd/auto/unit-phase.ts +5 -9
- package/src/resources/extensions/gsd/auto-direct-dispatch.ts +4 -5
- package/src/resources/extensions/gsd/auto-start.ts +4 -2
- package/src/resources/extensions/gsd/auto-worktree-branch-lifecycle.ts +237 -0
- package/src/resources/extensions/gsd/auto-worktree-cleanup.ts +166 -0
- package/src/resources/extensions/gsd/auto-worktree-conflict-auto-resolve.ts +37 -0
- package/src/resources/extensions/gsd/auto-worktree-creation.ts +171 -0
- package/src/resources/extensions/gsd/auto-worktree-entry.ts +154 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-already-merged.ts +161 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-branch-head.ts +83 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-cleanup.ts +132 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-code-changes.ts +71 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-db-ready.ts +112 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-integration-branch.ts +99 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-message.ts +166 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-pre-teardown.ts +93 -0
- package/src/resources/extensions/gsd/auto-worktree-merge-stash.ts +213 -0
- package/src/resources/extensions/gsd/auto-worktree-merge.ts +391 -0
- package/src/resources/extensions/gsd/auto-worktree-milestone-shelter.ts +159 -0
- package/src/resources/extensions/gsd/auto-worktree-path-resolution.ts +6 -0
- package/src/resources/extensions/gsd/auto-worktree-path-utils.ts +10 -0
- package/src/resources/extensions/gsd/auto-worktree-resource-version.ts +44 -0
- package/src/resources/extensions/gsd/auto-worktree-runtime-cleanup.ts +119 -0
- package/src/resources/extensions/gsd/auto-worktree-session-registry.ts +71 -0
- package/src/resources/extensions/gsd/auto-worktree-sync.ts +370 -0
- package/src/resources/extensions/gsd/auto-worktree-teardown.ts +161 -0
- package/src/resources/extensions/gsd/auto-worktree.ts +69 -2429
- package/src/resources/extensions/gsd/auto.ts +11 -17
- package/src/resources/extensions/gsd/bootstrap/dynamic-tools.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +19 -1
- package/src/resources/extensions/gsd/bootstrap/system-context.ts +1 -1
- package/src/resources/extensions/gsd/bootstrap/tool-call-loop-guard.ts +152 -21
- package/src/resources/extensions/gsd/commands-handlers.ts +1 -1
- package/src/resources/extensions/gsd/commands-workflow-templates.ts +3 -3
- package/src/resources/extensions/gsd/db/queries.ts +9 -9
- package/src/resources/extensions/gsd/doctor-engine-checks.ts +109 -10
- package/src/resources/extensions/gsd/flat-phase-migration.ts +14 -3
- package/src/resources/extensions/gsd/forensics.ts +1 -1
- package/src/resources/extensions/gsd/git-conflict-resolve.ts +2 -2
- package/src/resources/extensions/gsd/git-service.ts +53 -0
- package/src/resources/extensions/gsd/gsd-db.ts +13 -0
- package/src/resources/extensions/gsd/guided-flow.ts +7 -11
- package/src/resources/extensions/gsd/markdown-renderer.ts +15 -3
- package/src/resources/extensions/gsd/milestone-merge-transaction.ts +15 -0
- package/src/resources/extensions/gsd/milestone-settlement.ts +1 -1
- package/src/resources/extensions/gsd/parallel-merge.ts +1 -1
- package/src/resources/extensions/gsd/parallel-orchestrator.ts +3 -1
- package/src/resources/extensions/gsd/preferences-types.ts +30 -0
- package/src/resources/extensions/gsd/preferences-validation.ts +69 -0
- package/src/resources/extensions/gsd/prompts/system.md +6 -6
- package/src/resources/extensions/gsd/quick.ts +11 -3
- package/src/resources/extensions/gsd/slice-parallel-orchestrator.ts +3 -1
- package/src/resources/extensions/gsd/state/derive/from-db.ts +201 -157
- package/src/resources/extensions/gsd/tests/auto-loop-no-copy-artifacts.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-start-clean-runtime-db-gated.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-warning-noise-regression.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/auto-worktree-auto-resolve.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-already-merged.test.ts +177 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-branch-head.test.ts +118 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-cleanup.test.ts +115 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-code-changes.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-db-ready.test.ts +140 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-integration-branch.test.ts +123 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-message.test.ts +114 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-pre-teardown.test.ts +84 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-merge-stash.test.ts +70 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-milestone-shelter.test.ts +52 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-registry.test.ts +6 -6
- package/src/resources/extensions/gsd/tests/auto-worktree-resource-version.test.ts +59 -0
- package/src/resources/extensions/gsd/tests/auto-worktree-untracked-content.test.ts +3 -1
- package/src/resources/extensions/gsd/tests/completed-units-metrics-sync.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/derive-state-db.test.ts +4 -0
- package/src/resources/extensions/gsd/tests/doctor-scope-db-unavailable.test.ts +174 -0
- package/src/resources/extensions/gsd/tests/fast-forward-reused-milestone-branch.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/flat-phase-migration.test.ts +44 -1
- package/src/resources/extensions/gsd/tests/flat-phase-renderer.test.ts +25 -1
- package/src/resources/extensions/gsd/tests/gsd-db.test.ts +40 -0
- package/src/resources/extensions/gsd/tests/integration/all-milestones-complete-merge.test.ts +4 -6
- package/src/resources/extensions/gsd/tests/integration/auto-stash-merge.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/integration/auto-worktree-milestone-merge.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/integration/auto-worktree.test.ts +7 -8
- package/src/resources/extensions/gsd/tests/integration/feature-branch-lifecycle-integration.test.ts +2 -5
- package/src/resources/extensions/gsd/tests/integration/git-service.test.ts +76 -0
- package/src/resources/extensions/gsd/tests/integration/merge-cwd-restore.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/integration/merge-preserve-worktree-on-preteardown-error.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/integration/merge-strategy-regular.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/integration/milestone-transition-worktree.test.ts +5 -7
- package/src/resources/extensions/gsd/tests/integration/workspace-collapse-integration.test.ts +2 -4
- package/src/resources/extensions/gsd/tests/merge-closeout-consistency-gate.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/merge-db-cycle.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/merge-self-branch-guard.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/milestone-merge-stash-restore.test.ts +439 -0
- package/src/resources/extensions/gsd/tests/milestone-merge-transaction.test.ts +24 -0
- package/src/resources/extensions/gsd/tests/none-mode-gates.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/originalbase-path-comparison.test.ts +3 -3
- package/src/resources/extensions/gsd/tests/parallel-worker-lock-contention.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/preferences-worktree-sync.test.ts +1 -4
- package/src/resources/extensions/gsd/tests/prefs-wizard-coverage.test.ts +5 -0
- package/src/resources/extensions/gsd/tests/runtime-invariant-modules.test.ts +20 -0
- package/src/resources/extensions/gsd/tests/stale-worktree-cwd.test.ts +3 -5
- package/src/resources/extensions/gsd/tests/stash-pop-gsd-conflict.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/stash-queued-context-files.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/steer-worktree-path.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/sync-worktree-skip-current.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/system-flat-phase-layout.test.ts +33 -0
- package/src/resources/extensions/gsd/tests/teardown-chdir-failure-clears-registry.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/teardown-cleanup-parity.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/teardown-failure-clears-registry.test.ts +4 -4
- package/src/resources/extensions/gsd/tests/tool-call-loop-guard.test.ts +103 -0
- package/src/resources/extensions/gsd/tests/uat-stuck-loop-orphaned-worktree.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/unit-registry.test.ts +26 -1
- package/src/resources/extensions/gsd/tests/worktree-db-integration.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-db-respawn-truncation.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-db-same-file.test.ts +1 -3
- package/src/resources/extensions/gsd/tests/worktree-expected-warnings.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-git-pathspec.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-main-branch.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-preferences-sync.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-reentry.test.ts +2 -1
- package/src/resources/extensions/gsd/tests/worktree-sync-milestones.test.ts +5 -2
- package/src/resources/extensions/gsd/tests/worktree-sync-overwrite-loop.test.ts +1 -1
- package/src/resources/extensions/gsd/tests/worktree-sync-tasks.test.ts +1 -1
- package/src/resources/extensions/gsd/tool-contract.ts +29 -0
- package/src/resources/extensions/gsd/unit-registry.ts +16 -2
- package/src/resources/extensions/gsd/unmerged-milestone-guard.ts +1 -1
- package/src/resources/extensions/gsd/validation-block-guard.ts +2 -1
- package/src/resources/extensions/gsd/workspace-git-preflight.ts +2 -2
- package/src/resources/extensions/gsd/worktree-command.ts +1 -1
- package/src/resources/extensions/gsd/worktree-lifecycle.ts +19 -15
- package/src/resources/extensions/gsd/worktree-reentry.ts +2 -1
- /package/dist/web/standalone/.next/static/{L2UMqXELiDH3oz-7yguXp → ZpFDazP-38PXBPiI_LdZf}/_buildManifest.js +0 -0
- /package/dist/web/standalone/.next/static/{L2UMqXELiDH3oz-7yguXp → ZpFDazP-38PXBPiI_LdZf}/_ssgManifest.js +0 -0
|
@@ -519,6 +519,51 @@ export function runGit(basePath, args, options = {}) {
|
|
|
519
519
|
throw new GSDError(GSD_GIT_ERROR, `git ${args.join(" ")} failed in ${basePath}: ${filterGitSvnNoise(message)}`);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* Arguments for creating a task/workflow branch.
|
|
524
|
+
*
|
|
525
|
+
* When the current branch is a leftover GSD task branch (workflow template,
|
|
526
|
+
* quick task, or slice), the new branch starts from `baseBranch` — the
|
|
527
|
+
* caller's resolved integration branch, normally `GitServiceImpl.getMainBranch()`
|
|
528
|
+
* so `main_branch` preference, milestone integration branch, and worktree base
|
|
529
|
+
* all take priority over repo-default detection. Branching from HEAD there
|
|
530
|
+
* silently stacks consecutive workflow branches on top of each other, so every
|
|
531
|
+
* new gsd/* branch (and its eventual PR) drags along the previous workflow's
|
|
532
|
+
* commits.
|
|
533
|
+
*
|
|
534
|
+
* On any other branch (a user's feature branch, a worktree base, the main
|
|
535
|
+
* branch itself) the legacy branch-from-HEAD behavior is kept: basing new work
|
|
536
|
+
* on the branch the user chose to stand on is intentional there.
|
|
537
|
+
*
|
|
538
|
+
* Falls back to branch-from-HEAD, with a logged warning, when the base branch
|
|
539
|
+
* has no local ref or the working tree is still dirty (a start point that
|
|
540
|
+
* changes the tree would abort the checkout or strand in-flight changes).
|
|
541
|
+
* The base is the local ref — deliberately no fetch, so branch creation stays
|
|
542
|
+
* offline-safe even if the local base is behind its remote.
|
|
543
|
+
*/
|
|
544
|
+
export function taskBranchArgs(basePath, branchName, currentBranch, baseBranch) {
|
|
545
|
+
const args = ["checkout", "-b", branchName];
|
|
546
|
+
const onTaskBranch = WORKFLOW_BRANCH_RE.test(currentBranch) ||
|
|
547
|
+
QUICK_BRANCH_RE.test(currentBranch) ||
|
|
548
|
+
SLICE_BRANCH_RE.test(currentBranch);
|
|
549
|
+
if (!onTaskBranch || !baseBranch || baseBranch === currentBranch)
|
|
550
|
+
return args;
|
|
551
|
+
try {
|
|
552
|
+
if (!nativeBranchExists(basePath, baseBranch)) {
|
|
553
|
+
logWarning("engine", `taskBranchArgs: base branch "${baseBranch}" has no local ref — branching ${branchName} from HEAD (${currentBranch})`, { file: "git-service.ts" });
|
|
554
|
+
return args;
|
|
555
|
+
}
|
|
556
|
+
if (nativeHasChanges(basePath)) {
|
|
557
|
+
logWarning("engine", `taskBranchArgs: working tree still dirty after auto-commit — branching ${branchName} from HEAD (${currentBranch}) to preserve in-flight changes`, { file: "git-service.ts" });
|
|
558
|
+
return args;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
catch {
|
|
562
|
+
return args;
|
|
563
|
+
}
|
|
564
|
+
args.push(baseBranch);
|
|
565
|
+
return args;
|
|
566
|
+
}
|
|
522
567
|
// ─── Commit Type Inference ─────────────────────────────────────────────────
|
|
523
568
|
/**
|
|
524
569
|
* Keyword-to-commit-type mapping. Order matters — first match wins.
|
|
@@ -1000,6 +1000,17 @@ export function deleteArtifactByPath(path) {
|
|
|
1000
1000
|
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
1001
1001
|
getDbOrNull().prepare("DELETE FROM artifacts WHERE path = :path").run({ ":path": path });
|
|
1002
1002
|
}
|
|
1003
|
+
/** Delete artifact rows whose paths share a DB-relative prefix. */
|
|
1004
|
+
export function deleteArtifactsByPathPrefix(prefix) {
|
|
1005
|
+
if (!getDbOrNull())
|
|
1006
|
+
throw new GSDError(GSD_STALE_STATE, "gsd-db: No database open");
|
|
1007
|
+
return transaction(() => {
|
|
1008
|
+
const likePrefix = `${prefix}%`;
|
|
1009
|
+
const countRow = getDbOrNull().prepare("SELECT COUNT(*) AS count FROM artifacts WHERE path LIKE :prefix").get({ ":prefix": likePrefix });
|
|
1010
|
+
getDbOrNull().prepare("DELETE FROM artifacts WHERE path LIKE :prefix").run({ ":prefix": likePrefix });
|
|
1011
|
+
return Number(countRow?.["count"] ?? 0);
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1003
1014
|
/**
|
|
1004
1015
|
* Drop hierarchy rows in dependency order inside a transaction. Used by
|
|
1005
1016
|
* `gsd recover --confirm` to rebuild engine state from markdown.
|
|
@@ -28,7 +28,7 @@ import { nativeAddAll, nativeCommit, nativeHasCommittedHead, nativeIsRepo, nativ
|
|
|
28
28
|
import { isInheritedRepo } from "./repo-identity.js";
|
|
29
29
|
import { ensureGitignore, ensurePreferences, untrackRuntimeFiles } from "./gitignore.js";
|
|
30
30
|
import { getIsolationMode, loadEffectiveGSDPreferences } from "./preferences.js";
|
|
31
|
-
import { getAutoWorktreePath } from "./auto-worktree.js";
|
|
31
|
+
import { getAutoWorktreePath } from "./auto-worktree-path-resolution.js";
|
|
32
32
|
import { resolveUokFlags } from "./uok/flags.js";
|
|
33
33
|
import { ensurePlanV2Graph, isMissingFinalizedContextResult } from "./uok/plan-v2.js";
|
|
34
34
|
import { detectProjectState, hasGsdBootstrapArtifacts } from "./detection.js";
|
|
@@ -50,7 +50,7 @@ import { getCachedWorkflowMcpProbe, probeAndCacheWorkflowMcp, warmWorkflowMcpPro
|
|
|
50
50
|
import { probeCoversRequiredWorkflowTools } from "./tool-surface-readiness.js";
|
|
51
51
|
import { getRequiredWorkflowToolsForUnit } from "./unit-tool-contracts.js";
|
|
52
52
|
import { isWorkflowToolSurfaceName } from "./workflow-tool-surface.js";
|
|
53
|
-
import {
|
|
53
|
+
import { getUnitWorkflowDispatchReadinessErrorForModel } from "./tool-contract.js";
|
|
54
54
|
import { runPreparation, formatCodebaseBrief, formatPriorContextBrief, } from "./preparation.js";
|
|
55
55
|
import { verifyExpectedArtifact } from "./auto-recovery.js";
|
|
56
56
|
import { countPlanMilestoneRoadmapSlices } from "./artifact-verification.js";
|
|
@@ -491,7 +491,7 @@ async function dispatchWorkflow(pi, note, customType = "gsd-run", ctx, unitType,
|
|
|
491
491
|
const loadPreferences = resolvedOptions.deps?.loadPreferences ?? loadEffectiveGSDPreferences;
|
|
492
492
|
const selectModel = resolvedOptions.deps?.selectModel ?? selectAndApplyModel;
|
|
493
493
|
const getDispatchReadinessError = resolvedOptions.deps?.getDispatchReadinessError
|
|
494
|
-
??
|
|
494
|
+
?? getUnitWorkflowDispatchReadinessErrorForModel;
|
|
495
495
|
// Route through the dynamic routing pipeline (complexity classification,
|
|
496
496
|
// tier downgrade, fallback chains) — same path as auto-mode dispatches (#2958).
|
|
497
497
|
if (ctx && unitType) {
|
|
@@ -506,16 +506,12 @@ async function dispatchWorkflow(pi, note, customType = "gsd-run", ctx, unitType,
|
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
508
|
const compatibilityError = getDispatchReadinessError({
|
|
509
|
-
|
|
509
|
+
model: result.appliedModel,
|
|
510
|
+
fallbackModel: ctx.model,
|
|
511
|
+
getProviderAuthMode: (provider) => ctx.modelRegistry.getProviderAuthMode(provider),
|
|
510
512
|
projectRoot,
|
|
511
513
|
surface: "guided flow",
|
|
512
514
|
unitType,
|
|
513
|
-
authMode: result.appliedModel?.provider
|
|
514
|
-
? ctx.modelRegistry.getProviderAuthMode(result.appliedModel.provider)
|
|
515
|
-
: ctx.model?.provider
|
|
516
|
-
? ctx.modelRegistry.getProviderAuthMode(ctx.model.provider)
|
|
517
|
-
: undefined,
|
|
518
|
-
baseUrl: result.appliedModel?.baseUrl ?? ctx.model?.baseUrl,
|
|
519
515
|
// Guided flow starts the MCP workflow server as part of dispatch, so the
|
|
520
516
|
// parent session's activeTools doesn't include MCP tools yet. The MCP
|
|
521
517
|
// launch config check (detectWorkflowMcpLaunchConfig) is the right gate
|
|
@@ -1045,9 +1045,21 @@ export async function renderReplanFromDb(basePath, milestoneId, sliceId, replanD
|
|
|
1045
1045
|
return { replanPath: absPath, content };
|
|
1046
1046
|
}
|
|
1047
1047
|
export async function renderAssessmentFromDb(basePath, milestoneId, sliceId, assessmentData) {
|
|
1048
|
-
// Flat-phase: assessment file lives in the phase dir
|
|
1049
|
-
|
|
1050
|
-
|
|
1048
|
+
// Flat-phase: the assessment file lives in the phase dir, NOT in a slices/SID/
|
|
1049
|
+
// subdir. resolveSlicePath() detects a slices/SID/ dir unconditionally, so a
|
|
1050
|
+
// stray slices/SID/ created by an earlier planning step would send this write
|
|
1051
|
+
// to a hybrid path (wrong dir, flat filename) that verification cannot find.
|
|
1052
|
+
// Guard with the same legacy-base check relSlicePath() uses so flat-phase
|
|
1053
|
+
// milestones always target the phase dir.
|
|
1054
|
+
const mDir = resolveMilestonePath(basePath, milestoneId);
|
|
1055
|
+
const legacyBase = legacyMilestonesDir(basePath);
|
|
1056
|
+
const isLegacyLayout = mDir
|
|
1057
|
+
? mDir.startsWith(legacyBase + "/") || mDir.startsWith(legacyBase + "\\")
|
|
1058
|
+
: false;
|
|
1059
|
+
const fallbackDir = join(milestonesDir(basePath), canonicalPhaseDirName(milestoneId, getMilestone(milestoneId)?.title));
|
|
1060
|
+
const slicePath = isLegacyLayout
|
|
1061
|
+
? (resolveSlicePath(basePath, milestoneId, sliceId) ?? fallbackDir)
|
|
1062
|
+
: (mDir ?? fallbackDir);
|
|
1051
1063
|
const phaseNum = milestoneIdToPhaseNum(milestoneId);
|
|
1052
1064
|
const planNum = sliceIdToPlanNum(sliceId);
|
|
1053
1065
|
const absPath = join(slicePath, planFileName(phaseNum, planNum, "ASSESSMENT"));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Project/App: gsd-pi
|
|
2
2
|
// File Purpose: Process-level transaction wrapper for milestone merge closeout.
|
|
3
|
+
import { mergeMilestoneToMain } from "./auto-worktree-merge.js";
|
|
3
4
|
export function runMilestoneMergeTransaction(deps, input) {
|
|
4
5
|
return deps.mergeMilestone(input.basePath, input.milestoneId, input.roadmapContent);
|
|
5
6
|
}
|
|
@@ -8,3 +9,13 @@ export function createMilestoneMergeTransaction(mergeMilestone) {
|
|
|
8
9
|
return runMilestoneMergeTransaction({ mergeMilestone }, { basePath, milestoneId, roadmapContent });
|
|
9
10
|
};
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Production merge transaction adapter.
|
|
14
|
+
*
|
|
15
|
+
* This is the only production construction point that knows the legacy
|
|
16
|
+
* `auto-worktree.ts` merge primitive. Lifecycle callers depend on the
|
|
17
|
+
* transaction runner interface, not the legacy implementation module.
|
|
18
|
+
*/
|
|
19
|
+
export function createDefaultMilestoneMergeTransaction(mergeMilestone = mergeMilestoneToMain) {
|
|
20
|
+
return createMilestoneMergeTransaction(mergeMilestone);
|
|
21
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Project/App: gsd-pi
|
|
2
2
|
// File Purpose: Milestone closeout settlement state across DB proof, artifacts, merge, and cleanup.
|
|
3
|
-
import { isInAutoWorktree } from "./auto-worktree.js";
|
|
3
|
+
import { isInAutoWorktree } from "./auto-worktree-entry.js";
|
|
4
4
|
import { formatCloseoutProofBlock, proveMilestoneCloseout, } from "./milestone-closeout-proof.js";
|
|
5
5
|
import { resolveCloseoutArtifactProjection } from "./artifact-projection.js";
|
|
6
6
|
function isActiveUnmergedWorktree(input) {
|
|
@@ -8,7 +8,7 @@ import { existsSync, readdirSync } from "node:fs";
|
|
|
8
8
|
import { spawnSync } from "node:child_process";
|
|
9
9
|
import { resolveGsdPathContract } from "./paths.js";
|
|
10
10
|
import { worktreePathFor, worktreesDirs } from "./worktree-placement.js";
|
|
11
|
-
import { getAutoWorktreePath } from "./auto-worktree.js";
|
|
11
|
+
import { getAutoWorktreePath } from "./auto-worktree-path-resolution.js";
|
|
12
12
|
import { buildWorktreeLifecycleDeps } from "./auto.js";
|
|
13
13
|
import { mergeMilestoneStandalone, } from "./worktree-lifecycle.js";
|
|
14
14
|
import { MergeConflictError } from "./git-service.js";
|
|
@@ -12,7 +12,9 @@ import { join, dirname } from "node:path";
|
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { gsdRoot } from "./paths.js";
|
|
14
14
|
import { createWorktree, worktreePath } from "./worktree-manager.js";
|
|
15
|
-
import { autoWorktreeBranch, fastForwardReusedMilestoneBranchIfSafe
|
|
15
|
+
import { autoWorktreeBranch, fastForwardReusedMilestoneBranchIfSafe } from "./auto-worktree-branch-lifecycle.js";
|
|
16
|
+
import { syncGsdStateToWorktreeByScope } from "./auto-worktree-sync.js";
|
|
17
|
+
import { runWorktreePostCreateHook } from "./worktree-post-create-hook.js";
|
|
16
18
|
import { nativeBranchExists } from "./native-git-bridge.js";
|
|
17
19
|
import { readIntegrationBranch } from "./git-service.js";
|
|
18
20
|
import { createWorkspace, scopeMilestone } from "./workspace.js";
|
|
@@ -801,6 +801,88 @@ export function validatePreferences(preferences) {
|
|
|
801
801
|
errors.push("context_management must be an object");
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
+
// ─── Tool-call loop guard (#1198) ────────────────────────────────────────
|
|
805
|
+
if (preferences.tool_call_loop_guard !== undefined) {
|
|
806
|
+
if (typeof preferences.tool_call_loop_guard === "object" && preferences.tool_call_loop_guard !== null) {
|
|
807
|
+
const g = preferences.tool_call_loop_guard;
|
|
808
|
+
const validGuard = {};
|
|
809
|
+
if (g.enabled !== undefined) {
|
|
810
|
+
if (typeof g.enabled === "boolean")
|
|
811
|
+
validGuard.enabled = g.enabled;
|
|
812
|
+
else
|
|
813
|
+
errors.push("tool_call_loop_guard.enabled must be a boolean");
|
|
814
|
+
}
|
|
815
|
+
if (g.identical_args !== undefined) {
|
|
816
|
+
if (typeof g.identical_args === "object" && g.identical_args !== null) {
|
|
817
|
+
const ia = g.identical_args;
|
|
818
|
+
const validIa = {};
|
|
819
|
+
if (ia.enabled !== undefined) {
|
|
820
|
+
if (typeof ia.enabled === "boolean")
|
|
821
|
+
validIa.enabled = ia.enabled;
|
|
822
|
+
else
|
|
823
|
+
errors.push("tool_call_loop_guard.identical_args.enabled must be a boolean");
|
|
824
|
+
}
|
|
825
|
+
if (ia.max_consecutive_calls !== undefined) {
|
|
826
|
+
const n = ia.max_consecutive_calls;
|
|
827
|
+
if (typeof n === "number" && Number.isInteger(n) && n >= 1)
|
|
828
|
+
validIa.max_consecutive_calls = n;
|
|
829
|
+
else
|
|
830
|
+
errors.push("tool_call_loop_guard.identical_args.max_consecutive_calls must be an integer >= 1");
|
|
831
|
+
}
|
|
832
|
+
if (Object.keys(validIa).length > 0)
|
|
833
|
+
validGuard.identical_args = validIa;
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
errors.push("tool_call_loop_guard.identical_args must be an object");
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
if (g.repeated_tool !== undefined) {
|
|
840
|
+
if (typeof g.repeated_tool === "object" && g.repeated_tool !== null) {
|
|
841
|
+
const rt = g.repeated_tool;
|
|
842
|
+
const validRt = {};
|
|
843
|
+
if (rt.enabled !== undefined) {
|
|
844
|
+
if (typeof rt.enabled === "boolean")
|
|
845
|
+
validRt.enabled = rt.enabled;
|
|
846
|
+
else
|
|
847
|
+
errors.push("tool_call_loop_guard.repeated_tool.enabled must be a boolean");
|
|
848
|
+
}
|
|
849
|
+
if (rt.default_cap !== undefined) {
|
|
850
|
+
const n = rt.default_cap;
|
|
851
|
+
if (typeof n === "number" && Number.isInteger(n) && n >= 1)
|
|
852
|
+
validRt.default_cap = n;
|
|
853
|
+
else
|
|
854
|
+
errors.push("tool_call_loop_guard.repeated_tool.default_cap must be an integer >= 1");
|
|
855
|
+
}
|
|
856
|
+
if (rt.repeatable_cap !== undefined) {
|
|
857
|
+
const n = rt.repeatable_cap;
|
|
858
|
+
if (typeof n === "number" && Number.isInteger(n) && n >= 1)
|
|
859
|
+
validRt.repeatable_cap = n;
|
|
860
|
+
else
|
|
861
|
+
errors.push("tool_call_loop_guard.repeated_tool.repeatable_cap must be an integer >= 1");
|
|
862
|
+
}
|
|
863
|
+
if (rt.exempt_tools !== undefined) {
|
|
864
|
+
if (Array.isArray(rt.exempt_tools) && rt.exempt_tools.every((t) => typeof t === "string")) {
|
|
865
|
+
validRt.exempt_tools = rt.exempt_tools;
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
errors.push("tool_call_loop_guard.repeated_tool.exempt_tools must be an array of strings");
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
if (Object.keys(validRt).length > 0)
|
|
872
|
+
validGuard.repeated_tool = validRt;
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
errors.push("tool_call_loop_guard.repeated_tool must be an object");
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
if (Object.keys(validGuard).length > 0) {
|
|
879
|
+
validated.tool_call_loop_guard = validGuard;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
errors.push("tool_call_loop_guard must be an object");
|
|
884
|
+
}
|
|
885
|
+
}
|
|
804
886
|
// ─── Context Mode (gsd_exec sandbox) ────────────────────────────────────
|
|
805
887
|
if (preferences.context_mode !== undefined) {
|
|
806
888
|
if (typeof preferences.context_mode === "object" && preferences.context_mode !== null) {
|
|
@@ -38,7 +38,7 @@ If a `GSD Skill Preferences` block appears below, treat it as durable guidance f
|
|
|
38
38
|
|
|
39
39
|
### Naming Convention
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
GSD projects use a flat-phase layout. Phase directories are `{MM}-{slug}` where `{MM}` is the zero-padded phase number and `{slug}` is derived from the phase title (e.g. `47-real-time-runtime-hardening`). Phase-level files are `{MM}-SUFFIX.md` (e.g. `47-CONTEXT.md`, `47-RESEARCH.md`, `47-ROADMAP.md`, `47-VALIDATION.md`, `47-SUMMARY.md`). Slice/plan files live directly in the phase directory as `{MM}-{SS}-SUFFIX.md` (e.g. `47-01-PLAN.md`, `47-01-SUMMARY.md`, `47-01-UAT.md`). Task plan content lives inside the slice plan file (`{MM}-{SS}-PLAN.md`) as checkboxes; there is no `tasks/` subdirectory and no `tasks/T##-PLAN.md`. Titles live inside content, not names. Prefer GSD-provided layout-aware paths/resolvers over hardcoding artifact paths, since phase slugs are title-derived.
|
|
42
42
|
|
|
43
43
|
### Directory Structure
|
|
44
44
|
|
|
@@ -46,13 +46,13 @@ Directories use bare IDs. Files use ID-SUFFIX format. Milestones: `M001/` or `M{
|
|
|
46
46
|
.gsd/
|
|
47
47
|
PROJECT.md, REQUIREMENTS.md, DECISIONS.md, KNOWLEDGE.md, CODEBASE.md, OVERRIDES.md, QUEUE.md, STATE.md
|
|
48
48
|
runtime/, activity/, worktrees/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
S01-CONTEXT.md, S01-RESEARCH.md, S01-PLAN.md, S01-SUMMARY.md, S01-UAT.md
|
|
53
|
-
tasks/T01-PLAN.md, tasks/T01-SUMMARY.md
|
|
49
|
+
phases/{MM}-{slug}/
|
|
50
|
+
{MM}-CONTEXT.md, {MM}-RESEARCH.md, {MM}-ROADMAP.md, {MM}-VALIDATION.md, {MM}-SUMMARY.md
|
|
51
|
+
{MM}-{SS}-PLAN.md, {MM}-{SS}-SUMMARY.md, {MM}-{SS}-UAT.md
|
|
54
52
|
```
|
|
55
53
|
|
|
54
|
+
Task plan content is embedded in `{MM}-{SS}-PLAN.md`; do not expect `tasks/T##-PLAN.md`.
|
|
55
|
+
|
|
56
56
|
`runtime/`, `activity/`, `worktrees/`, and `STATE.md` are system-managed. `PROJECT.md` is current state; `REQUIREMENTS.md` is the active capability contract; `DECISIONS.md` and `KNOWLEDGE.md` are append-only; `CODEBASE.md` is an auto-refreshed codebase map.
|
|
57
57
|
|
|
58
58
|
### Isolation Model
|
|
@@ -13,7 +13,7 @@ import { isAbsolute, join, relative, resolve } from "node:path";
|
|
|
13
13
|
import { QUICK_BRANCH_RE } from "./branch-patterns.js";
|
|
14
14
|
import { loadPrompt } from "./prompt-loader.js";
|
|
15
15
|
import { gsdRoot } from "./paths.js";
|
|
16
|
-
import { GitServiceImpl, runGit } from "./git-service.js";
|
|
16
|
+
import { GitServiceImpl, runGit, taskBranchArgs } from "./git-service.js";
|
|
17
17
|
import { loadEffectiveGSDPreferences } from "./preferences.js";
|
|
18
18
|
import { nativeBranchExists, nativeDetectMainBranch, nativeDiffNumstat } from "./native-git-bridge.js";
|
|
19
19
|
import { nativeHasStagedChanges } from "./native-git-bridge.js";
|
|
@@ -317,6 +317,7 @@ export async function handleQuick(args, ctx, pi) {
|
|
|
317
317
|
const git = new GitServiceImpl(basePath, gitPrefs);
|
|
318
318
|
const branchName = `gsd/quick/${taskNum}-${slug}`;
|
|
319
319
|
let originalBranch = git.getCurrentBranch();
|
|
320
|
+
let returnBranch = originalBranch;
|
|
320
321
|
const { getIsolationMode } = await import("./preferences.js");
|
|
321
322
|
const usesBranch = getIsolationMode() !== "none" && isGitOpsEnabled();
|
|
322
323
|
let branchCreated = false;
|
|
@@ -331,7 +332,15 @@ export async function handleQuick(args, ctx, pi) {
|
|
|
331
332
|
}
|
|
332
333
|
}
|
|
333
334
|
catch { /* nothing to commit — fine */ }
|
|
334
|
-
|
|
335
|
+
const branchArgs = taskBranchArgs(basePath, branchName, current, git.getMainBranch());
|
|
336
|
+
const startPoint = branchArgs[3];
|
|
337
|
+
// When the quick branch is redirected off a stale task branch, the
|
|
338
|
+
// squash-merge on closeout must return to the same base — merging a
|
|
339
|
+
// base-branch-rooted quick branch back into the stale task branch
|
|
340
|
+
// would drag the base's newer history into it.
|
|
341
|
+
if (startPoint)
|
|
342
|
+
returnBranch = startPoint;
|
|
343
|
+
runGit(basePath, branchArgs);
|
|
335
344
|
branchCreated = true;
|
|
336
345
|
}
|
|
337
346
|
}
|
|
@@ -345,7 +354,7 @@ export async function handleQuick(args, ctx, pi) {
|
|
|
345
354
|
if (actualBranch === branchName && originalBranch !== branchName) {
|
|
346
355
|
persistPendingReturn({
|
|
347
356
|
basePath,
|
|
348
|
-
originalBranch,
|
|
357
|
+
originalBranch: returnBranch,
|
|
349
358
|
quickBranch: branchName,
|
|
350
359
|
taskNum,
|
|
351
360
|
slug,
|
|
@@ -19,7 +19,8 @@ import { isAbsolute, join, dirname, resolve } from "node:path";
|
|
|
19
19
|
import { fileURLToPath } from "node:url";
|
|
20
20
|
import { gsdRoot } from "./paths.js";
|
|
21
21
|
import { createWorktree, worktreePath, removeWorktree } from "./worktree-manager.js";
|
|
22
|
-
import {
|
|
22
|
+
import { syncGsdStateToWorktreeByScope } from "./auto-worktree-sync.js";
|
|
23
|
+
import { runWorktreePostCreateHook } from "./worktree-post-create-hook.js";
|
|
23
24
|
import { createWorkspace, scopeMilestone } from "./workspace.js";
|
|
24
25
|
import { writeSessionStatus, } from "./session-status-io.js";
|
|
25
26
|
import { hasFileConflict } from "./slice-parallel-conflict.js";
|