You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9cd07fb
Browse filesBrowse the repository at this point in the historyBrowse files
fix(extensions): harden assess slug handling and clarify verdict logic
Address the second review round on github#3568:
- Slug path traversal: intake and all four downstream commands
(research, define, shape, decide) now normalize an explicit or
user-supplied slug to the [a-z0-9-] alphabet (dropping '.', '/', '\\')
and reject an empty normalized result before constructing ASSESS_DIR.
This guarantees a slug like `../..` cannot escape .specify/assessments/.
- Metadata accuracy: the extension.yml and catalog.json descriptions no
longer imply a "build/kill" call is handed to /speckit.specify — only a
`go` hands off; a `kill` closes the assessment.
- Verdict determinism (decide): a `go` now explicitly requires evidence
strength `adequate`+ (never weak/unknown), resolving the conflict with
the thin-evidence guardrail.
- Risk polarity (decide): renamed the "Risk" criterion to "Risk posture"
with positive polarity (strong = risks understood and mitigated) so it
composes with the other scores that feed the verdict.
- README: aligned the go-threshold guardrail with the evidence rule and
documented the slug-normalization safety property.
The PR description was also updated to drop the stale before_specify
hook claim (the hook was removed in the previous commit).
Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 1f25cf9d-b7eb-4b2b-b811-3e91d8db8f6a
Copy file name to clipboardExpand all lines: extensions/assess/README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,8 @@ specify extension enable assess
94
94
- Only `speckit.assess.*` commands write, and only inside `.specify/assessments/<slug>/`. **None of them modify source code** — solution design and implementation belong to the SDD lifecycle (`/speckit.specify` onward).
95
95
- Web content fetched during `intake`/`research` is treated as untrusted data, governed by an explicit URL Trust Policy (allowlisted public sources fetched freely; unknown hosts prompted or skipped; loopback/RFC1918/metadata endpoints refused).
96
96
- Evidence is never over-claimed: unsourced statements are tagged `ASSUMPTION`, and `research.md` always includes an *Evidence Against the Idea* section.
97
-
- Verdicts are never over-claimed: a `go` requires a valid problem and a shaped concept; otherwise the honest verdict is `needs-clarification`.
97
+
- Verdicts are never over-claimed: a `go` requires a valid problem, `adequate`+ evidence (never weak/unknown), and a shaped concept; otherwise the honest verdict is `needs-clarification`.
98
+
- Slugs are normalized to `[a-z0-9-]` and an empty result is rejected, so an assessment directory can never escape `.specify/assessments/`.
98
99
- No command overwrites an existing artifact without confirmation; in automated mode it refuses.
Copy file name to clipboardExpand all lines: extensions/assess/commands/speckit.assess.decide.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Decide **judges; it does not spec or build.** It weighs the evidence already gat
14
14
$ARGUMENTS
15
15
```
16
16
17
-
Resolve the slug: explicit `slug=…` → conversation context (a slug reported earlier this session, confirmed by an existing `.specify/assessments/<slug>/` directory) → ask (interactive) → single existing directory (automated) → otherwise stop and ask. Set `ASSESS_SLUG` and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>`.
17
+
Resolve the slug: explicit `slug=…` → conversation context (a slug reported earlier this session, confirmed by an existing `.specify/assessments/<slug>/` directory) → ask (interactive) → single existing directory (automated) → otherwise stop and ask. **Slug safety**: normalize any explicit or user-supplied slug — lowercase; whitespace/underscores → `-`; keep only `[a-z0-9-]` (drop every other character, including `.`, `/`, `\`); collapse and trim `-`; reject an empty normalized result. Only then set `ASSESS_SLUG`(the normalized value) and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>` — this keeps every read and write inside `.specify/assessments/`.
18
18
19
19
## Prerequisites
20
20
@@ -31,9 +31,9 @@ Resolve the slug: explicit `slug=…` → conversation context (a slug reported
31
31
-**Value vs. cost of inaction** — does solving it beat doing nothing? (from `problem.md`)
32
32
-**Feasibility / appetite fit** — is there a credible option within a sane appetite? (from `concept.md`)
33
33
-**Strategic fit** — does it align with the project's constitution/goals, if known?
34
-
-**Risk** — what could make this fail or backfire?
34
+
-**Risk posture** — are the major risks understood and acceptably mitigated? Rate with the same positive polarity as the other criteria: `strong` = key risks identified and credibly mitigated; `weak` = serious, unmitigated risk. (from all artifacts)
35
35
2.**Reach a verdict**:
36
-
-**go** — the idea is worth specifying. Requires problem validity `adequate`+and a recommended concept option.
36
+
-**go** — the idea is worth specifying. Requires problem validity `adequate`+, **evidence strength `adequate`+ (never `weak` or `unknown`)**, and a recommended concept option. If evidence is `weak`/`unknown`, the verdict is `needs-clarification`, not `go`.
37
37
-**needs-clarification** — promising but blocked on specific unknowns. List exactly what must be answered and which stage to revisit.
38
38
-**kill** — not worth building now. State the decisive reason plainly (weak problem, better alternative exists, cost > value, out of scope, superseded).
39
39
3.**Record the rationale** so the decision is auditable months later. Any `unknown` score must be acknowledged, not glossed.
Copy file name to clipboardExpand all lines: extensions/assess/commands/speckit.assess.define.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Define **frames the problem; it does not shape or choose a solution.** If the in
14
14
$ARGUMENTS
15
15
```
16
16
17
-
Resolve the slug: explicit `slug=…` → conversation context (a slug reported earlier this session, confirmed by an existing `.specify/assessments/<slug>/` directory) → ask (interactive) → single existing directory (automated) → otherwise stop and ask. Set `ASSESS_SLUG` and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>`.
17
+
Resolve the slug: explicit `slug=…` → conversation context (a slug reported earlier this session, confirmed by an existing `.specify/assessments/<slug>/` directory) → ask (interactive) → single existing directory (automated) → otherwise stop and ask. **Slug safety**: normalize any explicit or user-supplied slug — lowercase; whitespace/underscores → `-`; keep only `[a-z0-9-]` (drop every other character, including `.`, `/`, `\`); collapse and trim `-`; reject an empty normalized result. Only then set `ASSESS_SLUG`(the normalized value) and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>` — this keeps every read and write inside `.specify/assessments/`.
Copy file name to clipboardExpand all lines: extensions/assess/commands/speckit.assess.intake.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,13 @@ If the input is empty, ask the user for the idea (interactive), or stop with a n
27
27
28
28
Each idea gets its own directory under `.specify/assessments/<slug>/`. Resolve the slug in this order:
29
29
30
-
1.**User-provided slug**: If the user explicitly passes a slug (e.g., `slug=offline-mode`, `--slug offline-mode`, or an obvious slug-like token), use it verbatim after normalization (lowercase; hyphen-separated; no spaces; keep only lowercase letters `a–z`, digits `0–9`, and `-`). Do not append timestamps or numbers.
30
+
1.**User-provided slug**: If the user explicitly passes a slug (e.g., `slug=offline-mode`, `--slug offline-mode`, or an obvious slug-like token), normalize it: lowercase; convert runs of whitespace/underscores to `-`; keep only lowercase letters `a–z`, digits `0–9`, and `-`; drop every other character (including `.`, `/`, `\`); collapse repeated `-`; strip leading/trailing `-`. Do not append timestamps or numbers.
31
31
2.**Interactive mode** (a human is driving): If no slug was provided, **ask the user** and wait. Suggest a 2–4 word kebab-case candidate derived from the idea as a default.
32
32
3.**Automated / non-interactive mode** (no human to ask): Generate a concise slug yourself (2–4 kebab-case words). The generated slug **MUST** produce a unique directory — if `.specify/assessments/<slug>/` already exists, append the shortest disambiguating suffix (`-2`, `-3`, …) or a short ISO-style date (`-20260715`). Never overwrite an existing assessment directory.
33
33
34
-
After resolution, set `ASSESS_SLUG` and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>`.
34
+
**Reject unsafe slugs.** If the normalized slug is empty (e.g. the input was `../..`, `/`, or non-ASCII-only), refuse it: ask again (interactive) or stop with a note (automated). Never build a path from an unnormalized slug — normalization strips `.`, `/`, and `\`, which guarantees `ASSESS_DIR` cannot escape `.specify/assessments/`.
35
+
36
+
After resolution, set `ASSESS_SLUG` (the normalized, validated value) and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>`.
Copy file name to clipboardExpand all lines: extensions/assess/commands/speckit.assess.research.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,13 @@ $ARGUMENTS
16
16
17
17
The input carries the slug and (optionally) research direction or links. Resolve the slug:
18
18
19
-
1.**Explicit slug** (`slug=…`, `--slug …`, or an obvious token) — use it verbatim after normalization.
19
+
1.**Explicit slug** (`slug=…`, `--slug …`, or an obvious token) — normalize it (see **Slug safety** below).
20
20
2.**Conversation context** — if this session just ran `__SPECKIT_COMMAND_ASSESS_INTAKE__`, reuse the slug it reported. Confirm by checking that `.specify/assessments/<slug>/intake.md` exists; if not, fall through.
21
21
3.**Interactive** — ask the user for the slug and wait.
22
22
4.**Automated** — if exactly one assessment directory exists, use it; otherwise stop and ask.
23
23
24
+
**Slug safety**: normalize any explicit or user-supplied slug to the slug alphabet — lowercase; whitespace/underscores → `-`; keep only `[a-z0-9-]` (drop every other character, including `.`, `/`, `\`); collapse and trim `-`. **Reject** a slug whose normalized form is empty. Only then set `ASSESS_SLUG` (the normalized value) and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>` — this keeps every read and write inside `.specify/assessments/`.
25
+
24
26
Set `ASSESS_SLUG` and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>`.
Copy file name to clipboardExpand all lines: extensions/assess/commands/speckit.assess.shape.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Shape **outlines options at the boundaries; it does not produce a spec or a plan
14
14
$ARGUMENTS
15
15
```
16
16
17
-
Resolve the slug: explicit `slug=…` → conversation context (a slug reported earlier this session, confirmed by an existing `.specify/assessments/<slug>/` directory) → ask (interactive) → single existing directory (automated) → otherwise stop and ask. Set `ASSESS_SLUG` and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>`.
17
+
Resolve the slug: explicit `slug=…` → conversation context (a slug reported earlier this session, confirmed by an existing `.specify/assessments/<slug>/` directory) → ask (interactive) → single existing directory (automated) → otherwise stop and ask. **Slug safety**: normalize any explicit or user-supplied slug — lowercase; whitespace/underscores → `-`; keep only `[a-z0-9-]` (drop every other character, including `.`, `/`, `\`); collapse and trim `-`; reject an empty normalized result. Only then set `ASSESS_SLUG`(the normalized value) and `ASSESS_DIR = .specify/assessments/<ASSESS_SLUG>` — this keeps every read and write inside `.specify/assessments/`.
Copy file name to clipboardExpand all lines: extensions/assess/extension.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ extension:
4
4
id: assess
5
5
name: "Idea Assessment Pipeline"
6
6
version: "1.0.0"
7
-
description: "Assess an idea before Spec-Driven Development via intake, research, define, shape, and decide, then hand a build/kill call to /speckit.specify. Assessments live under .specify/assessments/<slug>/"
7
+
description: "Assess an idea before Spec-Driven Development via intake, research, define, shape, and decide. A go verdict hands off to /speckit.specify; a kill closes it. Lives under .specify/assessments/<slug>/"
Copy file name to clipboardExpand all lines: extensions/catalog.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
"name": "Idea Assessment Pipeline",
22
22
"id": "assess",
23
23
"version": "1.0.0",
24
-
"description": "Assess an idea before Spec-Driven Development via intake, research, define, shape, and decide, then hand a build/kill call to /speckit.specify. Assessments live under .specify/assessments/<slug>/",
24
+
"description": "Assess an idea before Spec-Driven Development via intake, research, define, shape, and decide. A go verdict hands off to /speckit.specify; a kill closes it. Lives under .specify/assessments/<slug>/",
0 commit comments