workdash 0.3.0__tar.gz → 0.5.0__tar.gz

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 (109) hide show
  1. {workdash-0.3.0/src/workdash.egg-info → workdash-0.5.0}/PKG-INFO +593 -73
  2. workdash-0.5.0/README.md +788 -0
  3. {workdash-0.3.0 → workdash-0.5.0}/pyproject.toml +7 -3
  4. workdash-0.5.0/src/workdash/agent_context.py +134 -0
  5. workdash-0.5.0/src/workdash/agent_execution.py +123 -0
  6. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/analysis_cache.py +8 -0
  7. workdash-0.5.0/src/workdash/analyzer.py +147 -0
  8. workdash-0.5.0/src/workdash/autoclose.py +433 -0
  9. workdash-0.5.0/src/workdash/autodispatch.py +310 -0
  10. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/backend.py +135 -50
  11. workdash-0.5.0/src/workdash/branchdiff.py +367 -0
  12. workdash-0.5.0/src/workdash/branchinfo.py +85 -0
  13. workdash-0.5.0/src/workdash/config.py +792 -0
  14. workdash-0.5.0/src/workdash/control.py +2692 -0
  15. workdash-0.5.0/src/workdash/dashboard_record.py +97 -0
  16. workdash-0.5.0/src/workdash/git.py +733 -0
  17. workdash-0.5.0/src/workdash/github_client.py +3210 -0
  18. workdash-0.5.0/src/workdash/launcher.py +1392 -0
  19. workdash-0.5.0/src/workdash/log_diagnostics.py +38 -0
  20. workdash-0.5.0/src/workdash/models.py +158 -0
  21. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/prompts/analyze_issue.txt +28 -21
  22. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/prompts/analyze_pr.txt +11 -7
  23. workdash-0.5.0/src/workdash/prompts/autostart_implement.txt +82 -0
  24. workdash-0.5.0/src/workdash/prompts/autostart_review.txt +10 -0
  25. workdash-0.5.0/src/workdash/prompts/launch_issue.txt +26 -0
  26. workdash-0.5.0/src/workdash/prompts/launch_review.txt +26 -0
  27. workdash-0.5.0/src/workdash/prompts/review_pull_request.txt +4 -0
  28. workdash-0.5.0/src/workdash/prompts/work_address_review.txt +1 -0
  29. workdash-0.5.0/src/workdash/prompts/work_awaiting.txt +1 -0
  30. workdash-0.5.0/src/workdash/prompts/work_fix_ci.txt +1 -0
  31. workdash-0.5.0/src/workdash/prompts/work_fix_merge_conflicts.txt +1 -0
  32. workdash-0.5.0/src/workdash/prompts/work_implement.txt +1 -0
  33. workdash-0.5.0/src/workdash/repo_resolver.py +45 -0
  34. workdash-0.5.0/src/workdash/repo_worktree.py +374 -0
  35. workdash-0.5.0/src/workdash/review.py +85 -0
  36. workdash-0.5.0/src/workdash/tui.py +1738 -0
  37. workdash-0.5.0/src/workdash/view.py +546 -0
  38. workdash-0.5.0/src/workdash/work_instruction.py +118 -0
  39. workdash-0.5.0/src/workdash/work_state.py +229 -0
  40. workdash-0.5.0/src/workdash/workdash.py +1244 -0
  41. {workdash-0.3.0 → workdash-0.5.0/src/workdash.egg-info}/PKG-INFO +593 -73
  42. workdash-0.5.0/src/workdash.egg-info/SOURCES.txt +82 -0
  43. {workdash-0.3.0 → workdash-0.5.0}/src/workdash.egg-info/requires.txt +3 -1
  44. workdash-0.5.0/tests/test_agent_context.py +257 -0
  45. workdash-0.5.0/tests/test_analysis_browser.py +157 -0
  46. workdash-0.5.0/tests/test_analysis_viewer.py +815 -0
  47. workdash-0.5.0/tests/test_analyzer.py +597 -0
  48. workdash-0.5.0/tests/test_autoclose.py +1072 -0
  49. workdash-0.5.0/tests/test_autodispatch.py +4000 -0
  50. workdash-0.5.0/tests/test_backend.py +1399 -0
  51. workdash-0.5.0/tests/test_branchdiff.py +429 -0
  52. workdash-0.5.0/tests/test_branchinfo.py +254 -0
  53. workdash-0.5.0/tests/test_config.py +1488 -0
  54. workdash-0.5.0/tests/test_control.py +5473 -0
  55. workdash-0.5.0/tests/test_dashboard_record.py +84 -0
  56. workdash-0.5.0/tests/test_git.py +223 -0
  57. workdash-0.5.0/tests/test_github.py +145 -0
  58. workdash-0.5.0/tests/test_github_boundary_stage2.py +98 -0
  59. workdash-0.5.0/tests/test_github_client.py +2387 -0
  60. workdash-0.5.0/tests/test_launcher.py +1922 -0
  61. {workdash-0.3.0 → workdash-0.5.0}/tests/test_normalization.py +31 -0
  62. workdash-0.5.0/tests/test_persistent_startup.py +293 -0
  63. workdash-0.5.0/tests/test_repo_resolver.py +42 -0
  64. workdash-0.5.0/tests/test_repo_worktree.py +2311 -0
  65. workdash-0.5.0/tests/test_review.py +1454 -0
  66. workdash-0.5.0/tests/test_todo.py +240 -0
  67. workdash-0.5.0/tests/test_tui.py +4176 -0
  68. workdash-0.5.0/tests/test_view.py +526 -0
  69. workdash-0.5.0/tests/test_viewer_terminal.py +105 -0
  70. workdash-0.5.0/tests/test_work_instruction.py +281 -0
  71. workdash-0.5.0/tests/test_work_state.py +847 -0
  72. workdash-0.5.0/tests/test_workdash.py +2425 -0
  73. workdash-0.5.0/tests/test_zellij_integration.py +1635 -0
  74. workdash-0.3.0/README.md +0 -270
  75. workdash-0.3.0/src/workdash/analyzer.py +0 -229
  76. workdash-0.3.0/src/workdash/config.py +0 -608
  77. workdash-0.3.0/src/workdash/control.py +0 -717
  78. workdash-0.3.0/src/workdash/github_client.py +0 -1049
  79. workdash-0.3.0/src/workdash/launcher.py +0 -631
  80. workdash-0.3.0/src/workdash/models.py +0 -50
  81. workdash-0.3.0/src/workdash/prompts/launch_issue.txt +0 -20
  82. workdash-0.3.0/src/workdash/prompts/launch_pr.txt +0 -20
  83. workdash-0.3.0/src/workdash/prompts/launch_review.txt +0 -20
  84. workdash-0.3.0/src/workdash/repo_resolver.py +0 -112
  85. workdash-0.3.0/src/workdash/repo_worktree.py +0 -374
  86. workdash-0.3.0/src/workdash/tui.py +0 -682
  87. workdash-0.3.0/src/workdash/workdash.py +0 -727
  88. workdash-0.3.0/src/workdash.egg-info/SOURCES.txt +0 -43
  89. workdash-0.3.0/tests/test_analyzer.py +0 -354
  90. workdash-0.3.0/tests/test_backend.py +0 -646
  91. workdash-0.3.0/tests/test_config.py +0 -635
  92. workdash-0.3.0/tests/test_control.py +0 -171
  93. workdash-0.3.0/tests/test_github_client.py +0 -1223
  94. workdash-0.3.0/tests/test_launcher.py +0 -978
  95. workdash-0.3.0/tests/test_repo_resolver.py +0 -125
  96. workdash-0.3.0/tests/test_repo_worktree.py +0 -911
  97. workdash-0.3.0/tests/test_tui.py +0 -1058
  98. workdash-0.3.0/tests/test_workdash.py +0 -1325
  99. {workdash-0.3.0 → workdash-0.5.0}/LICENSE +0 -0
  100. {workdash-0.3.0 → workdash-0.5.0}/setup.cfg +0 -0
  101. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/__init__.py +0 -0
  102. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/__main__.py +0 -0
  103. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/included_items.py +0 -0
  104. {workdash-0.3.0 → workdash-0.5.0}/src/workdash/prompts/__init__.py +0 -0
  105. {workdash-0.3.0 → workdash-0.5.0}/src/workdash.egg-info/dependency_links.txt +0 -0
  106. {workdash-0.3.0 → workdash-0.5.0}/src/workdash.egg-info/entry_points.txt +0 -0
  107. {workdash-0.3.0 → workdash-0.5.0}/src/workdash.egg-info/top_level.txt +0 -0
  108. {workdash-0.3.0 → workdash-0.5.0}/tests/test_analysis_cache.py +0 -0
  109. {workdash-0.3.0 → workdash-0.5.0}/tests/test_included_items.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workdash
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Text-based GitHub work triage dashboard.
5
5
  Author-email: Alessandro Molina <alessandro@molina.fyi>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -698,11 +698,13 @@ Requires-Python: >=3.12
698
698
  Description-Content-Type: text/markdown
699
699
  License-File: LICENSE
700
700
  Requires-Dist: markdown>=3.6
701
+ Requires-Dist: nh3>=0.3.0
701
702
  Requires-Dist: TurboGears2>=2.5.0
702
703
  Requires-Dist: textual>=0.58
704
+ Requires-Dist: textual-diff-view>=0.1.0
703
705
  Provides-Extra: test
704
706
  Requires-Dist: pytest>=8; extra == "test"
705
- Requires-Dist: pytest-bdd>=7; extra == "test"
707
+ Requires-Dist: pytest-bdd>=9.0.1; extra == "test"
706
708
  Dynamic: license-file
707
709
 
708
710
  # workdash
@@ -714,11 +716,11 @@ your GitHub repositories, suggests what to pick up next, and makes it easy to
714
716
  jump into a work item — either for a quick review, a deeper AI-assisted
715
717
  analysis, or a full coding session in a dedicated worktree.
716
718
 
717
- ![workdash screenshot](site/workdash.png)
719
+ ![workdash screenshot](site/img/dashboard.gif)
718
720
 
719
721
  ## Platform
720
722
 
721
- Linux and macOS. `workdash` relies on `xdg-open` or `open` and expects `zellij`
723
+ Linux and macOS. `workdash` uses a configured viewer and expects `zellij`
722
724
  for the interactive dashboard and terminal-backed work actions. It has not
723
725
  been tested on Windows.
724
726
 
@@ -727,16 +729,15 @@ been tested on Windows.
727
729
  - Python `>=3.12`.
728
730
  - Authenticated [`gh`](https://cli.github.com/) for GitHub access.
729
731
  `workdash --configure` installs a local copy when `gh` is not available.
730
- - `xdg-open` or `open` for opening links and rendered analyses in your browser.
732
+ - An executable viewer command for opening links and rendered analyses (for example
733
+ `xdg-open`, `open`, a terminal viewer, or a clipboard wrapper).
731
734
  - `zellij` for the interactive dashboard, terminal panes, and agent sessions.
732
735
  `workdash --configure` installs a local copy when `zellij` is not available.
733
736
  - Global `gh` and `zellij` binaries are preferred; configured local copies are
734
737
  used as fallbacks.
735
- - Optional, depending on which actions you use from the TUI:
736
- - `claude` — to analyze or launch a Claude coding session.
737
- - `codex` — to analyze or launch a ChatGPT Codex session.
738
- - `code` — to launch a VSCode + Copilot coding session.
739
- - `pi` — to launch a pi coding agent session.
738
+ - At least one agent command-line tool (for example `claude`, `codex`, or `pi`;
739
+ see *Agents* below) to analyze items or launch coding sessions.
740
+ - Optional: `code` — to launch a VSCode + Copilot coding session.
740
741
 
741
742
  ## Installation
742
743
 
@@ -772,16 +773,82 @@ The wizard fills in:
772
773
  is still handled by `gh`; run `gh auth login` if startup reports that `gh` is
773
774
  not authenticated.
774
775
  - The list of repositories to track (see *Repository selectors* below).
776
+ - The todo repository where captured todos are created (defaults to
777
+ `<username>/todos`, see *Todos* below).
775
778
  - A working directory where per-item git worktrees will live.
776
- - The analyze and launch commands for Claude and Codex (auto-detected when the
777
- tools are on your `PATH`).
779
+ - The agents (see *Agents* below): `claude`, `codex`, and `pi` are added with
780
+ their default commands when they are on your `PATH`, and you can add more.
778
781
 
779
- You can edit `~/.config/workdash/config.json` by hand at any time. Re-running
780
- `--configure` only prompts for fields that are still empty, except for Zellij:
781
- the wizard always checks for a global `zellij` first and downloads a fresh
782
- local binary when no global binary exists. It does the same for `gh`, checking
783
- for a global GitHub CLI first and downloading a fresh local copy when none is
784
- available.
782
+ ### URL and analysis viewer
783
+
784
+ Separate viewers open selected issue/PR URLs (`v` then `o`) and analyses (fresh or cached). Configure it with `workdash --configure`, or edit
785
+ `~/.config/workdash/config.json` for advanced commands:
786
+
787
+ ```json
788
+ {
789
+ "open": "term-copy --quiet",
790
+ "open_needs_pane": false,
791
+ "analysis_viewer": {"command": "workdash view", "format": "markdown", "needs_pane": true}
792
+ }
793
+ ```
794
+
795
+ `open` remains a command string. Quoted arguments are supported; Workdash appends
796
+ one literal URL as the final argument. There are no templates,
797
+ shell expansion, or implicit shell commands. Explicit executable paths are allowed;
798
+ quote paths containing spaces. A missing `open` command prevents startup and tells
799
+ you to run `--configure`; there is no runtime default.
800
+
801
+ The wizard repairs missing, malformed, or unavailable viewer commands, checking
802
+ that the first command token identifies an executable on PATH or at an explicit
803
+ path. It suggests only an available `xdg-open` on Linux or `open` on macOS;
804
+ Enter accepts the displayed suggestion. With no suggestion, empty input is rejected.
805
+ Valid existing commands and unrelated settings are preserved.
806
+
807
+ For a missing or invalid `open_needs_pane`, the wizard asks
808
+ `Does the viewer require its own terminal window? [y/N]` (Enter means No).
809
+ Explicit boolean choices are preserved. Legacy configurations without this flag
810
+ continue to open directly. Direct viewers do not require Zellij and must finish
811
+ within four seconds. Set the flag to `true` for a terminal viewer: Workdash launches
812
+ it in a full-size floating pane in the current/selected active Zellij session,
813
+ without creating a session or worktree. Launch failures report the configured
814
+ command; viewer child errors stay visible in the pane.
815
+
816
+ Re-running `--configure` otherwise only prompts for empty fields, except for
817
+ Zellij and GitHub CLI: the wizard always checks for global binaries first and
818
+ downloads fresh local copies when none are available.
819
+
820
+ The analysis viewer is required and defaults to `workdash view` in the wizard.
821
+ The removed `workdash mdview` and `workdash markdownview` commands are no longer
822
+ available, and a configuration naming either one is repaired to the default.
823
+ Choose `markdown` or `html` for a custom command and whether it needs
824
+ a terminal pane. Direct analysis viewers run without blocking Workdash or a time limit.
825
+ Analyses are passed as local file URLs; the HTTP server is not
826
+ required. `workdash view` also reads local paths, file URLs and HTTP or HTTPS
827
+ URLs, and it intentionally does not verify HTTPS certificates.
828
+
829
+ ### Agents
830
+
831
+ An agent is a command-line tool that analyzes items, codes on them, or both. The
832
+ `agents` map in `config.json` gives each agent a name you choose, an `analyze`
833
+ command, a `launch` command, or both:
834
+
835
+ ```json
836
+ "agents": {
837
+ "pi": {"analyze": "pi -p", "launch": "pi"},
838
+ "aider": {"analyze": "aider --yes"}
839
+ }
840
+ ```
841
+
842
+ The order in the file is the order of the TUI dialogs, and the first agent is
843
+ the default for `workdash analyze` and `workdash code` without `--agent`. The
844
+ names `cached` and `vscode` are reserved. Workdash appends the task prompt to
845
+ the command as its last argument and runs it through your `$SHELL`, so aliases
846
+ work too. At least one agent is required.
847
+
848
+ The wizard asks about agents only when none is configured: it adds `claude`,
849
+ `codex`, and `pi` when found on your `PATH`, then asks for more analyze and
850
+ launch commands, each with a name. The TUI numbers its entries with single
851
+ keys, so the wizard accepts at most 9 analysis agents and 9 coding agents.
785
852
 
786
853
  ## Usage
787
854
 
@@ -794,34 +861,55 @@ workdash
794
861
  Useful commands and flags:
795
862
 
796
863
  ```bash
797
- workdash --server # start the TUI plus localhost JSON control API
864
+ workdash list --host dashboard.lan --json # connect to an explicit server host
798
865
  workdash list # list server-backed dashboard items as plain text
799
866
  workdash list --refresh # ask the server to refresh items before listing
800
867
  workdash list --json # list items as machine-readable JSON
801
868
  workdash info [--all] [--json] # report live Workdash-owned Zellij panes
802
- workdash analyze ITEM [--agent NAME] [--json] # analyze a current server item
803
- workdash code ITEM [--agent NAME] [--json] # launch a terminal-backed coding agent
869
+ workdash ready SCOPE [--json] # list the GitHub work ready to be picked up next
870
+ workdash dispatch SCOPE [--agent NAME] [--group NAME] [--host HOST] [--json] # launch one ready issue
871
+ workdash autodispatch SCOPE [--group NAME] [--agent NAME] [--host HOST] [--json] # start a session
872
+ workdash autodispatch-stop SESSION_ID [--host HOST] [--json] # stop a session
873
+ workdash analyze ITEM [--agent NAME] [--group NAME] [--json] # analyze an item
874
+ workdash review ITEM [--agent NAME] [--group NAME] [--json] # autonomously review an open PR
875
+ workdash code ITEM [--agent NAME] [--group NAME] [--autoclose] [--json] # launch an autonomous coding agent, or report the running one
876
+ workdash terminal ITEM [--json] # open a plain terminal in an item's worktree
877
+ workdash todo TEXT [--target REPOSITORY] [--body BODY] [--json] # capture a todo
878
+ workdash todo --close ITEM [--json] # close a todo
804
879
  workdash read PANE_ID [--full] [--json] # read text from a live pane
805
880
  workdash write PANE_ID TEXT [--raw] [--json] # send text to a live pane
806
- workdash show-config [--json] # show configured agents and fixed server address
881
+ workdash show-config [--json] # show configured agents and selected server address
882
+ workdash view TARGET # read a document: a GitHub item, a local path, or a URL
807
883
  workdash --debug # verbose logging
808
884
  workdash --configure # run the interactive setup wizard
809
- workdash --direct # start without the automatic Zellij wrapper
885
+ workdash --session NAME # use a named persistent Zellij session
810
886
  workdash --version # print version and exit
811
887
  ```
812
888
 
889
+ Outside Zellij, the dashboard creates or attaches to the persistent `workdash`
890
+ session. Use `--session NAME` to select another session. A new session has a
891
+ dashboard above a shell, with Zellij's tab and status bars. If the dashboard is
892
+ already running, new options are ignored; otherwise it starts with the supplied
893
+ options in the `dashboard` tab. Pressing `q` exits the dashboard but keeps the
894
+ session and its panes; Ctrl+Q quits the entire session. Inside Zellij, Workdash
895
+ runs in the current pane and uses the current session regardless of `--session`.
896
+
897
+
813
898
  ## What gets shown
814
899
 
815
900
  `workdash` gathers the following for your configured GitHub username:
816
901
 
817
- - Open pull requests you authored.
902
+ - Open pull requests you authored (shown as `PR` in the TUI).
818
903
  - Open pull requests where you are a requested reviewer, plus open pull
819
- requests you have already reviewed (shown as `REVIEW`).
820
- - Open issues assigned to you.
821
- - Open issues and pull requests across the tracked repositories.
904
+ requests you have already reviewed (shown as `RV` in the TUI).
905
+ - Open issues assigned to you (shown as `TD` for the configured todo repository and `IS` for other repositories in the TUI).
906
+ - Open issues and pull requests across the tracked repositories. A pull request
907
+ that is neither yours nor yours to review is shown as `VR` (voluntary review) in the TUI; once
908
+ you review it, the next refresh lists it as `RV`.
822
909
 
823
- Items are merged, deduplicated, and sorted by last update. One item is marked
824
- with `*` as the suggested next thing to pick up.
910
+ Items are merged, deduplicated, and sorted by last update. A pull request that
911
+ closes an issue replaces that issue, so the same work never takes two rows. One
912
+ item is marked with `*` as the suggested next thing to pick up.
825
913
 
826
914
  ### Repository selectors
827
915
 
@@ -832,44 +920,173 @@ The `repositories` list in `config.json` accepts:
832
920
 
833
921
  ## TUI keybindings
834
922
 
835
- - `o` — open the selected item in your browser.
923
+ - `/` — search/filter the listed items by Type, Repo, or Title. Matching is
924
+ literal and case-insensitive, including the full repository and title. Search
925
+ by the displayed type and number (e.g. `IS 42`) or the legacy form
926
+ (e.g. `ISSUE#42`). Press `/` again to clear.
927
+ - `v` — open the view menu for the selected item: `(v) view` reads it as a
928
+ Markdown document in a full-size floating pane, and `(o) open` opens its
929
+ GitHub URL with your configured viewer. Esc cancels.
836
930
  - `r` — refresh the list from GitHub.
837
931
  - `a` — analyze the selected item. Opens a dialog to open the cached analysis
838
- (if any), or run a fresh analysis with Claude or Codex. Fresh analyses are
839
- cached and rendered as HTML in your browser.
840
- - `c` — launch a coding session on the selected item. Opens a dialog to pick
841
- Claude, Codex, VSCode Copilot, or pi. `workdash` prepares a dedicated git
842
- worktree for the item and starts the chosen tool in it, preloaded with
843
- context about the issue or PR.
844
- - `t` — open a terminal in the selected item's worktree (no agent launched).
932
+ (if any), or run a fresh analysis with any configured analysis agent. Fresh
933
+ analyses are cached and opened with your configured analysis viewer.
934
+ - `c` — open the code menu for the selected item. Choose a numbered coding
935
+ agent, `(e) edit` for VSCode Copilot, `(d) branchdiff`, `(t) terminal`, or
936
+ `(r) auto review`, which asks which analysis agent reviews the item, shows a
937
+ progress dialog until the review finishes, and then reports the outcome.
938
+ `workdash` prepares a
939
+ dedicated git worktree for the item and starts the chosen tool in it, preloaded
940
+ with context about the issue or PR. If an agent is already running in the
941
+ item's worktree, choosing a numbered agent focuses its pane instead of launching another.
942
+ - `d` — choose an agent that can code and analyze to start an autodispatch session for the selected issue or a linked issue
943
+ of an authored PR, including in another repository. A PR without a linked
944
+ issue cannot be dispatched. The chosen agent handles implementation, review, and rework; Esc cancels without starting a session. For work with a running session, `m` replaces `d` in the display; `d` still starts or replaces the session for the selected target.
945
+ - `m` — toggle automerge for the selected work's running autodispatch session. If multiple sessions match, use `workdash info` and `workdash autodispatch-stop SESSION_ID` to leave only the intended session.
946
+ - `w` — capture a todo. Opens a dialog asking for the todo text and an
947
+ optional target repository.
845
948
  - `q` — quit.
846
949
 
950
+ ## Todos
951
+
952
+ Ideas and chores that show up while triaging can be captured as todos with `w`
953
+ in the TUI, `workdash todo TEXT`, or the JSON API. A todo is an ordinary GitHub
954
+ issue created in the single `todo_repository` from `config.json`, assigned to
955
+ you and labeled `workdash-todo`, so it shows up on the dashboard like any other
956
+ assigned issue. Create the repository on GitHub yourself; the label is created
957
+ on first use.
958
+
959
+ For long details, keep the title short and pass `--body`:
960
+
961
+ ```bash
962
+ workdash todo "Plan the migration" --body "Research findings and next steps..."
963
+ ```
964
+
965
+ `POST /api/v0/todo` likewise accepts an optional `body` string alongside `text`
966
+ and `target`. The issue body starts with Workdash's metadata block; user content
967
+ is appended after it without changing formatting. Omitting the body keeps the
968
+ existing metadata-only output. The TUI continues to capture title-only todos.
969
+
970
+ Close an issue in the configured todo repository with `workdash todo --close ITEM`.
971
+ `ITEM` may be its Workdash ID, a number such as `42` or `#42`, or its GitHub
972
+ issue URL. The command requires a running server; `--json` returns the closed
973
+ issue's ID, repository, number, URL, and status. The API offers the same action
974
+ as `POST /api/v0/todo_close` with an `item` string. The dashboard updates after
975
+ GitHub confirms the close.
976
+
977
+ A todo may name a GitHub target (`--target owner/repo`) or a git URL on any
978
+ hosting service (`--target https://codeberg.org/owner/repo.git`). HTTPS (with or
979
+ without `.git`), `ssh://`, `git://`, and scp-like `git@host:owner/repo.git` URLs
980
+ are supported. URL targets are cloned with Git automatically; no manual clone
981
+ or worktree preparation is needed. The issue still
982
+ lives in the todo repository, but the item is listed under its target and its
983
+ coding and terminal actions run in a worktree of the target checked
984
+ out on a `wt-<number>` branch. Analysis uses an existing worktree or a temporary
985
+ checkout of the target's default branch. URL targets display as their final `owner/repo`
986
+ path segments, while metadata keeps the original URL. Targets with the same
987
+ `owner/repo` on different hosts can have the same item ID; conflicting local
988
+ directories are reported rather than reused.
989
+
847
990
  ## Worktrees
848
991
 
849
- Coding and analysis actions operate on a per-item git worktree rooted under the
992
+ Coding actions operate on a per-item git worktree rooted under the
850
993
  configured `workdir`. Each tracked repository gets a local clone, and each work
851
994
  item gets its own worktree alongside it, so you can hop between items without
852
- disturbing other in-progress work.
995
+ disturbing other in-progress work. When an existing local branch is checked out
996
+ into a new worktree, Workdash preserves its commits. Issue branches keep their
997
+ upstream configuration; pull request branches track the pull request head.
998
+
999
+ A pull request you authored that closes an issue in the same repository is the
1000
+ implementation of that issue, so it shares the issue's worktree directory (named
1001
+ after the issue number) while staying checked out on the pull request's own
1002
+ branch. That shared checkout is only reused while it holds the pull request's
1003
+ branch; a checkout sitting on another branch belongs to other work, so it is left
1004
+ alone and the pull request gets its own pull-request-numbered worktree instead.
1005
+ Worktree directories created before this behavior existed are still named
1006
+ after the pull request number; they are not migrated and keep working, so the
1007
+ pull request stays in the checkout it already has and only a pull request with no
1008
+ checkout yet gets an issue-numbered one. The link between a pull request and the issue it closes is resolved when the
1009
+ dashboard refreshes or the pull request is added by URL.
853
1010
 
854
1011
  ## Local control server
855
1012
 
856
- `workdash --server` starts the normal TUI and a localhost JSON control API in the
857
- same process. V0 listens on `127.0.0.1:8765`, accepts JSON only, and stops when
858
- the TUI exits. Client commands such as `list`, `info`, `analyze`, `code`,
859
- `read`, and `write` connect to this server instead of loading GitHub or Zellij
860
- state themselves.
1013
+ `workdash` starts the normal TUI and a JSON control API in the same
1014
+ process. It listens on `WORKDASH_HOST` (default `127.0.0.1:8765`) and stops all
1015
+ listeners when the TUI exits. Control requests use JSON; item artifact GETs return file contents or a JSON listing.
1016
+
1017
+ A server writes its diagnostic log to `~/.config/workdash/workdash.log`, which
1018
+ each successful start replaces so it always describes the current run; a start
1019
+ that cannot bind leaves the existing log untouched. If the log cannot be
1020
+ written, startup fails and names the path instead of running without
1021
+ diagnostics. The log records server-side failures and where they happened, and
1022
+ omits raw command output and request bodies.
1023
+
1024
+ For trusted LAN access, add listener entries to the `listens` list in `~/.config/workdash/config.json`, for example:
1025
+
1026
+ ```json
1027
+ "listens": ["192.168.1.5@192.168.1.10,192.168.1.11"]
1028
+ ```
1029
+
1030
+ Each listener needs a nonempty list of accepted source IPs or CIDR subnets
1031
+ (no hostnames). All supplied source IPs are shared across every
1032
+ listener, with localhost and the primary server IP always accepted.
1033
+ Access checks use the actual peer IP, never forwarding headers. Wildcard binds are
1034
+ rejected; extra listeners use the selected server port.
1035
+ If any listener cannot bind, the entire server startup fails.
1036
+
1037
+ To list an item's `.workdash/` artifacts or retrieve one, URL-encode the `#` in
1038
+ its Workdash ID (otherwise it is interpreted as a URL fragment):
1039
+
1040
+ ```bash
1041
+ curl 'http://127.0.0.1:8765/api/items/owner/repo%23ISSUE-41/files/'
1042
+ curl 'http://127.0.0.1:8765/api/items/owner/repo%23ISSUE-41/files/.workdash/PR_REVIEW.md'
1043
+ ```
1044
+
1045
+ The listing is a JSON success envelope with `result.entries`, a sorted array of
1046
+ names. Files are returned with a Content-Type inferred from the requested filename,
1047
+ or `application/octet-stream` when unknown. Compressed archives remain compressed
1048
+ when downloaded; compressed SVG images are decoded by the browser. Only files inside the existing
1049
+ worktree's `.workdash/` directory are available. These endpoints are read-only
1050
+ and use the same peer access checks as the control API.
1051
+
1052
+ Control API requests require `X-Workdash` set to the installed Workdash version; the CLI sends it automatically. A mismatched or missing version is rejected with restart guidance. `POST /api/v0/info` accepts `panes` as `work` (the default), `all`, or `none`; `none` returns only the session, served addresses and version.
1053
+ Artifact GETs and GETs of analysis Markdown and HTML documents are exempt for
1054
+ browser viewing, but still require an allowed source IP. Cross-origin preflight
1055
+ requests are denied. The header prevents browser images and cross-origin JavaScript
1056
+ from invoking control APIs; it is not authentication and non-browser clients can
1057
+ send it. Artifact documents are sandboxed and cannot run scripts or submit forms.
1058
+ HTML analyses block scripts but can load HTTP(S) images, which can request other
1059
+ URLs, including read-only artifacts and analysis documents.
1060
+
1061
+ **Trusted LAN only:** the API is intentionally unauthenticated plain HTTP.
1062
+ Allowed clients can execute dashboard actions; do not expose it to untrusted
1063
+ networks or treat the IP allowlist as authentication or encryption.
1064
+
1065
+ Client commands `list`, `info`, `ready`, `dispatch`, `autodispatch`, `autodispatch-stop`, `analyze`, `code`, `terminal`, `todo`, `read`,
1066
+ `write`, `review`, and `close` accept `--host HOST[:PORT]` before or after the command.
1067
+ Set `WORKDASH_HOST` to an IPv4 address or IPv4 address:port to select the default
1068
+ for both server and clients; omitted ports use 8765. An explicit `--host` replaces
1069
+ that default, even if `WORKDASH_HOST` is invalid.
1070
+ A server dashboard already inside Zellij uses its current session, regardless
1071
+ of its name.
1072
+ Extra listener hosts and explicit client `--host` values may be IP addresses or DNS hostnames. Clients connect
1073
+ to the selected server without loading local GitHub, configuration, or Zellij state. Todo's `--target`
1074
+ still selects its repository, independently of the server host. `show-config`
1075
+ reports the selected default server address.
861
1076
 
862
1077
  ## List command
863
1078
 
864
- `workdash list` requires a running `workdash --server` session and emits one row
1079
+ `workdash list` requires a running `workdash` session and emits one row
865
1080
  per server-known item, sorted by last update (most recent first):
866
1081
 
867
1082
  ```
868
1083
  TYPE repo#TYPE-N YYYY-MM-DD title
869
1084
  ```
870
1085
 
871
- `TYPE` is `ISSUE`, `PR`, or `REVIEW` (for review-requested PRs). The row ID is
872
- copy/paste-friendly: `repo#ISSUE-N`, `repo#PR-N`, or `repo#REVIEW-N`. The suggested
1086
+ `TYPE` is `ISSUE`, `PR` (a PR you authored), `REVIEW` (for review-requested or
1087
+ already reviewed PRs), or `CHECK` (any other PR). The row ID is
1088
+ copy/paste-friendly: `repo#ISSUE-N`, `repo#PR-N`, `repo#REVIEW-N`,
1089
+ `repo#CHECK-N`, or `<target>#ISSUE-WT<n>` for a targeted todo. The suggested
873
1090
  item's title is prefixed with `* `. If nothing matches, the output is
874
1091
  `No work items found.`.
875
1092
 
@@ -878,9 +1095,111 @@ listing. Use `workdash list --json` to emit the same list as JSON records with
878
1095
  item ID, type, kind, repository, number, title, URL, timestamps, and suggested
879
1096
  status.
880
1097
 
1098
+ ## Ready command
1099
+
1100
+ `workdash ready SCOPE [--json]` requires a running `workdash` session
1101
+ and lists the GitHub work that can be picked up next, read straight from GitHub
1102
+ rather than from the dashboard. It only reports: nothing is claimed or launched.
1103
+
1104
+ `SCOPE` is one of:
1105
+
1106
+ - `owner/repo`: every open issue of the repository, including linked open pull
1107
+ requests in other repositories, and issues linked to its actionable authored pull requests.
1108
+ - An issue (`owner/repo#42`, `owner/repo#ISSUE-42`, a targeted todo ID, or an
1109
+ issue URL): the issue and its native sub-issue descendants, recursively and
1110
+ across repositories. A closed parent can scope open descendants.
1111
+ - `todo`: the server's todo repository.
1112
+ - `any`: every repository selected by the server's `repositories`, plus the todo
1113
+ repository.
1114
+
1115
+ Only issues are returned, never pull requests. An open issue is eligible when it
1116
+ has no open descendants or open `blocked by` issue and no live code pane holds
1117
+ its worktree. An open parent becomes eligible when all its descendants are
1118
+ closed: work on it can verify the overall goal. With no open linked pull request
1119
+ its action is `implement`. An issue linked to somebody else's open pull request
1120
+ is excluded; an authored open pull request must be pushable and need work:
1121
+ `address_review`, `fix_merge_conflicts`, or `fix_ci`. An issue whose pull request
1122
+ only waits for CI, review, or merge is absent. Unresolved inline review threads
1123
+ are actionable regardless of author, bot status, or subsequent pushes; general
1124
+ conversation comments and review bodies without a changes-requested verdict are not.
1125
+ A formal changes-requested review remains actionable across pushes regardless of reviewer
1126
+ identity, bot status, or whether it is minimized, until that reviewer is asked to review
1127
+ again or changes their verdict. The coding agent is instructed to
1128
+ address the review body, fix or explain and resolve each inline thread, and request
1129
+ re-review from each such reviewer; a failed request must be reported as a blocker.
1130
+
1131
+ Issues with actionable authored pull requests come first, ordered by pull request
1132
+ age; unstarted issues follow, ordered by issue age. Each issue is
1133
+ listed once. If one pull request links multiple eligible issues in the scope, its
1134
+ work appears once, under the issue with the first repository name and issue number.
1135
+ All applicable reasons appear in priority order: review feedback,
1136
+ merge conflicts, then failing CI. The issue ID can be passed to `code`, `analyze`,
1137
+ or `terminal`; the linked pull request is context. `--json` includes the PR head
1138
+ and base SHAs, mergeability, CI status (`passing`, `failing`, `pending`,
1139
+ `no_checks`, or `unknown`), failing checks, and feedback references. CI status
1140
+ comes from GitHub check metadata and base-branch required checks, not repository
1141
+ files. No ready work prints `No ready work found.`; GitHub or Zellij failures
1142
+ are errors rather than an empty result.
1143
+
1144
+ ## Dispatch command
1145
+
1146
+ `workdash dispatch SCOPE [--agent NAME] [--group NAME] [--host HOST] [--json]`
1147
+ asks the running server to select and launch at most one issue. Preview the same
1148
+ ordered candidates with `workdash ready SCOPE`; dispatch rechecks eligibility
1149
+ and skips candidates claimed by another caller. It uses the same scope forms as
1150
+ `ready`, including `todo` and `any`.
1151
+
1152
+ ```bash
1153
+ workdash dispatch owner/repo
1154
+ workdash dispatch owner/repo#42 --agent pi --group project --host dashboard.lan --json
1155
+ ```
1156
+
1157
+ Dispatch uses the issue as the coding target. If its authored pull request needs
1158
+ work, the agent resumes its existing branch with every applicable reason. The
1159
+ server supervises the new pane using autoclose after the client returns. The
1160
+ result reports `status=launched`, the issue, action, reasons, and actual pane ID;
1161
+ `status=no_ready_task` is a successful empty or exhausted scope. Unavailable
1162
+ GitHub or Zellij state and unconfirmed launches are errors, not empty results.
1163
+ The default Zellij group is the implementation repository's basename, including
1164
+ for a descendant in another repository; `--group` overrides it. The JSON API
1165
+ accepts `POST /api/v0/dispatch` with `scope` and optional `agent` and `group`.
1166
+
1167
+ Dispatch returns immediately; it does not wait for completion, create
1168
+ sub-issues, merge, or run a scheduler. Supervision is subject to the limitations
1169
+ in *Autoclose supervision* below.
1170
+
1171
+ ## Autodispatch sessions
1172
+
1173
+ `workdash autodispatch SCOPE [--group NAME] [--agent NAME] [--automerge]` starts a server-owned
1174
+ session and returns its ID without waiting for launched work. For an issue scope, it waits for the first readiness check and names an open blocker if there is one; a failure to check for blockers is an error. Other scopes return immediately. It uses the same scopes, readiness,
1175
+ parent behavior, claims and agent supervision as `dispatch`. Without `--group`, each task uses its implementation repository basename,
1176
+ including cross-repository work; `--group` overrides it. Each session dispatches one issue at a time, checks about every 30
1177
+ seconds for its pane to disappear, then synchronously reviews the linked open PR before checking readiness again. If there is no linked PR, review is skipped. The selected agent must support both coding and one-shot analysis. Review failure, including a failed or unconfirmed GitHub posting, fails the session and prevents automerge. The session fails before a tenth consecutive dispatch of the same issue; selecting another issue resets the count. By default it leaves PRs open. With `--automerge`, it merges only the unchanged reviewed head after rechecking feedback, checks, and mergeability. Actionable feedback, conflicts, or failing checks return to dispatch; the session waits and rechecks while a requested re-review, checks, or mergeability are pending or unknown. Incomplete review feedback fails the session. Stopping the session or disabling automerge ends the wait. A review already in progress cannot be used for automerge; enabling automerge during one starts a fresh review afterward. A head that changes during review or merge is reviewed again, with bounded retries. If a merge fails because of conflicts, the session continues to select ready work; other merge failures fail the session. The direct merge selects a method enabled in the repository settings, preferring squash, then merge commits, then rebase. It does not account for branch rulesets that further restrict merge methods, so GitHub may reject the selected method and fail the session. The review is agent-produced, not independent proof. Multiple independent sessions can run at once.
1178
+
1179
+ Feedback and checks can change between Workdash's readiness lookup and the GitHub
1180
+ merge. The head SHA guard only protects against changes to the commit, not those
1181
+ other changes. Use GitHub-enforced branch protection for policies that must be
1182
+ enforced atomically at merge time; Workdash's recheck is not such a guarantee.
1183
+
1184
+ `workdash info` and `workdash info --json` report sessions, their current task,
1185
+ status, elapsed time and any failure. The TUI shows running sessions, the three
1186
+ most recently started failed sessions, including failure details, and the three most
1187
+ recently started sessions with no work on their first check above the work table. Press Shift+Tab to focus progress and use the arrow keys or End to scroll it; press Tab to return to the work table. After three reminders and a further idle window with no pull request, a stuck session is blocked and remains visible. Any change in pane content resumes it and starts a fresh reminder window, whether caused by the agent or by input through Workdash or Zellij. Successful input through Workdash also resumes it immediately, even if the screen remains unchanged. The TUI does not provide a pane-input action. With progress focused, select a session with the arrow keys: `f` focuses its coding or active review pane while it is available, `m` toggles automerge for a running or blocked session, and `s` stops and removes it from progress, including a failed session. Stopping a blocked session closes its pane without changing the worktree. Stop a session with
1188
+ `workdash autodispatch-stop SESSION_ID`; stopping a blocked session closes its pane, while stopping a running session leaves its pane open. Starting another session for the same scope replaces the old one and also closes its pane if it is blocked. If the pane content has changed before either action closes it, the session still stops or is replaced, but that action leaves the recovered pane open. Starting an exact issue can still close its coding pane to dispatch ready work. A blocked pane is still checked for a later merged pull request.
1189
+ A dispatch already in progress may still finish launching its pane after stopping.
1190
+ Pane disappearance is not proof that the work was merged or completed.
1191
+ If dispatch, review, or the pane lookup fails, the session fails rather than treating the
1192
+ failure as an empty result. Sessions live only in the server process. After a
1193
+ restart, start another session on the same scope; readiness is checked afresh.
1194
+
1195
+ The API accepts `POST /api/v0/autodispatch` with `scope` and optional `group` and
1196
+ `agent` and boolean `automerge`, and `POST /api/v0/autodispatch_stop` with the session `id`.
1197
+ Session state is included in `POST /api/v0/info` as `autodispatch_sessions`;
1198
+ its `group` is null when no override was configured.
1199
+
881
1200
  ## Info command
882
1201
 
883
- `workdash info [--json]` requires a running `workdash --server` session and
1202
+ `workdash info [--json]` requires a running `workdash` session and
884
1203
  reports live Workdash-owned Zellij panes for terminal-backed work actions,
885
1204
  including pane title, cwd, command, tab, state, and mapped Workdash item. It maps
886
1205
  each live pane's current working directory to the matching Workdash item ID when
@@ -890,46 +1209,238 @@ Workdash session as `kind=unknown` with unknown item mapping.
890
1209
 
891
1210
  ## Analyze command
892
1211
 
893
- `workdash analyze ITEM [--agent NAME] [--json]` requires a running
894
- `workdash --server` session and analyzes a current server-known Workdash item.
895
- `ITEM` can be a row ID from `workdash list` (such as `owner/repo#ISSUE-123`) or a
896
- GitHub issue/PR URL that is already in the current dashboard data. It reuses a
897
- fresh cached analysis when available, otherwise the server prepares the item's
898
- worktree and runs the selected configured analysis agent.
899
-
900
- The server analyze response includes `content_type` (`text/markdown`), `file_name`,
901
- and base64 `file_content` so clients do not need filesystem access to the server
902
- cache. The CLI writes that content to a secure temporary local file and reports it
903
- as `analysis_path`. `--json` emits the same client-side result without the raw
904
- base64 content.
1212
+ `workdash analyze ITEM [--agent NAME] [--group NAME] [--json]` requires a running
1213
+ `workdash` session and analyzes a work item. `ITEM` can be a row ID from
1214
+ `workdash list` (such as `owner/repo#ISSUE-123`), `owner/repo#123` for an issue,
1215
+ or a GitHub issue/PR URL. The item does not need to be on the dashboard: the
1216
+ server looks up any issue or pull request it can access on GitHub, without adding
1217
+ it to `workdash list` or to the included items. `workdash terminal` accepts the
1218
+ same items. It reuses a
1219
+ fresh cached analysis when available. Otherwise, the server reuses the item's
1220
+ existing worktree, or analyzes an issue in a disposable detached worktree of the
1221
+ code repository's default branch. Pull requests use their head worktree. The server
1222
+ runs the selected configured analysis agent in a Zellij pane named
1223
+ `analyse_<worktree>`. The pane opens in the tab named by `--group`, or else in the
1224
+ tab named after the code repository's basename. A fresh analysis needs a known
1225
+ Zellij session; a cached analysis works without one.
1226
+
1227
+ The server analyze response includes Markdown and rendered HTML URLs using the
1228
+ request host. The CLI reports the Markdown URL; `--json` omits file content.
1229
+
1230
+ ## Review command
1231
+
1232
+ `workdash review ITEM [--agent NAME] [--group NAME] [--json]` requires a running
1233
+ server. ITEM accepts the same references as `analyze`: a pull request or an issue
1234
+ with a linked open pull request. If there is no open pull request, it reports
1235
+ nothing to review. The server prepares the PR worktree and starts a background
1236
+ review in a Zellij pane named `review_<worktree>`, opened in the tab named by
1237
+ `--group` or else the code repository's basename, using the selected configured
1238
+ analysis agent without using the analysis cache. A review needs a known Zellij
1239
+ session. The command returns the
1240
+ started review, agent, and intended document path on the server without waiting for completion.
1241
+ The document may not exist yet, and a failed review may not produce it. The first analysis
1242
+ agent is selected by default. The agent needs GitHub access and permission to
1243
+ post reviews; a restricted analysis command may not be suitable.
1244
+
1245
+ The agent is instructed to post only major findings as inline review comments,
1246
+ each beginning with 🤖, and submit a changes-requested review or approval as
1247
+ appropriate. It checks existing review threads and does not repeat
1248
+ already-described problems, regardless of who wrote them. For your own
1249
+ PR, based on the authenticated identity used to submit the review rather than
1250
+ the configured username, it submits a comment-only review, since GitHub does not
1251
+ permit self-approval or self-requested changes. If it cannot determine that
1252
+ identity, it is instructed not to submit a formal verdict and to report failure in the
1253
+ document. The agent writes a fresh document under the
1254
+ worktree's `.workdash/reviews/`, summarizing the outcome and explicitly listing
1255
+ posted comments or saying there were none. The document must begin with
1256
+ `Review outcome: success`, confirming that the review completed and all required
1257
+ GitHub postings succeeded. An explicit failure or an unconfirmed outcome fails
1258
+ the review; its document is retained for diagnosis. Starting a new review removes previous generated
1259
+ `review-<UUID>.md` documents in that worktree, except documents of active reviews;
1260
+ other files are left alone. If the document is missing or empty, Workdash retries
1261
+ once, asking the agent to check existing threads before posting again; a failed
1262
+ process or missing or empty document after
1263
+ retry is logged as an error by the server. Completion and the document path are
1264
+ logged by the server at debug logging level (`--debug`). Reviews are not supervised after the
1265
+ server exits. A concurrent request for the same pull request returns the same started information
1266
+ without starting another review; reviews of other pull requests can proceed.
1267
+ The document is agent-produced, not independent verification of GitHub's review state.
1268
+ `POST /api/v0/review` accepts `target` and optional `agent`.
905
1269
 
906
1270
  ## Code command
907
1271
 
908
- `workdash code ITEM [--agent NAME] [--json]` requires a running
909
- `workdash --server` session and launches a configured terminal-backed coding
910
- agent (`claude`, `codex`, or `pi`) for a current server-known Workdash item.
911
- `ITEM` accepts the same row IDs and GitHub URLs as `workdash analyze`.
912
-
913
- Human output reports the item, agent, selected session, cwd, pane title, and pane
914
- id when available. `--json` emits the same result as machine-readable JSON.
1272
+ `workdash code ITEM [--agent NAME] [--group NAME] [--autoclose] [--json]` requires a running
1273
+ `workdash` session and launches a configured coding agent for a work
1274
+ item. `ITEM` accepts the same items as `workdash analyze`. With `--group NAME`,
1275
+ the server opens a new agent pane in the named Zellij tab, creating it if needed;
1276
+ without it the pane opens in the current tab. This also works with `--host`.
1277
+ An existing agent remains in its current tab regardless of the requested group.
1278
+ The API accepts the same option as a `group` string.
1279
+
1280
+ At most one coding agent works in a worktree: its live `code_` Zellij pane is the
1281
+ claim, with no claim command or stored claim state. When an agent pane launched
1282
+ for the item's worktree is still live, including one started for another item
1283
+ sharing that worktree, wherever its cwd has moved, `code` starts nothing and reports `status` `already_running` with that
1284
+ pane. Otherwise it reports `launched` once the new pane is visible. If Zellij
1285
+ cannot list its panes, or a launched pane does not show up, `code` starts nothing
1286
+ and reports an error; a retry within a minute of an unconfirmed launch fails too.
1287
+ An agent that exits right after launch is reported as an error and does not block
1288
+ a retry.
1289
+ Terminal panes do not count. VSCode Copilot, offered only by the TUI, holds no
1290
+ claim and is not opened while an agent pane is live. In the TUI, `c` opens the
1291
+ code menu; choosing a numbered agent focuses any live agent pane for the worktree.
1292
+ Choosing terminal focuses an existing terminal in the worktree instead of opening
1293
+ another: a Workdash terminal, even when it runs a program or its shell changed
1294
+ directory, or a plain shell. Agent and diff panes are excluded, and so is a
1295
+ terminal in another worktree under the configured `workdir`, even one whose
1296
+ directory has the same name. Outside `workdir` a terminal carrying this
1297
+ worktree's Workdash title is treated as this worktree's terminal.
1298
+
1299
+ `workdash code` always autostarts the agent: its briefing ends with an appendix
1300
+ telling it to work without routine confirmation, commit, push, and open a pull
1301
+ request that closes the issue (or update the existing one), and verify the pull request's current head: CI `passing`, or GitHub reporting no required or
1302
+ observed checks (`no_checks`), and a clean merge. It never merges or closes
1303
+ anything, and the agent stays in its interactive pane. Commit and push are
1304
+ explicitly requested; if a force-push is needed, the briefing permits it only
1305
+ on the pull request branch, preferably with a lease and subject to repository
1306
+ restrictions. The state-specific task
1307
+ comes from the same GitHub classification as `ready`: an issue is implemented, an
1308
+ issue an open pull request of yours closes resumes that pull request in place, and a pull
1309
+ request with review feedback, merge conflicts, or failing CI is repaired on its
1310
+ own branch with every reason included. A pull request waiting on CI, review, or
1311
+ merge is described, not reworked, and somebody else's pull request stays a
1312
+ review-only session. There is no `--autostart` option; the TUI's `c` keeps the
1313
+ plan-first briefing and never commits or pushes by itself, and the HTTP
1314
+ `POST /api/v0/code` takes optional boolean `autostart` and `autoclose`, both
1315
+ false when omitted. `already_running` injects nothing into the running agent.
1316
+
1317
+ Coding an authored pull request linked to an issue is the same implementation
1318
+ task as coding that issue: it uses the issue target and cached issue analysis,
1319
+ when available, while continuing the pull request branch. An authored pull
1320
+ request without a linked issue remains the target. Reviewing somebody else's
1321
+ pull request uses its cached pull request analysis instead; linked issues are
1322
+ background, not instructions to implement. An open parent whose descendants are
1323
+ closed is briefed to verify its goal and, if already implemented, prove the
1324
+ workflow with a test.
1325
+
1326
+ Human output reports the status, item, agent, selected session, actual tab, cwd,
1327
+ pane title, and pane id when available, plus an `Autoclose` line saying whether
1328
+ monitoring was enabled when the request asked for autoclose. `--json` emits the
1329
+ same result as machine-readable JSON.
1330
+
1331
+ ### Autoclose supervision
1332
+
1333
+ `workdash code ITEM --autoclose` leaves the agent in its normal interactive pane
1334
+ and asks the server to supervise the pane it just launched. The CLI polls
1335
+ nothing itself: it sends `autostart` and `autoclose` to the server, which owns
1336
+ the GitHub lookups, the messages, and the pane. Autoclose requires autostart, so
1337
+ the HTTP API answers `bad_request` (400) to `{"autoclose": true}` without
1338
+ `autostart: true`; the CLI always autostarts, and the TUI asks for neither.
1339
+ `already_running` never turns a pane started elsewhere into a supervised one, and
1340
+ the response reports `autoclose_enabled` only when a request asked for it.
1341
+
1342
+ About every 30 seconds the server compares the pane's screen with the previous
1343
+ check. New output postpones every decision. After 5 minutes without new output
1344
+ and without a message from Workdash, the server asks GitHub what the work still
1345
+ needs, using the same classification `workdash ready` uses, and sends the same
1346
+ instruction the agent was briefed with: implement the issue, fix failing checks,
1347
+ resolve merge conflicts, or address review feedback. A new head, check result,
1348
+ review, base head, or mergeability is a new state; the same pull request state is never
1349
+ messaged twice, and every message restarts the 5 minutes. A pull request that
1350
+ merged closes its pane on the next check, even while the agent is still writing.
1351
+ A previously merged pull request does not finish a reopened issue, which continues to
1352
+ receive implementation reminders. A pane explicitly targeting a pull request that
1353
+ merged before launch is left alone. GitHub reports merges only to the second, so a
1354
+ merge in the launch second is ambiguous and does not close the pane. A supervised session on somebody else's pull
1355
+ request is never messaged and closes only once that pull request merges after launch.
1356
+
1357
+ Only a known pull request's state is read on every check: finding the pull
1358
+ request an issue now has, and deciding what an idle pane needs, each cost a whole
1359
+ work state, so each runs at most every five minutes. That lookup also finds a pull
1360
+ request that opened and merged since the previous one, so such work closes its
1361
+ pane at the next lookup, at most about five minutes late. If instruction text reached the pane, a failed Enter keystroke is retried
1362
+ on its own without typing the text again, unless the pane printed something since, which abandons that
1363
+ instruction instead of answering whatever the agent now asks.
1364
+
1365
+ Work counts as finished only when GitHub reports the current head's checks as
1366
+ passing or verifiably absent, clean mergeability against the current base, and no
1367
+ outstanding review feedback, and the worktree holds no local work GitHub does not
1368
+ have: an edited file, a new file the agent never added, or a commit it lacks. Only
1369
+ the worktree's `.workdash/` artifact directory is left out of that check; any other
1370
+ local work keeps the pane open and the server logs that reason. That check reads
1371
+ the GitHub state of a pane already found idle, and the pane's identity and screen
1372
+ are compared once more right before closing; the worktree, branch, and pull
1373
+ request are left alone. Pending, unknown, or unavailable GitHub answers
1374
+ close nothing and report no success, and a failed GitHub or Zellij call backs off
1375
+ instead of messaging. A pull request closed without merging is neither completion
1376
+ nor work to redo on its own: its pane is left open, supervision of it stops, and
1377
+ the server logs that the pane needs review.
1378
+
1379
+ **Limitation:** supervision lives only in the running `workdash`
1380
+ process, so it stops when the server restarts and never resumes on its own. The
1381
+ pane's identity is the session name, the pane ID, and the pane title Zellij
1382
+ reports after the launch, revalidated immediately before every message or close,
1383
+ and a pane whose identity stops matching is dropped from supervision for good:
1384
+ the action is abandoned and it is never messaged or closed again. A Zellij
1385
+ session recreated under the same name can reuse a pane ID, so this identity is
1386
+ the strongest evidence Zellij offers rather than a guarantee about which program
1387
+ owns the pane. Supervision is a heuristic: a silent long-running command, a
1388
+ pending question, or an agent waiting for permission looks exactly like a
1389
+ finished one, except when the pull request merges. A pane that cannot be checked
1390
+ surfaces only in the server log, as warnings spaced two, five, then fifteen
1391
+ minutes apart; once its checks keep failing at the longest of those waits, one
1392
+ further line reports the pane as stalled, and a stall after a successful check is
1393
+ reported again. When no pull request exists, the same work instruction is sent up to three times, each after a full idle window; another full idle window leaves the pane blocked. Pane activity postpones these decisions but does not reset the reminder count until the pane recovers from being blocked. A pull request state that does not change is never messaged twice.
915
1394
 
916
1395
  ## Read and write commands
917
1396
 
918
- `workdash read PANE_ID [--full] [--json]` requires a running `workdash --server`
1397
+ `workdash read PANE_ID [--full] [--json]` requires a running `workdash`
919
1398
  session and reads pane text through the server-backed pane content API. Human
920
1399
  output prints the pane text directly. Add `--full` to request full scrollback.
921
1400
 
922
1401
  `workdash write PANE_ID TEXT [--raw] [--json]` requires a running
923
- `workdash --server` session and sends pane input through the server-backed pane
1402
+ `workdash` session and sends pane input through the server-backed pane
924
1403
  send API. By default Workdash appends Enter; `--raw` or `--no-enter` sends the
925
1404
  text exactly. Human output confirms that the pane accepted the input.
926
1405
 
927
1406
  ## Show-config command
928
1407
 
929
1408
  `workdash show-config [--json]` reports configured analysis agents, configured
930
- terminal-backed coding agents, and the fixed V0 server address. It does not
931
- require a running server. The same information is also available from the JSON
932
- API for HTTP clients.
1409
+ coding agents, and the selected server address. It does not require a running
1410
+ server. The same information is also available from the JSON API for HTTP
1411
+ clients.
1412
+
1413
+ ## View command
1414
+
1415
+ `workdash view TARGET` shows one document in the built-in viewer. `TARGET` is a
1416
+ local path, a `file://` URL, an HTTP or HTTPS URL, a GitHub issue or pull
1417
+ request URL, `owner/repo#NUMBER`, or a bare `NUMBER` or `#NUMBER` resolved
1418
+ against the current directory's `origin` remote. Only GitHub targets are looked
1419
+ up with `gh`; a local file never contacts GitHub. Whether a GitHub target is an
1420
+ issue or a pull request comes from GitHub, not from the URL. The command needs
1421
+ no running server.
1422
+
1423
+ A GitHub document starts with the title, a metadata line, and a labels,
1424
+ assignees, milestone and comments line. A pull request also reports draft,
1425
+ mergeable, merge state and review decision, plus CI, reviews and review threads
1426
+ (capped at 50 threads, 100 comments per thread and 20 failing checks, with a
1427
+ truncation note). The description preserves its original Markdown; bare issue
1428
+ and pull request references are not converted to links. Sub-issues are listed as
1429
+ a table at every nesting level.
1430
+
1431
+ Inside the viewer, activating a link to a Markdown document opens it in the same
1432
+ viewer, and activating a link to a GitHub issue or pull request shows that item
1433
+ the same way. A Markdown file hosted on GitHub is a repository page rather than
1434
+ a document, so that link goes to the configured `open` command. Relative links
1435
+ resolve against the directory of the viewed file or against the address of the
1436
+ remote document. Any other link runs the configured `open` command, and the
1437
+ viewer reports the command it used in its status line.
1438
+ While a document is fetched the viewer says that it is loading; when a link
1439
+ cannot be loaded or opened, the message goes to the status line and the current
1440
+ document stays on screen. `b` returns to the previous document and is offered
1441
+ only while there is one, and links to headings scroll within the current
1442
+ document. Following a document or item link never opens a pane and never
1443
+ replaces the running viewer, with or without Zellij.
933
1444
 
934
1445
  ## Analysis cache
935
1446
 
@@ -956,12 +1467,21 @@ This applies to agents and humans alike. A change that lands code without a matc
956
1467
 
957
1468
  ## Tests
958
1469
 
959
- From the repository root:
1470
+ From the repository root, run the default suite:
960
1471
 
961
1472
  ```bash
962
1473
  PYTHONPATH=src pytest
963
1474
  ```
964
1475
 
1476
+ The browser security test is excluded by default. To run it, install Chromium
1477
+ (or Chrome) and Node.js with built-in WebSocket support, then run:
1478
+
1479
+ ```bash
1480
+ PYTHONPATH=src pytest -m browser
1481
+ ```
1482
+
1483
+ Set `CHROME_BIN` to the browser executable if it is not on `PATH`.
1484
+
965
1485
  ### BDD suite
966
1486
 
967
1487
  `tests/bdd/` drives development from the `.feature` files in `features/`.