omp-worklog 0.14.3 → 0.14.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0cd822ff3347278ac769f7b0c1d7e672aa32398fc585fac7daee8a2c40d98fa
4
- data.tar.gz: 03c08ef8472c91a41bab12dd9131a5ae274884959693dec684206afcb94a17c8
3
+ metadata.gz: e13d4863a853283acc2fbefdd433c6fa6dd38e5180f483fe647a29067621dfab
4
+ data.tar.gz: bdb0edda46245581f6ee7e68c71f3bac263eb6f78996f8dd3ccca7d135985f2a
5
5
  SHA512:
6
- metadata.gz: 8927b5a1844e245daf5643f2c0e65eca8e591ecc8e406df43c5eb2e215c9e65d4a1c9fec7a1353609a20be9d03e105175855e4ccc405670bd3850ff14ac048be
7
- data.tar.gz: 56cf4e87faa0936b4178d5a1a530c0e3d7fb57e467737a0757927f56fc5ac947a01514b34fa4a92063825bc6c6338883807fe08ccc4ba55910f036cc0e37c3a0
6
+ metadata.gz: e74327cb9ef7e26c41f34bbc4ffa59d6727373694885a527202d87b0bb2ed2bb36b09767f19d1069856a64770508d91d0430239a9fd9d3568e0ad2f875bdd62c
7
+ data.tar.gz: f1b50e45029fc37e59801742120a24608f413c2f78f7ae63a6526774692a6038f4479a05be2514a09165444e480bea34a1d31aa5e1e4f189b10ebab0faade03b
data/README.md CHANGED
@@ -81,11 +81,15 @@ Type `/worklog ` in OMP to discover `timesheet`; date aliases appear after selec
81
81
 
82
82
  ## OMP settings
83
83
 
84
+ The manifest declares the following settings. **Persisted settings are currently inactive in the extension**: OMP does not expose resolved user-plus-project plugin settings at factory initialization. Explicit factory options work for programmatic callers and tests. [Issue #134](https://github.com/klondikemarlen/omp-worklog/issues/134) tracks the host dependency; do not assume a successful `omp plugin config set` changed runtime behavior.
85
+
84
86
  - `defaultHours`: hours per business day when a time-off tool call omits `hours`; defaults to `7`.
85
87
  - `holidayRegions`: comma-separated Holidays regions; defaults to `ca_yt`.
86
88
  - `command`: direct path to the `omp-worklog` executable.
87
89
  - `projectTimeLogPath`: optional path to Project Time v1 evidence; defaults to `~/.omp/project-time/time-log.sqlite`. A legacy versioned JSON snapshot is also supported.
90
+ - `projectTimeMappings`: optional JSON mapping of exact local projects to Harvest project/task names; defaults to `{}`.
88
91
 
92
+ The host stores user plugin settings in `~/.omp/plugins/omp-plugins.lock.json` and project overrides in `.omp/plugin-overrides.json`. Back up private configuration outside Git before uninstalling/reinstalling a plugin. Worklog deliberately does not parse these files itself or bypass project precedence.
89
93
 
90
94
  ## OMP Project Time integration
91
95
 
@@ -101,6 +105,10 @@ OMP Worklog reads Project Time's persisted `omp-project-time/evidence` v1 entrie
101
105
 
102
106
  `omp_worklog_preview_project_time_drafts` produces deterministic, copyable Date/Project/Task/Duration blocks from all local `human_active` evidence in an inclusive date range. Mapped evidence uses its configured Harvest destination; unmapped, ambiguous, and unassigned evidence remains an explicit local-project draft. It preserves source entry IDs, intervals, source kind, repository identity, narratives, work items, and task-attribution provenance. Generated narratives are review evidence, never task identity or a factual Harvest note. The tool reads the local log only; it never calls or mutates Harvest.
103
107
 
108
+ Drafts preserve every positive interval using raw milliseconds, even when rounded decimal `hours` are zero. Exact displayed duration is review evidence, not a Harvest rounding or billable-time policy. Both range endpoints must be real calendar dates.
109
+
110
+ For independent comparison with manually recorded Harvest entries, follow the [private calibration workflow](/docs/calibration.md). Do not tune from incomplete baselines or commit personal evidence.
111
+
104
112
  ### Activity transforms
105
113
 
106
114
  `omp_worklog_preview_project_time_transforms` emits deterministic JSON for local raw intervals. It accepts an inclusive date range and optional exact `repositoryId`, `project`, and `sourceKind` filters; each matching interval is split by local date and grouped by activity, with missing labels reported as `unlabelled`. It defaults to `human_active` and returns the effective top-level `sourceKind`; selecting `agent_turn_elapsed` requires an explicit source-kind request. Set `applyMappings` to create configured Harvest destinations or review-required local destinations for every included group. The output reports groups and draft entries; it never writes Harvest.
@@ -109,7 +117,21 @@ OMP Worklog reads Project Time's persisted `omp-project-time/evidence` v1 entrie
109
117
 
110
118
  ## Migration from Harvest Worklog
111
119
 
112
- Version `0.14.0` is a clean identity cutover. Uninstall the retired `harvest-worklog` gem and OMP plugin, then install `omp-worklog`; replace former `harvest-worklog` CLI and `/harvest-worklog` command invocations with `omp-worklog` and `/worklog`. The retired package, executable, command, tools, module, and settings aliases are not retained.
120
+ Version `0.14.0` is a clean identity cutover. Uninstall the retired `harvest-worklog` gem and OMP plugin, then install `omp-worklog`; replace former `harvest-worklog` CLI and `/harvest-worklog` command invocations with `omp-worklog` and `/omp-worklog`. The retired package, executable, command, tools, module, and settings aliases are not retained.
121
+
122
+ Version `0.14.3` renames the OMP slash command from `/omp-worklog` to `/worklog`; the `omp-worklog` package identity and CLI executable are unchanged.
123
+
124
+ ## Changes in 0.14.5
125
+
126
+ - Preserve saved user settings across the required clean plugin reinstall, without copying project overrides or manifest defaults into user configuration.
127
+ - Retain an owner-only recovery snapshot and report its path; abort before uninstalling when settings cannot be exported.
128
+
129
+ ## Changes in 0.14.4
130
+
131
+ - Preserve short positive durations in mapped and review-required drafts.
132
+ - Refresh project-name completion when SQLite commits evidence through its write-ahead log.
133
+ - Reject impossible calendar dates in transform ranges.
134
+ - Document configuration activation limits, runtime ownership, and private calibration.
113
135
 
114
136
  ## Release
115
137
 
@@ -118,20 +140,19 @@ Before merging a release PR, self-review its complete diff, address every action
118
140
  ```bash
119
141
  ruby test_omp_worklog.rb
120
142
  npm run test:omp
121
- omp-worklog time-off 2026-08-17 2026-08-28 \
122
- --project 'Time Off - Marlen' \
123
- --task 'Vacation / PTO' \
124
- --holiday-region ca_yt \
125
- --dry-run
143
+ bin/omp-worklog --help
126
144
  VERSION="$(ruby -Ilib -romp_worklog/version -e 'puts OmpWorklog::VERSION')"
127
145
  gem build omp-worklog.gemspec
128
146
  gem push "omp-worklog-${VERSION}.gem"
129
- gem uninstall harvest-worklog --all --executables --ignore-dependencies
147
+ gem uninstall omp-worklog --all --executables --ignore-dependencies
130
148
  gem install --clear-sources --source https://rubygems.org omp-worklog --version "$VERSION" --no-document
131
- omp plugin uninstall harvest-worklog
132
149
  npm run release
133
150
  npm run verify:release
134
151
  omp-worklog --help
135
152
  ```
136
153
 
137
- `npm run release` owns the uninstall/force-install mutation. `npm run verify:release` never changes the installation: it checks the installed package version, resolved Git revision, and plugin path before running a deterministic slash-command smoke test against the installed plugin. It exits after verification. Existing OMP sessions retain startup-loaded extension code; restart them before optional manual autocomplete and slash-command QA.
154
+ `npm run release` owns the plugin uninstall/force-install mutation, including removal of the retired plugin when present. `npm run verify:release` never changes the installation: it checks the installed package version, resolved Git revision, and plugin path, then runs the installed JavaScript test suite. It exits after verification; tests alone do not exercise a fresh OMP host.
155
+
156
+ The release wrapper exports explicit user settings through OMP's configuration CLI from an isolated temporary directory before uninstalling. It saves `settings.json` in an owner-only recovery directory, prints that path without values, restores settings through the CLI, and verifies equality after installation. Project overrides remain project-scoped; unset defaults stay unset. Keep the reported backup until the release is confirmed. If installation or restoration fails, recover from that private snapshot after resolving the reported phase; do not paste its contents into an issue.
157
+
158
+ After installation, start a new OMP process and exercise `/worklog` completion and a timesheet against synthetic local evidence. Verify that a newly committed SQLite project appears without restarting that process. Existing sessions retain startup-loaded extension code and cannot prove the released artifact. Use explicit factory options for a mapped smoke until #134 is resolved; do not claim persisted-setting activation from that smoke.
data/bin/release-plugin CHANGED
@@ -1,19 +1,68 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- installed_plugin() {
5
- omp plugin list --json | node -e '
6
- const plugins = JSON.parse(require("fs").readFileSync(0, "utf8")).npm ?? []
7
- process.exit(plugins.some(plugin => plugin.name === process.argv[1]) ? 0 : 1)
8
- ' "$1"
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from "node:child_process"
3
+ import { mkdtempSync, rmSync, writeFileSync } from "node:fs"
4
+ import { tmpdir } from "node:os"
5
+ import { join } from "node:path"
6
+ import { isDeepStrictEqual } from "node:util"
7
+
8
+ // The CLI resolves settings against cwd; an isolated directory excludes project overrides.
9
+ const directory = mkdtempSync(join(tmpdir(), "omp-worklog-release-"))
10
+ let phase = "listing installed plugins"
11
+ let snapshotPath
12
+
13
+ function run(description, args) {
14
+ phase = description
15
+ return execFileSync("omp", args, {
16
+ cwd: directory,
17
+ encoding: "utf8",
18
+ stdio: ["ignore", "pipe", "pipe"],
19
+ })
9
20
  }
10
21
 
11
- if installed_plugin omp-worklog; then
12
- omp plugin uninstall omp-worklog
13
- fi
22
+ function userSettings() {
23
+ const { settings } = JSON.parse(run("exporting user settings", ["plugin", "config", "list", "omp-worklog", "--json"]))
24
+ if (!settings || typeof settings !== "object" || Array.isArray(settings)) {
25
+ throw new Error("Invalid settings export")
26
+ }
27
+
28
+ return settings
29
+ }
14
30
 
15
- if installed_plugin harvest-worklog; then
16
- omp plugin uninstall harvest-worklog
17
- fi
31
+ try {
32
+ const plugins = JSON.parse(run("listing installed plugins", ["plugin", "list", "--json"])).npm ?? []
33
+ const installed = new Set(plugins.map(plugin => plugin.name))
34
+ let settings
35
+ if (installed.has("omp-worklog")) {
36
+ settings = userSettings()
37
+ const backupPath = join(directory, "settings.json")
38
+ phase = "saving the private settings snapshot"
39
+ writeFileSync(backupPath, JSON.stringify(settings), { mode: 0o600, flag: "wx" })
40
+ snapshotPath = backupPath
41
+ console.log(`Saved private Worklog settings backup: ${snapshotPath}`)
42
+ run("uninstalling omp-worklog", ["plugin", "uninstall", "omp-worklog"])
43
+ }
18
44
 
19
- omp plugin install --force github:klondikemarlen/omp-worklog
45
+ if (installed.has("harvest-worklog")) {
46
+ run("uninstalling harvest-worklog", ["plugin", "uninstall", "harvest-worklog"])
47
+ }
48
+
49
+ run("installing omp-worklog", ["plugin", "install", "--force", "github:klondikemarlen/omp-worklog"])
50
+ if (settings) {
51
+ for (const [key, value] of Object.entries(settings)) {
52
+ const argument = typeof value === "string" ? value : JSON.stringify(value)
53
+ run("restoring user settings", ["plugin", "config", "set", "omp-worklog", key, argument])
54
+ }
55
+ if (!isDeepStrictEqual(userSettings(), settings)) {
56
+ phase = "verifying restored user settings"
57
+ throw new Error("Settings changed")
58
+ }
59
+ }
60
+
61
+ console.log("Installed omp-worklog; user settings preserved.")
62
+ } catch {
63
+ console.error(`Worklog release failed while ${phase}.`)
64
+ if (snapshotPath) console.error(`Recover saved user settings from ${snapshotPath}.`)
65
+ process.exitCode = 1
66
+ } finally {
67
+ if (!snapshotPath) rmSync(directory, { recursive: true, force: true })
68
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmpWorklog
4
- VERSION = "0.14.3"
4
+ VERSION = "0.14.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omp-worklog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marlen Brunner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-06 00:00:00.000000000 Z
11
+ date: 2026-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: marlens-harvest-api-v2