Skip to content

CLI leaks unrellated message about unrecognized section #33

Description

@VishnAndr

When using sap-devs cli and exploring different commands, I noticed that some commands leak unrecognized section error.
For example, sap-devs mcp status shows sap-devs: pack "cap": unrecognized section "Preparing for CAP 10 (June 2026)"
How is it related exactly to my cli command?

Image

AI response:

It has nothing to do with mcp status specifically — that command just happens to trigger the shared content-loading path, and the warning is a content lint check that fires there.

The chain

  1. Nearly every sap-devs command (including all mcp subcommands) constructs a ContentLoader and calls LoadPacks(). Pack loading is shared plumbing, not command-specific.

  2. loadPack ([internal/content/pack.go:395-398](internal/content/pack.go)) reads each pack's context.md. For the cap pack that's content/packs/cap/context.md.

  3. Unless it's the sync-expanded variant, it calls ValidateContextSections(pack.ID, data).

  4. ValidateContextSections ([internal/content/sections.go:19-44](internal/content/sections.go)) regex-scans every ### (H3) heading and checks it against a hardcoded allow-list:

    Overview, Key Concepts, Best Practices, Anti-patterns, Code Examples
    
  5. content/packs/cap/context.md:41 has ### Preparing for CAP 10 (June 2026), which isn't on that list → it prints to stderr:

    sap-devs: pack "cap": unrecognized section "Preparing for CAP 10 (June 2026)"
    

What it means

  • Non-fatal. It's a lint warning on stderr. The pack still loads; ParseVerbositySections runs regardless, so that CAP 10 content is still parsed and injected (it's the same block that appears in your global CLAUDE.md).
  • It's a bug in the CLI/content, not your usage. Someone added the CAP 10 section to cap/context.md but never updated RecognizedContextSections in sections.go. The two are out of sync.
  • It "leaks" everywhere because the warning has no verbosity gate and goes to stderr, so it interleaves with whatever command you ran when packs load. You'd see the same line from tip, resources, inject --dry-run, etc.

Working around it

  • Cosmetic: redirect stderr, e.g. sap-devs mcp status 2>/dev/null.
  • Real fix (upstream): add the heading to RecognizedContextSections, or demote it to #### in the pack — H4 headings aren't validated. Editing the pack locally isn't durable since sap-devs sync overwrites ~/.cache/sap-devs/official/.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions