Skip to content

Commit e92b5d8

Browse files
authored
Merge branch 'dev' into squad/1555-fs-storage-rootdir
2 parents ab9ed47 + a01bcd9 commit e92b5d8

128 files changed

Lines changed: 19466 additions & 7000 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/consolidated-0.11.0.md‎

Lines changed: 0 additions & 107 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@bradygaster/squad-cli': patch
3+
---
4+
5+
`squad doctor` now checks that every file pinned to `eol=lf` by `.gitattributes` is actually LF **on disk**, not just in the index. `.gitattributes` governs checkout, so adding an `eol=lf` rule never repairs a working tree that already exists — the affected files stay CRLF indefinitely, and a CRLF shebang makes a vitest suite load zero tests while still looking green. The check names the stale files and points at `npm run fix:crlf`, a new repair script that rewrites them from the index and refuses to overwrite any file with uncommitted changes. Closes #1793.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@bradygaster/squad-sdk': minor
3+
---
4+
5+
Fix scheduler script tasks failing on the default Windows Node install path
6+
7+
`LocalPollingProvider` split `task.ref` on whitespace with no quote handling,
8+
so a command path containing a space was truncated at the first space. On
9+
Windows that breaks the *default* install location — `C:\Program Files\nodejs\node.exe`
10+
became `C:\Program`, and the task failed with `ENOENT`. This affected any user
11+
who did not install Node somewhere unusual, not an exotic edge case.
12+
13+
Script task refs are now parsed with quote awareness, and an unquoted command
14+
path is resolved by widening across spaces (longest match first) the same way
15+
Windows `CreateProcess` does. A ref whose first token already resolves is used
16+
unchanged, so existing configurations — including bare PATH commands like
17+
`node` — keep their exact previous behaviour. Quote characters appearing
18+
mid-token, as in `node -e console.log('hi')`, are still passed through to the
19+
child verbatim rather than being stripped.
20+
21+
`TaskConfig.argv?: string[]` is added as the unambiguous form: when present,
22+
`ref` is used verbatim as the executable and is never parsed. Prefer it for any
23+
command path containing spaces.
24+
25+
Spawn failures are also no longer silent. `execFile` reports them with a
26+
*string* code (`ENOENT`, `EACCES`) and no stdout or stderr, which previously
27+
fell through every branch and produced `code: undefined, stderr: ''`. `TaskResult`
28+
gains `spawnError?: string` for that code, and the error message now names the
29+
ref that could not be spawned.
30+
31+
`shell: false` is retained, so the injection-safety property of the existing
32+
implementation is unchanged.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
'@bradygaster/squad-sdk': minor
3+
'@bradygaster/squad-cli': minor
4+
---
5+
6+
Make archival incapable of destroying state (#1774, #1783, #1760)
7+
8+
Archival is a two-half operation — append to a destination, trim from a source.
9+
Three production defects came from those halves coming apart, each one silently
10+
deleting team history while reporting success.
11+
12+
New `state/io/archival` module in the SDK enforces the five rules in code rather
13+
than only in prompt text:
14+
15+
- `resolveTrackedDestination()` / `isTrackedInGit()` — refuse to archive into a
16+
destination that is not git-tracked, or redirect to a tracked fallback. Under a
17+
git-excluded `.squad/`, already-tracked files still commit while brand-new files
18+
silently never do, which turns archival into deletion (#1783).
19+
- `archiveEntries()` — append, verify by literal heading containment **and** entry
20+
count, and only then trim. A failed append leaves the source completely intact
21+
(#1774).
22+
- `formatArchivalReport()` — reports entry counts and refuses to render an
23+
unbalanced result. File size is not a valid integrity signal, since a merge and
24+
an archive in the same pass move size in opposite directions.
25+
- `prepareInboxBodyForMerge()` / `demoteHeadings()` — fence-aware heading demotion
26+
so inbox `##` sections land at `####` beneath an `###` entry instead of breaking
27+
document hierarchy (#1760). `#` lines inside fenced code blocks are never
28+
rewritten.
29+
30+
Scribe's charter, spawn template, and the `decision-hygiene` watch capability
31+
prompt now carry the same rules.
32+
33+
**`squad nap` no longer destroys decision history.** `archiveDecisions()` in the
34+
CLI is a second, *shipped and user-invocable* archival path (`squad nap`, REPL
35+
`/nap`) that had all three defects independently of the agent path, and it is now
36+
wired to the SDK module:
37+
38+
- It appended to `.squad/decisions-archive.md` with no tracked-destination check.
39+
With `.squad/` git-excluded and no archive file yet, every archived record was
40+
written somewhere that could never be committed while the trim of the tracked
41+
`decisions.md` committed normally — a total loss of the archived records.
42+
- It trimmed the source unconditionally, even on the branch where the append was
43+
skipped, and never verified that the append landed.
44+
- It split records on `/^###\s/` with no fence tracking, so a `###` line inside a
45+
fenced code sample was treated as a record boundary and severed the record.
46+
47+
Archival now refuses to run when the destination is untracked *and* git-ignored,
48+
verifies the appended entry count before removing anything from the source, and
49+
reuses the SDK's fence-aware scanner for record boundaries. Because this changes
50+
the behavior of a user-invocable command rather than only prompt text, the CLI
51+
takes a minor bump.

‎.gitattributes‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,34 @@
2121
# Squad: shell scripts must stay LF — CRLF breaks the shebang on Linux/macOS.
2222
*.sh text eol=lf
2323

24+
# Squad: ESM scripts must stay LF — a CRLF shebang survives Vite's shebang
25+
# stripping as a bare `#`, so any .mjs imported by a vitest suite fails to parse
26+
# ("SyntaxError: Invalid or unexpected token") and the whole suite loads zero
27+
# tests. Green on Linux CI, silently dead on Windows checkouts (#1788).
28+
*.mjs text eol=lf
29+
30+
# Squad: same hazard, remaining shebanged file types (#1788). A CRLF shebang is
31+
# never correct -- the \r joins the interpreter argument on POSIX ("env: node\r:
32+
# No such file or directory"). Enforced by scripts/check-shebang-eol.mjs.
33+
*.js text eol=lf
34+
*.cjs text eol=lf
35+
*.ps1 text eol=lf
36+
37+
# Deliberately NOT "*.ts text eol=lf": only 3 tracked .ts files carry a shebang,
38+
# but a blanket rule would renormalize 95 CRLF-storing .ts blobs in one commit.
39+
# Pinning the shebanged entrypoints by path keeps the invariant without the churn.
40+
packages/squad-cli/src/cli-entry.ts text eol=lf
41+
samples/autonomous-pipeline/index.ts text eol=lf
42+
test-fixtures/dogfood/node-monorepo/packages/cli/src/cli.ts text eol=lf
43+
2444
# Squad: CRLF breaks RUN line-continuations when the image builds on Linux.
2545
Dockerfile text eol=lf
2646
Dockerfile.* text eol=lf
2747
.dockerignore text eol=lf
48+
49+
# Squad: vitest writes snapshots with LF unconditionally. Without a rule these
50+
# check out as CRLF on Windows, so `npm test` dirties a tracked file on every
51+
# run -- and a broad `git add` then commits pure line-ending noise. Same CRLF
52+
# class as the .mjs rule above, different symptom: not a load failure, a
53+
# perpetually dirty tree (#1788).
54+
*.snap text eol=lf

‎.github/agents.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,21 @@ Squad's planning behavior is configurable through policy profiles.
222222

223223
### Selecting a Profile
224224

225-
Add an HTML comment to the issue body:
225+
Add a policy directive line to the issue body:
226226

227-
```html
228-
<!-- squad-policy: lean -->
227+
```markdown
228+
Squad-Policy: lean
229229
```
230230

231+
Use a plain visible line — **not** an HTML comment. gh-aw strips HTML comments
232+
from issue bodies before the agent sees them, so a commented directive is
233+
silently ignored.
234+
231235
Or configure at the repo level in `.squad/planning-policy.md` with YAML frontmatter.
232236

233237
### Priority Order
234238

235-
1. Issue body (`<!-- squad-policy: ... -->`) — highest
239+
1. Issue body (`Squad-Policy: ...`) — highest
236240
2. Repository file (`.squad/planning-policy.md`)
237241
3. Profile name (built-in)
238242
4. Default — fallback

0 commit comments

Comments
 (0)