CLI leaks unrellated message about unrecognized section

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli, content

Research direction

Start with internal/content/sections.go, especially RecognizedContextSections and ValidateContextSections, then inspect content/packs/cap/context.md around the Preparing for CAP 10 heading. Run sap-devs mcp status and related CLI commands to reproduce the stderr warning. Done means the CAP section is handled consistently and shared commands no longer emit the unrelated unrecognized-section message.

Written by the indexing model from the issue text.

Description

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/.
Dominant language
Go
Stars
22
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SAP-samples/sap-devs-cli

All issues in SAP-samples/sap-devs-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.