Skip to content

Auto-generate all_blueprints.py via pre-commit hook (mark as read-only) #1275

@spomichter

Description

@spomichter

Issue

all_blueprints.py is frequently out of date because developers add new blueprints but forget to regenerate the file. This causes CI failures.

Current workflow:

  • Developer creates a new blueprint
  • CI fails with all_blueprints.py is out of date
  • Developer has to manually run pytest dimos/robot/test_all_blueprints_generation.py locally

Root cause: The blueprint scanner (_scan_for_blueprints) works, but it's not automated.

Solution

  1. Add pre-commit hook to auto-generate all_blueprints.py before every commit
  2. Mark all_blueprints.py as READ ONLY with a prominent comment:
    # ⚠️ DO NOT EDIT THIS FILE MANUALLY
    # This file is auto-generated by the pre-commit hook.
    # To add a blueprint, create it in the appropriate location and it will be picked up automatically.
    # Run `pytest dimos/robot/test_all_blueprints_generation.py` to regenerate manually if needed.
  3. Document blueprint registration — clear instructions on:
    • Where to place blueprint files so they're auto-detected
    • Naming conventions the scanner expects
    • How the scanner works (_scan_for_blueprints)

Tasks

  • Add pre-commit hook that runs the blueprint scanner
  • Auto-stage all_blueprints.py if changed by hook
  • Add READ ONLY warning comment to generated file
  • Document blueprint registration process in docs/development/blueprints.md (or similar)
  • Verify hook works in local dev and doesn't break CI

Context

CI Error Example:

FAILED dimos/robot/test_all_blueprints_generation.py::test_all_blueprints_is_current
all_blueprints.py is out of date. Run pytest dimos/robot/test_all_blueprints_generation.py locally to update.

Current scanner location: dimos/robot/test_all_blueprints_generation.py
Generated file: dimos/robot/all_blueprints.py

The scanner already works — just needs automation via pre-commit.

Linear Issue: DIM-544

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions