agent-ledger-harness 0.10.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.
- agent_ledger_harness-0.10.0/.gitignore +13 -0
- agent_ledger_harness-0.10.0/LICENSE +21 -0
- agent_ledger_harness-0.10.0/PKG-INFO +107 -0
- agent_ledger_harness-0.10.0/README.md +87 -0
- agent_ledger_harness-0.10.0/pyproject.toml +50 -0
- agent_ledger_harness-0.10.0/src/work_ledger/__init__.py +9 -0
- agent_ledger_harness-0.10.0/src/work_ledger/__main__.py +5 -0
- agent_ledger_harness-0.10.0/src/work_ledger/cli.py +1657 -0
- agent_ledger_harness-0.10.0/src/work_ledger/config.py +145 -0
- agent_ledger_harness-0.10.0/src/work_ledger/doctor.py +186 -0
- agent_ledger_harness-0.10.0/src/work_ledger/events.py +112 -0
- agent_ledger_harness-0.10.0/src/work_ledger/git_ops.py +147 -0
- agent_ledger_harness-0.10.0/src/work_ledger/ids.py +29 -0
- agent_ledger_harness-0.10.0/src/work_ledger/locking.py +36 -0
- agent_ledger_harness-0.10.0/src/work_ledger/markdown.py +328 -0
- agent_ledger_harness-0.10.0/src/work_ledger/migrations/__init__.py +359 -0
- agent_ledger_harness-0.10.0/src/work_ledger/pagination.py +66 -0
- agent_ledger_harness-0.10.0/src/work_ledger/reports.py +610 -0
- agent_ledger_harness-0.10.0/src/work_ledger/resolver.py +28 -0
- agent_ledger_harness-0.10.0/src/work_ledger/schema.py +274 -0
- agent_ledger_harness-0.10.0/src/work_ledger/snapshot_projection.py +315 -0
- agent_ledger_harness-0.10.0/src/work_ledger/store.py +523 -0
- agent_ledger_harness-0.10.0/src/work_ledger/transactions.py +293 -0
- agent_ledger_harness-0.10.0/src/work_ledger/types.py +58 -0
- agent_ledger_harness-0.10.0/tests/test_build_tools.py +754 -0
- agent_ledger_harness-0.10.0/tests/test_work_ledger.py +1784 -0
- agent_ledger_harness-0.10.0/tools/build_pypi.py +292 -0
- agent_ledger_harness-0.10.0/tools/build_zipapp.py +90 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 litiezhu
|
|
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,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-ledger-harness
|
|
3
|
+
Version: 0.10.0
|
|
4
|
+
Summary: Deterministic Obsidian Markdown and Git-backed personal work ledger
|
|
5
|
+
Project-URL: Homepage, https://github.com/likaihz/tz-agent-harness
|
|
6
|
+
Project-URL: Repository, https://github.com/likaihz/tz-agent-harness
|
|
7
|
+
Project-URL: Issues, https://github.com/likaihz/tz-agent-harness/issues
|
|
8
|
+
Maintainer: litiezhu
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent,cli,git,obsidian,work-tracking
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# Work Ledger CLI
|
|
22
|
+
|
|
23
|
+
`work-ledger` is a deterministic command-line tool for managing an Obsidian-compatible, Git-backed personal work ledger. It owns IDs, schemas, links, locking, transactions, Git commits, privacy filtering, weekly-report facts, diagnostics, and migrations.
|
|
24
|
+
|
|
25
|
+
## Requirements
|
|
26
|
+
|
|
27
|
+
- Python 3.11 or newer
|
|
28
|
+
- Git
|
|
29
|
+
- A POSIX platform providing `fcntl.flock` (macOS or Linux)
|
|
30
|
+
|
|
31
|
+
The runtime uses only the Python standard library.
|
|
32
|
+
|
|
33
|
+
## Entry points
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
work-ledger --version
|
|
37
|
+
work-ledger version
|
|
38
|
+
work-ledger capabilities
|
|
39
|
+
python -m work_ledger
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
All commands except `--version` emit exactly one JSON object on stdout. Run `work-ledger --help` for the complete command surface.
|
|
43
|
+
|
|
44
|
+
Configuration defaults to `~/.config/work-ledger/config.toml`; local state defaults to `~/.local/state/work-ledger/`. Override them with `WORK_LEDGER_CONFIG` and `WORK_LEDGER_STATE_DIR` for isolated environments.
|
|
45
|
+
|
|
46
|
+
Projects support nullable ISO `start_date` and `end_date` boundaries. When both are present, the start must be on or before the end. The range is descriptive and does not automatically change project status or reject tasks and events outside it.
|
|
47
|
+
|
|
48
|
+
Project and Task notes use a portable projection of the creation title as their permanent readable filename. Their titles are immutable, and projected filenames are unique within each note type. In schema 4, a root Task stores its Project link while a child Task stores only its parent link and derives project membership recursively, keeping the Obsidian Graph free of redundant child-to-project edges. CLI 0.6 and later migrate schema 1, 2, or 3 Vaults to schema 4 in one Git-backed transaction and reject ambiguous cross-project child histories.
|
|
49
|
+
|
|
50
|
+
CLI 0.7 adds `work-ledger snapshot`, a body-free, deterministic read projection for desktop visualization clients. It returns Project, Task, effective Event and weekly Report summaries from one shared read lock, including the derived project for child tasks, Vault identity, managed Work digest and an independent snapshot schema version.
|
|
51
|
+
|
|
52
|
+
CLI 0.8 adds `work-ledger report export`, a read-only clean projection of a digest-valid managed Report. Markdown export removes controlled frontmatter and evidence comments and reduces Obsidian wikilinks to visible labels; text export also removes Markdown presentation syntax. Export requires an explicit personal or reportable audience and never writes the Vault or Git history.
|
|
53
|
+
|
|
54
|
+
CLI 0.9 enriches `work-ledger report facts` with visibility-filtered Project and Task bodies plus the ancestor Task context needed to synthesize workstreams. Report evidence validation also covers full-width and ASCII numbered paragraphs used by paste-ready weekly reports. Vault schema 4 remains unchanged.
|
|
55
|
+
|
|
56
|
+
CLI 0.10 makes a newly created ordinary Project `reportable` when `visibility` is omitted. Explicit `private` remains supported, Task and Event visibility still copies the current effective visibility of its parent at creation, and the protected Inbox remains private. Existing Vault objects are not rewritten and Vault schema 4 remains unchanged.
|
|
57
|
+
|
|
58
|
+
## Build
|
|
59
|
+
|
|
60
|
+
Any PEP 517 frontend can build the standard artifacts. For example:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
uv build --out-dir dist
|
|
64
|
+
python tools/build_zipapp.py --dist dist
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The first command builds the wheel and sdist. The second builds an executable zipapp and writes `SHA256SUMS` for all artifacts.
|
|
68
|
+
|
|
69
|
+
For the complete PyPI release gate, install `build` and `twine`, then run:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
python tools/build_pypi.py --dist dist
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The helper runs the source test suite, builds exactly one wheel and one sdist,
|
|
76
|
+
runs `twine check`, validates and installs the direct wheel,
|
|
77
|
+
rebuilds a wheel from the sdist in an isolated PEP 517 environment, and
|
|
78
|
+
subjects that rebuilt wheel to the same metadata, installation, and CLI probes.
|
|
79
|
+
|
|
80
|
+
## Public distribution
|
|
81
|
+
|
|
82
|
+
Production wheel and source-distribution releases use the
|
|
83
|
+
`agent-ledger-harness` distribution name on PyPI. They are published through
|
|
84
|
+
GitHub Actions Trusted Publishing after TestPyPI installation verification and
|
|
85
|
+
the merged CLI Release PR approval. The executable zipapp and `SHA256SUMS` are
|
|
86
|
+
attached to the matching GitHub Release.
|
|
87
|
+
|
|
88
|
+
Published versions are immutable and follow PEP 440. The version in
|
|
89
|
+
`src/work_ledger/__init__.py` is the source for package metadata, CLI probes,
|
|
90
|
+
tags, and artifact names. See the [public PyPI release runbook](https://github.com/likaihz/tz-agent-harness/blob/main/docs/pypi-release.md).
|
|
91
|
+
|
|
92
|
+
## Installation
|
|
93
|
+
|
|
94
|
+
Install an exact production version with a user-level tool manager such as
|
|
95
|
+
`pipx` or `uv tool`:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
pipx install agent-ledger-harness==<version>
|
|
99
|
+
uv tool install agent-ledger-harness==<version>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
These installs provide the `work-ledger` command and `work_ledger` Python
|
|
103
|
+
module for the `work-ledger-cli` product. A verified wheel or GitHub Release
|
|
104
|
+
zipapp is also supported. Never make normal or scheduled use depend on
|
|
105
|
+
TestPyPI, an editable checkout, or an unfixed latest version.
|
|
106
|
+
|
|
107
|
+
GitHub Release zipapps are bare `.pyz` files, and HTTP downloads do not preserve POSIX file modes. Verify `SHA256SUMS`, then run one portably with `python3 work-ledger-<version>.pyz`. On POSIX, after checksum verification, `chmod +x work-ledger-<version>.pyz` also enables direct execution.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Work Ledger CLI
|
|
2
|
+
|
|
3
|
+
`work-ledger` is a deterministic command-line tool for managing an Obsidian-compatible, Git-backed personal work ledger. It owns IDs, schemas, links, locking, transactions, Git commits, privacy filtering, weekly-report facts, diagnostics, and migrations.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Python 3.11 or newer
|
|
8
|
+
- Git
|
|
9
|
+
- A POSIX platform providing `fcntl.flock` (macOS or Linux)
|
|
10
|
+
|
|
11
|
+
The runtime uses only the Python standard library.
|
|
12
|
+
|
|
13
|
+
## Entry points
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
work-ledger --version
|
|
17
|
+
work-ledger version
|
|
18
|
+
work-ledger capabilities
|
|
19
|
+
python -m work_ledger
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
All commands except `--version` emit exactly one JSON object on stdout. Run `work-ledger --help` for the complete command surface.
|
|
23
|
+
|
|
24
|
+
Configuration defaults to `~/.config/work-ledger/config.toml`; local state defaults to `~/.local/state/work-ledger/`. Override them with `WORK_LEDGER_CONFIG` and `WORK_LEDGER_STATE_DIR` for isolated environments.
|
|
25
|
+
|
|
26
|
+
Projects support nullable ISO `start_date` and `end_date` boundaries. When both are present, the start must be on or before the end. The range is descriptive and does not automatically change project status or reject tasks and events outside it.
|
|
27
|
+
|
|
28
|
+
Project and Task notes use a portable projection of the creation title as their permanent readable filename. Their titles are immutable, and projected filenames are unique within each note type. In schema 4, a root Task stores its Project link while a child Task stores only its parent link and derives project membership recursively, keeping the Obsidian Graph free of redundant child-to-project edges. CLI 0.6 and later migrate schema 1, 2, or 3 Vaults to schema 4 in one Git-backed transaction and reject ambiguous cross-project child histories.
|
|
29
|
+
|
|
30
|
+
CLI 0.7 adds `work-ledger snapshot`, a body-free, deterministic read projection for desktop visualization clients. It returns Project, Task, effective Event and weekly Report summaries from one shared read lock, including the derived project for child tasks, Vault identity, managed Work digest and an independent snapshot schema version.
|
|
31
|
+
|
|
32
|
+
CLI 0.8 adds `work-ledger report export`, a read-only clean projection of a digest-valid managed Report. Markdown export removes controlled frontmatter and evidence comments and reduces Obsidian wikilinks to visible labels; text export also removes Markdown presentation syntax. Export requires an explicit personal or reportable audience and never writes the Vault or Git history.
|
|
33
|
+
|
|
34
|
+
CLI 0.9 enriches `work-ledger report facts` with visibility-filtered Project and Task bodies plus the ancestor Task context needed to synthesize workstreams. Report evidence validation also covers full-width and ASCII numbered paragraphs used by paste-ready weekly reports. Vault schema 4 remains unchanged.
|
|
35
|
+
|
|
36
|
+
CLI 0.10 makes a newly created ordinary Project `reportable` when `visibility` is omitted. Explicit `private` remains supported, Task and Event visibility still copies the current effective visibility of its parent at creation, and the protected Inbox remains private. Existing Vault objects are not rewritten and Vault schema 4 remains unchanged.
|
|
37
|
+
|
|
38
|
+
## Build
|
|
39
|
+
|
|
40
|
+
Any PEP 517 frontend can build the standard artifacts. For example:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
uv build --out-dir dist
|
|
44
|
+
python tools/build_zipapp.py --dist dist
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The first command builds the wheel and sdist. The second builds an executable zipapp and writes `SHA256SUMS` for all artifacts.
|
|
48
|
+
|
|
49
|
+
For the complete PyPI release gate, install `build` and `twine`, then run:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
python tools/build_pypi.py --dist dist
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The helper runs the source test suite, builds exactly one wheel and one sdist,
|
|
56
|
+
runs `twine check`, validates and installs the direct wheel,
|
|
57
|
+
rebuilds a wheel from the sdist in an isolated PEP 517 environment, and
|
|
58
|
+
subjects that rebuilt wheel to the same metadata, installation, and CLI probes.
|
|
59
|
+
|
|
60
|
+
## Public distribution
|
|
61
|
+
|
|
62
|
+
Production wheel and source-distribution releases use the
|
|
63
|
+
`agent-ledger-harness` distribution name on PyPI. They are published through
|
|
64
|
+
GitHub Actions Trusted Publishing after TestPyPI installation verification and
|
|
65
|
+
the merged CLI Release PR approval. The executable zipapp and `SHA256SUMS` are
|
|
66
|
+
attached to the matching GitHub Release.
|
|
67
|
+
|
|
68
|
+
Published versions are immutable and follow PEP 440. The version in
|
|
69
|
+
`src/work_ledger/__init__.py` is the source for package metadata, CLI probes,
|
|
70
|
+
tags, and artifact names. See the [public PyPI release runbook](https://github.com/likaihz/tz-agent-harness/blob/main/docs/pypi-release.md).
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
Install an exact production version with a user-level tool manager such as
|
|
75
|
+
`pipx` or `uv tool`:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
pipx install agent-ledger-harness==<version>
|
|
79
|
+
uv tool install agent-ledger-harness==<version>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
These installs provide the `work-ledger` command and `work_ledger` Python
|
|
83
|
+
module for the `work-ledger-cli` product. A verified wheel or GitHub Release
|
|
84
|
+
zipapp is also supported. Never make normal or scheduled use depend on
|
|
85
|
+
TestPyPI, an editable checkout, or an unfixed latest version.
|
|
86
|
+
|
|
87
|
+
GitHub Release zipapps are bare `.pyz` files, and HTTP downloads do not preserve POSIX file modes. Verify `SHA256SUMS`, then run one portably with `python3 work-ledger-<version>.pyz`. On POSIX, after checksum verification, `chmod +x work-ledger-<version>.pyz` also enables direct execution.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27,<2"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agent-ledger-harness"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Deterministic Obsidian Markdown and Git-backed personal work ledger"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = []
|
|
12
|
+
maintainers = [
|
|
13
|
+
{ name = "litiezhu" },
|
|
14
|
+
]
|
|
15
|
+
license = "MIT"
|
|
16
|
+
license-files = ["LICENSE"]
|
|
17
|
+
keywords = ["agent", "cli", "git", "obsidian", "work-tracking"]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Environment :: Console",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://github.com/likaihz/tz-agent-harness"
|
|
29
|
+
Repository = "https://github.com/likaihz/tz-agent-harness"
|
|
30
|
+
Issues = "https://github.com/likaihz/tz-agent-harness/issues"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
work-ledger = "work_ledger.cli:main"
|
|
34
|
+
|
|
35
|
+
[tool.hatch.version]
|
|
36
|
+
path = "src/work_ledger/__init__.py"
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.wheel]
|
|
39
|
+
packages = ["src/work_ledger"]
|
|
40
|
+
|
|
41
|
+
[tool.hatch.build.targets.sdist]
|
|
42
|
+
include = [
|
|
43
|
+
"/LICENSE",
|
|
44
|
+
"/README.md",
|
|
45
|
+
"/pyproject.toml",
|
|
46
|
+
"/src/work_ledger",
|
|
47
|
+
"/tests",
|
|
48
|
+
"/tools/build_pypi.py",
|
|
49
|
+
"/tools/build_zipapp.py",
|
|
50
|
+
]
|