work-tempo 0.0.1__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.
- work_tempo-0.0.1/LICENSE +21 -0
- work_tempo-0.0.1/PKG-INFO +245 -0
- work_tempo-0.0.1/README.md +224 -0
- work_tempo-0.0.1/pyproject.toml +36 -0
- work_tempo-0.0.1/setup.cfg +4 -0
- work_tempo-0.0.1/src/work_tempo/__init__.py +1 -0
- work_tempo-0.0.1/src/work_tempo/__main__.py +5 -0
- work_tempo-0.0.1/src/work_tempo/cli.py +2629 -0
- work_tempo-0.0.1/src/work_tempo/defaults.json +189 -0
- work_tempo-0.0.1/src/work_tempo.egg-info/PKG-INFO +245 -0
- work_tempo-0.0.1/src/work_tempo.egg-info/SOURCES.txt +13 -0
- work_tempo-0.0.1/src/work_tempo.egg-info/dependency_links.txt +1 -0
- work_tempo-0.0.1/src/work_tempo.egg-info/entry_points.txt +2 -0
- work_tempo-0.0.1/src/work_tempo.egg-info/top_level.txt +1 -0
- work_tempo-0.0.1/tests/test_cli.py +1644 -0
work_tempo-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ren Diao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: work-tempo
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Track source-code momentum across Git workspaces
|
|
5
|
+
Author: Ren Diao
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/endario/work-tempo
|
|
8
|
+
Project-URL: Source, https://github.com/endario/work-tempo
|
|
9
|
+
Project-URL: Issues, https://github.com/endario/work-tempo/issues
|
|
10
|
+
Keywords: git,loc,churn,metrics,productivity
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# Work Tempo
|
|
23
|
+
|
|
24
|
+
Work Tempo tracks source-code momentum across a Git workspace and its related repositories. It produces terminal summaries, a self-contained HTML report, and optional schema-versioned JSON for other local tools.
|
|
25
|
+
|
|
26
|
+
It measures:
|
|
27
|
+
|
|
28
|
+
- Source and test LOC snapshots over time.
|
|
29
|
+
- Added plus deleted source churn by month or day.
|
|
30
|
+
- Language composition and per-repository contribution.
|
|
31
|
+
- Documentation LOC and churn as separate informational metrics.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
The optional native macOS menu-bar app opens on an aggregate of all tracked workspaces. Its menu-bar value and primary dashboard metric show source churn per day over the trailing closed days, up to thirty. An individual workspace remains selectable from the header.
|
|
35
|
+
|
|
36
|
+
Repository comparison and component classification are outside Work Tempo's scope.
|
|
37
|
+
|
|
38
|
+
## Requirements
|
|
39
|
+
|
|
40
|
+
- Python 3.10 or newer.
|
|
41
|
+
- Git 2.30 or newer.
|
|
42
|
+
|
|
43
|
+
Work Tempo has no Python runtime dependencies outside the standard library.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pipx install work-tempo # or: pip install work-tempo
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For local development:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/endario/work-tempo.git
|
|
55
|
+
cd work-tempo
|
|
56
|
+
python3 -m venv .venv
|
|
57
|
+
.venv/bin/pip install -e .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then run it from any Git repository:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
work-tempo
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The current directory is the default workspace. Analyze another checkout with:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
work-tempo --root ~/projects/my-app
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Without installation, use:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
PYTHONPATH=src python3 -m work_tempo --root ~/projects/my-app
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Reports
|
|
79
|
+
|
|
80
|
+
The default report covers the latest 18 monthly periods and writes HTML under the workspace-specific user cache directory. The exact path is printed after each run.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Monthly history with explicit outputs
|
|
84
|
+
work-tempo --root ~/projects/my-app \
|
|
85
|
+
--html /tmp/work-tempo.html \
|
|
86
|
+
--json /tmp/work-tempo.json
|
|
87
|
+
|
|
88
|
+
# Daily view for the latest 30 days
|
|
89
|
+
work-tempo --root ~/projects/my-app --period day --days 30
|
|
90
|
+
|
|
91
|
+
# Terminal and JSON only
|
|
92
|
+
work-tempo --root ~/projects/my-app --no-html --json /tmp/work-tempo.json
|
|
93
|
+
|
|
94
|
+
# Optional three-month LOC forecast using the last six completed months
|
|
95
|
+
work-tempo --root ~/projects/my-app --forecast
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Period boundaries use the active system timezone, falling back to UTC. The resolved timezone is included in JSON and HTML report metadata.
|
|
99
|
+
|
|
100
|
+
## Workspace Scope
|
|
101
|
+
|
|
102
|
+
Work Tempo always considers the parent Git repository. It also discovers usable initialized submodules declared in `.gitmodules` and can aggregate additional repositories configured outside the workspace.
|
|
103
|
+
|
|
104
|
+
Create a personal configuration:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
work-tempo --root ~/projects/my-app --init-config
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
This writes `~/projects/my-app/.work-tempo.local.json`, which should remain untracked. For shared workspace policy, generate or maintain `~/projects/my-app/.work-tempo.json` instead.
|
|
111
|
+
|
|
112
|
+
Configuration layers are applied in this order:
|
|
113
|
+
|
|
114
|
+
1. Built-in generic defaults.
|
|
115
|
+
2. Tracked `.work-tempo.json`.
|
|
116
|
+
3. Untracked `.work-tempo.local.json`, or the file passed with `--config`.
|
|
117
|
+
|
|
118
|
+
Later keys replace earlier keys. Arrays replace rather than append. Each file is validated on its own before merging: an unknown key, a wrong type, or an unsupported `schema_version` is an error that names the key and file, so a typo cannot silently change the numbers.
|
|
119
|
+
|
|
120
|
+
Config files declare `"schema_version": 1` or `2` (missing means 1). `test_file_markers`, the filename infixes that mark a test file, needs version 2; `--init-config` writes version 2. A version-2 file is rejected by older releases instead of being miscounted. Existing caches are recomputed once after upgrading. Run `work-tempo --init-config` to write every supported field with its default, or read [src/work_tempo/defaults.json](src/work_tempo/defaults.json).
|
|
121
|
+
|
|
122
|
+
Additional repositories use paths relative to the main checkout:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"schema_version": 1,
|
|
127
|
+
"extra_repos": [
|
|
128
|
+
{
|
|
129
|
+
"label": "client-app",
|
|
130
|
+
"path": "../client-app"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"label": "shared-sdk",
|
|
134
|
+
"path": "packages/shared-sdk"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Only actual Git repository roots are counted. Missing or uninitialized configured repositories are reported and skipped.
|
|
141
|
+
|
|
142
|
+
## Counting Model
|
|
143
|
+
|
|
144
|
+
LOC snapshots count newline-delimited tracked source files from the last commit available at each period cutoff. Source and tests are separated using conventional test directories and test/spec/e2e filename patterns.
|
|
145
|
+
|
|
146
|
+
Churn is added plus deleted lines from non-merge commits, grouped by author date and filtered through the same current counting policy. Blank lines and comments count because WorkTempo measures physical source lines rather than semantic SLOC.
|
|
147
|
+
|
|
148
|
+
Generated, minified, dependency, build, cache, scratch, and vendor-like paths are excluded by default. Documentation is counted separately and does not contribute to source LOC, growth, or churn metrics.
|
|
149
|
+
|
|
150
|
+
## Cache
|
|
151
|
+
|
|
152
|
+
On macOS, artifacts default to:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
~/Library/Caches/WorkTempo/<workspace-name>-<workspace-key>/
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Linux uses `$XDG_CACHE_HOME/work-tempo` or `~/.cache/work-tempo`. Set `WORK_TEMPO_CACHE_HOME` to override the root.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Rebuild the workspace cache
|
|
162
|
+
work-tempo --clear-cache
|
|
163
|
+
|
|
164
|
+
# Run without reading or writing a cache
|
|
165
|
+
work-tempo --no-cache
|
|
166
|
+
|
|
167
|
+
# Use an explicit cache file
|
|
168
|
+
work-tempo --cache /tmp/work-tempo-cache.json
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Snapshot cache entries include the commit and effective counting policy. Churn entries also include period kind and timezone. Rewritten history triggers a full churn rescan.
|
|
172
|
+
|
|
173
|
+
## JSON Compatibility
|
|
174
|
+
|
|
175
|
+
Reports currently use schema version 1. Additive fields may be introduced within version 1, and consumers must ignore unknown fields. Removing a field, changing its type or meaning, or changing period-series alignment requires a schema-version increment.
|
|
176
|
+
|
|
177
|
+
## Development
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
PYTHONPATH=src python3 -m unittest discover -s tests -v
|
|
181
|
+
python3 -m compileall -q src tests
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### macOS menu-bar app
|
|
185
|
+
|
|
186
|
+
The local app requires macOS 14 or newer on Apple Silicon, Swift 6, and an installed `work-tempo` CLI. It resolves the collector from `~/.local/bin`, Homebrew locations, and then `PATH`.
|
|
187
|
+
|
|
188
|
+
Build an ad-hoc signed app bundle:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
scripts/build-macos-app.sh
|
|
192
|
+
open dist/WorkTempo.app
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Install the local build in `/Applications`:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
scripts/build-macos-app.sh --install
|
|
199
|
+
open /Applications/WorkTempo.app
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Use the plus button to add individual Git repository roots. Each workspace keeps its own `.work-tempo.json` and `.work-tempo.local.json` counting policy. The default All Workspaces scope rejects overlapping reports and mixed timezones. Historical metrics share a common closed-day watermark, while current totals use each contributing report's latest snapshot. Both charts keep code and test activity above the axis and informational documentation below it.
|
|
203
|
+
|
|
204
|
+
The app renders saved reports immediately. Collection is sequential, skips unattended work in Low Power Mode, uses two workers, and checkpoints the collector cache so an interrupted history extension can resume.
|
|
205
|
+
|
|
206
|
+
App state and saved reports live under:
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
~/Library/Application Support/WorkTempo/
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
The collector's existing cache remains under `~/Library/Caches/WorkTempo/`, shared with terminal runs. Removing a workspace from the app does not alter its source repository. To uninstall, quit WorkTempo and remove `/Applications/WorkTempo.app`; remove the Application Support directory separately only when its saved workspace list and reports are no longer wanted.
|
|
213
|
+
|
|
214
|
+
Swift development checks:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
cd macos
|
|
218
|
+
swift test
|
|
219
|
+
swift build -c release
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Design docs
|
|
223
|
+
|
|
224
|
+
- [Architecture](docs/architecture.md): the collector, configuration, counting model, and cache.
|
|
225
|
+
- [macOS app](docs/macos-app.md): scheduling, aggregation, and metric definitions.
|
|
226
|
+
|
|
227
|
+
## Releasing
|
|
228
|
+
|
|
229
|
+
Bump `version` in `pyproject.toml` in a pull request and merge it, then tag the merge commit `vX.Y.Z` and push the tag. The Publish workflow builds the package and uploads it to PyPI by trusted publishing, with no stored token.
|
|
230
|
+
|
|
231
|
+
## Contributing
|
|
232
|
+
|
|
233
|
+
`main` takes changes only through a pull request that passes the tests and the identity check. Every commit is authored and committed under `5214595+ren-diao@users.noreply.github.com` (or a bot's noreply address); an AI model may be credited with a `Co-authored-by` trailer. Turn the same check on locally with `git config core.hooksPath .githooks`.
|
|
234
|
+
|
|
235
|
+
## Authors
|
|
236
|
+
|
|
237
|
+
Ren Diao, co-authored with Claude (Anthropic).
|
|
238
|
+
|
|
239
|
+
## License
|
|
240
|
+
|
|
241
|
+
[MIT](LICENSE)
|
|
242
|
+
|
|
243
|
+
## 2mw2lt
|
|
244
|
+
|
|
245
|
+
Work Tempo is part of [2mw2lt](https://2mw2lt.com) — *Too Much Work, Too Little Time* — a steering partner that coordinates work across AI workers and trusted people. Its sibling [unlimited](https://github.com/endario/unlimited) reads AI-subscription usage.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Work Tempo
|
|
2
|
+
|
|
3
|
+
Work Tempo tracks source-code momentum across a Git workspace and its related repositories. It produces terminal summaries, a self-contained HTML report, and optional schema-versioned JSON for other local tools.
|
|
4
|
+
|
|
5
|
+
It measures:
|
|
6
|
+
|
|
7
|
+
- Source and test LOC snapshots over time.
|
|
8
|
+
- Added plus deleted source churn by month or day.
|
|
9
|
+
- Language composition and per-repository contribution.
|
|
10
|
+
- Documentation LOC and churn as separate informational metrics.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
The optional native macOS menu-bar app opens on an aggregate of all tracked workspaces. Its menu-bar value and primary dashboard metric show source churn per day over the trailing closed days, up to thirty. An individual workspace remains selectable from the header.
|
|
14
|
+
|
|
15
|
+
Repository comparison and component classification are outside Work Tempo's scope.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Python 3.10 or newer.
|
|
20
|
+
- Git 2.30 or newer.
|
|
21
|
+
|
|
22
|
+
Work Tempo has no Python runtime dependencies outside the standard library.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pipx install work-tempo # or: pip install work-tempo
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For local development:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/endario/work-tempo.git
|
|
34
|
+
cd work-tempo
|
|
35
|
+
python3 -m venv .venv
|
|
36
|
+
.venv/bin/pip install -e .
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then run it from any Git repository:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
work-tempo
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The current directory is the default workspace. Analyze another checkout with:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
work-tempo --root ~/projects/my-app
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Without installation, use:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
PYTHONPATH=src python3 -m work_tempo --root ~/projects/my-app
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Reports
|
|
58
|
+
|
|
59
|
+
The default report covers the latest 18 monthly periods and writes HTML under the workspace-specific user cache directory. The exact path is printed after each run.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Monthly history with explicit outputs
|
|
63
|
+
work-tempo --root ~/projects/my-app \
|
|
64
|
+
--html /tmp/work-tempo.html \
|
|
65
|
+
--json /tmp/work-tempo.json
|
|
66
|
+
|
|
67
|
+
# Daily view for the latest 30 days
|
|
68
|
+
work-tempo --root ~/projects/my-app --period day --days 30
|
|
69
|
+
|
|
70
|
+
# Terminal and JSON only
|
|
71
|
+
work-tempo --root ~/projects/my-app --no-html --json /tmp/work-tempo.json
|
|
72
|
+
|
|
73
|
+
# Optional three-month LOC forecast using the last six completed months
|
|
74
|
+
work-tempo --root ~/projects/my-app --forecast
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Period boundaries use the active system timezone, falling back to UTC. The resolved timezone is included in JSON and HTML report metadata.
|
|
78
|
+
|
|
79
|
+
## Workspace Scope
|
|
80
|
+
|
|
81
|
+
Work Tempo always considers the parent Git repository. It also discovers usable initialized submodules declared in `.gitmodules` and can aggregate additional repositories configured outside the workspace.
|
|
82
|
+
|
|
83
|
+
Create a personal configuration:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
work-tempo --root ~/projects/my-app --init-config
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This writes `~/projects/my-app/.work-tempo.local.json`, which should remain untracked. For shared workspace policy, generate or maintain `~/projects/my-app/.work-tempo.json` instead.
|
|
90
|
+
|
|
91
|
+
Configuration layers are applied in this order:
|
|
92
|
+
|
|
93
|
+
1. Built-in generic defaults.
|
|
94
|
+
2. Tracked `.work-tempo.json`.
|
|
95
|
+
3. Untracked `.work-tempo.local.json`, or the file passed with `--config`.
|
|
96
|
+
|
|
97
|
+
Later keys replace earlier keys. Arrays replace rather than append. Each file is validated on its own before merging: an unknown key, a wrong type, or an unsupported `schema_version` is an error that names the key and file, so a typo cannot silently change the numbers.
|
|
98
|
+
|
|
99
|
+
Config files declare `"schema_version": 1` or `2` (missing means 1). `test_file_markers`, the filename infixes that mark a test file, needs version 2; `--init-config` writes version 2. A version-2 file is rejected by older releases instead of being miscounted. Existing caches are recomputed once after upgrading. Run `work-tempo --init-config` to write every supported field with its default, or read [src/work_tempo/defaults.json](src/work_tempo/defaults.json).
|
|
100
|
+
|
|
101
|
+
Additional repositories use paths relative to the main checkout:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"schema_version": 1,
|
|
106
|
+
"extra_repos": [
|
|
107
|
+
{
|
|
108
|
+
"label": "client-app",
|
|
109
|
+
"path": "../client-app"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"label": "shared-sdk",
|
|
113
|
+
"path": "packages/shared-sdk"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Only actual Git repository roots are counted. Missing or uninitialized configured repositories are reported and skipped.
|
|
120
|
+
|
|
121
|
+
## Counting Model
|
|
122
|
+
|
|
123
|
+
LOC snapshots count newline-delimited tracked source files from the last commit available at each period cutoff. Source and tests are separated using conventional test directories and test/spec/e2e filename patterns.
|
|
124
|
+
|
|
125
|
+
Churn is added plus deleted lines from non-merge commits, grouped by author date and filtered through the same current counting policy. Blank lines and comments count because WorkTempo measures physical source lines rather than semantic SLOC.
|
|
126
|
+
|
|
127
|
+
Generated, minified, dependency, build, cache, scratch, and vendor-like paths are excluded by default. Documentation is counted separately and does not contribute to source LOC, growth, or churn metrics.
|
|
128
|
+
|
|
129
|
+
## Cache
|
|
130
|
+
|
|
131
|
+
On macOS, artifacts default to:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
~/Library/Caches/WorkTempo/<workspace-name>-<workspace-key>/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Linux uses `$XDG_CACHE_HOME/work-tempo` or `~/.cache/work-tempo`. Set `WORK_TEMPO_CACHE_HOME` to override the root.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Rebuild the workspace cache
|
|
141
|
+
work-tempo --clear-cache
|
|
142
|
+
|
|
143
|
+
# Run without reading or writing a cache
|
|
144
|
+
work-tempo --no-cache
|
|
145
|
+
|
|
146
|
+
# Use an explicit cache file
|
|
147
|
+
work-tempo --cache /tmp/work-tempo-cache.json
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Snapshot cache entries include the commit and effective counting policy. Churn entries also include period kind and timezone. Rewritten history triggers a full churn rescan.
|
|
151
|
+
|
|
152
|
+
## JSON Compatibility
|
|
153
|
+
|
|
154
|
+
Reports currently use schema version 1. Additive fields may be introduced within version 1, and consumers must ignore unknown fields. Removing a field, changing its type or meaning, or changing period-series alignment requires a schema-version increment.
|
|
155
|
+
|
|
156
|
+
## Development
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
PYTHONPATH=src python3 -m unittest discover -s tests -v
|
|
160
|
+
python3 -m compileall -q src tests
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### macOS menu-bar app
|
|
164
|
+
|
|
165
|
+
The local app requires macOS 14 or newer on Apple Silicon, Swift 6, and an installed `work-tempo` CLI. It resolves the collector from `~/.local/bin`, Homebrew locations, and then `PATH`.
|
|
166
|
+
|
|
167
|
+
Build an ad-hoc signed app bundle:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
scripts/build-macos-app.sh
|
|
171
|
+
open dist/WorkTempo.app
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Install the local build in `/Applications`:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
scripts/build-macos-app.sh --install
|
|
178
|
+
open /Applications/WorkTempo.app
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Use the plus button to add individual Git repository roots. Each workspace keeps its own `.work-tempo.json` and `.work-tempo.local.json` counting policy. The default All Workspaces scope rejects overlapping reports and mixed timezones. Historical metrics share a common closed-day watermark, while current totals use each contributing report's latest snapshot. Both charts keep code and test activity above the axis and informational documentation below it.
|
|
182
|
+
|
|
183
|
+
The app renders saved reports immediately. Collection is sequential, skips unattended work in Low Power Mode, uses two workers, and checkpoints the collector cache so an interrupted history extension can resume.
|
|
184
|
+
|
|
185
|
+
App state and saved reports live under:
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
~/Library/Application Support/WorkTempo/
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The collector's existing cache remains under `~/Library/Caches/WorkTempo/`, shared with terminal runs. Removing a workspace from the app does not alter its source repository. To uninstall, quit WorkTempo and remove `/Applications/WorkTempo.app`; remove the Application Support directory separately only when its saved workspace list and reports are no longer wanted.
|
|
192
|
+
|
|
193
|
+
Swift development checks:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
cd macos
|
|
197
|
+
swift test
|
|
198
|
+
swift build -c release
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Design docs
|
|
202
|
+
|
|
203
|
+
- [Architecture](docs/architecture.md): the collector, configuration, counting model, and cache.
|
|
204
|
+
- [macOS app](docs/macos-app.md): scheduling, aggregation, and metric definitions.
|
|
205
|
+
|
|
206
|
+
## Releasing
|
|
207
|
+
|
|
208
|
+
Bump `version` in `pyproject.toml` in a pull request and merge it, then tag the merge commit `vX.Y.Z` and push the tag. The Publish workflow builds the package and uploads it to PyPI by trusted publishing, with no stored token.
|
|
209
|
+
|
|
210
|
+
## Contributing
|
|
211
|
+
|
|
212
|
+
`main` takes changes only through a pull request that passes the tests and the identity check. Every commit is authored and committed under `5214595+ren-diao@users.noreply.github.com` (or a bot's noreply address); an AI model may be credited with a `Co-authored-by` trailer. Turn the same check on locally with `git config core.hooksPath .githooks`.
|
|
213
|
+
|
|
214
|
+
## Authors
|
|
215
|
+
|
|
216
|
+
Ren Diao, co-authored with Claude (Anthropic).
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
[MIT](LICENSE)
|
|
221
|
+
|
|
222
|
+
## 2mw2lt
|
|
223
|
+
|
|
224
|
+
Work Tempo is part of [2mw2lt](https://2mw2lt.com) — *Too Much Work, Too Little Time* — a steering partner that coordinates work across AI workers and trusted people. Its sibling [unlimited](https://github.com/endario/unlimited) reads AI-subscription usage.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "work-tempo"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Track source-code momentum across Git workspaces"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{ name = "Ren Diao" }]
|
|
13
|
+
keywords = ["git", "loc", "churn", "metrics", "productivity"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Topic :: Software Development :: Version Control :: Git",
|
|
21
|
+
]
|
|
22
|
+
dependencies = []
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/endario/work-tempo"
|
|
26
|
+
Source = "https://github.com/endario/work-tempo"
|
|
27
|
+
Issues = "https://github.com/endario/work-tempo/issues"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
work-tempo = "work_tempo.cli:main"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
where = ["src"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.package-data]
|
|
36
|
+
work_tempo = ["defaults.json"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""WorkTempo source-momentum reporting."""
|