Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .claude/commands/normalize-license-field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Normalize the License Field

Rebuild the `License:` field in the spec file from the `%{cargo_license_summary}`
comment block so both are in sync and the SPDX expression is canonically ordered.

Run this any time the comment block has been updated with fresh `cargo license
--summary` output, or when the License field and comment block have drifted apart.

---

## Step 1: Extract the Comment Block

Read every `# <license>` line from the comment block above the `License:` field
(the block between the `# output of %%{cargo_license_summary}.` line and the
`License:` field).

## Step 2: Normalize Each Entry

For each entry, sort all license identifiers within every OR or AND expression
alphabetically to produce its canonical form:

| Raw (cargo output) | Canonical |
|------------------------------------------------------------|------------------------------------------------------------|
| `MIT OR Apache-2.0` | `Apache-2.0 OR MIT` |
| `0BSD OR MIT OR Apache-2.0` | `0BSD OR Apache-2.0 OR MIT` |
| `MIT OR Zlib OR Apache-2.0` | `Apache-2.0 OR MIT OR Zlib` |
| `MIT AND BSD-3-Clause` | `BSD-3-Clause AND MIT` |
| `Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT` | `Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT` |
| `CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception` | `Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR CC0-1.0` |

## Step 3: Deduplicate

After canonicalizing, discard any entry whose canonical form has already been
seen. Common sources of duplicates in cargo output:

- `Apache-2.0 OR MIT` and `MIT OR Apache-2.0` → keep one
- `BSD-3-Clause AND MIT` and `MIT AND BSD-3-Clause` → keep one
- Multiple word-order variants of the same triple (e.g. `Apache-2.0 OR MIT OR
Zlib`, `MIT OR Zlib OR Apache-2.0`, `Zlib OR Apache-2.0 OR MIT`) → keep one

## Step 4: Classify Each Unique Entry

**Simple OR** — two or more licenses joined by OR; will be wrapped in parens:
- `Apache-2.0 OR MIT` → `(Apache-2.0 OR MIT)`

**Simple AND** — two licenses both required (cargo uses AND when there is no
choice); will be wrapped in parens:
- `BSD-3-Clause AND MIT` → `(BSD-3-Clause AND MIT)`
- `Apache-2.0 AND ISC` → `(Apache-2.0 AND ISC)`

> **Critical:** if cargo says AND, the License field must say AND. Never convert
> AND to OR — they carry different legal obligations.

**Standalone** — a single license identifier; no parens needed:
- `Apache-2.0`, `ISC`, `bzip2-1.0.6`

**Compound AND with OR sub-expression** — entries like
`(Apache-2.0 OR MIT) AND BSD-3-Clause`. Do **not** add these as compound terms;
their component licenses are already covered as separate entries. Discard after
confirming all components are present in the list.

## Step 5: Sort

Sort all entries by their inner expression text (strip outer parens for the sort
key) using strict ASCII byte order:

```
( < 0-9 < A-Z < a-z
```

Practical consequences:
- Entries starting with a digit (`0BSD`) sort before uppercase letters
- Entries starting with a lowercase letter (`bzip2-1.0.6`) sort **after** all
uppercase entries — `bzip2-1.0.6` comes after `Zlib`, not between `BSL-1.0`
and `CC0-1.0`
- Among entries sharing the same prefix, the shorter one sorts first:
`Apache-2.0` → `Apache-2.0 AND ISC` → `Apache-2.0 OR ...`
- AND sorts before OR at the same prefix level (`A` < `O`)

## Step 6: Write the License Field

Replace the existing `License:` block with the sorted entries using the spec's
`%{shrink:}` pattern. The first entry has no `AND ` prefix; every subsequent
entry is prefixed with `AND `:

```
License: %{shrink:
(0BSD OR Apache-2.0 OR MIT)
AND Apache-2.0
AND (Apache-2.0 AND ISC)
AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR CC0-1.0)
...
AND Zlib
AND bzip2-1.0.6
}
```

## Step 7: Verify

Compare the new field against the old one and account for every difference:

- **Entry removed** — confirm no matching comment block entry exists (stale from
a prior version)
- **Entry added** — confirm it maps to a comment block entry
- **AND ↔ OR change** — always a substantive correction; note it explicitly
- **Reordered only** — cosmetic, no action needed
79 changes: 0 additions & 79 deletions 0000-Add-tui-feature-flag-for-tui-command.patch

This file was deleted.

37 changes: 18 additions & 19 deletions 0001-Strip-non-Linux-deps-and-use-system-libraries.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From 52a210785751e703397f42554b5d653c7f85dab2 Mon Sep 17 00:00:00 2001
From: Rodolfo Olivieri <rolivier@redhat.com>
Date: Thu, 28 May 2026 09:00:28 -0300
Subject: [PATCH] strip non-linux
From 50bf2e0a81cf7aa02f5bb4e2a5a1fc7a3521a8e4 Mon Sep 17 00:00:00 2001
From: Sam Doran <sdoran@redhat.com>
Date: Tue, 23 Jun 2026 10:42:47 -0400
Subject: [PATCH] Strip non-Linux deps and use system libraries

---
Cargo.toml | 10 ++--------
Cargo.toml | 9 ++-------
crates/goose-cli/Cargo.toml | 4 ----
crates/goose-server/Cargo.toml | 3 ---
crates/goose/Cargo.toml | 11 -----------
4 files changed, 2 insertions(+), 26 deletions(-)
4 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 27e8432..bb1bd7e 100644
index e69de25..f5d7fb1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,6 @@
Expand All @@ -29,31 +29,30 @@ index 27e8432..bb1bd7e 100644
indoc = { version = "2", default-features = false }
-keyring = { version = "3.6.3", default-features = false, features = ["vendored"] }
+keyring = { version = "3.6.3", default-features = false }
lru = { version = "0.16", default-features = false }
lru = { version = "0.18", default-features = false }
once_cell = { version = "1.21.3", default-features = false, features = ["std"] }
rand = { version = "0.8.5", default-features = false, features = ["std"] }
@@ -72,7 +70,7 @@ utoipa = { version = "4.2", default-features = false }
uuid = { version = "1.18", default-features = false, features = ["v4", "std"] }
uuid = { version = "1.23", default-features = false, features = ["v4", "std"] }
webbrowser = { version = "1", default-features = false }
which = { version = "8", default-features = false, features = ["real-sys"] }
-winapi = { version = "0.3.9", default-features = false, features = ["wincred", "std"] }
+
wiremock = { version = "0.6", default-features = false }
zip = { version = "8", default-features = false, features = ["deflate"] }
serial_test = { version = "3", default-features = false }
@@ -109,7 +107,3 @@ llama-cpp-sys-2 = { version = "=0.1.146", default-features = false }
# They are just here to pin the version, and can be removed if PCTX updates temporal_rs
@@ -110,6 +108,3 @@ llama-cpp-sys-2 = { version = "=0.1.146", default-features = false }
icu_calendar = { version = "=2.1.1", default-features = false }
icu_locale = { version = "=2.1.1", default-features = false }
-
-[patch.crates-io]
-v8 = { path = "vendor/v8" }
-cudaforge = { git = "https://github.com/jbg/cudaforge", rev = "e7c1967340e40673db98dc9e17da0f04834a456f" }
diff --git a/crates/goose-cli/Cargo.toml b/crates/goose-cli/Cargo.toml
index e6c704e..0de4e1f 100644
index 2f33e21..9290c5c 100644
--- a/crates/goose-cli/Cargo.toml
+++ b/crates/goose-cli/Cargo.toml
@@ -65,10 +65,6 @@ sigstore-verify = { version = "0.8", default-features = false, optional = true }
@@ -66,10 +66,6 @@ sigstore-verify = { version = "0.8", default-features = false, optional = true }
axum.workspace = true
clap_complete_nushell = { version = "4", default-features = false }

Expand All @@ -65,7 +64,7 @@ index e6c704e..0de4e1f 100644
default = [
"code-mode",
diff --git a/crates/goose-server/Cargo.toml b/crates/goose-server/Cargo.toml
index c1f04fc..30bd3cd 100644
index add298a..0fe99a5 100644
--- a/crates/goose-server/Cargo.toml
+++ b/crates/goose-server/Cargo.toml
@@ -91,9 +91,6 @@ aws-lc-rs = { version = "1.17", default-features = false, optional = true }
Expand All @@ -79,12 +78,12 @@ index c1f04fc..30bd3cd 100644
name = "goosed"
path = "src/main.rs"
diff --git a/crates/goose/Cargo.toml b/crates/goose/Cargo.toml
index fccd7db..e0528d1 100644
index 47f172b..1ceee51 100644
--- a/crates/goose/Cargo.toml
+++ b/crates/goose/Cargo.toml
@@ -216,17 +216,6 @@ icu_calendar = { version = "=2.1.1", default-features = false }
icu_locale = { version = "=2.1.1", default-features = false }
llama-cpp-sys-2 = { workspace = true, optional = true }
@@ -218,17 +218,6 @@ image = { version = "0.24.9", default-features = false, features = ["png", "jpeg
subtle = { version = "2.5", default-features = false, features = ["std"] }
gethostname = "1.1.0"

-[target.'cfg(target_os = "windows")'.dependencies]
-winapi = { workspace = true }
Expand Down
18 changes: 9 additions & 9 deletions 0002-Set-downstream-feature-flags.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 06529a6c6c9918dcd72c3445e3e644e828a84004 Mon Sep 17 00:00:00 2001
From: Rodolfo Olivieri <rolivier@redhat.com>
Date: Thu, 28 May 2026 09:02:19 -0300
From d9a0356b5f8cb3cfc3bd8555d6471e41fdcc1783 Mon Sep 17 00:00:00 2001
From: Sam Doran <sdoran@redhat.com>
Date: Tue, 23 Jun 2026 10:45:09 -0400
Subject: [PATCH] Set downstream feature flags

---
Expand All @@ -10,10 +10,10 @@ Subject: [PATCH] Set downstream feature flags
3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/crates/goose-cli/Cargo.toml b/crates/goose-cli/Cargo.toml
index 0de4e1f..8644578 100644
index 9290c5c..54d9542 100644
--- a/crates/goose-cli/Cargo.toml
+++ b/crates/goose-cli/Cargo.toml
@@ -67,16 +67,11 @@ clap_complete_nushell = { version = "4", default-features = false }
@@ -68,16 +68,11 @@ clap_complete_nushell = { version = "4", default-features = false }

[features]
default = [
Expand All @@ -33,7 +33,7 @@ index 0de4e1f..8644578 100644
code-mode = ["goose/code-mode"]
local-inference = ["goose/local-inference"]
diff --git a/crates/goose-server/Cargo.toml b/crates/goose-server/Cargo.toml
index 30bd3cd..1d61efb 100644
index 0fe99a5..1236141 100644
--- a/crates/goose-server/Cargo.toml
+++ b/crates/goose-server/Cargo.toml
@@ -13,13 +13,9 @@ workspace = true
Expand All @@ -52,10 +52,10 @@ index 30bd3cd..1d61efb 100644
]
code-mode = ["goose/code-mode"]
diff --git a/crates/goose/Cargo.toml b/crates/goose/Cargo.toml
index e0528d1..be0e805 100644
index 1ceee51..8b8bdcd 100644
--- a/crates/goose/Cargo.toml
+++ b/crates/goose/Cargo.toml
@@ -129,7 +129,7 @@ tokio-cron-scheduler = { version = "0.15", default-features = false }
@@ -130,7 +130,7 @@ tokio-cron-scheduler = { version = "0.15", default-features = false }
urlencoding = { workspace = true }
v_htmlescape = { version = "0.17", default-features = false, features = ["std"] }
sqlx = { version = "0.8.5", default-features = false, features = [
Expand All @@ -64,6 +64,6 @@ index e0528d1..be0e805 100644
"chrono",
"json",
"macros",
--
--
2.54.0

25 changes: 25 additions & 0 deletions 0003-Downgrade-pkcs8-to-0.10.2-for-native-tls-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 73f80f1b0bcac2bf94db0126f3115ad8b8e8c2b9 Mon Sep 17 00:00:00 2001
From: Sam Doran <github@samdoran.com>
Date: Wed, 24 Jun 2026 15:17:32 -0400
Subject: [PATCH] Downgrade pkcs8 to 0.10.2 for native-tls compatibility

---
crates/goose/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/goose/Cargo.toml b/crates/goose/Cargo.toml
index 47f172b..04da822 100644
--- a/crates/goose/Cargo.toml
+++ b/crates/goose/Cargo.toml
@@ -195,7 +195,7 @@ pastey = { version = "0.2", default-features = false }
shell-words = { workspace = true }
pem = { version = "3.0.2", default-features = false, features = ["std"], optional = true }
pkcs1 = { version = "0.7.5", default-features = false, features = ["pkcs8", "std"], optional = true }
-pkcs8 = { version = "0.11.0", default-features = false, features = ["alloc", "std"], optional = true }
+pkcs8 = { version = "0.10.2", default-features = false, features = ["alloc", "std"], optional = true }
sec1 = { version = "0.7", default-features = false, features = ["der", "pkcs8", "std"], optional = true }
goose-acp-macros = { path = "../goose-acp-macros", default-features = false }
tower-http = { workspace = true, features = ["cors"] }
--
2.54.0

Loading