Skip to content

[Bug]: Top-level defaults: in extension.yml, as documented and used in the extension template, is ignored by ConfigManager #5084

Open

Description

@hnipps

Bug Description

ConfigManager._get_extension_defaults reads defaults only from config.defaults in extension.yml (src/specify_cli/extensions/__init__.py:5329). The public docs and the extension template put them under a top-level defaults: key, which is silently ignored. An extension built from the template therefore has no defaults at runtime.

Either side could be the one to change. The code, design/extension.md:144 and the bundled extensions/git/extension.yml:137 use config: defaults:. These use a top-level defaults::

  • extensions/EXTENSION-API-REFERENCE.md:85,563
  • extensions/EXTENSION-DEVELOPMENT-GUIDE.md:249,386
  • extensions/template/extension.yml:105-107, which says "These are merged with user config"

Steps to Reproduce

Save this as repro.py and run uv run python -I repro.py from the repository root.

import tempfile
from pathlib import Path
from specify_cli.extensions import ConfigManager

proj = Path(tempfile.mkdtemp())
d = proj / ".specify/extensions/myext"
d.mkdir(parents=True)
(d / "extension.yml").write_text('schema_version: "1.0"\ndefaults:\n  feature:\n    enabled: true\n')
print("top-level defaults:", ConfigManager(proj, "myext").get_config())
(d / "extension.yml").write_text('schema_version: "1.0"\nconfig:\n  defaults:\n    feature:\n      enabled: true\n')
print("config.defaults:   ", ConfigManager(proj, "myext").get_config())

Expected Behavior

Per extensions/EXTENSION-API-REFERENCE.md:563 ("Extension Defaults (from extension.yml defaults section)") and extensions/template/extension.yml:105-107, the top-level defaults appear in get_config(). If config.defaults is the intended location, the docs and the template should use it.

Actual Behavior

top-level defaults: {}
config.defaults:    {'feature': {'enabled': True}}

Specify CLI Version

1.2.4.dev0 (main at 27d14e2)

AI Agent

Not applicable

Operating System

Linux 6.18 (Ubuntu container)

Python Version

Python 3.12.3

Additional Context

The manifest validator does not check either key, so neither form produces a warning.

Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.

AI Disclosure

Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.

Activity

  1. added
    triage-must-haveVerdict: high-value, important work for Spec Kit — do first
    on Oct 23, 2026
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

    triage-must-haveVerdict: high-value, important work for Spec Kit — do first

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions