Skip to content

Conversation

@hmans
Copy link
Owner

@hmans hmans commented Dec 12, 2025

Summary

  • Replace generic links array with explicit parent (scalar) and blocks (array) fields
  • Remove "duplicates" and "related" link types entirely
  • Add parent type validation to enforce hierarchy rules
  • Simplify CLI flags: --parent, --no-parent, --block, --unblock
  • Clean up GraphQL API with direct field access instead of generic Link type

Breaking Changes

YAML Format

# Before
links:
  - parent: beans-abc
  - blocks: beans-xyz

# After
parent: beans-abc
blocks:
  - beans-xyz

CLI

  • --link parent:<id>--parent <id>
  • --link blocks:<id>--block <id>
  • --unlink parent:<id>--no-parent
  • --unlink blocks:<id>--unblock <id>

GraphQL

  • addLink/removeLink mutations → setParent/addBlock/removeBlock
  • Link type removed
  • Bean.linksBean.parent and Bean.blocks

Parent Type Validation

Bean Type Allowed Parent Types
milestone (none - cannot have parent)
epic milestone
feature milestone, epic
task/bug milestone, epic, feature

Migration

Old beans with links array will be automatically migrated when read and saved in the new format. "duplicates" and "related" links will be silently dropped.

Test plan

  • All unit tests pass (go test ./...)
  • Build succeeds (mise build)
  • Manual testing with CLI commands
  • Verified YAML format changes
  • Verified GraphQL queries work correctly

Replace generic `links` array with explicit `parent` (scalar) and `blocks` (array) fields.

Breaking changes:
- YAML format: `links` array replaced with `parent` and `blocks` fields
- CLI: `--link type:id` replaced with `--parent id` and `--block id`
- CLI: `--unlink type:id` replaced with `--no-parent` and `--unblock id`
- GraphQL: `addLink`/`removeLink` mutations replaced with `setParent`/`addBlock`/`removeBlock`
- GraphQL: `Link` type removed, `Bean` type now has `parent` and `blocks` fields directly
- Removed "duplicates" and "related" link types entirely

New features:
- Parent type validation enforces hierarchy rules (milestone cannot have parent, epic can only have milestone as parent, etc.)
- Simpler YAML format: `parent: <id>` and `blocks: [<id>, ...]`
- Cleaner GraphQL API with direct field access

Migration:
- Old beans with `links` array will be automatically migrated when read
- "duplicates" and "related" links will be silently dropped during migration

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

Co-Authored-By: Claude <noreply@anthropic.com>
@hmans hmans force-pushed the simplify-bean-linking branch from 7517424 to a293ee5 Compare December 12, 2025 16:19
hmans and others added 5 commits December 12, 2025 17:25
- Migrate beans-thi to use `parent:` instead of `links: - parent:`
- Update prompt.tmpl to document new relationship model
- Replace old GraphQL filter examples (linkedAs, noLinks) with new ones (isBlocked, noParent)
- Document --parent/--no-parent CLI flags instead of --epic/--milestone
- Add filterByNotBlocked function to filters.go
- Update resolver to handle both true and false values for isBlocked
- Add test for isBlocked: false case
- Rename YAML frontmatter field from `blocks` to `blocking`
- Rename GraphQL fields: `blockIds` → `blockingIds`, `blocks` → `blocking`
- Rename GraphQL mutations: `addBlock` → `addBlocking`, `removeBlock` → `removeBlocking`
- Rename GraphQL filters: `hasBlocks` → `hasBlocking`, `noBlocks` → `noBlocking`
- Rename CLI flags: `--has-blocks` → `--has-blocking`, `--no-blocks` → `--no-blocking`
- Rename Go methods: `BlocksBean` → `IsBlocking`, `AddBlock` → `AddBlocking`, `RemoveBlock` → `RemoveBlocking`
- Update internal link type from "blocks" to "blocking"
- Add migration support for old `blocks` field in frontmatter

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Rename CLI flags for consistency with field names
- Harmonize flag descriptions between create and update commands
- Clarify "link" terminology in archive/delete help text to specify
  "parent or blocking" relationships
- Update prompt.tmpl documentation to match new flag names
- Rename --no-parent to --remove-parent
- Rename --unblocking to --remove-blocking
- Rename --untag to --remove-tag
- Add blockingId filter to GraphQL schema
- Remove unused Link type and migration code
- Remove KnownLinkTypes constant
- Clean up gqlgen.yml Link model binding
@hmans hmans merged commit 142631e into main Dec 12, 2025
1 check passed
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