Commit graph

2855 commits

Author SHA1 Message Date
OfficialDelta
c3ba64d56b M005: Tiered Context Injection - Scoped knowledge queries & roadmap excerpts
- Added queryKnowledge() for keyword-based KNOWLEDGE.md section filtering
- Added formatRoadmapExcerpt() for slice-scoped roadmap excerpts
- Added inlineKnowledgeScoped() and inlineRoadmapExcerpt() to auto-prompts
- Context reduction: ~65% for knowledge, ~67% for roadmap excerpts
- Also includes deriveSliceScope() fix for unit IDs and process words

Squash merge of milestone/M005
2026-04-07 23:48:06 -04:00
OfficialDelta
e4f94fa5fb feat(context): implement R005 decision scope cascade and derive scope from slice metadata
Fix 1 - Fallback cascade:
- inlineDecisionsFromDb() now cascades: milestone+scope → milestone only → null
- When scoped query returns empty AND scope was provided, retries without scope
- Falls back to milestone-level decisions when no scope-specific ones exist

Fix 2 - Derive scope from slice metadata:
- Added deriveSliceScope(title, description?) helper function
- Extracts first meaningful noun (filters stopwords and generic words)
- Examples: 'Auth Middleware & Protected Route' → 'auth'
           'Integration Testing' → undefined (too generic)
- Wired into buildPlanSlicePrompt and buildResearchSlicePrompt

Added comprehensive test suite (13 tests) covering:
- Keyword extraction from slice titles
- Generic title detection
- Cascade fallback behavior
- Integration between scope derivation and cascade
2026-04-07 23:23:55 -04:00
OfficialDelta
4214252eaa feat(M005): Tiered Context Injection - relevance-scoped context with 65%+ reduction
- Added milestone-scoped queryDecisions/queryRequirements with D020 fallback cascade
- Added queryKnowledge() for keyword-based KNOWLEDGE.md section filtering
- Added formatRoadmapExcerpt() for minimal roadmap table extraction
- Wired inlineKnowledgeScoped() and inlineRoadmapExcerpt() into slice prompts
- 39 new tests (31 context-store + 8 measurement)
- Measured 65.7% combined context reduction (exceeds 40% target)
2026-04-07 22:44:09 -04:00
Jeremy McSpadden
0dd7c31213 Merge pull request #3719 from jeremymcs/fix/suppress-model-notify-automode
fix(gsd): suppress model change notification in auto-mode unless verbose
2026-04-07 11:00:50 -05:00
Jeremy McSpadden
11f12e31a9 Merge pull request #3602 from OfficialDelta/feat/enhanced-discussion
feat(gsd): add deep evidence-backed discussion system with preparation engine
2026-04-07 11:00:36 -05:00
Jeremy
230939e558 test(gsd): add regression test for verbose-gated model change notification
Verifies that the Model [phase] [tier] notification in selectAndApplyModel
is gated behind the verbose flag to prevent auto-mode notification noise.
2026-04-07 10:48:41 -05:00
OfficialDelta
c4a1fc11a0 fix(gsd): remove ecosystem research stub and address adversarial review
Ecosystem research: executeSearchQuery() was a stub returning empty
results. Research now happens during the discussion (between Layer 1
and Layer 2) using whatever web search tools are available — native
Anthropic web search for Claude, search-the-web for other providers.
Preparation phase focuses on mechanical work only.

Adversarial review fixes:
- Clear lastPreparationResult on every discuss entry to prevent
  cross-session/project state leaks
- Replace invalid JS regex anchor \z with indexOf-based section
  extraction in prompt-validation.ts
- Document consecutive error counter finding as upstream behavior
  (agent-loop.ts is part of pi-agent-core, not gsd extension)
2026-04-07 11:39:01 -04:00
OfficialDelta
f8c148eed7 chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:38:49 -04:00
OfficialDelta
13c9c96c6a chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:38:40 -04:00
OfficialDelta
f2f8c173bd chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:38:30 -04:00
OfficialDelta
7d99026119 chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:38:24 -04:00
OfficialDelta
504633a388 chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:38:09 -04:00
OfficialDelta
990f45e952 chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:38:00 -04:00
OfficialDelta
9884f24986 chore: auto-commit after quick-task
GSD-Unit: Q13
2026-04-07 11:37:35 -04:00
Alan Alwakeel
6d96386cc5 test: add test isolation and pause wiring tests
- worktree.ts: Added _resetServiceCache() for test isolation
- test-isolation.ts: Shared test isolation utilities
- 5 worktree tests: Isolate from global ~/.gsd/preferences.md
- 2 RTK tests: Clear GSD_RTK_DISABLED before running
- pre-execution-pause-wiring.test.ts: Pause wiring integration tests
- preferences.ts: Add enhanced_verification to mergePreferences
2026-04-07 11:35:12 -04:00
Jeremy
d25a7d6fb7 fix(gsd): suppress model change notification in auto-mode unless verbose
The Model [phase] [tier] notification fired on every unit dispatch during
auto-mode, cluttering the notification widget. The dashboard header already
displays the active model, making this redundant. Gate behind verbose flag
consistent with all other model routing notifications in the same function.
2026-04-07 10:09:58 -05:00
Jeremy McSpadden
23c38807ac Merge pull request #3715 from jeremymcs/fix/pre-exec-ordering-false-positive
fix(gsd): exclude task.files from checkTaskOrdering to prevent false positives
2026-04-07 08:54:04 -05:00
Jeremy
b6da76f8b8 fix(gsd): exclude task.files from checkTaskOrdering to prevent false positives
task.files ("files likely touched") is a planning hint that includes files
a task will create, not a dependency contract. Including it in ordering
checks caused false "sequence violation" blocking errors when a task listed
files it would create. Only task.inputs (machine-parsed prerequisites)
should trigger ordering violations, matching checkFilePathConsistency (#3626).

Closes #3677

- Changed checkTaskOrdering to check [...task.inputs] instead of
  [...task.files, ...task.inputs]
- Updated 4 existing tests to use inputs (were testing buggy behavior)
- Added 8 regression tests: 5 ordering false-positive cases,
  3 consistency edge cases
2026-04-07 08:41:51 -05:00
Jeremy McSpadden
c3485820ca Merge pull request #3164 from jeremymcs/fix/3161-state-machine-fixes
fix(state-machine): 9 resilience fixes from validation audit
2026-04-07 07:57:48 -05:00
Jeremy
a30e837d9e fix(state): skip ghost check for queued milestones in registry build
The ghost milestone check (#3645) was eliminating queued shell
milestones before the deferred-shell logic (#3470) could handle them,
causing queued milestones to vanish from the registry entirely.
2026-04-07 07:41:10 -05:00
Jeremy
b658eb9a24 fix(ci): replace empty catch blocks and raw stderr with logWarning
Fixes workflow-logger coverage test failures: empty catch blocks in
reopen-slice/reopen-task and raw process.stderr in reopen-milestone
now use logWarning from workflow-logger.
2026-04-07 07:36:15 -05:00
Jeremy
90440f93b3 fix(logging): add debugLog to empty catch in reopen-milestone
Addresses review comment on #3164 — replace empty catch block
with debugLog for observability.
2026-04-07 07:27:24 -05:00
Jeremy
c6093b4bbd fix(state-machine): 9 resilience fixes + 86 regression tests (#3161)
Fixes identified by comprehensive state machine validation:

- M12: reopen-task/slice now deletes SUMMARY.md from disk, preventing
  the DB-filesystem reconciler from auto-correcting tasks back to
  "complete" — reopen was previously a no-op when artifacts existed
- H4: add 30s hard timeout to unitPromise via Promise.race — prevents
  permanent hang if supervision fails to resolve agent_end
- H5: add handleReopenMilestone — milestone completion was irrevocable
- H6: pass ID as title when auto-creating phantom parent entities
- H7: guard loadRegistry() against missing/corrupt registry.json
- M4: report_blocker replay now sets blocker_discovered flag via
  new setTaskBlockerDiscovered() DB function
- M5: insertVerificationEvidence uses INSERT OR IGNORE with unique
  index on (task_id, slice_id, milestone_id, command, verdict)
- M11: complete-slice rollback preserves original status instead of
  hardcoding "pending"
- M14: deriveWorkflowAction shows contextual labels for blocked,
  paused, validating-milestone, completing-milestone, needs-discussion,
  and replanning-slice phases instead of generic "Continue"

Includes 86 regression tests (49 unit + 37 integration) validating
every phase transition, completion guard, and edge case.

Closes #3161
2026-04-07 07:27:08 -05:00
Jeremy McSpadden
dab20a2b7f Merge pull request #3119 from jeremymcs/feat/reactive-graph-diagnostics
feat(reactive): graph diagnostics and subagent_model config
2026-04-07 07:23:18 -05:00
Jeremy McSpadden
8e54878fac Merge pull request #3118 from jeremymcs/feat/parallel-research-slices
feat(dispatch): parallel research slices and parallel milestone validation
2026-04-07 07:22:24 -05:00
Jeremy McSpadden
91eec25d21 Merge pull request #3117 from jeremymcs/feat/worker-model-override
feat(parallel): worker model override for parallel milestone workers
2026-04-07 07:22:00 -05:00
Jeremy McSpadden
4fcb0d7fe7 Merge pull request #3034 from jeremymcs/feat/gsd-show-config
feat(gsd): add /gsd show-config command
2026-04-07 07:20:38 -05:00
Jeremy McSpadden
b38db63c96 Merge pull request #3555 from Tibsfox/fix/captures-executed-timestamp
fix(gsd): stamp defer and milestone captures as executed after triage
2026-04-07 07:19:43 -05:00
Jeremy McSpadden
caca43814f Merge pull request #3554 from Tibsfox/fix/filepath-slash-command
fix(tui): treat absolute file paths as plain text, not commands
2026-04-07 07:19:25 -05:00
Jeremy McSpadden
e7bf3ac826 Merge pull request #3549 from Tibsfox/fix/stale-milestone-selection
fix(gsd): defer queued shells in active milestone selection
2026-04-07 07:18:08 -05:00
Jeremy McSpadden
41ceb95b66 Merge pull request #3533 from NilsR0711/feat/queued-discuss-fast-path
feat(gsd): add fast path for queued milestone discussion
2026-04-07 07:17:53 -05:00
Jeremy McSpadden
ad67824b46 Merge pull request #3548 from Tibsfox/fix/429-quota-cascade
fix(retry): prevent 429 quota cascade and 30-min provider lockout
2026-04-07 07:17:40 -05:00
Jeremy McSpadden
3e7dcdb3a5 Merge pull request #3556 from Tibsfox/fix/worktree-main-branch-pref
fix(gsd): use main_branch preference in worktree creation
2026-04-07 07:17:17 -05:00
Jeremy McSpadden
53cd0bf892 Merge pull request #3553 from Tibsfox/fix/cmux-image-rerender-loop
fix(tui): break infinite re-render loop for images in cmux
2026-04-07 07:17:00 -05:00
Jeremy McSpadden
c3c0fb782a Merge pull request #3550 from Tibsfox/fix/stale-state-md-guided-flow
fix(gsd): rebuild STATE.md before guided-flow dispatch
2026-04-07 07:16:30 -05:00
Jeremy McSpadden
4dc9fa274c Merge pull request #3557 from Tibsfox/fix/rethink-skip-slice-db-sync
fix(gsd): rebuild STATE.md after skip-slice and strengthen rethink prompt
2026-04-07 07:15:53 -05:00
Jeremy McSpadden
8cbd1b5a83 Merge pull request #3558 from Tibsfox/fix/zero-slice-roadmap-blocked
fix(gsd): treat zero-slice roadmap as pre-planning in guided flow
2026-04-07 07:15:29 -05:00
Jeremy McSpadden
cd347bb258 Merge pull request #3581 from NilsR0711/fix/sharp-optional-browser-tools
fix(browser-tools): make sharp an optional lazy dependency
2026-04-07 07:15:07 -05:00
Jeremy McSpadden
15ca62df15 Merge pull request #3653 from Tibsfox/fix/dispatch-guard-closed-status
fix(gsd): use isClosedStatus() in dispatch guard for reconciled slices
2026-04-07 07:13:53 -05:00
Jeremy McSpadden
45604bbc16 Merge pull request #3661 from Tibsfox/fix/verification-not-provided-default
fix(gsd): recognize 'Not provided.' default in isVerificationNotApplicable
2026-04-07 07:11:40 -05:00
Jeremy McSpadden
4911f937ad Merge pull request #3662 from igouss/fix/symlink-extension-discovery
fix(gsd): discoverManifests skips symlinked extension directories
2026-04-07 07:11:23 -05:00
Jeremy McSpadden
f2c87d71ee Merge pull request #3663 from Tibsfox/fix/queued-user-message-skip-pause
fix(gsd): pause auto-mode on queued-user-message tool skip instead of retrying
2026-04-07 07:09:38 -05:00
Jeremy McSpadden
182a8c758d Merge pull request #3664 from Tibsfox/fix/error-success-masks-real-error
fix(gsd): surface real provider error when errorMessage is 'success'
2026-04-07 07:09:25 -05:00
Jeremy McSpadden
e87119e7e0 Merge pull request #3665 from Tibsfox/fix/worktree-expected-condition-warnings
fix(gsd): suppress misleading ENOENT/EISDIR warnings in worktree operations
2026-04-07 07:09:08 -05:00
Jeremy McSpadden
85a578265b Merge pull request #3667 from Tibsfox/fix/clear-stale-pending-autostart
fix(gsd): clear stale pendingAutoStart after /clear interrupts discussion
2026-04-07 07:08:53 -05:00
Jeremy McSpadden
d5dac9ec04 Merge pull request #3668 from Tibsfox/fix/stale-lockfile-auto-recovery
fix(gsd): recover from stale lockfile after crash or SIGKILL
2026-04-07 07:08:41 -05:00
Jeremy McSpadden
f8c5a9c6ee Merge pull request #3669 from Tibsfox/fix/find-missing-summaries-skip-closed
fix(gsd): exclude closed slices from findMissingSummaries check
2026-04-07 07:08:26 -05:00
Jeremy McSpadden
1a0e3aecbb Merge pull request #3670 from Tibsfox/fix/needs-remediation-revalidation
fix(gsd): force re-validation when verdict is needs-remediation
2026-04-07 07:08:14 -05:00
Jeremy McSpadden
498a7a0aac Merge pull request #3671 from Tibsfox/fix/phantom-milestone-ghost-detection
fix(gsd): detect phantom milestones from abandoned generate_id
2026-04-07 07:07:59 -05:00
Jeremy McSpadden
24d40788ac Merge pull request #3672 from Tibsfox/fix/query-tools-ensure-db-open
fix(gsd): open DB on demand in gsd_milestone_status for non-auto sessions
2026-04-07 07:07:47 -05:00