Commit graph

5 commits

Author SHA1 Message Date
Julian Knutsen
ca67253d7b
fix: validate graph plan node types against custom types (#2874)
graph_apply used IsValid() to check node types, which only accepts
built-in types (task, bug, feature, etc.). User-configured custom
types (spec, session, agent, etc.) were rejected with "invalid type".

Use IsValidWithCustom() instead, loading custom types from the store
config or config.yaml fallback — the same pattern used by list and
update commands.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:27:04 -07:00
julianknutsen
05a967c0d7 refactor: move graph-apply to bd create --graph
Replace standalone `bd graph-apply` subcommand with `bd create --graph
<plan-file>` flag, consistent with the existing `bd create -f` (markdown)
pattern. The graph plan format and transactional execution are unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:32:10 -07:00
julianknutsen
6e1e65c604 fix: address round 2 review findings
- Default priority to P2 (was Go zero-value P0/critical)
- Persist labels via tx.AddLabel (CreateIssues tx path drops them)
- Validate IssueType and DependencyType against known constants
- Deterministic output ordering (sort keys before printing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:32:10 -07:00
julianknutsen
8e07783ff4 fix: address review findings for graph-apply
- Use RunInTransaction for true atomicity (blocker: partial graph on failure)
- Validate duplicate node keys upfront (major: silent key overwrite)
- Remove dead first-pass MetadataRef resolution (keyToID was empty)
- Remove unused From field and Edge.Metadata (dead API surface)
- Pre-validate all edge refs, parent keys, and metadata refs before writes
- commit_message now correctly controls the single transaction commit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:32:10 -07:00
julianknutsen
fb99e894aa feat: add bd graph-apply for batch issue creation
Adds a new `bd graph-apply --plan-file <path>` command that atomically
creates a graph of issues with dependencies in a single transaction.
Uses the existing store.CreateIssues() batch path for the bulk insert,
then resolves symbolic key references for edges, parent-child deps,
metadata cross-refs, and deferred assignees.

This is the bd-side counterpart to gascity's GraphApplyStore interface,
replacing N sequential bd create + bd dep add subprocess calls with a
single bd invocation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:32:10 -07:00