Skip to content

tickets.py: when active_initiative is unset and the store holds exactly one initiative, use it instead of failing #3396

Backlog

Description

@peterstarbek

Describe your idea
When core.active_initiative is not set and {output_folder} holds exactly one top-level container (program-*, initiative-* or epic-*), tickets.py and the skills that read the active initiative should use that container and say so in their output. With no container or several, keep today's error.

Why is this needed?
Context: each of our projects has one initiative. Several people work on it, and an unattended loop runs on its own machine.

active_initiative is personal: the initiative step writes it to _bmad/custom/config.user.toml (initiative.md:9), the migration checks it there (migration-1.toml:215), and the team guide says to keep it out of the committed team file (adopt-bmad-across-a-team.md:102). That makes sense when people switch between several initiatives.

With one initiative it means that every fresh clone starts without one: a teammate's checkout after the migration is merged, a CI job, the loop machine. A linked worktree falls back to the main checkout's personal file, but a fresh clone has nothing to fall back to. Then tickets.py stops with "no active initiative: set core.active_initiative in _bmad/custom/config.user.toml, or pass a folder" (tickets.py:1462). Each person sets the same value by hand, and every unattended machine needs a setup step for it, although there is only one possible answer.

Today we work around it by writing the value to the team file _bmad/custom/config.toml when a project has exactly one initiative. That goes against the guide above, and we would drop it if tickets.py did the fallback.

Alternatives considered:

  • A team value in _bmad/custom/config.toml (what we do now): works, but the guide advises against it, and it has to be removed by hand when a second initiative arrives.
  • A setup step on every clone and machine: easy to forget, and the error only shows up mid-session.

How should it work?

  • In active_initiative() in tickets.py: when the key is missing or empty, list the top-level program-*, initiative-* and epic-* folders under {output_folder} that hold their same-named file. With exactly one, use it and add "active_initiative_source": "only container" (or similar) to the output. Otherwise raise today's error.
  • Skills that resolve the active initiative through resolve_config.py and not through tickets.py get the same rule, or a one-line note in initiative.md that the single container is used when none is set.
  • A value set in either config file always wins, so nothing changes for projects with several initiatives.

PR
Happy to contribute a PR against main if a maintainer confirms the shape; I won't open one without that.

Additional context

  • Lines are cited at v7.2.0 (c978bf85). We hit this on 7.1.0, in a fresh clone of a migrated project.
  • The checklist item at migration-1.toml:215 could then accept "set, or the only container".

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