-
Notifications
You must be signed in to change notification settings - Fork 6
Fix Spec Kit wizard artifact and phase handling #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
2fb5961
Fix Spec Kit wizard artifact handling
nicolehaugen c1ed9b4
Hydrate converge task artifact path
nicolehaugen 65f6c7f
Prefer current checklist form artifact
nicolehaugen 9a09952
Exclude task markers from template detection
nicolehaugen acbdf82
Clear clarification run lock on submit failure
nicolehaugen 6505726
Fallback to checklist directory artifact
nicolehaugen 5237e74
Deduplicate clarification flushes
nicolehaugen 7504e79
Fix extension phase artifact lookup
nicolehaugen acbd433
Fix rerun phase lock completion detection
nicolehaugen ae9dea2
Preserve live clarification edits
nicolehaugen 718b128
Fix updater phase provenance prompts
nicolehaugen e86d845
Fix extension rerun completion signal
nicolehaugen d0e325a
Constrain checklist artifact resolution
nicolehaugen f678e2c
Fix artifact readiness during active runs
nicolehaugen e27712a
Remove placeholder readiness heuristic
nicolehaugen 749f565
Fix checklist folder fallback rendering
nicolehaugen f53aa09
Gate constitution scaffold readiness
nicolehaugen 861ccc6
Reject clarification flush during active phase
nicolehaugen 135ae53
Avoid constitution comment sanitization
nicolehaugen aa714f9
Omit converge from UI fallback order
nicolehaugen 951659f
Protect clarification queue during submit
nicolehaugen 12dae91
Remove edge-case modal regression
nicolehaugen cc222d4
Harden checklist artifact path resolution
nicolehaugen 8036b01
Handle truncated constitution comments
nicolehaugen 0e12244
Harden extension artifact cache paths
nicolehaugen b621d5a
Restore preset-only Core filtering
nicolehaugen ebc67f4
Track phase runs from session activity
nicolehaugen 6f25695
Use markdown mtimes for extension folder fallback
nicolehaugen 88ab453
Prune low-value wizard tests
nicolehaugen 40d250c
Keep phase runs locked during user input
nicolehaugen a02a956
Require extension artifact existence
nicolehaugen 10e69f3
Keep phase locks through Q&A
nicolehaugen 3a77f49
Generalize phase lock regressions
nicolehaugen 0286090
Allow arbitrary phase execution
nicolehaugen 2e2e0b4
Require terminal phase callbacks
nicolehaugen 062289b
Show full Core command list
nicolehaugen 359f534
Fix run-tracker instance scoping, extension symlink hardening, consti…
Copilot 5091606
Clear untracked wizard run locks
nicolehaugen e7fb8ac
Reject duplicate wizard run dispatch
nicolehaugen fb782c4
Merge remote-tracking branch 'origin/main' into nicolehaugen-fix-wiza…
nicolehaugen 1e69a37
Normalize tracked wizard command names
nicolehaugen cfb2f44
Handle wizard send failures
nicolehaugen 5fc6d81
Hide overridden core command tiles
nicolehaugen 73a8e30
Clear wizard run locks on turn completion
nicolehaugen d073c76
Correlate queued wizard runs per turn
nicolehaugen bd76121
Apply batched suggestions from code review
nicolehaugen 9b637c6
Correlate wizard runs with dispatch queue
nicolehaugen 9f8b57f
Simplify wizard run timeout handling
nicolehaugen 87c0050
Simplify wizard run feedback
nicolehaugen 2f4e42b
Reject overlapping wizard phase runs
Copilot 8a3a1ed
Remove unused wizard session activity tracker
nicolehaugen e2ea85e
Merge commit '2f4e42b80813146106befbd0a3f6a9807511a92c' into nicoleha…
nicolehaugen 26a455e
Restore launcher run-token contract and document rerun guidance
Copilot 9ae807c
Recover wizard phase locks safely
nicolehaugen c5676e2
Simplify wizard run tokens
nicolehaugen 0ba0b87
Guard execution reports with run tokens
nicolehaugen 65c7cec
Update wizard tracking preamble docs
nicolehaugen 903ff66
Tighten wizard run token guards
nicolehaugen 639b22e
Fix wizard canonical phase tracking
nicolehaugen ac96689
Restrict wizard phase actions to runnable phases
nicolehaugen 8242708
Document wizard run freshness guard
nicolehaugen 7ae23be
Keep artifacts viewable after failed reruns
nicolehaugen e04a25b
Clarify overlapping-run scope with inline comment
Copilot b6aea95
Document wizard run token scope
nicolehaugen 7b5f677
Clarify wizard status write scope
nicolehaugen 45080cc
Document checklist folder fallback
nicolehaugen 1874888
Clarify checklist folder preservation
nicolehaugen 2d8cb8d
Avoid awaiting wizard session sends
nicolehaugen 65ffa54
Extend wizard phase run acknowledgement
nicolehaugen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
95 changes: 95 additions & 0 deletions
95
...s/spec-kit-copilot-wizard/extensions/speckit-wizard-canvas/canvas-runtime/run-tracker.mjs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| // Lightweight phase status token tracking. | ||
| // | ||
| // Chat owns execution progress, while the scanner owns artifact availability. | ||
| // These tokens protect canonical phase status callbacks from stale writes. | ||
| // Tokens do not appear in UI snapshots. | ||
|
|
||
| import { PHASE_BY_ID } from "./wizard-phases.mjs"; | ||
|
|
||
| // Kept in memory only for the current extension process. The wizard is | ||
| // normally one guided panel per project; if a panel closes mid-run, any | ||
| // leftover entry is harmless unless the same instance id is reused before the | ||
| // process restarts. Artifact discovery and durable phase state do not depend | ||
| // on these maps. | ||
| const activeTokens = new Map(); | ||
| const reportableTokens = new Map(); | ||
| let sequence = 0; | ||
|
|
||
| function runKey(instanceId, commandName) { | ||
| return `${instanceId}::${commandName}`; | ||
| } | ||
|
|
||
| export function beginRun(instanceId, commandName, { startedAtMs = Date.now() } = {}) { | ||
| const trackedCommandName = normalizeTrackedCommandName(commandName); | ||
| if (!instanceId || !trackedCommandName) return null; | ||
| const key = runKey(instanceId, trackedCommandName); | ||
| const run = { | ||
| runId: `run-${++sequence}`, | ||
| instanceId, | ||
| commandName: trackedCommandName, | ||
| startedAt: new Date(startedAtMs).toISOString(), | ||
| startedAtMs, | ||
| }; | ||
| activeTokens.set(key, run); | ||
| reportableTokens.delete(key); | ||
| return { runId: run.runId, commandName: run.commandName, startedAt: run.startedAt }; | ||
| } | ||
|
|
||
| export function clearRun(instanceId, commandName, runId = null) { | ||
| const key = runKey(instanceId, normalizeTrackedCommandName(commandName)); | ||
| const run = activeTokens.get(key); | ||
| if (!run) return false; | ||
| if (runId && run.runId !== runId) return false; | ||
| activeTokens.delete(key); | ||
| reportableTokens.delete(key); | ||
| return true; | ||
| } | ||
|
|
||
| export function finishRun(instanceId, commandName, runId, { allowReport = false } = {}) { | ||
| const key = runKey(instanceId, normalizeTrackedCommandName(commandName)); | ||
| const run = activeTokens.get(key); | ||
| if (!run || !runId || run.runId !== runId) return false; | ||
| activeTokens.delete(key); | ||
| if (allowReport) { | ||
| reportableTokens.set(key, { runId }); | ||
| } else { | ||
| reportableTokens.delete(key); | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| export function consumeReportableRun(instanceId, commandName, runId) { | ||
| if (!runId) return false; | ||
| const key = runKey(instanceId, normalizeTrackedCommandName(commandName)); | ||
| const reportable = reportableTokens.get(key); | ||
| if (reportable?.runId !== runId) return false; | ||
| reportableTokens.delete(key); | ||
| return true; | ||
| } | ||
|
|
||
| export function activeRunMatches(instanceId, commandName, runId) { | ||
| if (!runId) return false; | ||
| const key = runKey(instanceId, normalizeTrackedCommandName(commandName)); | ||
| return activeTokens.get(key)?.runId === runId; | ||
| } | ||
|
|
||
| export function hasActiveRun(instanceId, commandName) { | ||
| const key = runKey(instanceId, normalizeTrackedCommandName(commandName)); | ||
| return activeTokens.has(key); | ||
| } | ||
|
|
||
| export function __resetRunTrackerForTests() { | ||
| activeTokens.clear(); | ||
| reportableTokens.clear(); | ||
| sequence = 0; | ||
| } | ||
|
|
||
| function normalizeTrackedCommandName(commandName) { | ||
| if (typeof commandName !== "string") return ""; | ||
| const name = commandName.startsWith("/") ? commandName.slice(1) : commandName; | ||
| const hyphenMatch = /^speckit-([a-z0-9_]+)$/i.exec(name); | ||
| if (hyphenMatch && PHASE_BY_ID[hyphenMatch[1]]) { | ||
| return `speckit.${hyphenMatch[1]}`; | ||
| } | ||
| return name; | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.