chore(attribution): default to assisted-by + email (#1444)

Amolith created

Change summary

README.md                                     | 13 ++++++++-----
internal/agent/tools/bash.tpl                 |  2 +-
internal/config/attribution_migration_test.go |  4 ++--
internal/config/config.go                     |  2 +-
internal/config/load.go                       | 12 ++++++++----
schema.json                                   |  2 +-
6 files changed, 21 insertions(+), 14 deletions(-)

Detailed changes

README.md 🔗

@@ -374,11 +374,14 @@ it creates. You can customize this behavior with the `attribution` option:
 }
 ```
 
-- `trailer_style`: Controls the attribution trailer added to commit messages (default: `co-authored-by`)
-  - `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
-  - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush` (includes the model name)
-  - `none`: No attribution trailer
-- `generated_with`: When true (default), adds `💘 Generated with Crush` line to commit messages and PR descriptions
+- `trailer_style`: Controls the attribution trailer added to commit messages
+  (default: `assisted-by`)
+	- `assisted-by`: Adds `Assisted-by: [Model Name] via Crush <crush@charm.land>`
+	  (includes the model name)
+	- `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
+	- `none`: No attribution trailer
+- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
+  commit messages and PR descriptions
 
 ### Custom Providers
 

internal/agent/tools/bash.tpl 🔗

@@ -69,7 +69,7 @@ When user asks to create git commit:
 {{ end}}
 {{if eq .Attribution.TrailerStyle "assisted-by" }}
 
-   Assisted-by: {{ .ModelName }} via Crush
+   Assisted-by: {{ .ModelName }} via Crush <crush@charm.land>
 {{ else if eq .Attribution.TrailerStyle "co-authored-by" }}
 
    Co-Authored-By: Crush <crush@charm.land>

internal/config/attribution_migration_test.go 🔗

@@ -66,7 +66,7 @@ func TestAttributionMigration(t *testing.T) {
 					}
 				}
 			}`,
-			expectedTrailer:  TrailerStyleCoAuthoredBy,
+			expectedTrailer:  TrailerStyleAssistedBy,
 			expectedGenerate: true,
 		},
 		{
@@ -74,7 +74,7 @@ func TestAttributionMigration(t *testing.T) {
 			configJSON: `{
 				"options": {}
 			}`,
-			expectedTrailer:  TrailerStyleCoAuthoredBy,
+			expectedTrailer:  TrailerStyleAssistedBy,
 			expectedGenerate: true,
 		},
 	}

internal/config/config.go 🔗

@@ -177,7 +177,7 @@ const (
 )
 
 type Attribution struct {
-	TrailerStyle  TrailerStyle `json:"trailer_style,omitempty" jsonschema:"description=Style of attribution trailer to add to commits,enum=none,enum=co-authored-by,enum=assisted-by,default=co-authored-by"`
+	TrailerStyle  TrailerStyle `json:"trailer_style,omitempty" jsonschema:"description=Style of attribution trailer to add to commits,enum=none,enum=co-authored-by,enum=assisted-by,default=assisted-by"`
 	CoAuthoredBy  *bool        `json:"co_authored_by,omitempty" jsonschema:"description=Deprecated: use trailer_style instead"`
 	GeneratedWith bool         `json:"generated_with,omitempty" jsonschema:"description=Add Generated with Crush line to commit messages and issues and PRs,default=true"`
 }

internal/config/load.go 🔗

@@ -353,15 +353,19 @@ func (c *Config) setDefaults(workingDir, dataDir string) {
 
 	if c.Options.Attribution == nil {
 		c.Options.Attribution = &Attribution{
-			TrailerStyle:  TrailerStyleCoAuthoredBy,
+			TrailerStyle:  TrailerStyleAssistedBy,
 			GeneratedWith: true,
 		}
 	} else if c.Options.Attribution.TrailerStyle == "" {
 		// Migrate deprecated co_authored_by or apply default
-		if c.Options.Attribution.CoAuthoredBy != nil && !*c.Options.Attribution.CoAuthoredBy {
-			c.Options.Attribution.TrailerStyle = TrailerStyleNone
+		if c.Options.Attribution.CoAuthoredBy != nil {
+			if *c.Options.Attribution.CoAuthoredBy {
+				c.Options.Attribution.TrailerStyle = TrailerStyleCoAuthoredBy
+			} else {
+				c.Options.Attribution.TrailerStyle = TrailerStyleNone
+			}
 		} else {
-			c.Options.Attribution.TrailerStyle = TrailerStyleCoAuthoredBy
+			c.Options.Attribution.TrailerStyle = TrailerStyleAssistedBy
 		}
 	}
 	if c.Options.InitializeAs == "" {

schema.json 🔗

@@ -13,7 +13,7 @@
             "assisted-by"
           ],
           "description": "Style of attribution trailer to add to commits",
-          "default": "co-authored-by"
+          "default": "assisted-by"
         },
         "co_authored_by": {
           "type": "boolean",