@jamesaphoenix/tx-cli 0.4.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/cli-exit.d.ts.map +1 -0
  2. package/dist/cli-exit.js.map +1 -0
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +40 -17
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/attempt.d.ts.map +1 -0
  8. package/dist/commands/attempt.js +4 -5
  9. package/dist/commands/attempt.js.map +1 -0
  10. package/dist/commands/bulk.d.ts.map +1 -0
  11. package/dist/commands/bulk.js +7 -8
  12. package/dist/commands/bulk.js.map +1 -0
  13. package/dist/commands/claim.d.ts.map +1 -0
  14. package/dist/commands/claim.js +3 -4
  15. package/dist/commands/claim.js.map +1 -0
  16. package/dist/commands/compact.d.ts.map +1 -0
  17. package/dist/commands/compact.js.map +1 -0
  18. package/dist/commands/coordinator.d.ts.map +1 -0
  19. package/dist/commands/coordinator.js.map +1 -0
  20. package/dist/commands/cycle.d.ts +1 -3
  21. package/dist/commands/cycle.d.ts.map +1 -0
  22. package/dist/commands/cycle.js +28 -25
  23. package/dist/commands/cycle.js.map +1 -0
  24. package/dist/commands/daemon.d.ts +1 -1
  25. package/dist/commands/daemon.d.ts.map +1 -0
  26. package/dist/commands/daemon.js.map +1 -0
  27. package/dist/commands/dashboard.d.ts.map +1 -0
  28. package/dist/commands/dashboard.js.map +1 -0
  29. package/dist/commands/dashboard.test.d.ts +2 -0
  30. package/dist/commands/dashboard.test.d.ts.map +1 -0
  31. package/dist/commands/dashboard.test.js +99 -0
  32. package/dist/commands/dashboard.test.js.map +1 -0
  33. package/dist/commands/dep.d.ts.map +1 -0
  34. package/dist/commands/dep.js +2 -3
  35. package/dist/commands/dep.js.map +1 -0
  36. package/dist/commands/doc.d.ts +1 -1
  37. package/dist/commands/doc.d.ts.map +1 -0
  38. package/dist/commands/doc.js +0 -3
  39. package/dist/commands/doc.js.map +1 -0
  40. package/dist/commands/doctor.d.ts.map +1 -0
  41. package/dist/commands/doctor.js +1 -1
  42. package/dist/commands/doctor.js.map +1 -0
  43. package/dist/commands/graph.d.ts +1 -1
  44. package/dist/commands/graph.d.ts.map +1 -0
  45. package/dist/commands/graph.js.map +1 -0
  46. package/dist/commands/hierarchy.d.ts.map +1 -0
  47. package/dist/commands/hierarchy.js +2 -3
  48. package/dist/commands/hierarchy.js.map +1 -0
  49. package/dist/commands/hooks.d.ts +2 -2
  50. package/dist/commands/hooks.d.ts.map +1 -0
  51. package/dist/commands/hooks.js +22 -14
  52. package/dist/commands/hooks.js.map +1 -0
  53. package/dist/commands/invariant.d.ts +1 -1
  54. package/dist/commands/invariant.d.ts.map +1 -0
  55. package/dist/commands/invariant.js +4 -5
  56. package/dist/commands/invariant.js.map +1 -0
  57. package/dist/commands/learning.d.ts.map +1 -0
  58. package/dist/commands/learning.js +57 -14
  59. package/dist/commands/learning.js.map +1 -0
  60. package/dist/commands/migrate.d.ts.map +1 -0
  61. package/dist/commands/migrate.js.map +1 -0
  62. package/dist/commands/orchestrator.d.ts.map +1 -0
  63. package/dist/commands/orchestrator.js.map +1 -0
  64. package/dist/commands/outbox.d.ts +48 -0
  65. package/dist/commands/outbox.d.ts.map +1 -0
  66. package/dist/commands/outbox.js +186 -0
  67. package/dist/commands/outbox.js.map +1 -0
  68. package/dist/commands/stats.d.ts.map +1 -0
  69. package/dist/commands/stats.js.map +1 -0
  70. package/dist/commands/sync-platform.d.ts.map +1 -0
  71. package/dist/commands/sync-platform.js +3 -4
  72. package/dist/commands/sync-platform.js.map +1 -0
  73. package/dist/commands/sync.d.ts.map +1 -0
  74. package/dist/commands/sync.js +2 -3
  75. package/dist/commands/sync.js.map +1 -0
  76. package/dist/commands/task.d.ts.map +1 -0
  77. package/dist/commands/task.js +7 -8
  78. package/dist/commands/task.js.map +1 -0
  79. package/dist/commands/test.d.ts.map +1 -0
  80. package/dist/commands/test.js.map +1 -0
  81. package/dist/commands/trace.d.ts.map +1 -0
  82. package/dist/commands/trace.js +13 -14
  83. package/dist/commands/trace.js.map +1 -0
  84. package/dist/commands/validate.d.ts.map +1 -0
  85. package/dist/commands/validate.js +1 -2
  86. package/dist/commands/validate.js.map +1 -0
  87. package/dist/commands/worker.d.ts +1 -1
  88. package/dist/commands/worker.d.ts.map +1 -0
  89. package/dist/commands/worker.js.map +1 -0
  90. package/dist/help.d.ts.map +1 -0
  91. package/dist/help.js +884 -200
  92. package/dist/help.js.map +1 -0
  93. package/dist/output.d.ts.map +1 -0
  94. package/dist/output.js.map +1 -0
  95. package/dist/tx +0 -0
  96. package/dist/utils/parse.d.ts.map +1 -0
  97. package/dist/utils/parse.js.map +1 -0
  98. package/dist/utils/parse.test.d.ts +2 -0
  99. package/dist/utils/parse.test.d.ts.map +1 -0
  100. package/dist/utils/parse.test.js +140 -0
  101. package/dist/utils/parse.test.js.map +1 -0
  102. package/dist/version.d.ts.map +1 -0
  103. package/dist/version.js.map +1 -0
  104. package/package.json +4 -11
package/dist/help.js CHANGED
@@ -14,19 +14,20 @@ Tasks:
14
14
  show <id> Show task details
15
15
  update <id> Update task
16
16
  done <id> Mark task complete
17
- reset <id> Reset task to ready (recover from stuck)
17
+ reset <id> Reset task to ready
18
18
  delete <id> Delete task
19
+
20
+ Dependencies & Hierarchy:
19
21
  block <id> <blocker> Add blocking dependency
20
22
  unblock <id> <blocker> Remove blocking dependency
21
23
  children <id> List child tasks
22
24
  tree <id> Show task subtree
25
+
26
+ Attempts:
23
27
  try <id> <approach> Record an attempt on a task
24
28
  attempts <id> List attempts for a task
25
- claim Claim a task with a lease
26
- claim:release Release a claim on a task
27
- claim:renew Renew the lease on a claim
28
29
 
29
- Context & Learnings:
30
+ Memory:
30
31
  learning:add Add a learning
31
32
  learning:search Search learnings
32
33
  learning:recent List recent learnings
@@ -36,19 +37,29 @@ Context & Learnings:
36
37
  learn Attach a learning to file/glob pattern
37
38
  recall Query learnings for a path
38
39
 
39
- Sync:
40
+ Messages:
41
+ send Send a message to a channel
42
+ inbox Read messages from a channel
43
+ ack Acknowledge a message
44
+ ack:all Acknowledge all messages on a channel
45
+ outbox:pending Count pending messages on a channel
46
+ outbox:gc Garbage collect old messages
47
+
48
+ Docs:
49
+ doc <subcommand> Manage docs (add, edit, show, list, render, lock, version, link, attach, patch, validate, drift)
50
+ invariant <subcommand> Manage invariants (list, show, record, sync)
51
+
52
+ Cycle Scan:
53
+ cycle Run cycle-based issue discovery with sub-agent swarms
54
+
55
+ Sync & Data:
40
56
  sync export Export tasks to JSONL file
41
57
  sync import Import tasks from JSONL file
42
58
  sync status Show sync status
43
59
  sync claude Sync tasks to Claude Code team directory
44
- sync codex Sync tasks to Codex (coming soon)
45
-
46
- Traces:
47
- trace list Show recent runs with event counts
48
- trace show Show metrics events for a run
49
- trace transcript Display raw transcript content
50
- trace stderr Display stderr content
51
- trace errors Show recent errors across all runs
60
+ compact Compact completed tasks and export learnings
61
+ history View compaction history
62
+ migrate status Show database migration status
52
63
 
53
64
  Bulk Operations:
54
65
  bulk done <id...> Complete multiple tasks
@@ -56,36 +67,11 @@ Bulk Operations:
56
67
  bulk reset <id...> Reset multiple tasks to ready
57
68
  bulk delete <id...> Delete multiple tasks
58
69
 
59
- Docs:
60
- doc add <kind> <name> Create a doc (overview, prd, design)
61
- doc edit <name> Open doc YAML in $EDITOR
62
- doc show <name> Show doc details
63
- doc list List all docs
64
- doc render [name] Render MD files + regenerate index
65
- doc lock <name> Lock doc (immutable)
66
- doc version <name> Create new version from locked doc
67
- doc link <from> <to> Link two docs
68
- doc attach <task> <doc> Link task to doc
69
- doc patch <design> <n> Create design patch on locked doc
70
- doc validate Warn about unlinked tasks
71
- doc drift <name> Detect drift between doc and tasks
72
-
73
- Invariants:
74
- invariant list List all invariants
75
- invariant show <id> Show invariant details
76
- invariant record <id> Record pass/fail check result
77
- invariant sync Sync invariants from doc YAML to DB
78
-
79
- Cycle Scan:
80
- cycle Run cycle-based issue discovery scan
81
-
82
- Utilities:
70
+ Tools:
83
71
  stats Show queue metrics and health overview
84
72
  validate Run pre-flight database health checks
85
- migrate status Show database migration status
86
- doctor Run system diagnostics for troubleshooting
87
- dashboard Start API server + dashboard and open in browser
88
- mcp-server Start MCP server (JSON-RPC over stdio)
73
+ doctor Run system diagnostics
74
+ dashboard Start API server + dashboard
89
75
 
90
76
  Global Options:
91
77
  --json Output as JSON
@@ -579,8 +565,9 @@ Examples:
579
565
 
580
566
  Usage: tx learning:search <query> [options]
581
567
 
582
- Searches learnings using hybrid BM25 + vector search with RRF fusion.
583
- Returns results ranked by relevance.
568
+ Searches learnings using BM25 full-text search. Returns results ranked by
569
+ relevance (BM25 score) and recency. Supports graph expansion to discover
570
+ related learnings through the knowledge graph.
584
571
 
585
572
  Arguments:
586
573
  <query> Required. Search query (keywords or phrase)
@@ -588,12 +575,16 @@ Arguments:
588
575
  Options:
589
576
  -n, --limit <n> Maximum results (default: 10)
590
577
  --min-score <n> Minimum relevance score 0-1 (default: 0.3)
578
+ --expand Enable graph expansion to find related learnings
579
+ --depth <n> Graph expansion depth (default: 2)
580
+ --edge-types <types> Comma-separated edge types to traverse
591
581
  --json Output as JSON
592
582
  --help Show this help
593
583
 
594
584
  Examples:
595
585
  tx learning:search "database transactions"
596
- tx learning:search "authentication" -n 5 --json`,
586
+ tx learning:search "authentication" -n 5 --json
587
+ tx learning:search "auth" --expand --depth 3`,
597
588
  "learning:recent": `tx learning:recent - List recent learnings
598
589
 
599
590
  Usage: tx learning:recent [options]
@@ -659,8 +650,8 @@ Examples:
659
650
  Usage: tx context <task-id> [options]
660
651
 
661
652
  Retrieves learnings relevant to a specific task based on its title and
662
- description. Uses hybrid BM25 + vector search with RRF fusion, optional
663
- re-ranking and MMR diversification.
653
+ description. Uses hybrid BM25 + recency scoring. Supports graph expansion
654
+ to discover related learnings through the knowledge graph.
664
655
 
665
656
  Arguments:
666
657
  <task-id> Required. Task ID (e.g., tx-a1b2c3d4)
@@ -668,6 +659,9 @@ Arguments:
668
659
  Options:
669
660
  --json Output as JSON
670
661
  --inject Write to .tx/context.md for injection
662
+ --expand Enable graph expansion to find related learnings
663
+ --depth <n> Graph expansion depth (default: 2)
664
+ --edge-types <types> Comma-separated edge types to traverse
671
665
  --retriever <path> Use custom retriever module (exports Layer<RetrieverService>)
672
666
  --help Show this help
673
667
 
@@ -690,6 +684,7 @@ Examples:
690
684
  tx context tx-a1b2c3d4
691
685
  tx context tx-a1b2c3d4 --json
692
686
  tx context tx-a1b2c3d4 --inject
687
+ tx context tx-a1b2c3d4 --expand --depth 3
693
688
  tx context tx-a1b2c3d4 --retriever ./my-retriever.ts`,
694
689
  learn: `tx learn - Attach a learning to a file path or glob pattern
695
690
 
@@ -742,6 +737,580 @@ Examples:
742
737
  tx help # General help
743
738
  tx help add # Help for 'add' command
744
739
  tx add --help # Same as above`,
740
+ "graph:verify": `tx graph:verify - Verify anchor validity
741
+
742
+ Usage: tx graph:verify [file] [--all] [--json]
743
+
744
+ Verifies that anchors still point to valid code locations. Checks if files
745
+ exist, content hashes match, and symbols are present.
746
+
747
+ Arguments:
748
+ [file] Optional. File path to verify anchors for
749
+
750
+ Options:
751
+ --file <path> File path to verify (alternative to positional arg)
752
+ --all Verify all anchors (default if no file specified)
753
+ --json Output as JSON
754
+ --help Show this help
755
+
756
+ Examples:
757
+ tx graph:verify # Verify all anchors
758
+ tx graph:verify src/auth.ts # Verify anchors for specific file
759
+ tx graph:verify --json # Output as JSON`,
760
+ "graph:invalidate": `tx graph:invalidate - Manually invalidate an anchor
761
+
762
+ Usage: tx graph:invalidate <anchor-id> [--reason <reason>] [--json]
763
+
764
+ Marks an anchor as invalid (soft delete). The anchor is kept for history
765
+ but excluded from retrieval. Use graph:restore to undo.
766
+
767
+ Arguments:
768
+ <anchor-id> Required. Anchor ID (number)
769
+
770
+ Options:
771
+ --reason <text> Reason for invalidation (default: "Manual invalidation")
772
+ --json Output as JSON
773
+ --help Show this help
774
+
775
+ Examples:
776
+ tx graph:invalidate 42 --reason "Code removed"
777
+ tx graph:invalidate 42 --json`,
778
+ "graph:restore": `tx graph:restore - Restore a soft-deleted anchor
779
+
780
+ Usage: tx graph:restore <anchor-id> [--json]
781
+
782
+ Restores an invalid anchor back to valid status. Use this to undo
783
+ accidental invalidations or re-enable an anchor after code is restored.
784
+
785
+ Arguments:
786
+ <anchor-id> Required. Anchor ID (number)
787
+
788
+ Options:
789
+ --json Output as JSON
790
+ --help Show this help
791
+
792
+ Examples:
793
+ tx graph:restore 42
794
+ tx graph:restore 42 --json`,
795
+ "graph:prune": `tx graph:prune - Hard delete old invalid anchors
796
+
797
+ Usage: tx graph:prune [--older-than <days>] [--json]
798
+
799
+ Permanently deletes anchors that have been invalid for longer than the
800
+ specified period. Default retention is 90 days.
801
+
802
+ Options:
803
+ --older-than <days> Delete anchors invalid for this many days (default: 90)
804
+ --json Output as JSON
805
+ --help Show this help
806
+
807
+ Examples:
808
+ tx graph:prune # Delete anchors invalid > 90 days
809
+ tx graph:prune --older-than 30 # Delete anchors invalid > 30 days
810
+ tx graph:prune --json`,
811
+ "graph:status": `tx graph:status - Show graph health metrics
812
+
813
+ Usage: tx graph:status [--json]
814
+
815
+ Shows overall health of the knowledge graph including anchor counts by
816
+ status, pinned anchors, and recent invalidation events.
817
+
818
+ Options:
819
+ --json Output as JSON
820
+ --help Show this help
821
+
822
+ Examples:
823
+ tx graph:status
824
+ tx graph:status --json`,
825
+ "graph:pin": `tx graph:pin - Pin an anchor
826
+
827
+ Usage: tx graph:pin <anchor-id> [--json]
828
+
829
+ Pins an anchor to prevent automatic invalidation. Pinned anchors are
830
+ skipped during periodic and on-access verification. Use for anchors
831
+ you want to preserve regardless of code changes.
832
+
833
+ Arguments:
834
+ <anchor-id> Required. Anchor ID (number)
835
+
836
+ Options:
837
+ --json Output as JSON
838
+ --help Show this help
839
+
840
+ Examples:
841
+ tx graph:pin 42
842
+ tx graph:pin 42 --json`,
843
+ "graph:unpin": `tx graph:unpin - Unpin an anchor
844
+
845
+ Usage: tx graph:unpin <anchor-id> [--json]
846
+
847
+ Removes the pin from an anchor, allowing automatic invalidation
848
+ during verification.
849
+
850
+ Arguments:
851
+ <anchor-id> Required. Anchor ID (number)
852
+
853
+ Options:
854
+ --json Output as JSON
855
+ --help Show this help
856
+
857
+ Examples:
858
+ tx graph:unpin 42
859
+ tx graph:unpin 42 --json`,
860
+ "hooks:install": `tx hooks:install - Install post-commit hook
861
+
862
+ Usage: tx hooks:install [options]
863
+
864
+ Installs a git post-commit hook that automatically triggers anchor
865
+ verification when commits meet certain criteria:
866
+ - More than 10 files changed (configurable)
867
+ - High-value configuration files modified
868
+
869
+ The hook runs verification in the background to avoid blocking commits.
870
+ Configuration is stored in .txrc.json and can be customized.
871
+
872
+ Options:
873
+ --force, -f Overwrite existing hook
874
+ --threshold, -t <n> File count threshold (default: 10)
875
+ --high-value, -h <list> Comma-separated list of high-value file patterns
876
+ --json Output as JSON
877
+ --help Show this help
878
+
879
+ Examples:
880
+ tx hooks:install # Install with defaults
881
+ tx hooks:install --threshold 5 # Trigger on 5+ files
882
+ tx hooks:install --high-value "*.config.ts,schema.prisma"
883
+ tx hooks:install --force # Reinstall hook
884
+ tx hooks:install --json # JSON output for scripting`,
885
+ "hooks:uninstall": `tx hooks:uninstall - Remove post-commit hook
886
+
887
+ Usage: tx hooks:uninstall [options]
888
+
889
+ Removes the tx post-commit hook. Only removes hooks that were
890
+ installed by tx (identified by marker comment). Updates .txrc.json
891
+ to disable hook settings.
892
+
893
+ Options:
894
+ --json Output as JSON
895
+ --help Show this help
896
+
897
+ Examples:
898
+ tx hooks:uninstall
899
+ tx hooks:uninstall --json # JSON output for scripting`,
900
+ "hooks:status": `tx hooks:status - Show git hook status
901
+
902
+ Usage: tx hooks:status [--json]
903
+
904
+ Shows the current status of the tx git hook integration including:
905
+ - Whether a hook is installed
906
+ - Whether hooks are enabled in config
907
+ - Current configuration settings
908
+
909
+ Options:
910
+ --json Output as JSON
911
+ --help Show this help
912
+
913
+ Examples:
914
+ tx hooks:status
915
+ tx hooks:status --json`,
916
+ "test:cache-stats": `tx test:cache-stats - Show LLM cache statistics
917
+
918
+ Usage: tx test:cache-stats [--json]
919
+
920
+ Shows statistics about the LLM response cache including:
921
+ - Total number of cache entries
922
+ - Total cache size in bytes
923
+ - Date range of cached entries
924
+ - Breakdown by model
925
+ - Breakdown by cache version
926
+
927
+ Options:
928
+ --json Output as JSON
929
+ --help Show this help
930
+
931
+ Examples:
932
+ tx test:cache-stats # Show formatted statistics
933
+ tx test:cache-stats --json # Output as JSON`,
934
+ "test:clear-cache": `tx test:clear-cache - Clear LLM cache entries
935
+
936
+ Usage: tx test:clear-cache [options]
937
+
938
+ Clears LLM cache entries based on specified criteria. At least one
939
+ option must be provided to prevent accidental cache deletion.
940
+
941
+ Options:
942
+ --all Clear all cache entries
943
+ --older-than <n>d Clear entries older than N days (e.g., 30d, 7d)
944
+ Supports: d (days), h (hours), m (minutes), s (seconds)
945
+ --model <name> Clear entries for a specific model
946
+ --version <n> Clear entries with a specific cache version
947
+ --json Output as JSON
948
+ --help Show this help
949
+
950
+ Examples:
951
+ tx test:clear-cache --all # Clear entire cache
952
+ tx test:clear-cache --older-than 30d # Clear entries older than 30 days
953
+ tx test:clear-cache --older-than 2h # Clear entries older than 2 hours
954
+ tx test:clear-cache --model claude-haiku # Clear claude-haiku entries
955
+ tx test:clear-cache --version 1 # Clear version 1 entries
956
+ tx test:clear-cache --model claude-sonnet-4 --older-than 7d`,
957
+ daemon: `tx daemon - Background daemon for learning extraction
958
+
959
+ Usage: tx daemon <subcommand> [options]
960
+
961
+ Subcommands:
962
+ start Start the background daemon
963
+ stop Stop the background daemon
964
+ status Show daemon status
965
+ track Track a project for learning extraction
966
+ untrack Stop tracking a project
967
+ list List tracked projects
968
+ process Process learning candidates
969
+ review Review a learning candidate
970
+ promote Promote a candidate to learning
971
+ reject Reject a learning candidate
972
+
973
+ Run 'tx daemon <subcommand> --help' for subcommand-specific help.
974
+
975
+ Examples:
976
+ tx daemon start # Start the daemon
977
+ tx daemon status # Show daemon status
978
+ tx daemon track . # Track current directory
979
+ tx daemon list # List tracked projects`,
980
+ "daemon start": `tx daemon start - Start the background daemon
981
+
982
+ Usage: tx daemon start [options]
983
+
984
+ Starts the background daemon process that monitors tracked projects
985
+ for file changes and extracts learning candidates.
986
+
987
+ Options:
988
+ --json Output as JSON
989
+ --help Show this help
990
+
991
+ Examples:
992
+ tx daemon start`,
993
+ "daemon stop": `tx daemon stop - Stop the background daemon
994
+
995
+ Usage: tx daemon stop [options]
996
+
997
+ Stops the running background daemon process.
998
+
999
+ Options:
1000
+ --json Output as JSON
1001
+ --help Show this help
1002
+
1003
+ Examples:
1004
+ tx daemon stop`,
1005
+ "daemon status": `tx daemon status - Show daemon status
1006
+
1007
+ Usage: tx daemon status [options]
1008
+
1009
+ Shows the current status of the daemon including:
1010
+ - Whether daemon is running
1011
+ - PID if running
1012
+ - Number of tracked projects
1013
+ - Number of pending candidates
1014
+
1015
+ Options:
1016
+ --json Output as JSON
1017
+ --help Show this help
1018
+
1019
+ Examples:
1020
+ tx daemon status
1021
+ tx daemon status --json`,
1022
+ "daemon track": `tx daemon track - Track a project for learning extraction
1023
+
1024
+ Usage: tx daemon track <project-path> [options]
1025
+
1026
+ Adds a project directory to the daemon's watch list. The daemon will
1027
+ monitor file changes and extract learning candidates.
1028
+
1029
+ Arguments:
1030
+ <project-path> Required. Path to the project directory
1031
+
1032
+ Options:
1033
+ --json Output as JSON
1034
+ --help Show this help
1035
+
1036
+ Examples:
1037
+ tx daemon track . # Track current directory
1038
+ tx daemon track ~/projects/my-app`,
1039
+ "daemon untrack": `tx daemon untrack - Stop tracking a project
1040
+
1041
+ Usage: tx daemon untrack <project-path> [options]
1042
+
1043
+ Removes a project from the daemon's watch list.
1044
+
1045
+ Arguments:
1046
+ <project-path> Required. Path to the project directory
1047
+
1048
+ Options:
1049
+ --json Output as JSON
1050
+ --help Show this help
1051
+
1052
+ Examples:
1053
+ tx daemon untrack .
1054
+ tx daemon untrack ~/projects/my-app`,
1055
+ "daemon list": `tx daemon list - List tracked projects
1056
+
1057
+ Usage: tx daemon list [options]
1058
+
1059
+ Lists all projects currently being tracked by the daemon.
1060
+
1061
+ Options:
1062
+ --json Output as JSON
1063
+ --help Show this help
1064
+
1065
+ Examples:
1066
+ tx daemon list
1067
+ tx daemon list --json`,
1068
+ "daemon process": `tx daemon process - Process JSONL files for learning candidates
1069
+
1070
+ Usage: tx daemon process [options]
1071
+
1072
+ Processes JSONL files to extract learning candidates. By default, processes
1073
+ files from tracked projects. Use --path to specify a custom glob pattern.
1074
+
1075
+ Options:
1076
+ --path, -p <glob> Glob pattern for JSONL files to process
1077
+ --json Output as JSON
1078
+ --help Show this help
1079
+
1080
+ Examples:
1081
+ tx daemon process # Process tracked projects
1082
+ tx daemon process --path ~/.claude/**/*.jsonl # Process specific files`,
1083
+ "daemon review": `tx daemon review - List pending learning candidates
1084
+
1085
+ Usage: tx daemon review [options]
1086
+
1087
+ Lists pending learning candidates awaiting promotion.
1088
+
1089
+ Options:
1090
+ --confidence, -c <levels> Filter by confidence (comma-separated: high,medium,low)
1091
+ --limit, -l <n> Maximum candidates to show
1092
+ --json Output as JSON
1093
+ --help Show this help
1094
+
1095
+ Examples:
1096
+ tx daemon review
1097
+ tx daemon review --confidence medium,low
1098
+ tx daemon review --limit 10 --json`,
1099
+ "daemon promote": `tx daemon promote - Promote a candidate to learning
1100
+
1101
+ Usage: tx daemon promote <candidate-id> [options]
1102
+
1103
+ Promotes a learning candidate to a permanent learning entry.
1104
+
1105
+ Arguments:
1106
+ <candidate-id> Required. Candidate ID
1107
+
1108
+ Options:
1109
+ --json Output as JSON
1110
+ --help Show this help
1111
+
1112
+ Examples:
1113
+ tx daemon promote 42`,
1114
+ "daemon reject": `tx daemon reject - Reject a learning candidate
1115
+
1116
+ Usage: tx daemon reject <candidate-id> --reason <reason> [options]
1117
+
1118
+ Rejects a learning candidate with a reason.
1119
+
1120
+ Arguments:
1121
+ <candidate-id> Required. Candidate ID
1122
+
1123
+ Options:
1124
+ --reason <text> Required. Reason for rejection
1125
+ --json Output as JSON
1126
+ --help Show this help
1127
+
1128
+ Examples:
1129
+ tx daemon reject 42 --reason "Not relevant"
1130
+ tx daemon reject 42 --reason "Duplicate of existing learning"`,
1131
+ coordinator: `tx coordinator - Worker coordination primitives
1132
+
1133
+ Usage: tx coordinator <subcommand> [options]
1134
+
1135
+ Manages the worker coordination system for parallel task processing.
1136
+ Provides Kubernetes-style worker health tracking, lease-based claims,
1137
+ and automatic orphan detection.
1138
+
1139
+ Subcommands:
1140
+ start Start the coordinator
1141
+ stop Stop the coordinator
1142
+ status Show coordinator status
1143
+ reconcile Force a reconciliation pass
1144
+
1145
+ Run 'tx coordinator <subcommand> --help' for subcommand-specific help.
1146
+
1147
+ Examples:
1148
+ tx coordinator start # Start with default settings
1149
+ tx coordinator start --workers 3 # Start with 3 workers
1150
+ tx coordinator status # Show current status
1151
+ tx coordinator reconcile # Force orphan detection`,
1152
+ "coordinator start": `tx coordinator start - Start the coordinator
1153
+
1154
+ Usage: tx coordinator start [options]
1155
+
1156
+ Starts the worker coordination system. The coordinator manages worker
1157
+ health via heartbeats, handles lease-based task claims, and runs periodic
1158
+ reconciliation to detect dead workers and orphaned tasks.
1159
+
1160
+ Options:
1161
+ --workers, -w <n> Worker pool size (default: 1)
1162
+ --daemon, -d Run as daemon in background
1163
+ --json Output as JSON
1164
+ --help Show this help
1165
+
1166
+ Examples:
1167
+ tx coordinator start # Start with 1 worker
1168
+ tx coordinator start --workers 3 # Start with 3 workers
1169
+ tx coordinator start -w 5 --daemon # 5 workers in background`,
1170
+ "coordinator stop": `tx coordinator stop - Stop the coordinator
1171
+
1172
+ Usage: tx coordinator stop [options]
1173
+
1174
+ Stops the running coordinator. By default, immediately marks all workers
1175
+ as dead. With --graceful, signals workers to finish current tasks first.
1176
+
1177
+ Options:
1178
+ --graceful, -g Wait for workers to finish current tasks
1179
+ --json Output as JSON
1180
+ --help Show this help
1181
+
1182
+ Examples:
1183
+ tx coordinator stop # Immediate stop
1184
+ tx coordinator stop --graceful # Wait for workers to finish`,
1185
+ "coordinator status": `tx coordinator status - Show coordinator status
1186
+
1187
+ Usage: tx coordinator status [options]
1188
+
1189
+ Shows the current status of the coordinator including:
1190
+ - Running status (stopped/starting/running/stopping)
1191
+ - Process ID if running
1192
+ - Worker pool size configuration
1193
+ - Heartbeat and lease timing settings
1194
+ - Last reconciliation timestamp
1195
+
1196
+ Options:
1197
+ --json Output as JSON
1198
+ --help Show this help
1199
+
1200
+ Examples:
1201
+ tx coordinator status
1202
+ tx coordinator status --json`,
1203
+ "coordinator reconcile": `tx coordinator reconcile - Force reconciliation pass
1204
+
1205
+ Usage: tx coordinator reconcile [options]
1206
+
1207
+ Runs a single reconciliation pass immediately. Reconciliation:
1208
+ - Detects dead workers (missed 2+ heartbeats)
1209
+ - Releases expired task claims
1210
+ - Recovers orphaned tasks (active but no claim)
1211
+ - Fixes state inconsistencies
1212
+
1213
+ Normally runs automatically every 60s, but can be triggered manually.
1214
+
1215
+ Options:
1216
+ --json Output as JSON
1217
+ --help Show this help
1218
+
1219
+ Examples:
1220
+ tx coordinator reconcile
1221
+ tx coordinator reconcile --json`,
1222
+ worker: `tx worker - Worker process management
1223
+
1224
+ Usage: tx worker <subcommand> [options]
1225
+
1226
+ Manages worker processes for the coordination system. Workers claim and
1227
+ execute tasks, sending heartbeats to the coordinator.
1228
+
1229
+ Subcommands:
1230
+ start Start a worker process
1231
+ stop Stop a worker process
1232
+ status Show worker status
1233
+ list List all workers
1234
+
1235
+ Run 'tx worker <subcommand> --help' for subcommand-specific help.
1236
+
1237
+ Examples:
1238
+ tx worker start # Start with defaults
1239
+ tx worker start --name my-worker # Start with custom name
1240
+ tx worker status # Show worker summary
1241
+ tx worker list # List all workers`,
1242
+ "worker start": `tx worker start - Start a worker process
1243
+
1244
+ Usage: tx worker start [options]
1245
+
1246
+ Starts a worker process that registers with the coordinator, claims tasks,
1247
+ and executes them using Claude. The worker sends periodic heartbeats and
1248
+ handles graceful shutdown on SIGTERM/SIGINT.
1249
+
1250
+ Options:
1251
+ --name, -n <name> Worker name (default: worker-<auto>)
1252
+ --capabilities, -c <list> Comma-separated capabilities (default: tx-implementer)
1253
+ --heartbeat <seconds> Heartbeat interval in seconds (default: 30)
1254
+ --json Output as JSON
1255
+ --help Show this help
1256
+
1257
+ Examples:
1258
+ tx worker start # Start with defaults
1259
+ tx worker start --name my-worker # Custom name
1260
+ tx worker start -c tx-implementer,tx-tester # Multiple capabilities
1261
+ tx worker start --heartbeat 15 # Custom heartbeat interval`,
1262
+ "worker stop": `tx worker stop - Stop a worker process
1263
+
1264
+ Usage: tx worker stop [options]
1265
+
1266
+ Workers are stopped by sending SIGTERM to the worker process. The worker
1267
+ will finish its current task (if any) before exiting gracefully.
1268
+
1269
+ Options:
1270
+ --graceful, -g Graceful shutdown (workers already handle this)
1271
+ --json Output as JSON
1272
+ --help Show this help
1273
+
1274
+ Note: To stop a worker, find its PID with 'tx worker list --json' and
1275
+ send SIGTERM:
1276
+
1277
+ kill -SIGTERM <worker-pid>
1278
+
1279
+ Examples:
1280
+ tx worker stop # Show stop instructions`,
1281
+ "worker status": `tx worker status - Show worker status
1282
+
1283
+ Usage: tx worker status [worker-id] [options]
1284
+
1285
+ Shows the status of workers. If a worker ID is provided, shows detailed
1286
+ status for that specific worker. Otherwise, shows a summary of all workers.
1287
+
1288
+ Arguments:
1289
+ [worker-id] Optional. Show detailed status for this worker
1290
+
1291
+ Options:
1292
+ --json Output as JSON
1293
+ --help Show this help
1294
+
1295
+ Examples:
1296
+ tx worker status # Summary of all workers
1297
+ tx worker status worker-abc12345 # Detailed status for one worker
1298
+ tx worker status --json # Summary as JSON`,
1299
+ "worker list": `tx worker list - List all workers
1300
+
1301
+ Usage: tx worker list [options]
1302
+
1303
+ Lists all registered workers with their current status, name, and active task.
1304
+
1305
+ Options:
1306
+ --status, -s <list> Filter by status (comma-separated: starting,idle,busy,stopping,dead)
1307
+ --json Output as JSON
1308
+ --help Show this help
1309
+
1310
+ Examples:
1311
+ tx worker list # List all workers
1312
+ tx worker list --status idle,busy # Only idle and busy workers
1313
+ tx worker list --json # Output as JSON for scripting`,
745
1314
  trace: `tx trace - Execution tracing for debugging run failures
746
1315
 
747
1316
  Usage: tx trace <subcommand> [options]
@@ -899,6 +1468,47 @@ Fails if:
899
1468
  Examples:
900
1469
  tx claim:renew tx-abc123 worker-def456
901
1470
  tx claim:renew tx-abc123 worker-def456 --json`,
1471
+ compact: `tx compact - Compact completed tasks and export learnings
1472
+
1473
+ Usage: tx compact [options]
1474
+
1475
+ Compacts completed tasks older than a specified date and exports learnings
1476
+ to a markdown file (default: CLAUDE.md). Uses LLM to generate summaries
1477
+ and extract actionable learnings from completed work.
1478
+
1479
+ Options:
1480
+ --before <date> Compact tasks before this date (default: 7 days ago)
1481
+ Formats: YYYY-MM-DD or Nd (e.g., 7d for 7 days ago)
1482
+ --output, -o <file> Output file for learnings (default: CLAUDE.md)
1483
+ --dry-run, --preview Preview without compacting (no API key needed)
1484
+ --json Output as JSON
1485
+ --help Show this help
1486
+
1487
+ Requirements:
1488
+ - ANTHROPIC_API_KEY environment variable must be set for actual compaction
1489
+ - --dry-run works without an API key
1490
+
1491
+ Examples:
1492
+ tx compact # Compact tasks older than 7 days
1493
+ tx compact --before 2024-01-15 # Compact tasks before Jan 15
1494
+ tx compact --before 30d # Compact tasks older than 30 days
1495
+ tx compact --dry-run # Preview what would be compacted
1496
+ tx compact --output agents.md # Export learnings to agents.md
1497
+ tx compact --json # Output as JSON`,
1498
+ history: `tx history - View compaction history
1499
+
1500
+ Usage: tx history [options]
1501
+
1502
+ Shows the history of past compaction operations including dates,
1503
+ task counts, and where learnings were exported.
1504
+
1505
+ Options:
1506
+ --json Output as JSON
1507
+ --help Show this help
1508
+
1509
+ Examples:
1510
+ tx history
1511
+ tx history --json`,
902
1512
  validate: `tx validate - Database health checks
903
1513
 
904
1514
  Usage: tx validate [options]
@@ -1009,57 +1619,126 @@ Examples:
1009
1619
  tx dashboard # Start and open in Brave/Chrome
1010
1620
  tx dashboard --no-open # Start without opening browser
1011
1621
  tx dashboard --port 3002 # Custom API port`,
1012
- doc: `tx doc - Docs as primitives (DD-023)
1622
+ send: `tx send - Send a message to a channel
1623
+
1624
+ Usage: tx send <channel> <content> [options]
1625
+
1626
+ Options:
1627
+ --sender <s> Sender name (default: "cli")
1628
+ --task <id> Associate with a task ID
1629
+ --ttl <seconds> Time-to-live in seconds
1630
+ --correlation <id> Correlation ID for request/reply
1631
+ --metadata '{}' JSON metadata object
1632
+ --json Output as JSON
1633
+
1634
+ Examples:
1635
+ tx send worker-3 "Review PR #42" --sender orchestrator
1636
+ tx send broadcast "v2.3.0 deployed" --sender ci --ttl 3600
1637
+ tx send errors "OOM at step 4" --sender worker-3 --task tx-abc123
1638
+ tx send orchestrator "Done" --correlation 550e8400-e29b`,
1639
+ inbox: `tx inbox - Read messages from a channel
1640
+
1641
+ Usage: tx inbox <channel> [options]
1642
+
1643
+ Read-only: does NOT modify message status. Use tx ack to acknowledge.
1644
+ Use --after for cursor-based reading (each reader tracks their own position).
1645
+
1646
+ Options:
1647
+ --after <id> Only messages with ID > this value (cursor)
1648
+ --limit <n> Max messages to return (default: 50)
1649
+ --sender <s> Filter by sender
1650
+ --correlation <id> Filter by correlation ID
1651
+ --include-acked Include already-acknowledged messages
1652
+ --json Output as JSON
1653
+
1654
+ Examples:
1655
+ tx inbox worker-3 # Read pending messages
1656
+ tx inbox broadcast --after 42 # Cursor-based fan-out
1657
+ tx inbox orchestrator --json # JSON output
1658
+ tx inbox errors --include-acked # Include acked messages`,
1659
+ ack: `tx ack - Acknowledge a message
1660
+
1661
+ Usage: tx ack <message-id> [--json]
1662
+
1663
+ Transitions a message from pending to acked.
1664
+
1665
+ Examples:
1666
+ tx ack 42
1667
+ tx ack 42 --json`,
1668
+ "ack:all": `tx ack:all - Acknowledge all pending messages on a channel
1669
+
1670
+ Usage: tx ack:all <channel> [--json]
1671
+
1672
+ Examples:
1673
+ tx ack:all worker-3
1674
+ tx ack:all errors --json`,
1675
+ "outbox:pending": `tx outbox:pending - Count pending messages
1676
+
1677
+ Usage: tx outbox:pending <channel> [--json]
1678
+
1679
+ Examples:
1680
+ tx outbox:pending errors
1681
+ tx outbox:pending worker-3 --json`,
1682
+ "outbox:gc": `tx outbox:gc - Garbage collect old messages
1683
+
1684
+ Usage: tx outbox:gc [--acked-older-than <hours>] [--json]
1685
+
1686
+ Deletes expired messages (past TTL) and optionally old acked messages.
1687
+
1688
+ Options:
1689
+ --acked-older-than <hours> Delete acked messages older than N hours
1690
+
1691
+ Examples:
1692
+ tx outbox:gc # Delete expired only
1693
+ tx outbox:gc --acked-older-than 24 # Also clean acked > 24h old`,
1694
+ doc: `tx doc - Manage docs-as-primitives
1013
1695
 
1014
1696
  Usage: tx doc <subcommand> [options]
1015
1697
 
1016
1698
  Subcommands:
1017
- add <kind> <name> Create a doc (overview, prd, design)
1018
- edit <name> Open doc YAML in $EDITOR
1019
- show <name> Show doc details (--md for rendered markdown)
1020
- list List all docs (--kind, --status filters)
1021
- render [name] Render MD files + regenerate index
1022
- lock <name> Lock doc (immutable after locking)
1023
- version <name> Create new version from locked doc (copies content)
1024
- link <from> <to> Link two docs (auto-infers link type)
1025
- attach <task> <doc> Link task to doc (--type implements|references)
1026
- patch <design> <name> Create design patch on locked doc
1027
- validate Warn about tasks not linked to docs
1028
- drift <name> Detect drift between doc and linked tasks
1699
+ add <kind> <name> Create a new doc (overview, prd, design)
1700
+ edit <name> Open doc YAML in $EDITOR
1701
+ show <name> Show doc details
1702
+ list List all docs
1703
+ render [name] Render YAML to Markdown (all docs if no name)
1704
+ lock <name> Lock a doc version (immutable)
1705
+ version <name> Create new version from locked doc
1706
+ link <from> <to> Link two docs
1707
+ attach <task-id> <name> Attach a doc to a task
1708
+ patch <design> <patch> Create a design patch doc
1709
+ validate Check all tasks are linked to docs
1710
+ drift <name> Detect hash/link drift for a doc
1029
1711
 
1030
1712
  Run 'tx doc <subcommand> --help' for subcommand-specific help.
1031
1713
 
1032
1714
  Examples:
1033
- tx doc add overview system-design
1034
- tx doc add design DD-023 --title "Docs as Primitives"
1715
+ tx doc add prd auth-flow --title "Authentication Flow"
1716
+ tx doc show auth-flow --json
1717
+ tx doc list --kind design --status changing
1718
+ tx doc lock auth-flow
1719
+ tx doc version auth-flow
1035
1720
  tx doc render
1036
- tx doc lock DD-023
1037
- tx doc version DD-023
1038
- tx doc validate`,
1721
+ tx doc attach tx-abc123 auth-flow
1722
+ tx doc drift auth-flow`,
1039
1723
  "doc add": `tx doc add - Create a new doc
1040
1724
 
1041
- Usage: tx doc add <kind> <name> [--title <title>]
1725
+ Usage: tx doc add <kind> <name> [--title <title>] [--json]
1042
1726
 
1043
- Creates a new doc with template YAML content. The file is written to
1044
- .tx/docs/<kind>/<name>.yml (overview docs go to .tx/docs/<name>.yml).
1727
+ Creates a new doc with generated YAML template on disk and metadata in DB.
1045
1728
 
1046
1729
  Arguments:
1047
- <kind> Required. Doc kind: overview, prd, design
1048
- <name> Required. Doc name (e.g., DD-023-docs-as-primitives)
1730
+ <kind> Required. Doc kind: overview, prd, or design
1731
+ <name> Required. Doc name (alphanumeric with dashes/dots)
1049
1732
 
1050
1733
  Options:
1051
- --title, -t <title> Doc title (defaults to name)
1052
- --json Output as JSON
1053
- --help Show this help
1054
-
1055
- Notes:
1056
- - Only ONE overview doc is allowed per project
1057
- - YAML content is the source of truth; MD is generated via 'tx doc render'
1734
+ --title, -t <title> Doc title (defaults to name)
1735
+ --json Output as JSON
1736
+ --help Show this help
1058
1737
 
1059
1738
  Examples:
1060
- tx doc add overview system-design --title "System Design & Invariants"
1061
- tx doc add prd PRD-023 --title "Docs as Primitives"
1062
- tx doc add design DD-023 --title "Docs as Primitives"`,
1739
+ tx doc add prd auth-flow --title "Authentication Flow"
1740
+ tx doc add design auth-impl -t "Auth Implementation"
1741
+ tx doc add overview system-overview`,
1063
1742
  "doc edit": `tx doc edit - Open doc YAML in editor
1064
1743
 
1065
1744
  Usage: tx doc edit <name>
@@ -1070,66 +1749,66 @@ Arguments:
1070
1749
  <name> Required. Doc name
1071
1750
 
1072
1751
  Examples:
1073
- tx doc edit DD-023
1074
- EDITOR=code tx doc edit DD-023`,
1752
+ tx doc edit auth-flow
1753
+ EDITOR=code tx doc edit auth-flow`,
1075
1754
  "doc show": `tx doc show - Show doc details
1076
1755
 
1077
1756
  Usage: tx doc show <name> [--md] [--json]
1078
1757
 
1079
- Shows metadata for a doc. Use --md to display rendered markdown content.
1758
+ Shows doc metadata. With --md, renders and displays Markdown content.
1080
1759
 
1081
1760
  Arguments:
1082
1761
  <name> Required. Doc name
1083
1762
 
1084
1763
  Options:
1085
- --md Show rendered markdown content instead of metadata
1764
+ --md Render and display Markdown content
1086
1765
  --json Output as JSON
1087
1766
  --help Show this help
1088
1767
 
1089
1768
  Examples:
1090
- tx doc show DD-023
1091
- tx doc show DD-023 --md
1092
- tx doc show DD-023 --json`,
1769
+ tx doc show auth-flow
1770
+ tx doc show auth-flow --md
1771
+ tx doc show auth-flow --json`,
1093
1772
  "doc list": `tx doc list - List all docs
1094
1773
 
1095
- Usage: tx doc list [--kind <k>] [--status <s>] [--json]
1774
+ Usage: tx doc list [--kind <kind>] [--status <status>] [--json]
1096
1775
 
1097
- Lists all docs with their kind, version, status, and title.
1776
+ Lists all docs, optionally filtered by kind or status.
1098
1777
 
1099
1778
  Options:
1100
- --kind, -k <kind> Filter by kind (overview, prd, design)
1101
- --status, -s <status> Filter by status (changing, locked)
1102
- --json Output as JSON
1103
- --help Show this help
1779
+ --kind, -k <kind> Filter by kind (overview, prd, design)
1780
+ --status, -s <status> Filter by status (changing, locked)
1781
+ --json Output as JSON
1782
+ --help Show this help
1104
1783
 
1105
1784
  Examples:
1106
1785
  tx doc list
1107
1786
  tx doc list --kind design
1108
1787
  tx doc list --status locked --json`,
1109
- "doc render": `tx doc render - Render MD files from YAML
1788
+ "doc render": `tx doc render - Render YAML to Markdown
1110
1789
 
1111
1790
  Usage: tx doc render [name] [--json]
1112
1791
 
1113
- Reads YAML source files and generates markdown. Always regenerates
1114
- index.yml and index.md alongside any specific doc.
1792
+ Renders doc YAML to Markdown files. If no name given, renders all docs.
1793
+ Also regenerates index.yml and index.md.
1115
1794
 
1116
1795
  Arguments:
1117
- [name] Optional. Specific doc to render (default: all)
1796
+ [name] Optional. Doc name (renders all if omitted)
1118
1797
 
1119
1798
  Options:
1120
1799
  --json Output as JSON
1121
1800
  --help Show this help
1122
1801
 
1123
1802
  Examples:
1124
- tx doc render # Render all docs + index
1125
- tx doc render DD-023 # Render specific doc + index`,
1126
- "doc lock": `tx doc lock - Lock a doc
1803
+ tx doc render # Render all docs
1804
+ tx doc render auth-flow # Render specific doc
1805
+ tx doc render --json`,
1806
+ "doc lock": `tx doc lock - Lock a doc version
1127
1807
 
1128
1808
  Usage: tx doc lock <name> [--json]
1129
1809
 
1130
- Locks a doc, making it immutable. Renders final MD. To make changes
1131
- to a locked doc, create a new version (tx doc version) or a patch
1132
- (tx doc patch).
1810
+ Locks a doc, making it immutable. Also renders final Markdown.
1811
+ Use 'tx doc version' to create a new editable version from a locked doc.
1133
1812
 
1134
1813
  Arguments:
1135
1814
  <name> Required. Doc name
@@ -1139,13 +1818,13 @@ Options:
1139
1818
  --help Show this help
1140
1819
 
1141
1820
  Examples:
1142
- tx doc lock DD-023`,
1821
+ tx doc lock auth-flow
1822
+ tx doc lock auth-flow --json`,
1143
1823
  "doc version": `tx doc version - Create new version from locked doc
1144
1824
 
1145
1825
  Usage: tx doc version <name> [--json]
1146
1826
 
1147
- Creates a new version (v2, v3, etc.) by copying the locked doc's content.
1148
- The new version starts in 'changing' status and can be edited.
1827
+ Creates a new editable version of a locked doc. The doc must be locked first.
1149
1828
 
1150
1829
  Arguments:
1151
1830
  <name> Required. Doc name (must be locked)
@@ -1155,70 +1834,66 @@ Options:
1155
1834
  --help Show this help
1156
1835
 
1157
1836
  Examples:
1158
- tx doc version DD-023 # Creates DD-023 v2 from locked v1`,
1837
+ tx doc version auth-flow`,
1159
1838
  "doc link": `tx doc link - Link two docs
1160
1839
 
1161
1840
  Usage: tx doc link <from-name> <to-name> [--type <link-type>]
1162
1841
 
1163
- Creates a link between two docs. Link type is auto-inferred from
1164
- doc kinds (overview->prd, prd->design, etc.) unless overridden.
1842
+ Creates a directed link between two docs. Link type is auto-inferred
1843
+ from doc kinds if not specified.
1165
1844
 
1166
1845
  Arguments:
1167
- <from-name> Required. Source doc name
1168
- <to-name> Required. Target doc name
1846
+ <from-name> Required. Source doc name
1847
+ <to-name> Required. Target doc name
1169
1848
 
1170
1849
  Options:
1171
- --type <type> Link type (overview_to_prd, overview_to_design,
1172
- prd_to_design, design_patch). Auto-inferred if omitted.
1173
- --json Output as JSON
1174
- --help Show this help
1850
+ --type <type> Link type (overview_to_prd, overview_to_design, prd_to_design, design_patch)
1851
+ --json Output as JSON
1852
+ --help Show this help
1175
1853
 
1176
1854
  Examples:
1177
- tx doc link system-design PRD-023
1178
- tx doc link PRD-023 DD-023`,
1179
- "doc attach": `tx doc attach - Link task to doc
1855
+ tx doc link system-overview auth-prd
1856
+ tx doc link auth-prd auth-impl --type prd_to_design`,
1857
+ "doc attach": `tx doc attach - Attach a doc to a task
1180
1858
 
1181
- Usage: tx doc attach <task-id> <doc-name> [--type <link-type>]
1859
+ Usage: tx doc attach <task-id> <doc-name> [--type implements|references]
1182
1860
 
1183
- Links a task to a doc. Allowed even on locked docs (Class A bugs
1184
- can reference locked designs).
1861
+ Creates a link between a task and a doc.
1185
1862
 
1186
1863
  Arguments:
1187
1864
  <task-id> Required. Task ID (e.g., tx-a1b2c3d4)
1188
1865
  <doc-name> Required. Doc name
1189
1866
 
1190
1867
  Options:
1191
- --type <type> Link type: implements (default) or references
1192
- --json Output as JSON
1193
- --help Show this help
1868
+ --type <type> Link type: implements (default) or references
1869
+ --json Output as JSON
1870
+ --help Show this help
1194
1871
 
1195
1872
  Examples:
1196
- tx doc attach tx-abc123 DD-023
1197
- tx doc attach tx-abc123 DD-023 --type references`,
1198
- "doc patch": `tx doc patch - Create design patch on locked doc
1873
+ tx doc attach tx-abc123 auth-flow
1874
+ tx doc attach tx-abc123 auth-flow --type references`,
1875
+ "doc patch": `tx doc patch - Create a design patch doc
1199
1876
 
1200
1877
  Usage: tx doc patch <design-name> <patch-name> [--title <title>]
1201
1878
 
1202
- Creates a new design doc linked as a patch to a locked design doc.
1203
- Use for Class B bug fixes on locked designs.
1879
+ Creates a new design doc that patches an existing design doc.
1204
1880
 
1205
1881
  Arguments:
1206
- <design-name> Required. Name of locked design doc to patch
1207
- <patch-name> Required. Name for the patch doc
1882
+ <design-name> Required. Parent design doc name
1883
+ <patch-name> Required. New patch doc name
1208
1884
 
1209
1885
  Options:
1210
- --title, -t <title> Patch title (defaults to patch name)
1211
- --json Output as JSON
1212
- --help Show this help
1886
+ --title, -t <title> Patch title (defaults to patch name)
1887
+ --json Output as JSON
1888
+ --help Show this help
1213
1889
 
1214
1890
  Examples:
1215
- tx doc patch DD-023 DD-023-patch-1 --title "Fix rendering edge case"`,
1216
- "doc validate": `tx doc validate - Warn about unlinked tasks
1891
+ tx doc patch auth-impl auth-impl-v2 --title "Auth v2 Migration"`,
1892
+ "doc validate": `tx doc validate - Check task-doc coverage
1217
1893
 
1218
1894
  Usage: tx doc validate [--json]
1219
1895
 
1220
- Checks all tasks and warns about any that are not linked to a design doc.
1221
- Does not block operations (warn-only enforcement).
1896
+ Checks that all tasks are linked to at least one doc.
1222
1897
 
1223
1898
  Options:
1224
1899
  --json Output as JSON
@@ -1227,12 +1902,12 @@ Options:
1227
1902
  Examples:
1228
1903
  tx doc validate
1229
1904
  tx doc validate --json`,
1230
- "doc drift": `tx doc drift - Detect drift between doc and tasks
1905
+ "doc drift": `tx doc drift - Detect drift for a doc
1231
1906
 
1232
1907
  Usage: tx doc drift <name> [--json]
1233
1908
 
1234
- Checks for drift between a doc and its linked tasks. Reports tasks
1235
- that are linked but may not be covered in the doc's work breakdown.
1909
+ Checks for drift between the DB metadata and the YAML file on disk.
1910
+ Reports hash mismatches, missing files, and unlinked design docs.
1236
1911
 
1237
1912
  Arguments:
1238
1913
  <name> Required. Doc name
@@ -1242,93 +1917,113 @@ Options:
1242
1917
  --help Show this help
1243
1918
 
1244
1919
  Examples:
1245
- tx doc drift DD-023
1246
- tx doc drift DD-023 --json`,
1247
- invariant: `tx invariant - Manage structured invariants (DD-023)
1920
+ tx doc drift auth-flow
1921
+ tx doc drift auth-flow --json`,
1922
+ invariant: `tx invariant - Manage machine-checkable invariants
1248
1923
 
1249
1924
  Usage: tx invariant <subcommand> [options]
1250
1925
 
1251
1926
  Subcommands:
1252
- list List all invariants (--subsystem, --enforcement filters)
1253
- show <id> Show invariant details
1254
- record <id> Record pass/fail check result
1255
- sync Sync invariants from doc YAML files to DB
1927
+ list List all invariants
1928
+ show <id> Show invariant details
1929
+ record <id> Record a check result (--passed or --failed)
1930
+ sync Sync invariants from doc YAML files into DB
1256
1931
 
1257
1932
  Run 'tx invariant <subcommand> --help' for subcommand-specific help.
1258
1933
 
1259
1934
  Examples:
1260
1935
  tx invariant list
1261
- tx invariant list --subsystem docs
1262
- tx invariant show INV-DOC-001
1263
- tx invariant record INV-DOC-001 --passed
1264
- tx invariant sync`,
1936
+ tx invariant list --subsystem auth --enforcement integration_test
1937
+ tx invariant show INV-AUTH-001
1938
+ tx invariant record INV-AUTH-001 --passed
1939
+ tx invariant sync
1940
+ tx invariant sync --doc auth-flow`,
1265
1941
  "invariant list": `tx invariant list - List all invariants
1266
1942
 
1267
- Usage: tx invariant list [--subsystem <s>] [--enforcement <e>] [--json]
1943
+ Usage: tx invariant list [options]
1268
1944
 
1269
- Lists all invariants with their rule, enforcement type, and status.
1945
+ Lists all invariants, optionally filtered by subsystem or enforcement type.
1270
1946
 
1271
1947
  Options:
1272
- --subsystem, -s <sub> Filter by subsystem (e.g., docs, task-management)
1273
- --enforcement, -e <type> Filter by enforcement type (integration_test, linter, llm_as_judge)
1274
- --json Output as JSON
1275
- --help Show this help
1948
+ --subsystem, -s <name> Filter by subsystem
1949
+ --enforcement, -e <type> Filter by enforcement (integration_test, linter, llm_as_judge)
1950
+ --json Output as JSON
1951
+ --help Show this help
1276
1952
 
1277
1953
  Examples:
1278
1954
  tx invariant list
1279
- tx invariant list --subsystem docs
1280
- tx invariant list --enforcement integration_test --json`,
1955
+ tx invariant list --subsystem auth
1956
+ tx invariant list --enforcement linter --json`,
1281
1957
  "invariant show": `tx invariant show - Show invariant details
1282
1958
 
1283
1959
  Usage: tx invariant show <id> [--json]
1284
1960
 
1285
1961
  Shows full details for an invariant including rule, enforcement type,
1286
- subsystem, test/lint/prompt references, and status.
1962
+ subsystem, test/lint/prompt references, and creation date.
1287
1963
 
1288
1964
  Arguments:
1289
- <id> Required. Invariant ID (e.g., INV-001, INV-DOC-001)
1965
+ <id> Required. Invariant ID (e.g., INV-AUTH-001)
1290
1966
 
1291
1967
  Options:
1292
1968
  --json Output as JSON
1293
1969
  --help Show this help
1294
1970
 
1295
1971
  Examples:
1296
- tx invariant show INV-001
1297
- tx invariant show INV-DOC-001 --json`,
1298
- "invariant record": `tx invariant record - Record invariant check result
1972
+ tx invariant show INV-AUTH-001
1973
+ tx invariant show INV-AUTH-001 --json`,
1974
+ "invariant record": `tx invariant record - Record a check result
1299
1975
 
1300
- Usage: tx invariant record <id> --passed|--failed [--details <text>]
1976
+ Usage: tx invariant record <id> --passed|--failed [--details <text>] [--json]
1301
1977
 
1302
- Manually records the result of checking an invariant. In v1, all
1303
- checks are manual. Automated runners (test, lint, LLM) are v2.
1978
+ Records whether an invariant check passed or failed. Creates an audit
1979
+ trail entry for compliance tracking.
1304
1980
 
1305
1981
  Arguments:
1306
- <id> Required. Invariant ID (e.g., INV-001)
1982
+ <id> Required. Invariant ID (e.g., INV-AUTH-001)
1307
1983
 
1308
1984
  Flags (one required):
1309
- --passed Record a passing check
1310
- --failed Record a failing check
1985
+ --passed Record a passing check
1986
+ --failed Record a failing check
1311
1987
 
1312
1988
  Options:
1313
- --details, -d <text> Additional details about the check
1989
+ --details, -d <text> Additional details about the check result
1314
1990
  --json Output as JSON
1315
1991
  --help Show this help
1316
1992
 
1317
1993
  Examples:
1318
- tx invariant record INV-001 --passed
1319
- tx invariant record INV-DOC-001 --failed --details "Missing test coverage"
1320
- tx invariant record INV-001 --passed --json`,
1321
- cycle: `tx cycle - Run cycle-based issue discovery scan
1994
+ tx invariant record INV-AUTH-001 --passed
1995
+ tx invariant record INV-AUTH-001 --failed --details "Missing null check"
1996
+ tx invariant record INV-AUTH-001 --passed --json`,
1997
+ "invariant sync": `tx invariant sync - Sync invariants from YAML
1998
+
1999
+ Usage: tx invariant sync [--doc <name>] [--json]
2000
+
2001
+ Syncs invariants from doc YAML files into the database. If a doc name
2002
+ is given, syncs only that doc's invariants. Otherwise syncs all docs.
2003
+
2004
+ Options:
2005
+ --doc <name> Sync invariants from a specific doc only
2006
+ --json Output as JSON
2007
+ --help Show this help
2008
+
2009
+ Examples:
2010
+ tx invariant sync # Sync all docs
2011
+ tx invariant sync --doc auth-flow # Sync specific doc
2012
+ tx invariant sync --json`,
2013
+ cycle: `tx cycle - Cycle-based issue discovery with sub-agent swarms
1322
2014
 
1323
2015
  Usage: tx cycle --task-prompt <text|file> [options]
1324
2016
 
1325
- Dispatches sub-agent swarms to scan for codebase issues, deduplicates
1326
- findings against known issues using LLM-as-judge, and optionally fixes them.
1327
- Repeats in rounds within each cycle until convergence.
2017
+ Dispatches parallel sub-agent swarms to scan for codebase issues,
2018
+ deduplicates findings across rounds, and optionally fixes them.
2019
+ Uses a convergence loop: scan dedup → score → repeat until no new
2020
+ issues are found (loss stabilizes).
2021
+
2022
+ Arguments:
2023
+ --task-prompt <text|file> Required. Area/work being reviewed
1328
2024
 
1329
2025
  Options:
1330
- --task-prompt <text|file> Area/work being reviewed (required)
1331
- --scan-prompt <text|file> What sub-agents look for (optional)
2026
+ --scan-prompt <text|file> What sub-agents look for (default: bugs, anti-patterns, security)
1332
2027
  --name <text> Cycle name (shown in dashboard)
1333
2028
  --description <text> Cycle description
1334
2029
  --cycles <N> Number of cycles (default: 1)
@@ -1340,27 +2035,16 @@ Options:
1340
2035
  --dry-run Report only, no DB writes
1341
2036
  --score <N> Base score for new tasks (default: 500)
1342
2037
  --json Output as JSON
2038
+ --help Show this help
1343
2039
 
1344
- Examples:
1345
- tx cycle --task-prompt "Review core services" --scan-prompt "Find bugs"
1346
- tx cycle --task-prompt "Auth module" --scan-only --name "Auth review"
1347
- tx cycle --task-prompt "Review core" --agents 2 --model claude-sonnet-4-5-20250929
1348
- tx cycle --task-prompt "Full review" --cycles 3 --fix`,
1349
- "invariant sync": `tx invariant sync - Sync invariants from doc YAML to DB
1350
-
1351
- Usage: tx invariant sync [--doc <name>] [--json]
1352
-
1353
- Parses invariant definitions from doc YAML files and upserts them
1354
- into the database. Invariants removed from YAML are deprecated.
1355
-
1356
- Options:
1357
- --doc <name> Only sync invariants from a specific doc
1358
- --json Output as JSON
1359
- --help Show this help
2040
+ Loss Calculation:
2041
+ loss = 3 * HIGH + 2 * MEDIUM + 1 * LOW
2042
+ Convergence: loss drops to 0 or stops decreasing between rounds
1360
2043
 
1361
2044
  Examples:
1362
- tx invariant sync # Sync all docs
1363
- tx invariant sync --doc DD-023 # Sync specific doc
1364
- tx invariant sync --json`
2045
+ tx cycle --task-prompt "Review core services"
2046
+ tx cycle --task-prompt "Review auth module" --scan-prompt "Find security issues"
2047
+ tx cycle --task-prompt "Audit API" --agents 5 --max-rounds 5 --fix
2048
+ tx cycle --task-prompt prompt.md --dry-run --json`
1365
2049
  };
1366
2050
  //# sourceMappingURL=help.js.map