Skip to content
Open
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
18 changes: 18 additions & 0 deletions .printing-press-patches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"schema_version": 1,
"applied_at": "2026-08-11",
"base_run_id": "metadata-not-present",
"base_printing_press_version": "metadata-not-present",
"patches": [
{
"id": "compact-me-groups-fields",
"summary": "Preserve group identity fields in compact me groups output.",
"reason": "The command emits title-cased fields, causing --agent compact output to return empty objects.",
"files": [
"internal/cli/helpers.go",
"internal/cli/helpers_test.go"
],
"validated_outcome": "Compact output retains Hash, Name, and Slug while omitting verbose fields."
}
]
}
2 changes: 2 additions & 0 deletions internal/cli/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ func compactFields(data json.RawMessage) json.RawMessage {
func compactListFields(items []map[string]any) json.RawMessage {
keepFields := map[string]bool{
"id": true, "name": true, "title": true, "identifier": true,
// PATCH: Preserve the title-cased identity fields emitted by `me groups`.
"Hash": true, "Name": true, "Slug": true,
"status": true, "state": true, "type": true, "priority": true,
"url": true, "email": true, "key": true,
"created_at": true, "updated_at": true, "createdAt": true, "updatedAt": true,
Expand Down
33 changes: 33 additions & 0 deletions internal/cli/helpers_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cli

import (
"encoding/json"
"testing"
)

func TestCompactListFieldsPreservesMeGroupIdentity(t *testing.T) {
input := []map[string]any{
{
"Hash": "97d0633486794bc8a486f31f2ff4be2d",
"Name": "GenHQ - Creative AI Education",
"Slug": "genhq",
"description": "verbose field that compact output should omit",
},
}

var got []map[string]any
if err := json.Unmarshal(compactListFields(input), &got); err != nil {
t.Fatalf("decode compact output: %v", err)
}
if len(got) != 1 {
t.Fatalf("expected one group, got %d", len(got))
}
for _, field := range []string{"Hash", "Name", "Slug"} {
if got[0][field] == "" {
t.Errorf("expected %s to survive compact output, got %#v", field, got[0])
}
}
if _, ok := got[0]["description"]; ok {
t.Errorf("description should be omitted from compact output: %#v", got[0])
}
}