Skip to content

Conversation

@kraitsura
Copy link
Contributor

Agents naturally try to use 'bd dep --blocks ' when establishing blocking relationships - a desire path revealing intuitive mental model for how dependencies should work.

Motivation

When AI agents set up dependency chains, they consistently attempt:
bd dep conduit-abc --blocks conduit-xyz

This reveals a desire path - the syntax users naturally reach for before reading documentation. Instead of fighting this intuition, we embrace it.

Changes

  • Add --blocks (-b) flag to the bd dep command
  • Support syntax: bd dep --blocks
  • Equivalent to: bd dep add
  • Full daemon and direct mode support
  • Cycle detection and child-parent anti-pattern checks
  • JSON output support for programmatic use

Backwards Compatibility

This is purely additive. The existing command structure remains:

  • 'bd dep add' subcommand works exactly as before
  • All other dep subcommands (remove, list, tree, cycles) unchanged
  • No breaking changes to existing workflows

Examples

bd dep bd-xyz --blocks bd-abc # bd-xyz blocks bd-abc
bd dep bd-xyz -b bd-abc # Same, using shorthand
bd dep add bd-abc bd-xyz # Original syntax still works

Testing

  • Added TestDepBlocksFlag for flag initialization
  • Added TestDepBlocksFlagFunctionality for semantic correctness
  • All existing tests pass

kraitsura and others added 2 commits January 3, 2026 23:18
Agents naturally try to use 'bd dep <blocker> --blocks <blocked>' when
establishing blocking relationships - a desire path revealing intuitive
mental model for how dependencies should work.

## Motivation

When AI agents set up dependency chains, they consistently attempt:
  bd dep conduit-abc --blocks conduit-xyz

This reveals a desire path - the syntax users naturally reach for before
reading documentation. Instead of fighting this intuition, we embrace it.

## Changes

- Add --blocks (-b) flag to the bd dep command
- Support syntax: bd dep <blocker-id> --blocks <blocked-id>
- Equivalent to: bd dep add <blocked-id> <blocker-id>
- Full daemon and direct mode support
- Cycle detection and child-parent anti-pattern checks
- JSON output support for programmatic use

## Backwards Compatibility

This is purely additive. The existing command structure remains:
- 'bd dep add' subcommand works exactly as before
- All other dep subcommands (remove, list, tree, cycles) unchanged
- No breaking changes to existing workflows

## Examples

  bd dep bd-xyz --blocks bd-abc    # bd-xyz blocks bd-abc
  bd dep bd-xyz -b bd-abc          # Same, using shorthand
  bd dep add bd-abc bd-xyz         # Original syntax still works

## Testing

- Added TestDepBlocksFlag for flag initialization
- Added TestDepBlocksFlagFunctionality for semantic correctness
- All existing tests pass
The daemon code path was returning early after adding the dependency,
skipping the cycle detection that runs for direct mode. Restructure
so both paths share the cycle detection and output code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link
Owner

@steveyegge steveyegge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the fix I pushed.

Fix applied: The daemon code path was returning early after AddDependency(), skipping the cycle detection that runs for direct mode. I restructured so both paths share the cycle detection and output code.

Note on CI: The lint failures are pre-existing baseline issues in unrelated files (gate.go, daemon_autostart.go, etc.) - not introduced by this PR. Those need a separate fix to the .golangci.yml exclusions.

Thanks for the contribution - this is a nice UX improvement for agents!

@steveyegge
Copy link
Owner

Merged via 6202711 after rebasing to resolve conflicts. Thanks @kraitsura!

@steveyegge steveyegge closed this Jan 5, 2026
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.

2 participants