@knpkv/jira-clockify 1.3.0 → 1.4.1

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 (242) hide show
  1. package/README.md +245 -1
  2. package/dist/package.json +36 -12
  3. package/dist/src/agent/agentSettings.d.ts +18 -0
  4. package/dist/src/agent/agentSettings.d.ts.map +1 -0
  5. package/dist/src/agent/agentSettings.js +23 -0
  6. package/dist/src/agent/agentSettings.js.map +1 -0
  7. package/dist/src/agent/schedule.d.ts +20 -0
  8. package/dist/src/agent/schedule.d.ts.map +1 -0
  9. package/dist/src/agent/schedule.js +189 -0
  10. package/dist/src/agent/schedule.js.map +1 -0
  11. package/dist/src/agent/sessions.d.ts +427 -0
  12. package/dist/src/agent/sessions.d.ts.map +1 -0
  13. package/dist/src/agent/sessions.js +868 -0
  14. package/dist/src/agent/sessions.js.map +1 -0
  15. package/dist/src/agent/sourceConsumption.d.ts +79 -0
  16. package/dist/src/agent/sourceConsumption.d.ts.map +1 -0
  17. package/dist/src/agent/sourceConsumption.js +191 -0
  18. package/dist/src/agent/sourceConsumption.js.map +1 -0
  19. package/dist/src/agent/watch.d.ts +76 -0
  20. package/dist/src/agent/watch.d.ts.map +1 -0
  21. package/dist/src/agent/watch.js +45 -0
  22. package/dist/src/agent/watch.js.map +1 -0
  23. package/dist/src/agent/writePlanning.d.ts +154 -0
  24. package/dist/src/agent/writePlanning.d.ts.map +1 -0
  25. package/dist/src/agent/writePlanning.js +210 -0
  26. package/dist/src/agent/writePlanning.js.map +1 -0
  27. package/dist/src/bin.d.ts +3 -0
  28. package/dist/src/bin.d.ts.map +1 -0
  29. package/dist/src/bin.js +9 -3
  30. package/dist/src/bin.js.map +1 -1
  31. package/dist/src/cli/agentWrite.d.ts +164 -0
  32. package/dist/src/cli/agentWrite.d.ts.map +1 -0
  33. package/dist/src/cli/agentWrite.js +362 -0
  34. package/dist/src/cli/agentWrite.js.map +1 -0
  35. package/dist/src/cli/auth.d.ts +8 -0
  36. package/dist/src/cli/auth.d.ts.map +1 -0
  37. package/dist/src/cli/auth.js +10 -10
  38. package/dist/src/cli/auth.js.map +1 -1
  39. package/dist/src/cli/calendar.d.ts +42 -0
  40. package/dist/src/cli/calendar.d.ts.map +1 -0
  41. package/dist/src/cli/calendar.js +189 -0
  42. package/dist/src/cli/calendar.js.map +1 -0
  43. package/dist/src/cli/config.d.ts +12 -0
  44. package/dist/src/cli/config.d.ts.map +1 -0
  45. package/dist/src/cli/config.js +163 -21
  46. package/dist/src/cli/config.js.map +1 -1
  47. package/dist/src/cli/fetchTicket.d.ts +51 -0
  48. package/dist/src/cli/fetchTicket.d.ts.map +1 -0
  49. package/dist/src/cli/fetchTicket.js +18 -2
  50. package/dist/src/cli/fetchTicket.js.map +1 -1
  51. package/dist/src/cli/fuzzySelect.d.ts +24 -0
  52. package/dist/src/cli/fuzzySelect.d.ts.map +1 -0
  53. package/dist/src/cli/layers.d.ts +40 -0
  54. package/dist/src/cli/layers.d.ts.map +1 -0
  55. package/dist/src/cli/layers.js +57 -13
  56. package/dist/src/cli/layers.js.map +1 -1
  57. package/dist/src/cli/list.d.ts +8 -0
  58. package/dist/src/cli/list.d.ts.map +1 -0
  59. package/dist/src/cli/list.js +2 -2
  60. package/dist/src/cli/list.js.map +1 -1
  61. package/dist/src/cli/reconcile.d.ts +129 -0
  62. package/dist/src/cli/reconcile.d.ts.map +1 -0
  63. package/dist/src/cli/reconcile.js +635 -46
  64. package/dist/src/cli/reconcile.js.map +1 -1
  65. package/dist/src/cli/root.d.ts +15 -0
  66. package/dist/src/cli/root.d.ts.map +1 -0
  67. package/dist/src/cli/root.js +4 -3
  68. package/dist/src/cli/root.js.map +1 -1
  69. package/dist/src/cli/runtimeFailure.d.ts +10 -0
  70. package/dist/src/cli/runtimeFailure.d.ts.map +1 -0
  71. package/dist/src/cli/runtimeFailure.js +17 -0
  72. package/dist/src/cli/runtimeFailure.js.map +1 -0
  73. package/dist/src/cli/setup.d.ts +10 -0
  74. package/dist/src/cli/setup.d.ts.map +1 -0
  75. package/dist/src/cli/setup.js +7 -7
  76. package/dist/src/cli/setup.js.map +1 -1
  77. package/dist/src/cli/timer/discard.d.ts +4 -0
  78. package/dist/src/cli/timer/discard.d.ts.map +1 -0
  79. package/dist/src/cli/timer/discard.js +2 -2
  80. package/dist/src/cli/timer/discard.js.map +1 -1
  81. package/dist/src/cli/timer/edit.d.ts +22 -0
  82. package/dist/src/cli/timer/edit.d.ts.map +1 -0
  83. package/dist/src/cli/timer/edit.js +62 -42
  84. package/dist/src/cli/timer/edit.js.map +1 -1
  85. package/dist/src/cli/timer/index.d.ts +12 -0
  86. package/dist/src/cli/timer/index.d.ts.map +1 -0
  87. package/dist/src/cli/timer/log.d.ts +16 -0
  88. package/dist/src/cli/timer/log.d.ts.map +1 -0
  89. package/dist/src/cli/timer/log.js +6 -6
  90. package/dist/src/cli/timer/log.js.map +1 -1
  91. package/dist/src/cli/timer/start.d.ts +21 -0
  92. package/dist/src/cli/timer/start.d.ts.map +1 -0
  93. package/dist/src/cli/timer/start.js +9 -9
  94. package/dist/src/cli/timer/start.js.map +1 -1
  95. package/dist/src/cli/timer/status.d.ts +22 -0
  96. package/dist/src/cli/timer/status.d.ts.map +1 -0
  97. package/dist/src/cli/timer/status.js +3 -3
  98. package/dist/src/cli/timer/status.js.map +1 -1
  99. package/dist/src/cli/timer/stop.d.ts +48 -0
  100. package/dist/src/cli/timer/stop.d.ts.map +1 -0
  101. package/dist/src/cli/timer/stop.js +19 -19
  102. package/dist/src/cli/timer/stop.js.map +1 -1
  103. package/dist/src/cli/timer.d.ts +11 -0
  104. package/dist/src/cli/timer.d.ts.map +1 -0
  105. package/dist/src/cli/timer.js +1 -1
  106. package/dist/src/cli/timer.js.map +1 -1
  107. package/dist/src/cli/watch.d.ts +54 -0
  108. package/dist/src/cli/watch.d.ts.map +1 -0
  109. package/dist/src/cli/watch.js +412 -0
  110. package/dist/src/cli/watch.js.map +1 -0
  111. package/dist/src/cli/watchLease.d.ts +99 -0
  112. package/dist/src/cli/watchLease.d.ts.map +1 -0
  113. package/dist/src/cli/watchLease.js +204 -0
  114. package/dist/src/cli/watchLease.js.map +1 -0
  115. package/dist/src/cli/writerGuard.d.ts +37 -0
  116. package/dist/src/cli/writerGuard.d.ts.map +1 -0
  117. package/dist/src/cli/writerGuard.js +92 -0
  118. package/dist/src/cli/writerGuard.js.map +1 -0
  119. package/dist/src/index.d.ts +46 -0
  120. package/dist/src/index.d.ts.map +1 -0
  121. package/dist/src/index.js +46 -0
  122. package/dist/src/index.js.map +1 -0
  123. package/dist/src/main.d.ts +4 -0
  124. package/dist/src/main.d.ts.map +1 -0
  125. package/dist/src/services/AgentSessionReader.d.ts +121 -0
  126. package/dist/src/services/AgentSessionReader.d.ts.map +1 -0
  127. package/dist/src/services/AgentSessionReader.js +392 -0
  128. package/dist/src/services/AgentSessionReader.js.map +1 -0
  129. package/dist/src/services/ClockifyAuth.d.ts +47 -0
  130. package/dist/src/services/ClockifyAuth.d.ts.map +1 -0
  131. package/dist/src/services/ClockifyAuth.js +2 -2
  132. package/dist/src/services/ClockifyAuth.js.map +1 -1
  133. package/dist/src/services/CodexTranscript.d.ts +112 -0
  134. package/dist/src/services/CodexTranscript.d.ts.map +1 -0
  135. package/dist/src/services/CodexTranscript.js +96 -0
  136. package/dist/src/services/CodexTranscript.js.map +1 -0
  137. package/dist/src/services/ConfigService.d.ts +99 -0
  138. package/dist/src/services/ConfigService.d.ts.map +1 -0
  139. package/dist/src/services/ConfigService.js +79 -7
  140. package/dist/src/services/ConfigService.js.map +1 -1
  141. package/dist/src/services/HomeDirectory.d.ts +17 -0
  142. package/dist/src/services/HomeDirectory.d.ts.map +1 -0
  143. package/dist/src/services/HomeDirectory.js +1 -1
  144. package/dist/src/services/IssueFacts.d.ts +127 -0
  145. package/dist/src/services/IssueFacts.d.ts.map +1 -0
  146. package/dist/src/services/IssueFacts.js +277 -0
  147. package/dist/src/services/IssueFacts.js.map +1 -0
  148. package/dist/src/services/ProviderDeletion.d.ts +19 -0
  149. package/dist/src/services/ProviderDeletion.d.ts.map +1 -0
  150. package/dist/src/services/ProviderDeletion.js +37 -0
  151. package/dist/src/services/ProviderDeletion.js.map +1 -0
  152. package/dist/src/services/ReconcileService.d.ts +378 -0
  153. package/dist/src/services/ReconcileService.d.ts.map +1 -0
  154. package/dist/src/services/ReconcileService.js +1270 -79
  155. package/dist/src/services/ReconcileService.js.map +1 -1
  156. package/dist/src/services/SavedEntries.d.ts +40 -0
  157. package/dist/src/services/SavedEntries.d.ts.map +1 -0
  158. package/dist/src/services/SavedEntries.js +209 -0
  159. package/dist/src/services/SavedEntries.js.map +1 -0
  160. package/dist/src/services/SessionAttributor.d.ts +114 -0
  161. package/dist/src/services/SessionAttributor.d.ts.map +1 -0
  162. package/dist/src/services/SessionAttributor.js +240 -0
  163. package/dist/src/services/SessionAttributor.js.map +1 -0
  164. package/dist/src/services/SourceLedger.d.ts +104 -0
  165. package/dist/src/services/SourceLedger.d.ts.map +1 -0
  166. package/dist/src/services/SourceLedger.js +302 -0
  167. package/dist/src/services/SourceLedger.js.map +1 -0
  168. package/dist/src/services/StateWriter.d.ts +39 -0
  169. package/dist/src/services/StateWriter.d.ts.map +1 -0
  170. package/dist/src/services/TicketService.d.ts +63 -0
  171. package/dist/src/services/TicketService.d.ts.map +1 -0
  172. package/dist/src/services/TimerService.d.ts +145 -0
  173. package/dist/src/services/TimerService.d.ts.map +1 -0
  174. package/dist/src/services/TimerService.js +113 -80
  175. package/dist/src/services/TimerService.js.map +1 -1
  176. package/dist/src/services/internal/JiraWorklogPost.d.ts +7 -0
  177. package/dist/src/services/internal/JiraWorklogPost.d.ts.map +1 -0
  178. package/dist/src/services/internal/JiraWorklogPost.js +32 -0
  179. package/dist/src/services/internal/JiraWorklogPost.js.map +1 -0
  180. package/dist/src/testing/fakeHeadless.d.ts +318 -0
  181. package/dist/src/testing/fakeHeadless.d.ts.map +1 -0
  182. package/dist/src/testing/fakeHeadless.js +1149 -0
  183. package/dist/src/testing/fakeHeadless.js.map +1 -0
  184. package/dist/src/tui/App.d.ts +6 -0
  185. package/dist/src/tui/App.d.ts.map +1 -0
  186. package/dist/src/tui/App.js +1 -1
  187. package/dist/src/tui/App.js.map +1 -1
  188. package/dist/src/tui/atoms/runtime.d.ts +8 -0
  189. package/dist/src/tui/atoms/runtime.d.ts.map +1 -0
  190. package/dist/src/tui/atoms/runtime.js +1 -1
  191. package/dist/src/tui/atoms/runtime.js.map +1 -1
  192. package/dist/src/tui/atoms/tickets.d.ts +3 -0
  193. package/dist/src/tui/atoms/tickets.d.ts.map +1 -0
  194. package/dist/src/tui/atoms/timer.d.ts +11 -0
  195. package/dist/src/tui/atoms/timer.d.ts.map +1 -0
  196. package/dist/src/tui/atoms/timer.js +1 -1
  197. package/dist/src/tui/atoms/timer.js.map +1 -1
  198. package/dist/src/tui/atoms/ui.d.ts +11 -0
  199. package/dist/src/tui/atoms/ui.d.ts.map +1 -0
  200. package/dist/src/tui/atoms/ui.js +1 -1
  201. package/dist/src/tui/atoms/ui.js.map +1 -1
  202. package/dist/src/tui/components/BigTimer.d.ts +2 -0
  203. package/dist/src/tui/components/BigTimer.d.ts.map +1 -0
  204. package/dist/src/tui/components/Footer.d.ts +2 -0
  205. package/dist/src/tui/components/Footer.d.ts.map +1 -0
  206. package/dist/src/tui/components/Header.d.ts +2 -0
  207. package/dist/src/tui/components/Header.d.ts.map +1 -0
  208. package/dist/src/tui/components/Header.js +1 -1
  209. package/dist/src/tui/components/Header.js.map +1 -1
  210. package/dist/src/tui/components/PopupInput.d.ts +18 -0
  211. package/dist/src/tui/components/PopupInput.d.ts.map +1 -0
  212. package/dist/src/tui/components/PopupMessage.d.ts +20 -0
  213. package/dist/src/tui/components/PopupMessage.d.ts.map +1 -0
  214. package/dist/src/tui/components/TicketList.d.ts +2 -0
  215. package/dist/src/tui/components/TicketList.d.ts.map +1 -0
  216. package/dist/src/tui/components/TicketList.js +1 -1
  217. package/dist/src/tui/components/TicketList.js.map +1 -1
  218. package/dist/src/tui/components/TicketRow.d.ts +8 -0
  219. package/dist/src/tui/components/TicketRow.d.ts.map +1 -0
  220. package/dist/src/tui/components/TimerDisplay.d.ts +2 -0
  221. package/dist/src/tui/components/TimerDisplay.d.ts.map +1 -0
  222. package/dist/src/tui/components/index.d.ts +12 -0
  223. package/dist/src/tui/components/index.d.ts.map +1 -0
  224. package/dist/src/tui/context/theme.d.ts +15 -0
  225. package/dist/src/tui/context/theme.d.ts.map +1 -0
  226. package/dist/src/tui/hooks/useElapsedTimer.d.ts +6 -0
  227. package/dist/src/tui/hooks/useElapsedTimer.d.ts.map +1 -0
  228. package/dist/src/tui/hooks/useElapsedTimer.js +1 -1
  229. package/dist/src/tui/hooks/useElapsedTimer.js.map +1 -1
  230. package/dist/src/tui/hooks/useTerminalSize.d.ts +5 -0
  231. package/dist/src/tui/hooks/useTerminalSize.d.ts.map +1 -0
  232. package/dist/src/utils/hints.d.ts +12 -0
  233. package/dist/src/utils/hints.d.ts.map +1 -0
  234. package/dist/src/utils/hints.js +12 -0
  235. package/dist/src/utils/hints.js.map +1 -0
  236. package/dist/src/utils/time.d.ts +104 -0
  237. package/dist/src/utils/time.d.ts.map +1 -0
  238. package/dist/src/utils/time.js +74 -8
  239. package/dist/src/utils/time.js.map +1 -1
  240. package/dist/tsconfig.tsbuildinfo +1 -1
  241. package/package.json +36 -18
  242. package/skills/jcf/SKILL.md +93 -1
package/package.json CHANGED
@@ -1,10 +1,25 @@
1
1
  {
2
2
  "name": "@knpkv/jira-clockify",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "TUI for Jira-Clockify time tracking, attachable to neovim",
5
5
  "license": "MIT",
6
6
  "author": "knpkv",
7
7
  "type": "module",
8
+ "main": "dist/src/index.js",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/src/index.d.ts",
12
+ "default": "./dist/src/index.js"
13
+ },
14
+ "./testing.js": {
15
+ "types": "./dist/src/testing/fakeHeadless.d.ts",
16
+ "default": "./dist/src/testing/fakeHeadless.js"
17
+ },
18
+ "./*.js": {
19
+ "types": "./dist/src/*.d.ts",
20
+ "default": "./dist/src/*.js"
21
+ }
22
+ },
8
23
  "bin": {
9
24
  "jcf": "dist/src/bin.js"
10
25
  },
@@ -18,30 +33,33 @@
18
33
  "skills"
19
34
  ],
20
35
  "dependencies": {
21
- "@effect/atom-react": "4.0.0-rc.109",
22
- "@effect/platform-node": "4.0.0-rc.109",
23
- "@opentui/core": "0.5.1",
24
- "@opentui/react": "0.5.1",
25
- "effect": "4.0.0-rc.109",
26
- "react": "^19.2.8",
27
- "@knpkv/agent-skills": "^0.3.1",
28
- "@knpkv/atlassian-common": "^1.4.1",
29
- "@knpkv/clockify-api-client": "^1.1.1",
30
- "@knpkv/jira-api-client": "^1.1.1",
31
- "@knpkv/jira-cli": "^1.3.1"
36
+ "@effect/atom-react": "4.0.0",
37
+ "@effect/platform-node": "4.0.0",
38
+ "@opentui/core": "0.5.14",
39
+ "@opentui/react": "0.5.14",
40
+ "effect": "4.0.0",
41
+ "react": "^19.3.0",
42
+ "@knpkv/agent-skills": "^0.3.2",
43
+ "@knpkv/ai-claude": "^0.4.0",
44
+ "@knpkv/atlassian-common": "^1.6.0",
45
+ "@knpkv/ai-codex": "^0.5.0",
46
+ "@knpkv/clockify-api-client": "^2.0.0",
47
+ "@knpkv/jira-api-client": "^2.0.0",
48
+ "@knpkv/jira-cli": "^1.4.1"
32
49
  },
33
50
  "devDependencies": {
34
- "@effect/vitest": "4.0.0-rc.109",
51
+ "@effect/vitest": "4.0.0",
35
52
  "@types/node": "latest",
36
- "@types/react": "^19.2.18",
37
- "tsx": "^4.23.12",
38
- "vitest": "^4.1.10"
53
+ "@types/react": "^19.3.0",
54
+ "tsx": "^4.23.15",
55
+ "vitest": "^5.0.3"
39
56
  },
40
57
  "scripts": {
41
58
  "start": "tsx src/bin.ts",
42
59
  "build": "tsc -b && chmod +x dist/src/bin.js",
43
- "check": "tsc -b tsconfig.json",
60
+ "check": "tsc -b tsconfig.json && tsc --noEmit -p test/tsconfig.json",
44
61
  "test": "vitest",
45
62
  "lint": "eslint \"{src,test}/**/*.{ts,tsx}\""
46
- }
63
+ },
64
+ "types": "dist/src/index.d.ts"
47
65
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jcf
3
- description: Use the @knpkv/jira-clockify CLI to track work across Jira and Clockify. Trigger when the user asks an agent to start, stop, discard, edit, inspect, or manually log time for Jira tickets; configure Jira OAuth or Clockify API access; list current Jira tickets; set default Clockify project, billable flag, or JQL; or launch the jcf TUI.
3
+ description: Use the @knpkv/jira-clockify CLI to track work across Jira and Clockify. Trigger when the user asks an agent to start, stop, discard, edit, inspect, or manually log time for Jira tickets; reconcile Clockify against Jira or recover forgotten time from local Claude Code and Codex sessions; configure Jira OAuth or Clockify API access; list current Jira tickets; set default Clockify project, billable flag, or JQL; or launch the jcf TUI.
4
4
  ---
5
5
 
6
6
  # Jcf
@@ -38,6 +38,15 @@ jcf config set jql 'assignee = currentUser() AND status != Done ORDER BY updated
38
38
  jcf config reset
39
39
  ```
40
40
 
41
+ Configure which directories' Claude Code and Codex sessions may become proposed worklogs:
42
+
43
+ ```bash
44
+ jcf config set session-root ~/dev/work
45
+ jcf config set session-root ~/dev/work --remove
46
+ jcf config set session-ticket ~/dev/work/docs PROJ-42
47
+ jcf config set idle-cap 300
48
+ ```
49
+
41
50
  ## Timer Commands
42
51
 
43
52
  Launch the TUI:
@@ -85,6 +94,87 @@ Edit the running timer:
85
94
  jcf timer edit
86
95
  ```
87
96
 
97
+ ## Reconcile Commands
98
+
99
+ Both forms are remote write commands: they create Clockify entries and Jira worklogs. Never run
100
+ either unattended. Confirm the window and the direction (or the agent) with the user first, and
101
+ prefer the read-only forms below when gathering information.
102
+
103
+ Compare the two sides and fill whichever is short:
104
+
105
+ ```bash
106
+ jcf sync reconcile clockify-to-jira --day
107
+ jcf sync reconcile jira-to-clockify --week
108
+ jcf sync reconcile clockify-to-jira --since 2026-07-01 --until 2026-07-07
109
+ ```
110
+
111
+ Recover time neither side recorded, using local Claude Code and Codex sessions as evidence:
112
+
113
+ ```bash
114
+ jcf sync reconcile --agent claude --day
115
+ jcf sync reconcile --agent claude --week
116
+ jcf sync reconcile --agent claude --json
117
+ jcf sync reconcile --agent claude --day --calendar
118
+ ```
119
+
120
+ - `--agent` is a mode switch, not a direction. Passing both is a usage error.
121
+ - `claude` is the only supported agent mode; `--agent codex` fails. That mode reads in-scope Claude Code
122
+ and Codex sessions as evidence.
123
+ - `--agent claude --json` is the read-only form: it writes exactly one JSON value to stdout, sends
124
+ everything human-facing to stderr, and creates no Clockify entry or Jira worklog. Use it to
125
+ inspect proposals before asking the user which to accept.
126
+ - Without `--json`, every row needs an interactive confirmation, so this form is unsuitable for
127
+ unattended use.
128
+ - Nothing is proposed for a directory outside the configured session roots, and a day with a timer
129
+ still running is reported but never proposed. Stop the timer and re-run to log that day.
130
+ - Every picker row names the issue summary and assignee; `--json` carries both as `summary` and
131
+ `assignee`. Rows are not listed above the picker — the picker rows _are_ the report.
132
+ - Written entries carry the issue title and an agent-written sentence saying what was done, read off
133
+ the session prompts. Notes are asked for only about confirmed rows, and only when writing, so
134
+ `--json` never spends a call on one. A row still writes when no note can be produced.
135
+ - `--calendar` adds an ASCII hour-by-hour grid of when the time was credited. `--json` carries the
136
+ same information as a `blocks` array per proposal, with `startMs`, `endMs` and credited `seconds`,
137
+ plus the issue `summary`. Sum `seconds`, not wall-clock bounds, for shared work.
138
+ - In `--json`, `ownershipWithheld` keeps rows assigned to someone else or unassigned, with a
139
+ `reason`; `withheld` remains the separate confidence-floor list. Neither list is offered to write.
140
+ - `--json` and `--calendar` are agent-mode flags; passing either without `--agent` is a usage error.
141
+ - Only messages the user typed count towards time; the agent's own output, its tool results, and
142
+ prompts it sends its own subagents do not, so an unattended agent run credits at most the idle cap
143
+ rather than the hour it ran for.
144
+ - If Jira cannot be read, the run fails rather than proposing time that may already be logged.
145
+ - Time worked on several issues at once is split equally between them, so a row's credited total can
146
+ be lower than the clock ranges beneath it; the report names the active total and the shared amount.
147
+ - Each proposal shows the attribution signal behind it (`branch`, `path`, `standing`, `agent`).
148
+ A branch name states intent, not fact: time spent on an unrelated fix while on a ticket branch is
149
+ credited to that branch's ticket, so review the signal before confirming.
150
+
151
+ ## Watch Command
152
+
153
+ ```bash
154
+ jcf watch claude # Runs until interrupted; writes as work settles
155
+ jcf watch claude --dry-run # Prints what it would write, writes nothing
156
+ jcf watch claude --interval 60
157
+ ```
158
+
159
+ - A long-running remote write command. Only start it when the user explicitly asks for live
160
+ tracking, and say that it will keep writing until they stop it. Do not start it to answer a
161
+ question — it never terminates on its own, so it cannot be used to gather information.
162
+ - `--dry-run` is the read-only form, but it still runs forever. To inspect unlogged work, use
163
+ `jcf sync reconcile --agent claude --json` instead.
164
+ - It writes only branch-, path-, and standing-attributed blocks. Time only a coding agent could
165
+ place is reported and left for `jcf sync reconcile --agent claude`.
166
+ - It writes a block once it has been quiet for one idle cap, so work in progress is never written.
167
+ Nothing is written twice _on this machine_ — a proposal is always the gap the two sides still have,
168
+ and the lease keeps a second local watch out. Two machines watching one Clockify account can still
169
+ duplicate: see ADR-0007.
170
+ - It covers time since it started, plus any stretch a previous watch reached but had not written —
171
+ it leaves a cursor, so a restart resumes rather than dropping the block. A first run reaches back
172
+ for nothing. Earlier work in the same day needs `jcf sync reconcile`.
173
+ - Only one watch writes at a time, per machine. Starting a second one prints who holds the lease and
174
+ exits; do not start one to "check" on a running watch. After an ungraceful process death, verify no
175
+ watch remains before manually removing `~/.jcf/watch.lease`; the file is never auto-taken-over.
176
+ - It stops itself if Jira rejects the login. Re-authenticate with `jcf auth jira login` and restart.
177
+
88
178
  ## Agent Workflow
89
179
 
90
180
  1. Run `jcf auth status` and `jcf timer status` before changing timer state.
@@ -92,3 +182,5 @@ jcf timer edit
92
182
  3. Verify the active Jira profile when the user names a Jira site/account or before posting worklogs; `atlassian profiles doctor` shows Jira Clockify as a consumer of the `jira-cli` auth store.
93
183
  4. Prefer explicit flags for non-interactive work: issue key, duration, date, time, project id, billable flag, and comment.
94
184
  5. If no timer is running, `jcf timer stop` may offer an interactive correction interval; use `jcf timer log` for deterministic manual logging.
185
+ 6. To find unlogged work, read `jcf sync reconcile --agent claude --json` first and report the
186
+ proposals to the user; only they should decide which rows to write.