Skip to content

fix: preserve group fields in compact output - #2

Open
beausterling wants to merge 1 commit into
Robj1925:mainfrom
beausterling:fix/compact-group-fields
Open

fix: preserve group fields in compact output#2
beausterling wants to merge 1 commit into
Robj1925:mainfrom
beausterling:fix/compact-group-fields

Conversation

@beausterling

@beausterling beausterling commented Aug 12, 2026

Copy link
Copy Markdown

Preserve Skool group identity in compact agent output

Status: Ready for review
Scope: Compact JSON field selection for me groups
User-visible fix: skool-pp-cli me groups --agent returns useful group objects instead of {}
Risk: Low; only three identity fields are added to the compact allowlist

Human summary

me groups emits title-cased identity fields—Hash, Name, and Slug—but compact mode only retained lowercase generic fields. Because --agent enables compact mode automatically, every accessible community was rendered as an empty object.

This PR preserves those three fields and adds a regression test. A live authenticated check returned all 10 accessible communities with complete compact identity data.

Problem

Expected:

[
  {
    "Hash": "97d0633486794bc8a486f31f2ff4be2d",
    "Name": "GenHQ - Creative AI Education",
    "Slug": "genhq"
  }
]

Actual before this change:

[
  {},
  {},
  {}
]

The non-agent command worked because it did not apply compact field filtering:

skool-pp-cli me groups --json

The agent-oriented equivalent lost all identity data:

skool-pp-cli me groups --agent

Root cause

newMeGroupsCmd constructs objects with these keys:

Hash
Name
Slug

compactListFields used a case-sensitive allowlist containing generic lowercase keys such as:

id
name
title
status

None of the fields emitted by me groups matched the allowlist, so compact mode retained no fields.

Changes

File Change Purpose
internal/cli/helpers.go Add Hash, Name, and Slug to the compact list allowlist Preserve group identity in --compact and --agent output
internal/cli/helpers_test.go Add TestCompactListFieldsPreservesMeGroupIdentity Prevent regression to empty objects and prove verbose fields remain omitted
.printing-press-patches.json Catalog the generated-tree customization Follow the local contribution contract in AGENTS.md

The source change includes a // PATCH: annotation so it can be identified during future Printing Press regeneration.

Behavior matrix

Command or input Before After
me groups --json Full group identities Unchanged
me groups --agent Array of empty objects Hash, Name, and Slug retained
Generic compact arrays using lowercase fields Works Unchanged
Verbose fields such as description Omitted Still omitted

Automated validation

Targeted regression test:

go test -vet=off ./internal/cli \
  -run TestCompactListFieldsPreservesMeGroupIdentity -v

Result:

=== RUN   TestCompactListFieldsPreservesMeGroupIdentity
--- PASS: TestCompactListFieldsPreservesMeGroupIdentity
PASS

Build validation:

go build ./cmd/skool-pp-cli ./cmd/skool-pp-mcp

Both entry points build successfully.

Live integration validation

Using an authenticated account with 10 accessible Skool communities:

skool-pp-cli me groups --agent

Verified assertions:

live compact groups: 10
fields: [Hash Name Slug]

No credential values or community member data are included in this PR.

Baseline dependency note

At the current main baseline, unrestricted go test ./... and go vet ./... encounter two unrelated pre-existing vet failures:

internal/cli/auth.go: non-constant format string in call to fmt.Errorf
internal/cli/install.go: fmt.Errorf format %w has arg binDir of wrong type string

Those failures are fixed independently in #1. This PR intentionally does not duplicate or depend on those source changes; its targeted test disables vet only to isolate this regression against the current baseline.

Once #1 is merged, the full suite can run without that baseline exception.

Security and privacy

  • No cookies, HAR files, API keys, configuration files, member records, or private community content are committed.
  • This changes output selection only; it does not add network calls or permissions.
  • The live test was read-only.

Compatibility

  • No command names, flags, API paths, or persisted schemas changed.
  • Existing lowercase compact fields remain supported.
  • Output only becomes more informative for objects that contain the title-cased Skool group identity fields.

Review guide

Recommended review order:

  1. Compare the fields emitted in internal/cli/me.go with the allowlist change in internal/cli/helpers.go.
  2. Review the regression test's positive assertions for Hash, Name, and Slug.
  3. Review its negative assertion that description remains omitted.
  4. Confirm the generated-tree patch catalog matches AGENTS.md.

Follow-up opportunity

A future systemic Printing Press improvement could normalize generated identity keys or make compact matching schema-aware/case-tolerant. This PR remains deliberately narrow to fix the observed Skool CLI behavior without changing compact semantics globally.

@beausterling
beausterling force-pushed the fix/compact-group-fields branch from 370088d to bff7909 Compare August 12, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant