Add two-clone collision test proving beads multi-agent workflow failure

- Creates TestTwoCloneCollision integration test
- Sets up 2 independent clones with git hooks and daemons
- Both file issues with same ID (test-1)
- Demonstrates databases don't converge after collision resolution
- Clone A: test-1='Issue from clone A', test-2='Issue from clone B'
- Clone B: test-1='Issue from clone B', test-2='Issue from clone A'
- Git status shows dirty state in both clones
- Test proves beads fails at basic multi-agent workflow

Also adds --json flag to create, ready, and list commands for
better test integration.

Amp-Thread-ID: https://ampcode.com/threads/T-8fa0ab6c-2226-4f9b-8e11-14e1156537fc
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-28 11:34:27 -07:00
parent e75f8c77a2
commit a4eb4fe451
4 changed files with 285 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ var createCmd = &cobra.Command{
externalRef, _ := cmd.Flags().GetString("external-ref")
deps, _ := cmd.Flags().GetStringSlice("deps")
forceCreate, _ := cmd.Flags().GetBool("force")
jsonOutput, _ := cmd.Flags().GetBool("json")
// Validate explicit ID format if provided (prefix-number)
if explicitID != "" {
@@ -245,5 +246,6 @@ func init() {
createCmd.Flags().String("external-ref", "", "External reference (e.g., 'gh-9', 'jira-ABC')")
createCmd.Flags().StringSlice("deps", []string{}, "Dependencies in format 'type:id' or 'id' (e.g., 'discovered-from:bd-20,blocks:bd-15' or 'bd-20')")
createCmd.Flags().Bool("force", false, "Force creation even if prefix doesn't match database prefix")
createCmd.Flags().Bool("json", false, "Output JSON format")
rootCmd.AddCommand(createCmd)
}

View File

@@ -46,6 +46,7 @@ var listCmd = &cobra.Command{
labelsAny, _ := cmd.Flags().GetStringSlice("label-any")
titleSearch, _ := cmd.Flags().GetString("title")
idFilter, _ := cmd.Flags().GetString("id")
jsonOutput, _ := cmd.Flags().GetBool("json")
// Normalize labels: trim, dedupe, remove empty
labels = normalizeLabels(labels)
@@ -211,6 +212,7 @@ func init() {
listCmd.Flags().IntP("limit", "n", 0, "Limit results")
listCmd.Flags().String("format", "", "Output format: 'digraph' (for golang.org/x/tools/cmd/digraph), 'dot' (Graphviz), or Go template")
listCmd.Flags().Bool("all", false, "Show all issues (default behavior; flag provided for CLI familiarity)")
listCmd.Flags().Bool("json", false, "Output JSON format")
rootCmd.AddCommand(listCmd)
}

View File

@@ -20,6 +20,7 @@ var readyCmd = &cobra.Command{
limit, _ := cmd.Flags().GetInt("limit")
assignee, _ := cmd.Flags().GetString("assignee")
sortPolicy, _ := cmd.Flags().GetString("sort")
jsonOutput, _ := cmd.Flags().GetBool("json")
filter := types.WorkFilter{
// Leave Status empty to get both 'open' and 'in_progress' (bd-165)
@@ -293,6 +294,7 @@ func init() {
readyCmd.Flags().IntP("priority", "p", 0, "Filter by priority")
readyCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
readyCmd.Flags().StringP("sort", "s", "hybrid", "Sort policy: hybrid (default), priority, oldest")
readyCmd.Flags().Bool("json", false, "Output JSON format")
rootCmd.AddCommand(readyCmd)
rootCmd.AddCommand(blockedCmd)