Skip to content

fix(output): llmstxt section header produces "Itemss" when entity_type unset#102

Merged
greynewell merged 1 commit intomainfrom
fix-llmstxt-double-plural
Apr 9, 2026
Merged

fix(output): llmstxt section header produces "Itemss" when entity_type unset#102
greynewell merged 1 commit intomainfrom
fix-llmstxt-double-plural

Conversation

@greynewell
Copy link
Copy Markdown
Contributor

@greynewell greynewell commented Apr 9, 2026

Summary

  • GenerateLlmsTxt builds the entities section header as entityLabel + "s"
  • The fallback when cfg.Data.EntityType is empty was "Items" — already plural
  • This produced "## Itemss" as the default heading when no entity type is configured
  • Fix: change the default fallback from "Items" to "Item" so the computed header reads "## Items"

Test plan

  • TestGenerateLlmsTxt_DefaultEntityType: fails with old "Items" default, passes with "Item"
  • TestGenerateLlmsTxt_ConfiguredEntityType: entity_type: recipe## Recipes
  • TestGenerateLlmsTxt_EntityLinks: entity URLs use correct format
  • go test ./internal/archdocs/pssg/output/... passes
  • go build ./... passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed entity label pluralization in generated output headers.
  • Tests

    • Added unit tests for entity label pluralization and output generation validation.

…e unset

GenerateLlmsTxt built the section header as `entityLabel + "s"` where the
fallback for an unconfigured entity_type was "Items". This produced the
double-plural "## Itemss" as the default heading.

Fix: change the default fallback from "Items" to "Item" so that the
computed header reads "## Items".

Adds llmstxt_test.go covering the default and configured entity-type
cases plus entity URL formatting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41a211b7-f9d8-4c9b-bd0d-67cc273ca892

📥 Commits

Reviewing files that changed from the base of the PR and between ac01b6d and 8c81753.

📒 Files selected for processing (2)
  • internal/archdocs/pssg/output/llmstxt.go
  • internal/archdocs/pssg/output/llmstxt_test.go

Walkthrough

This change adjusts the default entity label in the llmstxt output generator from plural ("Items") to singular ("Item"), with corresponding test coverage added to validate pluralization behavior for default and custom entity types.

Changes

Cohort / File(s) Summary
Pluralization Logic Update
internal/archdocs/pssg/output/llmstxt.go
Changed default entityLabel from "Items" to "Item" when cfg.Data.EntityType is empty, affecting the generated section heading text.
Test Coverage
internal/archdocs/pssg/output/llmstxt_test.go
Added unit tests validating default pluralization (checks for "## Items"), custom entity pluralization (e.g., "recipe""## Recipes"), and entity link rendering with URL and description fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Singular to plural, a label takes flight,
From "Item" to "Items"—the pluralization rite,
Tests guard the transformation with care,
Recipes dance where Items once were there. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main bug fix: changing the default entity label to prevent double pluralization ('Itemss').
Description check ✅ Passed The description covers the bug, the fix, and includes test plan details, though it deviates slightly from the template structure with a 'Summary' section instead of 'What/Why/Test plan' headers.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-llmstxt-double-plural

Comment @coderabbitai help to get the list of available commands and usage tips.

@greynewell greynewell merged commit 09bef24 into main Apr 9, 2026
7 checks passed
@greynewell greynewell deleted the fix-llmstxt-double-plural branch April 9, 2026 18:43
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