Commit graph

254 commits

Author SHA1 Message Date
Lex Christopherson
4e82688de6 fix: alias @mariozechner/* imports to @gsd/* for external PI ecosystem packages
External packages (pi-rtk, pi-context, pi-agent-browser, etc.) import from
the original @mariozechner/* scope which GSD forked to @gsd/*. Add aliases
in both jiti resolution paths (virtualModules for Bun, getAliases for Node)
so these packages resolve correctly without manual workarounds.

Closes #161

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 07:27:24 -06:00
TÂCHES
53e4208c0f Merge pull request #170 from marcelreschke/fix/missing-export-html-vendor
Reviewed: restores vendor files missed during pi-mono vendoring due to .gitignore vendor/ rule. Correct root-cause fix for #163.
2026-03-13 07:25:38 -06:00
TÂCHES
1e8fb6e01f Merge pull request #162 from alphinus/fix/bundle-workspace-deps
Reviewed: approach is correct, bundleDependencies is the standard fix for workspace packages in registry installs.
2026-03-13 07:23:21 -06:00
Marcel Reschke
a2d724a8b4 fix: add missing export-html vendor files
- Add .gitignore negation for vendor path
- Restore marked.min.js from pi-mono upstream
- Restore highlight.min.js from pi-mono upstream

Fixes build failure in pi-coding-agent caused by
global vendor/ ignore rule excluding vendored libs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:38:13 +01:00
Marcel Reschke
2140a4de07 Merge branch 'gsd-build:main' into main 2026-03-13 09:35:06 +01:00
alphinus_biosdesk
d6bf806f1a fix: bundle workspace dependencies for npm registry installs
Workspace packages (@gsd/pi-agent-core, @gsd/pi-ai, @gsd/pi-coding-agent,
@gsd/pi-tui) are included in the published tarball via the "files" field but
are not resolvable by Node because npm does not recreate workspace symlinks
when installing from the registry. This causes "ERR_MODULE_NOT_FOUND: Cannot
find package '@gsd/pi-coding-agent'" on fresh installs.

Add workspace packages to both "dependencies" and "bundleDependencies" so npm
packs them into node_modules/ within the tarball and installs them correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:36:53 +01:00
TÂCHES
24302942d0 Merge pull request #153 from Jah-yee/main
fix: make /exit use graceful shutdown, add /kill for immediate exit
2026-03-12 22:49:12 -06:00
SparkLabScout
1217e03225 fix: make /exit use graceful shutdown, add /kill for immediate exit
- /exit now calls stopAuto() before exiting to save activity log and clear locks
- Added new /kill command for immediate exit without cleanup
- Fixes issue #132: /exit terminates too abruptly and leaves terminal state dirty
2026-03-13 12:29:15 +08:00
TÂCHES
2a3c2b5194 Merge pull request #151 from dbachelder/fix/pi-provider-reuse-and-extension-loading
fix: reuse Pi provider config and load Pi extensions correctly
2026-03-12 22:25:15 -06:00
TÂCHES
18348e2103 Merge pull request #135 from Jamie-BitFlight/feat/model-fallbacks
feat: add model fallback support for auto-mode phases
2026-03-12 22:24:13 -06:00
Lex Christopherson
7f2ba0e839 2.7.0 2026-03-12 22:06:48 -06:00
Lex Christopherson
1f1e8e4fad docs: update changelog for v2.7.0 2026-03-12 22:06:44 -06:00
Lex Christopherson
4b09cd9a91 fix: exclude packages/ from test resolver .js→.ts rewriting
The ESM resolve hook was rewriting .js imports from vendored Pi
packages (packages/*/dist/) to .ts, breaking test resolution.
Compiled dist/ files need their .js specifiers left intact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:01:00 -06:00
Lex Christopherson
c80d640d35 feat: vendor Pi source into workspace monorepo
Vendor all 4 Pi packages (tui, ai, agent-core, coding-agent) from
pi-mono v0.57.1 as @gsd/* workspace packages under packages/. This
replaces the compiled npm dependency (@mariozechner/pi-coding-agent)
and patch-package workflow, giving direct source access for
modifications.

- Copy Pi source from pi-mono v0.57.1 into packages/
- Create workspace package.json + tsconfig.json for each package
- Rename ~240 imports from @mariozechner/pi-* to @gsd/pi-*
- Apply existing patches as source edits (setModel persist, VT input)
- Remove @mariozechner/pi-coding-agent dep and patch-package
- Update build pipeline to build packages in dependency order
- Add pi-upstream git remote for future selective syncing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:55:17 -06:00
dan
00cb2f36a8 fix: reuse pi provider config and extension loading 2026-03-12 20:44:09 -07:00
Lex Christopherson
9d3735b9a3 2.6.0 2026-03-12 21:38:23 -06:00
Lex Christopherson
e97c3de199 docs: update README and changelog for v2.6.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:38:19 -06:00
Lex Christopherson
f6d56991df fix: doctor post-hook no longer preempts complete-slice dispatch
Doctor's fix:true mode was creating summary stubs and marking slices
done in the roadmap during the post-hook after every task. This
short-circuited the complete-slice dispatch unit — by the time
dispatchNextUnit ran, the slice was already 'done' and the merge
guard merged it to main, so complete-slice (which writes the real
compressed summary) never got a chance to run.

Root cause: doctor conflated two responsibilities — task-level
bookkeeping (marking checkboxes) and completion state transitions
(summary stubs, roadmap marking). The post-hook should only do
the former.

Fix: added fixLevel option to runGSDDoctor. fixLevel:'task' (used
by post-hook) skips completion transition codes. fixLevel:'all'
(default, used by manual gsd doctor and resume) preserves existing
recovery behavior.

Completion transition codes gated by fixLevel:
- all_tasks_done_missing_slice_summary
- all_tasks_done_missing_slice_uat
- all_tasks_done_roadmap_not_checked
2026-03-12 21:35:57 -06:00
Lex Christopherson
d4a46d36dd fix: restore main_branch preference and implement runPreMergeCheck
Restores main_branch field on GitPreferences (removed in a prior merge conflict
resolution) and adds VALID_BRANCH_NAME validation in getMainBranch(). Implements
runPreMergeCheck with auto-detection from package.json test scripts and support
for custom commands via prefs.pre_merge_check string values.

Fixes 5 pre-existing test failures in git-service.test.ts (158/158 now pass).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:35:57 -06:00
Lex Christopherson
af2061bbe1 fix: cap recovery/retry prompt injection to prevent V8 OOM (#139)
The crash loop: stale state → unit redispatched → activity log grows →
retry diagnostic reads full log → prompt grows → replaceAll on huge
string → V8 heap exhaustion. Cap both the read path (10MB JSONL parse
limit) and the injection path (50K char prompt cap) to break the cycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:35:57 -06:00
Lex Christopherson
db2a409d7d fix: exclude .gsd/ from pre-switch auto-commits to prevent squash merge conflicts (#143)
Pre-switch auto-commits were including .gsd/ planning artifacts (roadmaps, STATE.md)
on both sides of a branch switch, causing reliable merge conflicts when squash-merging
slices back to main. Now pre-switch auto-commits exclude the entire .gsd/ directory,
while post-task auto-commits continue to include them normally.

Also restores VALID_BRANCH_NAME export removed in a prior merge conflict resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:35:57 -06:00
Lex Christopherson
7a1eac6af3 feat(M001): proactive secret management
Front-load API key collection into GSD's planning phase so auto-mode
runs uninterrupted. Planning prompts forecast secrets into a manifest,
auto-mode collects pending keys before dispatching the first slice.

- getManifestStatus() queries manifest state against env
- collectSecretsFromManifest() orchestrates summary, collection, manifest update
- showSecretsSummary() read-only TUI summary with status indicators
- collectOneSecret() enhanced with guidance display above masked input
- Secrets gate in startAuto() — non-fatal, inherited by guided flow
- 19 new tests (manifest-status, collect-from-manifest, auto-secrets-gate)
- All 10 requirements (R001-R010) validated
2026-03-12 21:35:57 -06:00
Lex Christopherson
dc3c2e7d76 docs(M001): context, requirements, and roadmap 2026-03-12 21:35:57 -06:00
TÂCHES
cf0ab43b14 Merge pull request #148 from vp275/feat/continue-flag
Add --continue / -c flag to resume most recent session
2026-03-12 21:02:58 -06:00
vp275
d7a90cf0e6 Add --continue / -c flag to resume the most recent session
Uses the existing SessionManager.continueRecent() from the Pi SDK
to load the most recent session for the current working directory.
Mirrors the --continue flag already available in the base Pi CLI.
2026-03-13 07:51:29 +05:30
Lex Christopherson
59a4d06fae 2.5.1 2026-03-12 15:32:39 -06:00
Lex Christopherson
6b358491b3 docs: update changelog for v2.5.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 15:32:39 -06:00
Lex Christopherson
6139a22c44 chore: delete old .gsd 2026-03-12 15:32:39 -06:00
Lex Christopherson
39f0df45d5 fix: abort squash-merge on conflict and stop auto-mode instead of looping (#merge-bug-fix)
mergeSliceToMain now runs git reset --hard if git merge --squash fails,
restoring a clean working tree instead of leaving conflict markers.

The merge guard catch block in auto.ts now:
1. Detects leftover conflicted state (UU/AA/UD in porcelain status)
2. Resets the working tree if conflicts remain
3. Stops auto-mode with a clear error instead of continuing with
   corrupted .gsd/ state files that cause an infinite dispatch loop

Also fixes conflict markers in loader.ts, logo.ts, and postinstall.js
that were baked into main from a prior bad merge resolution.
2026-03-12 15:32:39 -06:00
Lex Christopherson
63f9a84e8a feat(M002/S02): enhanced secure_env_collect UX — checkExistingEnvKeys, detectDestination, guidance field, auto-detection 2026-03-12 15:32:39 -06:00
Lex Christopherson
1b87bd046f docs(M002): reassess roadmap after S01 — no changes needed 2026-03-12 15:32:39 -06:00
Lex Christopherson
d6ae48d2bf fix: resolve remaining merge conflict in git-service.ts 2026-03-12 15:32:39 -06:00
Lex Christopherson
86aba6ec59 fix: resolve merge conflicts from S01 branch merge into main 2026-03-12 15:32:39 -06:00
Lex Christopherson
a64508e7a8 chore: auto-commit before switching to gsd/M002/S01 2026-03-12 15:32:39 -06:00
Lex Christopherson
1c68dc2906 chore: auto-commit before switching to gsd/M002/S01 2026-03-12 15:32:39 -06:00
TÂCHES
488d0fd4fb Merge pull request #136 from gsd-build/feat/pipeline-right-sizing
refactor: right-size pipeline for simple work
2026-03-12 14:54:42 -06:00
Lex Christopherson
f0459785c6 refactor: right-size pipeline for simple work
Remove task/project/product classification taxonomy from discuss prompt.
The LLM now sizes work based on judgment, not labels.

Key changes:
- discuss.md: Replace 3-tier classification with judgment-based sizing.
  Remove hard minimum question rounds (2 for task, 4 for project).
  Questioning depth now matches actual scope.

- plan-milestone.md: Add right-sizing doctrine. Single-slice milestones
  now write the S01 plan + task plans inline, eliminating separate
  research-slice and plan-slice sessions.

- plan-slice.md: Add right-sizing guidance. Make Proof Level,
  Integration Closure, and Observability sections conditional —
  omit entirely for simple slices instead of filling with 'none'.
  Consolidate self-audit from 10 items to 7 (remove duplicates).

- auto.ts: Skip research-slice for S01 when milestone research exists.
  Update peekNext label for plan-milestone.

- complete-slice.md: Add effort-matching guidance. Lighten observability
  verification for simple slices.

- execute-task.md: Make observability steps conditional on task plan
  content rather than always required.

- templates (plan.md, task-plan.md): Add comments making heavyweight
  sections explicitly optional for simple work.

Pipeline reduction for simple 1-slice milestone:
  Before: 9-10 sessions (research-M, plan-M, research-S, plan-S,
          execute×N, complete-S, reassess, complete-M)
  After:  5-6 sessions (research-M, plan-M [+S01 inline],
          execute×N, complete-S, complete-M)
2026-03-12 14:33:42 -06:00
Jamie McGregor Nelson
f1cf77a738 feat: add model fallback support for auto-mode phases
Adds support for specifying fallback models in GSD preferences. When a
primary model fails to switch (provider unavailable, rate limited, etc.),
GSD automatically tries the next model in the fallbacks list.

Changes:
- Add GSDPhaseModelConfig interface for per-phase model with fallbacks
- Add resolveModelWithFallbacksForUnit() function
- Update model switching in auto.ts to try fallbacks in order
- Update preferences-reference.md with fallback examples

Example usage:
```yaml
models:
  planning:
    model: claude-opus-4-6
    fallbacks:
      - openrouter/z-ai/glm-5
      - openrouter/minimax/minimax-m2.5
```

This enables cost-optimized configurations with resilience against
provider outages or credit exhaustion.
2026-03-12 16:15:54 -04:00
Lex Christopherson
ea1dbd26f5 test: add main_branch preference tests to git-service
Covers VALID_BRANCH_NAME regex validation, configured preference
returns correctly, fallback to auto-detection, and injection rejection.

Closes #108

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 14:14:26 -06:00
Lex Christopherson
9200401e55 chore: auto-commit before switching to gsd/M002/S01 2026-03-12 14:01:10 -06:00
Lex Christopherson
4e92a49d45 docs(M002): context, requirements, and roadmap 2026-03-12 14:01:07 -06:00
Lex Christopherson
ad2931a521 2.5.0 2026-03-12 13:24:24 -06:00
Lex Christopherson
57e118c144 docs: update changelog for v2.5.0 2026-03-12 13:24:20 -06:00
Lex Christopherson
b17ab25aaa chore: remove .gsd/ from tracking (already in .gitignore) 2026-03-12 13:21:18 -06:00
Lex Christopherson
cd01a47461 feat(M001/S06): Cleanup and archive 2026-03-12 13:21:18 -06:00
Lex Christopherson
d43322c45d feat(M001/S05): Enhanced features — merge guards, snapshots, auto-push, rich commits 2026-03-12 13:21:18 -06:00
Lex Christopherson
d9d773e44e feat(M001/S04): Remove git commands from prompts 2026-03-12 13:21:05 -06:00
Lex Christopherson
b2e7dbdc25 feat(M001/S03): Bug fixes and doc corrections 2026-03-12 13:21:05 -06:00
Lex Christopherson
dfe9527641 feat(M001/S02): Wire GitService into codebase 2026-03-12 13:21:05 -06:00
Lex Christopherson
91cf23a634 fix(auto): prevent state machine deadlock when units fail to produce artifacts
Three fixes to the dispatch loop:

1. Don't mark a unit complete when the next dispatch is the same unit
   (retry scenario) — let the retry mechanism handle it instead of
   persisting a false completion.

2. Verify expected artifact exists on disk before marking a unit
   complete. Uses resolveExpectedArtifactPath + existsSync to gate
   persistCompletedKey calls.

3. Cross-validate idempotency: when skipping a "completed" unit, verify
   the artifact actually exists. If missing, remove the stale record
   from completed-units.json and re-run the unit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:21:05 -06:00