Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
735d02e
Archive the public repo plan and add tests for popup size and config …
kgrizz-git Oct 28, 2026
2fbcf6c
Record the open ruleset status-check item in the archived plan and TO…
kgrizz-git Oct 28, 2026
c39d756
Raise coverage: Python dialog tests, five shell module tests, 19 Tier…
kgrizz-git Oct 28, 2026
8d01cbb
Run the popup-display source smoke in a temp HOME.
kgrizz-git Oct 28, 2026
34d6ca5
Clear two Sonar smells in the dialog tests.
kgrizz-git Oct 28, 2026
e711735
Fix the lock message end time, 24:00 ranges, and Wayland resolution d…
kgrizz-git Oct 28, 2026
a720538
Clear the Sonar findings in the new shell tests and drop the stale ti…
kgrizz-git Oct 28, 2026
e21e272
Clear the Sonar findings on the lines the bug fixes touched.
kgrizz-git Oct 28, 2026
1426f81
Add local checks for the shell findings SonarCloud reports.
kgrizz-git Oct 28, 2026
abd5383
Clear the SonarCloud findings in the new shell-check scripts.
kgrizz-git Oct 28, 2026
d4e8c62
Address CodeRabbit: octal-safe hours, deterministic lock tests, scrip…
kgrizz-git Oct 28, 2026
28aae77
Fix the zero-padded hour cases the qoder review found.
kgrizz-git Oct 28, 2026
3829f16
Tidy status-config-display.sh: one config-read helper, shared labels.
kgrizz-git Oct 28, 2026
ddded89
Use [[ ]] on the one line the status refactor left with [.
kgrizz-git Oct 28, 2026
7b26e0f
Address CodeRabbit round 3: CI and Security checks, exit-0 wording, o…
kgrizz-git Oct 28, 2026
a2a6b67
Name the real workflow jobs in the open ruleset item.
kgrizz-git Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Local SonarQube freshness and BUG/VULNERABILITY ratchet when SONAR_TOKEN is set.
# This hook does not run sonar-scanner; run bash scripts/sonar_scan.sh first.
# Tier-A stays opt-in (INSTALL_PRE_PUSH=1). Disable Tier-A: rm .githooks/enable-pre-push
# Skip the Sonar checks: SKIP_LOCAL_SONAR=1 git push
# Skip the Sonar checks (and the shell warning): SKIP_LOCAL_SONAR=1 git push
# Skip Python coverage: SKIP_PYTHON_COVERAGE=1 git push (CI does not honor that)
# Skip types and file sizes: SKIP_QUALITY_CHECKS=1 / SKIP_PYTHON_TYPES=1 (CI honors neither)
# Shell coverage runs with the opt-in Tier-A hook below, and always in CI.
Expand Down Expand Up @@ -47,6 +47,16 @@ if [ "${SKIP_QUALITY_CHECKS:-0}" != "1" ] || [ "${CI:-}" = "true" ]; then
"${ROOT}/scripts/check-file-sizes.sh" --strict
fi

# SonarCloud analyzes shell and the local Community Build does not. This warns about
# new "[" tests (S7688), the rule SonarCloud reports most. It never blocks a push.
if [ "${SKIP_LOCAL_SONAR:-0}" != "1" ]; then
shell_rc=0
"${ROOT}/scripts/check-sonar-shell-newcode.sh" || shell_rc=$?
if [ "${shell_rc}" -eq 1 ]; then
echo "pre-push: SonarCloud will likely flag the '[' tests above. The push is not blocked." >&2
fi
fi

if [ ! -f "${ROOT}/.githooks/enable-pre-push" ]; then
exit 0
fi
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ We follow [OpenAI harness engineering](https://openai.com/index/harness-engineer
2. For `lib/` or entrypoint script changes: `./scripts/run-security-scan.sh --ci --with-tests` (or at least `--ci`).
3. Update [docs/SAFETY.md](docs/SAFETY.md) and/or `dev-docs/` if behavior changed ([versioning guide](dev-docs/development/versioning.md)).
4. Confirm [docs/SAFETY.md](docs/SAFETY.md) checklist still passes.
5. Shell findings: local Sonar skips `.sh`. Before a push run `./scripts/check-sonar-shell-newcode.sh`; after it run `python3 scripts/sonarcloud_pr_issues.py --wait 180`.

## Git hooks (local)

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- **Shell findings from SonarCloud, locally:** The local SonarQube Community Build has no Shell analyzer, so `sonar_scan.sh` never reported the shell findings that SonarCloud shows on a PR. `scripts/check-sonar-shell-newcode.sh` approximates the most common one (S7688, use `[[`) on lines added since the merge base, using ShellCheck's `require-double-brackets`. The pre-push hook runs it as a non-blocking warning. `scripts/sonarcloud_pr_issues.py` prints SonarCloud's real new-code issues for the current PR after a push, and `--wait` polls until the analysis matches your HEAD. Both have tests. No runtime behavior changed.
- **Test coverage:** Shell coverage of `lib/*.sh` in Tier-A rises from 16.2% to 26.1% on macOS and from 16.9% to about 26.7% on Ubuntu. Python coverage of `lib/*.py` rises from 31.5% to 99.2%. New Tier-A scripts cover `config-popup-size.sh`, `config-safety.sh`, `time-calculations.sh`, `scheduler-platform.sh` and `resolution-detection.sh`. `tests/test-configure-dialogs-darwin-ui.py` covers every macOS configure-dialog module with fake tkinter widgets and needs no display. Nineteen fast, hermetic scripts moved from Tier-B to Tier-A so the coverage gate counts them. The three `configure.sh` scripts stay in Tier-B. Both coverage floors rise to match. Tests only; runtime behavior is unchanged. The tests found three bugs, which are listed in `dev-docs/TO_DO.md`.
- **App icon:** A crescent-moon-and-clock icon (`assets/icon.svg`) heads the README, which also gains status, license, and platform badges. Installers copy `assets/icon-256.png` to `~/.local/lib/sleep-warning/timerwarning-icon.png`. Linux warning popups and pause confirmations pass it to yad or zenity (`--window-icon`) or kdialog (`--icon`) when that tool's help lists the flag, so the taskbar can show it. The first warning in a process spends up to about two seconds on that help check; later warnings in the same process reuse the answer. On macOS the fullscreen tkinter blocker and the configure dialogs set the icon as the Dock icon. The osascript fallback keeps the system icon. `user-docs/MACOS.md` describes that split. A missing icon file leaves the default icon. Buttons and the watchdog are unchanged. Other candidate designs are in `assets/icon-candidates/`.
- **Project license:** Source is available under the Apache License 2.0 with the Commons Clause License Condition v1.0. Personal use, modification, redistribution, and a company's own internal use stay allowed when the notices in `LICENSE` stay with the copy. Selling the software, as that condition defines Sell, is not allowed. This is source-available, not an OSI open-source license. Installed behavior is unchanged.
- **Gamescope overlay debug flag:** `GAMESCOPE_OVERLAY_DEBUG` (default off) logs one `DEBUG-GAMESCOPE` block per gamescope warning spawn, countdown respawn, and pause notice when the experimental overlay path is active. The environment wins over the config file, including explicit false; a configure save keeps a key that is already in the file and does not write a temporary environment override. The flag does not change geometry, atoms, buttons, auto-close, or the watchdog. Minor capability; do not tag a release for this alone. Pointer behavior is unchanged.
Expand All @@ -24,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **Lock message end time and 24:00 ranges:** The configure lock error printed a blank end time (`Lock ends: today`) because it formatted `HH:MM` values, which `parse_config` and the lock-hour reader return, as bare hours. `calculate_restriction_end_time` and `show_config_locked_error` now share `format_endpoint_12h`, so the message reads `Lock ends: 5:30 AM today`. A range that ends at 24 or 24:00 (for example `16-24`) now reads as ending at 12:00 AM on the next day. It used to read 12:00 PM, and `build_weekly_restricted_intervals` dropped it, so the popup's next-unrestricted time treated that evening as free. `range_endpoint_to_day_minutes` takes an `end` role that accepts 24, as the 16-hour cap code already did. A range that ends at the week boundary (Saturday 24:00) now continues into Sunday in that search. `status.sh` and the configure range summary also print a 24:00 end as 12:00 AM. No restriction, lock, cap, or popup-lifetime check changed: the runtime restricted-time test already handled 24:00.
- **Wayland resolution detection:** `get_display_resolution` tests `A || B && C`, which Bash reads as `(A || B) && C`, so `WAYLAND_DISPLAY` alone never selected Wayland detection. It now does, with or without `XDG_SESSION_TYPE`.
- **Pause notice icon:** The Linux "Pause Activated" dialog passes the same yad, zenity, and kdialog icon flags as the warning. A warning that already ran in that process supplies the cached help answer, so the notice does not probe again. The notice watchdog, buttons, and per-day cap are unchanged.
- **Icon help probe:** The help check runs the command in its own process group and reads the result from a temporary file after that group is stopped. GNU `timeout` and `gtimeout` are not used: they return when the direct child exits and leave a descendant holding the pipe. A descendant that leaves the process group is not signalled, and it still cannot hold the popup, because the popup reads the file. The check sends SIGTERM after one second and SIGKILL one second later, or SIGKILL immediately if the leader exits sooner. The help file is capped at 2 MiB so a writer that leaves the process group cannot fill the disk. Popup buttons, the watchdog, and the per-day cap are unchanged.
- **Greptile review fixes:** Pre-spawn gamescope root-size queries now have a roughly two-second deadline, kill and reap stalled probes, and use fallback dimensions on failure. The test runner preserves its selected Bash interpreter for child tests when PATH points to an older Bash.
Expand Down
4 changes: 2 additions & 2 deletions dev-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ See [canonical-vs-archive.md](canonical-vs-archive.md) for what is current vs hi
| [`plans/master/`](plans/master/) | [Master implementation plan](plans/master/linux-warning-system-plan.md) |
| [`plans/phases/`](plans/phases/) | Phase 1–5 checklists, code-quality plan |
| [`plans/`](plans/) | Active feature plans (in progress) |
| [Public repository preparation](plans/plan-public-repo-prep-2026-10-16.md) | Sanitized private staging copy. PayPal removal stays deferred. Next: CI and settings review; public visibility needs a separate approval |
| [Public repository preparation](completed-plans/plan-public-repo-prep-2026-10-16.md) | Complete and archived 2026-10-28. The repository is public. PayPal removal stays deferred |
| [`completed-plans/plan-harness-engineering-improvements-2026-06-12.md`](completed-plans/plan-harness-engineering-improvements-2026-06-12.md) | **Complete** — Phases 0–8 (archived 2026-10-25) |
| [`completed-plans/`](completed-plans/) | Finished or superseded implementation plans (archive) |

Expand All @@ -65,4 +65,4 @@ See [canonical-vs-archive.md](canonical-vs-archive.md) for what is current vs hi
- **Safety** overrides feature work — read [`docs/SAFETY.md`](../docs/SAFETY.md) before popup, scheduler, or config changes.
- **Tests** during restricted hours: use a temp `HOME`; see [`.cursor/rules/config-file-edits.mdc`](../.cursor/rules/config-file-edits.mdc).

**Last updated:** 2026-06-12 (Phase 8 contributor guide; harness Phases 1–7 complete)
**Last updated:** 2026-10-28 (public repository plan archived; test coverage tiers and the SonarCloud shell checks documented)
8 changes: 4 additions & 4 deletions dev-docs/TO_DO.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Doc convention: **`docs/`** = end-users; **`dev-docs/`** = developers and agents
- [x] **Linux popup watchdog (code, 2026-05-30)** — `lib/popup-display-linux.sh` uses `popup_compute_watchdog_seconds` + `popup_start_pid_file_watchdog`. Unit tests: `tests/test-popup-safety-linux.sh` (Tier-A on Linux CI, 2026-06-12 harness Phase 7).
- [ ] **Linux popup watchdog (integration / display host)** — Optional follow-ups on a Linux machine with DISPLAY:
- [x] Tier-A unit tests on `ubuntu-latest` CI (`test-popup-safety-linux.sh` via `./scripts/run-tests.sh --tier a`)
- [ ] `bash tests/test-config-locking.sh` and `bash tests/test-uninstall-lock-hours.sh` on GNU stat host (Tier-B; portable helpers exist)
- [x] `bash tests/test-config-locking.sh` and `bash tests/test-uninstall-lock-hours.sh` on a GNU stat host. Both are Tier-A now and pass on `ubuntu-latest` CI (2026-10-28). They need a non-root user, because they assert a locked directory is not writable.
- [ ] `bash tests/test-popup.sh` with yad/zenity/kdialog available
- [ ] Add `tests/test-popup-safety-linux-integration.sh` — wedge dialog, assert hard kill within cap (recommended)
- [ ] Manual: `POPUP_AUTO_CLOSE=false` + stuck dialog → must terminate within `POPUP_ABSOLUTE_MAX_SECONDS`
Expand All @@ -37,7 +37,7 @@ Doc convention: **`docs/`** = end-users; **`dev-docs/`** = developers and agents

## Testing (high impact)

- [ ] **Raise line coverage** — Add tests that execute untested `lib/*.py` and `lib/*.sh`, then raise the floors from a new measurement. Current floors: Python 260/826 with a display and 238/826 headless ([python-coverage-baseline.json](../scripts/python-coverage-baseline.json)); shell darwin 2922/18047 and linux 3054/18047 ([shell-coverage-baseline.json](../scripts/shell-coverage-baseline.json)). The configure-dialog UI modules are still unread as code. Do not lower a floor to make a run pass.
- [ ] **Raise line coverage** — Add tests that execute untested `lib/*.py` and `lib/*.sh`, then raise the floors from a new measurement. Current floors: Python 819/826 with or without a display ([python-coverage-baseline.json](../scripts/python-coverage-baseline.json)); shell darwin 4703/18047 and linux 4800/18047 ([shell-coverage-baseline.json](../scripts/shell-coverage-baseline.json)). The interactive shell modules (`configure-ui*.sh`, `configure-input-*.sh`, `configure-dialogs*.sh`, `configure-display-*.sh`) still have little or no coverage. Do not lower a floor to make a run pass.
- [ ] **SteamOS Gaming Mode** — Full validation with full-screen games → [STEAMOS_GAMING_MODE.md](STEAMOS_GAMING_MODE.md), [phase 4 plan](plans/phases/plan-phase-4-testing.md)
- [x] **2026-10-19 on-device:** popup **displays and stays up** in Gaming Mode (experimental overlay on)
- [x] **Click-through + magnification (Phase 1 code):** full `:0` root-width gamescope dialogs + atom/geometry logging → [plan](completed-plans/plan-gamescope-overlay-click-through-2026-10-19.md)
Expand All @@ -49,7 +49,7 @@ Doc convention: **`docs/`** = end-users; **`dev-docs/`** = developers and agents

## Documentation and release

- [ ] **Public repository preparation — next: private staging checks, then an explicit public-visibility decision** — [Publication plan](plans/plan-public-repo-prep-2026-10-16.md). History sanitization and the TimerWarning installation-name commit are in this repository. PayPal removal stays deferred. Do not make the repository public without a separate approval.
- [x] **Public repository preparation** — `kgrizz-git/TimerWarning` is public (2026-10-26); plan archived 2026-10-28 → [plan](completed-plans/plan-public-repo-prep-2026-10-16.md). Open residue: the install/status/help string check for the public name, and requiring the `security.yml` checks (Static analysis, Tier-A on Ubuntu and macOS) as status checks in the `Mainrules1` ruleset (it requires none today). Donation removal is the deferred item below.
- [ ] **Donation cleanup — deferred 2026-10-24** — Leave existing PayPal links in place until the owner reopens this. Do not add donation integrations as part of publication preparation. Spec: [#27](enhancements/enhancement-27-paypal-donation-links.md).
- [ ] **SteamOS locale docs** — User guide section (Nix + manual paths); do not automate `locale-gen` in install.sh → [REMAINING_WORK_SUMMARY.md](REMAINING_WORK_SUMMARY.md#documentation-work)

Expand Down Expand Up @@ -90,4 +90,4 @@ Track detail in [REMAINING_WORK_SUMMARY.md](REMAINING_WORK_SUMMARY.md#mostly-imp

**Plans index:** [Master plan](plans/master/linux-warning-system-plan.md) · [Active plans](plans/) · [Completed plans](completed-plans/)

**Last updated:** 2026-10-25 (publication Phase 3 done: stubs removed, completed plans archived, smoke items collected; PayPal removal and public rename deferred)
**Last updated:** 2026-10-28 (public repository plan archived; coverage tests added and 19 Tier-B scripts moved to Tier-A; PayPal removal deferred)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Revised:** 2026-10-26

**Status:** Phases 1–4 applied. `kgrizz-git/TimerWarning` is public. On 2026-10-25 its CI was green, the full-history Gitleaks scan was clean, and the tracked file list matched the source. `main` is protected by the active ruleset `Mainrules1`. The classic protection API returns 404 because that protection is a ruleset. The ruleset does not require the Security workflow checks. Phase 5 still includes those required checks and archiving this plan.
**Status:** Complete; archived 2026-10-28. Three items stay open (donation removal, deferred by the owner; a final install/status/help string check; required `security.yml` status checks in the ruleset) and are tracked in `dev-docs/TO_DO.md`. Phases 1–4 applied. `kgrizz-git/TimerWarning` is public. On 2026-10-25 its CI was green, the full-history Gitleaks scan was clean, and the tracked file list matched the source. `main` is protected by the active ruleset `Mainrules1`. The classic protection API returns 404 because that protection is a ruleset. As of 2026-10-28 the ruleset still requires no status checks: none of the `security.yml` jobs (Static analysis, Tier-A on Ubuntu and macOS). Adding them is open and tracked in `dev-docs/TO_DO.md`.

**Working branch:** `chore/public-repo-prep-phase-1` for phases 1–4, based on `main` at `86cfc7a`. That name is historical; it is not the branch for later icon work.

Expand Down Expand Up @@ -258,9 +258,11 @@ changes or forbidden reachable material, reproducible private audit record.
in `LICENSE`). `git clone --depth 1 https://github.com/kgrizz-git/TimerWarning.git`
succeeded, and `git rev-parse HEAD` in that clone was
`a664b8e4a372f23489da24172616c55772691cff`.
7. Archive this plan under `dev-docs/completed-plans/` after final status and
any residual work are recorded. Keep source `LinuxTimerWarning` private
unless separately directed.
7. [x] This plan was archived under `dev-docs/completed-plans/` on 2026-10-28.
The residual work is in `dev-docs/TO_DO.md`: require the `security.yml` checks
(Static analysis, Tier-A on Ubuntu and macOS) on `main`, the install/status/help string check, and donation
removal.
Keep source `LinuxTimerWarning` private unless separately directed.

## Verification and delivery gates

Expand All @@ -270,7 +272,7 @@ changes or forbidden reachable material, reproducible private audit record.
| Phases 1–3 | `./scripts/check-doc-drift.sh --strict`; `./scripts/check-stale-plans.sh --strict`; license/link/donation/branding checks |
| Shell or entrypoint changes | Targeted regressions, temp-HOME `CI_HEADLESS=1 ./scripts/run-tests.sh --tier a`, and `./scripts/run-security-scan.sh --ci`; normal hooks intact |
| Sanitized export | All preceding checks plus reachable-history privacy scan, `git fsck`, source/export comparison |
| Public release | Destination is public. `Mainrules1` protects `main`. `git clone --depth 1` of the public URL succeeded at `a664b8e`, and the GitHub description is set. Remaining: require the Security workflow checks, then archive this plan |
| Public release | Destination is public. `Mainrules1` protects `main`. `git clone --depth 1` of the public URL succeeded at `a664b8e`, and the GitHub description is set. Remaining: require the `security.yml` checks (Static analysis, Tier-A on Ubuntu and macOS) on `main` (open, tracked in `dev-docs/TO_DO.md`). This plan was archived 2026-10-28 |

Follow the operational rules in AGENTS: never unbounded configure menus; timeout,
controlled stdin, and bounded output are all required if a menu test is necessary.
Expand All @@ -281,7 +283,7 @@ CI-green, and merged states separately. Branch cleanup is not release completion

**Next action:** `kgrizz-git/TimerWarning` is already public. Phase 5 step 6 is
done: `git clone --depth 1` of the public URL succeeded at `a664b8e`, and the
GitHub description is set. Remaining Phase 5 work is to require the Security
workflow checks on `main`, then archive this plan. PayPal removal stays
deferred. Do not rewrite this history again, and do not change the private
GitHub description is set. This plan is archived. The one remaining Phase 5 item
is to require the `security.yml` checks (Static analysis, Tier-A on
Ubuntu and macOS) on `main`, which `dev-docs/TO_DO.md` tracks. PayPal removal stays deferred. Do not rewrite this history again, and do not change the private
source repository's history.
Loading
Loading