repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell cleanup

28212a02ba2089588dd92c92e419b8a041f4b2b4

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (15)

Notes

Modified
1 -Subproject commit eb6ee4d6232a3e265d28be84bc93059e893d47b8
1 +Subproject commit 4ad2db25611d47630742c817db262b2c53e153f7

git/gitconfig

Modified
15 15 ui = !gitu
16 16 down = "!sh -c 'git pull --recurse-submodules \"$@\" && git submodule sync --recursive && git submodule update --init --recursive' -"
17 17 diffz = difftool --tool zed
18 - rv = "!f() { base=origin/trunk; if [ \"$1\" != \"\" ] && [ \"$1\" != \"--\" ]; then base=$1; shift; fi; if [ \"$1\" = \"--\" ]; then shift; fi; next() { printf '\\n[Enter] %s / [Ctrl-C] stop ' \"$1\"; read -r _; }; git fetch --all --prune || return; echo \"STEP 1/4 COMMITS $base..HEAD\"; git log --oneline --decorate --graph \"$base..HEAD\"; next \"STEP 2/4 FILES\"; echo \"STEP 2/4 FILES $base...HEAD\"; git diff --name-status \"$base...HEAD\" -- \"$@\"; git diff --stat \"$base...HEAD\" -- \"$@\"; next \"STEP 3/4 DELTA DIFF\"; echo \"STEP 3/4 DELTA DIFF $base...HEAD\"; git diff \"$base...HEAD\" -- \"$@\"; next \"STEP 4/4 DIFFTASTIC\"; echo \"STEP 4/4 DIFFTASTIC $base...HEAD\"; git difftool -d \"$base...HEAD\" -- \"$@\"; }; f"
18 + rv = "!f() { base=origin/trunk; if [ \"$1\" != \"\" ] && [ \"$1\" != \"--\" ]; then base=$1; shift; fi; if [ \"$1\" = \"--\" ]; then shift; fi; next() { printf '\\n[Enter] %s / [Ctrl-C] stop ' \"$1\"; read -r _; }; git fetch --all --prune || return; echo \"STEP 1/4 COMMITS $base..HEAD\"; git log --oneline --decorate --graph \"$base..HEAD\"; next \"STEP 2/4 FILES\"; echo \"STEP 2/4 FILES $base...HEAD\"; git diff --name-status \"$base...HEAD\" -- \"$@\"; git diff --stat \"$base...HEAD\" -- \"$@\"; next \"STEP 3/4 DELTA DIFF\"; echo \"STEP 3/4 DELTA DIFF $base...HEAD\"; git diff \"$base...HEAD\" -- \"$@\"; next \"STEP 4/4 DIFFTASTIC\"; echo \"STEP 4/4 DIFFTASTIC $base...HEAD\"; git difftool --no-symlinks -d \"$base...HEAD\" -- \"$@\"; }; f"
20 20 [core]
21 21 attributesfile = .gitattributes

nushell/modules/git.nu

Modified
351 351 def add-candidate-matches [candidate: record, query: string] {
352 - let q = ($query | str lowercase)
353 - let branch = ($candidate.branch | str lowercase | str contains $q)
354 - let base = ($candidate.base | str lowercase | str contains $q)
355 - let display = ($candidate.display | str lowercase | str contains $q)
352 + let branch = ($candidate.branch | str contains --ignore-case $query)
353 + let base = ($candidate.base | str contains --ignore-case $query)
354 + let display = ($candidate.display | str contains --ignore-case $query)
356 355 $branch or $base or $display

nushell/modules/minimax.nu

Modified
122 122 # ── Completions ─────────────────────────────────────────────────────────────────
124 124 def parse-voice-gender [voice_name: string] {
125 - let name_lower = ($voice_name | str lowercase)
126 125 let female_markers = ["girl", "lady", "woman", "queen", "sister", "mother", "wife", "aunt", "narrator", "host", "hostess", "antie", "belle", "maiden"]
127 126 let male_markers = ["man", "boy", "father", "husband", "king", "brother", "uncle", "bloke", "guy", "dude", "fellow", "lad", "gentleman"]
128 - if ($female_markers | any { |m| $name_lower | str contains $m }) {
127 + if ($female_markers | any { |m| $voice_name | str contains --ignore-case $m }) {
129 128 "Female"
130 - } else if ($male_markers | any { |m| $name_lower | str contains $m }) {
129 + } else if ($male_markers | any { |m| $voice_name | str contains --ignore-case $m }) {
131 130 "Male"
132 131 } else {
133 132 "Neutral"

nushell/modules/syncthing.nu

Modified
9 9 each { |conflict|
10 10 merge ( to_original $conflict ) $conflict
11 11 let input = ( input $"Merge successful? \((ansi pb)Y(ansi reset)/n\) \n" )
12 - let sanitize = ( $input | str trim | str lowercase | str substring 0..1 )
13 - if ($sanitize | is-empty) or $sanitize == 'y' {
12 + let sanitize = ( $input | str trim | str substring 0..0 )
13 + if ($sanitize | is-empty) or $sanitize in ['y' 'Y'] {
14 14 rm --verbose --interactive $conflict
15 15 } else {
16 16 $conflict

nushell/modules/zai.nu

Modified
55 55 let d = (ansi d)
56 56 let e = (ansi rst)
58 - print $"($c)($plan | str uppercase) Plan($e)"
58 + print $"($c)($plan) Plan($e)"
60 60 let tokens = $limits | where kind == TOKENS_LIMIT
61 61 if $tokens != [] { print ""; print $"($c)Tokens($e) LLM quota"; $tokens | each {|r| show_limit $r $d null } }

nushell/vendor/autoload/mise.nu

Deleted
deleted file mode 100644
1 -def "parse vars" [] {
2 - $in | from csv --noheaders --no-infer | rename 'op' 'name' 'value'
3 -}
5 -def --env "update-env" [] {
6 - for $var in $in {
7 - if $var.op == "set" {
8 - if ($var.name =~ '(?i)^path$') {
9 - $env.PATH = ($var.value | split row (char esep))
10 - } else {
11 - load-env {($var.name): $var.value}
12 - }
13 - } else if $var.op == "hide" and $var.name in $env {
14 - hide-env $var.name
15 - }
16 - }
17 -}
18 -export-env {
19 -
20 - '' | parse vars | update-env
21 - $env.MISE_SHELL = "nu"
22 - let mise_hook = {
23 - condition: { "MISE_SHELL" in $env }
24 - code: { mise_hook }
25 - }
26 - add-hook hooks.pre_prompt $mise_hook
27 - add-hook hooks.env_change.PWD $mise_hook
28 -}
30 -def --env add-hook [field: cell-path new_hook: any] {
31 - let field = $field | split cell-path | update optional true | into cell-path
32 - let old_config = $env.config? | default {}
33 - let old_hooks = $old_config | get $field | default []
34 - $env.config = ($old_config | upsert $field ($old_hooks ++ [$new_hook]))
35 -}
37 -export def --env --wrapped main [command?: string, --help, ...rest: string] {
38 - let commands = ["deactivate", "shell", "sh"]
40 - if ($command == null) {
41 - ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe"
42 - } else if ($command == "activate") {
43 - $env.MISE_SHELL = "nu"
44 - } else if ($command in $commands) {
45 - ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe" $command ...$rest
46 - | parse vars
47 - | update-env
48 - } else {
49 - ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe" $command ...$rest
50 - }
51 -}
53 -def --env mise_hook [] {
54 - ^"C:\\Users\\okr\\AppData\\Local\\Microsoft\\WinGet\\Links\\mise.exe" hook-env -s nu
55 - | parse vars
56 - | update-env
57 -}

pi-ext

Modified
1 -Subproject commit e7231f68e7305d136e6785e9c84df58e077976ff
1 +Subproject commit 32af3873d77df3b2252c1da0d1cd81d419a4ae08

pi/agent/settings.json

Modified

pi/agent/skills/.isp-skills.json

Modified
3 3 "experimentation": "4377b7dd6180967d47b1011aafd7d117129d46562388dce5778d0467679da200",
4 4 "fxdriver": "60c5e9369ec272bfe2d3bff932e458bb5bfb2edd4a27de3f121d71a8cae4c473",
5 5 "fxdriver-instructions": "03acd906bfa49e7feef159191988e105505c9b5a6a1f80d7e48f1b2cf587665f",
6 - "isp-start-day": "173371555ee72b3d7d92e0df0db34a9da0e93b1a74512a47738582be00d6fd2a",
6 + "isp-start-day": "40a4f931f9766d2327af8e79c5b68e3696aea74421bd980e850a68cf04f41481",
7 7 "desloppy": "7ffcbcfc3b414477eb6825b625b647045e43653e53d412f844d6973de0f44acc"

pi/agent/skills/isp-start-day/SKILL.md

Modified
32 32 node scripts/isp-start-day.mjs
35 +Use `node scripts/isp-start-day.mjs --date YYYY-MM-DD` for a deterministic read-only report. This changes only the report date; it never edits remote data.
35 37 If the harness runs commands from elsewhere, resolve `scripts/isp-start-day.mjs`
36 38 relative to this SKILL.md's directory; do not hardcode `~/.pi/...` or any other
37 39 install path.
83 85 - Today has an entry.
84 86 - Future workdays in current month have planning entries where known.
85 -- If future/planned days are missing, propose values and ask before editing.
87 +- Check every remaining workday through the end of the current month; never stop at a rolling window.
88 +- If future/planned days are missing, propose each value from the previous same weekday, then ask the user to confirm or correct every proposal before editing.
86 89 - Always read the legend table at the top of the Bürobelegung page before judging codes/colors.
87 90 - Do not hardcode color meanings; validate current/future entries against the live legend.
98 101 - Future weekdays blank → list day numbers only, ask for planning values.
99 102 - Current/future entries with colors not found in the live legend → warn softly; do not edit automatically.
101 -If user asks to fill missing planned future days:
104 +If future planned days are missing:
103 -1. Ask for exact values (`B`, `BP`, `H`, `A`, `AP`) per day.
104 -2. Fetch latest page body/version.
105 -3. Prepare diff/summary.
106 -4. Ask confirmation.
107 -5. Only then edit Confluence.
106 +1. Propose each value from the previous same weekday; use `?` when no valid prior value exists.
107 +2. Ask the user to confirm or correct exact values (`B`, `BP`, `H`, `A`, `AP`) per day.
108 +3. If the user asks to apply them, fetch the latest page body/version.
109 +4. Prepare a diff/summary.
110 +5. Ask confirmation.
111 +6. Only then edit Confluence.
109 113 ## Jira checks
122 126 acli jira workitem search --jql "assignee = currentUser() AND statusCategory != Done ORDER BY updated DESC" --fields "key,summary,status,priority" --limit 100 --json
129 +`Ready to Sync` means waiting for code review. Match its PR by an `RD-####` key in the PR branch or title. Only surface it as actionable when no open PR exists, review changes are requested, or an unapproved PR has had no activity for more than one workday. Show approved PRs as non-actionable review state. Weekends do not consume the threshold.
127 133 - Sprint ticket in `To Do` with related active branch/PR.
194 200 Jira sprint
195 201 • RD-1950 To Do — ...
196 -• RD-2038 Ready to Sync — PR #117 OK
202 +Review queue: cross-checked with open PRs below.
199 205 ! #112 RD-2121 changes requested while Jira Ready to Sync
206 +• RD-2038 — PR #117 waiting for review; active today
201 208 KKG worktrees
202 209 ! dke dirty=25 no RD ticket

pi/agent/skills/isp-start-day/scripts/isp-start-day.mjs

Modified
2 2 #!/usr/bin/env node
3 3 import { execFile } from 'node:child_process';
4 4 import { existsSync } from 'node:fs';
5 5 import path from 'node:path';
6 +import { pathToFileURL } from 'node:url';
6 7 import { promisify } from 'node:util';
8 9 const execFileP = promisify(execFile);
10 11 const KKG_ROOT = process.env.ISP_KKG_ROOT || null;
11 12 const OFFICE_PAGE_ID = process.env.ISP_OFFICE_PAGE_ID || '166494212';
14 +export function parseDateArg(args) {
15 + const index = args.indexOf('--date');
16 + if (index < 0) return new Date();
18 + const value = args[index + 1] || '';
19 + const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
20 + if (!match) throw new Error(`Invalid date: ${value}`);
22 + const [, year, month, day] = match.map(Number);
23 + const date = new Date(year, month - 1, day, 12);
24 + if (
25 + date.getFullYear() !== year ||
26 + date.getMonth() !== month - 1 ||
27 + date.getDate() !== day
28 + )
29 + throw new Error(`Invalid date: ${value}`);
30 + return date;
33 +function formatDate(date) {
34 + const year = date.getFullYear();
35 + const month = String(date.getMonth() + 1).padStart(2, '0');
36 + const day = String(date.getDate()).padStart(2, '0');
37 + return `${year}-${month}-${day}`;
13 40 function line(s = '') {
14 41 console.log(s);
175 202 return '';
178 -function parseOffice(body, accountId) {
179 - const today = new Date();
205 +export function parseOffice(body, accountId, today) {
180 206 const months = [
181 207 'Januar',
182 208 'Februar',
216 242 if (todayWarning) legendWarnings.push(todayWarning);
217 243 const future = [];
218 244 const missing = [];
219 - for (let n = 1; n < 15; n++) {
220 - const d = new Date(today);
221 - d.setDate(today.getDate() + n);
222 - if (d.getMonth() !== today.getMonth()) continue;
223 - const dow = d.getDay();
245 + const lastDay = new Date(
246 + today.getFullYear(),
247 + today.getMonth() + 1,
248 + 0,
249 + ).getDate();
250 + for (let dayNumber = day + 1; dayNumber <= lastDay; dayNumber++) {
251 + const date = new Date(today.getFullYear(), today.getMonth(), dayNumber, 12);
252 + const dow = date.getDay();
224 253 if (dow === 0 || dow === 6) continue;
225 - const v = dayVal(d.getDate());
226 - future.push(`${d.getDate()}:${v.text || '_'}/${v.color || 'no-color'}`);
227 - if (!v.text) missing.push(String(d.getDate()));
228 - const warning = validateOfficeCell(v, legend, `future ${d.getDate()}`);
254 + const value = dayVal(dayNumber);
255 + future.push(
256 + `${dayNumber}:${value.text || '_'}/${value.color || 'no-color'}`,
257 + );
258 + if (!value.text) missing.push(dayNumber);
259 + const warning = validateOfficeCell(value, legend, `future ${dayNumber}`);
229 260 if (warning) legendWarnings.push(warning);
231 262 out.push(`Next workdays: ${future.join(', ')}`);
232 - if (missing.length)
263 + if (missing.length) {
233 264 out.push(`! Future workdays missing planning: ${missing.join(', ')}`);
265 + const proposals = missing.map((dayNumber) => {
266 + const sourceDay = dayNumber - 7;
267 + const source = dayVal(sourceDay).text.trim().toUpperCase();
268 + return source && legend.validColorsByValue.has(source)
269 + ? `${dayNumber}=${source} (from ${sourceDay})`
270 + : `${dayNumber}=?`;
271 + });
272 + out.push(`Proposed update: ${proposals.join(', ')}`);
273 + out.push(
274 + 'Confirm or correct each value (B/BP/H/A/AP); Confluence unchanged.',
275 + );
234 277 out.push(legend.summary);
235 278 if (legendWarnings.length) out.push(...legendWarnings);
236 279 else out.push('Legend check: ✓ current/future entries match page legend');
241 284 return [...new Set(text.match(/RD-[0-9]+/g) || [])];
244 -async function main() {
287 +function previousWorkdayStart(today) {
288 + const date = new Date(today.getFullYear(), today.getMonth(), today.getDate());
289 + do date.setDate(date.getDate() - 1);
290 + while (date.getDay() === 0 || date.getDay() === 6);
291 + return date;
294 +export function jiraReviewFindings(tickets, prs, today) {
295 + const result = { action: [], waiting: [] };
296 + const cutoff = previousWorkdayStart(today);
297 + for (const ticket of tickets) {
298 + if (ticket.fields.status.name !== 'Ready to Sync') continue;
299 + const pullRequest = prs.find((candidate) =>
300 + rdKeysFrom(`${candidate.headRefName} ${candidate.title}`).includes(
301 + ticket.key,
302 + ),
303 + );
304 + if (!pullRequest) {
305 + result.action.push(`! ${ticket.key} — Ready to Sync but no open PR`);
306 + continue;
308 + if (pullRequest.reviewDecision === 'CHANGES_REQUESTED') {
309 + result.action.push(
310 + `! ${ticket.key} — PR #${pullRequest.number} changes requested`,
311 + );
312 + continue;
314 + if (pullRequest.reviewDecision === 'APPROVED') {
315 + result.waiting.push(
316 + `• ${ticket.key} — PR #${pullRequest.number} approved`,
317 + );
318 + continue;
320 + const updated = new Date(pullRequest.updatedAt);
321 + if (updated < cutoff) {
322 + result.action.push(
323 + `! ${ticket.key} — PR #${pullRequest.number} stale since ${updated.toISOString().slice(0, 10)}`,
324 + );
325 + continue;
327 + result.waiting.push(
328 + `• ${ticket.key} — PR #${pullRequest.number} waiting for review; active ${updated.toISOString().slice(0, 10)}`,
329 + );
331 + return result;
334 +async function main(today) {
245 335 line('# isp-start-day eval');
246 336 line('');
247 - line(`Date: ${new Date().toISOString().slice(0, 10)}`);
337 + line(`Date: ${formatDate(today)}`);
248 338 line('');
250 340 const tools = {};
280 370 line('');
282 372 const seenKeys = new Set();
373 + let sprintTickets = [];
284 375 line('## Bürobelegung');
285 376 if (tools.acli) {
315 406 const data = jsonParse(page.stdout);
316 407 const body = data?.body?.storage?.value || '';
317 - if (accountId && body) parseOffice(body, accountId).forEach(line);
408 + if (accountId && body) parseOffice(body, accountId, today).forEach(line);
320 411 'Cannot parse your Bürobelegung row; set ISP_JIRA_ACCOUNT_ID if assignee lookup fails',
345 436 const data = sprint.ok ? jsonParse(sprint.stdout) : null;
346 437 if (Array.isArray(data)) {
347 - line(`tickets: ${data.length}`);
348 - const counts = new Map();
349 - for (const item of data)
350 - counts.set(
351 - item.fields.status.name,
352 - (counts.get(item.fields.status.name) || 0) + 1,
353 - );
354 - line('status counts:');
355 - [...counts.entries()]
356 - .sort((a, b) => b[1] - a[1])
357 - .forEach(([k, v]) => {
358 - line(` ${v} ${k}`);
359 - });
360 - line('items:');
361 - data.forEach((i) => {
362 - seenKeys.add(i.key);
363 - line(` ${i.key} [${i.fields.status.name}] ${i.fields.summary}`);
438 + sprintTickets = data;
439 + data.forEach((item) => {
440 + seenKeys.add(item.key);
442 + for (const [heading, status] of [
443 + ['In progress', 'In Progress'],
444 + ['To do', 'To Do'],
445 + ]) {
446 + const tickets = data.filter(
447 + (item) => item.fields.status.name === status,
448 + );
449 + if (!tickets.length) continue;
450 + line(`${heading}:`);
451 + tickets.forEach((item) => {
452 + line(
453 + ` • ${item.key} [${item.fields.priority?.name || 'no priority'}] ${item.fields.summary}`,
454 + );
455 + });
457 + if (data.some((item) => item.fields.status.name === 'Ready to Sync'))
458 + line('Review queue: cross-checked with open PRs below.');
365 459 } else fail('Jira sprint query failed');
366 460 } else warn('Skipped: acli missing');
367 461 line('');
379 473 '--limit',
380 474 '100',
381 475 '--json',
382 - 'number,title,headRefName,author,reviewDecision,url',
476 + 'number,title,headRefName,author,reviewDecision,updatedAt,url',
384 478 { cwd: path.join(KKG_ROOT, 'trunk') },
386 480 prs = pr.ok ? jsonParse(pr.stdout) || [] : [];
387 - if (prs.length) {
388 - const me = (
389 - await run('gh', ['api', 'user', '-q', '.login'])
390 - ).stdout.trim();
391 - line('my PRs:');
392 - prs
393 - .filter((p) => p.author.login === me)
394 - .forEach((p) => {
395 - line(
396 - ` #${p.number} ${p.headRefName} ${p.reviewDecision || ''} ${p.title}`,
397 - );
398 - });
399 - line('team PRs:');
400 - prs
401 - .filter((p) => p.author.login !== me)
402 - .forEach((p) => {
403 - line(
404 - ` #${p.number} ${p.headRefName} ${p.reviewDecision || ''} ${p.title}`,
405 - );
406 - });
481 + if (pr.ok) {
482 + if (prs.length) {
483 + const me = (
484 + await run('gh', ['api', 'user', '-q', '.login'])
485 + ).stdout.trim();
486 + line('my PRs:');
487 + prs
488 + .filter((p) => p.author.login === me)
489 + .forEach((p) => {
490 + line(
491 + ` #${p.number} ${p.headRefName} ${p.reviewDecision || ''} ${p.title}`,
492 + );
493 + });
494 + line('team PRs:');
495 + prs
496 + .filter((p) => p.author.login !== me)
497 + .forEach((p) => {
498 + line(
499 + ` #${p.number} ${p.headRefName} ${p.reviewDecision || ''} ${p.title}`,
500 + );
501 + });
502 + } else line('No open PRs.');
408 504 .flatMap((p) => rdKeysFrom(`${p.headRefName} ${p.title}`))
409 505 .forEach((k) => {
410 506 seenKeys.add(k);
412 - } else fail('gh pr list failed or no open PRs');
508 + const findings = jiraReviewFindings(sprintTickets, prs, today);
509 + if (findings.action.length) {
510 + line('Action:');
511 + findings.action.forEach(line);
513 + if (findings.waiting.length) {
514 + line('Review state:');
515 + findings.waiting.forEach(line);
517 + } else fail('gh pr list failed');
413 518 } else
415 520 KKG_ROOT
431 536 for (const l of wt.stdout.split(/\r?\n/)) {
432 537 if (l.startsWith('worktree ')) cur = { worktree: l.slice(9) };
433 538 if (l.startsWith('branch ') && cur) {
434 - cur.branch = l
435 - .replace(/^branch refs\/heads\//, '')
436 - .slice('branch '.length);
539 + cur.branch = l.replace(/^branch refs\/heads\//, '');
437 540 entries.push(cur);
438 541 cur = null;
513 616 } else warn('Skipped: no RD keys or acli missing');
516 -main().catch((err) => {
517 - fail(err?.message || String(err));
518 - process.exitCode = 1;
519 -});
619 +if (
620 + process.argv[1] &&
621 + import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href
623 + main(parseDateArg(process.argv.slice(2))).catch((err) => {
624 + fail(err?.message || String(err));
625 + process.exitCode = 1;
626 + });

pi/agent/skills/isp-start-day/scripts/isp-start-day.test.mjs

Added
new file mode 100644
1 +import assert from 'node:assert/strict';
2 +import test from 'node:test';
4 +import {
5 + jiraReviewFindings,
6 + parseDateArg,
7 + parseOffice,
8 +} from './isp-start-day.mjs';
10 +test('parses an explicit report date', () => {
11 + const date = parseDateArg(['--date', '2026-07-17']);
13 + assert.deepEqual(
14 + [date.getFullYear(), date.getMonth(), date.getDate()],
15 + [2026, 6, 17],
16 + );
17 +});
19 +test('rejects an invalid report date', () => {
20 + assert.throws(
21 + () => parseDateArg(['--date', '2026-02-30']),
22 + /Invalid date: 2026-02-30/,
23 + );
24 +});
26 +function officeBody(accountId, values) {
27 + const cells = Array.from({ length: 31 }, (_, index) => {
28 + const value = values[index + 1];
29 + return value
30 + ? `<td data-highlight-colour="#fff0b3">${value}</td>`
31 + : '<td></td>';
32 + }).join('');
33 + return `
34 + <table>
35 + <tr><td data-highlight-colour="#fff0b3">A</td><td>Abwesend</td></tr>
36 + </table>
37 + <h2>Juli 2026</h2>
38 + <table><tr><td>R&amp;D</td><td>${accountId}</td>${cells}</tr></table>
39 + `;
42 +test('checks through month-end and proposes missing office values', () => {
43 + const values = Object.fromEntries(
44 + [15, 16, 17, 20, 21, 22, 23, 24, 27, 28, 29].map((day) => [day, 'A']),
45 + );
46 + const output = parseOffice(
47 + officeBody('account-1', values),
48 + 'account-1',
49 + new Date(2026, 6, 15, 12),
50 + ).join('\n');
52 + assert.match(output, /30:_\/no-color/);
53 + assert.match(output, /31:_\/no-color/);
54 + assert.match(output, /Future workdays missing planning: 30, 31/);
55 + assert.match(output, /Proposed update: 30=A \(from 23\), 31=A \(from 24\)/);
56 + assert.match(output, /Confirm or correct each value \(B\/BP\/H\/A\/AP\)/);
57 +});
59 +const readyTicket = {
60 + key: 'RD-1',
61 + fields: { status: { name: 'Ready to Sync' }, summary: 'Review me' },
62 +};
63 +const friday = new Date(2026, 6, 17, 12);
65 +function pr(overrides = {}) {
66 + return {
67 + number: 42,
68 + title: 'RD-1 Review me',
69 + headRefName: 'feature/RD-1',
70 + reviewDecision: '',
71 + updatedAt: '2026-07-16T12:00:00Z',
72 + ...overrides,
73 + };
76 +test('flags Ready to Sync without an open PR', () => {
77 + const result = jiraReviewFindings([readyTicket], [], friday);
79 + assert.match(result.action.join('\n'), /RD-1.*no open PR/);
80 + assert.equal(result.waiting.length, 0);
81 +});
83 +test('flags requested review changes', () => {
84 + const result = jiraReviewFindings(
85 + [readyTicket],
86 + [pr({ reviewDecision: 'CHANGES_REQUESTED' })],
87 + friday,
88 + );
90 + assert.match(result.action.join('\n'), /PR #42.*changes requested/);
91 +});
93 +test('flags review activity older than one workday', () => {
94 + const result = jiraReviewFindings(
95 + [readyTicket],
96 + [pr({ updatedAt: '2026-07-15T12:00:00Z' })],
97 + friday,
98 + );
100 + assert.match(result.action.join('\n'), /PR #42.*stale since 2026-07-15/);
101 +});
103 +test('keeps recently active review work waiting', () => {
104 + const result = jiraReviewFindings([readyTicket], [pr()], friday);
106 + assert.equal(result.action.length, 0);
107 + assert.match(result.waiting.join('\n'), /RD-1.*PR #42.*waiting for review/);
108 +});
110 +test('does not call an approved PR stale', () => {
111 + const result = jiraReviewFindings(
112 + [readyTicket],
113 + [pr({ reviewDecision: 'APPROVED', updatedAt: '2026-07-14T12:00:00Z' })],
114 + friday,
115 + );
117 + assert.equal(result.action.length, 0);
118 + assert.match(result.waiting.join('\n'), /RD-1.*PR #42.*approved/);
119 +});
121 +test('does not apply review findings to other Jira states', () => {
122 + const ticket = {
123 + ...readyTicket,
124 + fields: { ...readyTicket.fields, status: { name: 'In Progress' } },
125 + };
126 + const result = jiraReviewFindings([ticket], [], friday);
128 + assert.deepEqual(result, { action: [], waiting: [] });
129 +});

pi/agent/skills/win32-drive/SKILL.md

Modified
2 2 name: win32-drive
3 -description: "Use on Windows to observe or drive local desktop GUI apps: enumerate windows, screenshot desktop/window/region, pick pixel colors, read UI Automation, cursor/idle/clipboard/theme, click/type/hotkey/window actions. Racing/mutating actions auto-show a red guard and wait for user idle."
3 +description: "Use on Windows for cursor/pointer or other local desktop-GUI symptoms, and to observe or drive GUI apps: enumerate windows, screenshot desktop/window/region, pick pixel colors, read UI Automation, cursor/idle/clipboard/theme, click/type/hotkey/window actions. Racing/mutating actions auto-show a red guard and wait for user idle."
4 4 compatibility: "Windows PowerShell 5.1+"

pi/agent/trust.json

Modified
2 2 "/data/data/com.termux/files/home/Workspace/dotfiles/trunk/pi-ext": true,
3 3 "/home/me": true,
4 - "/home/me/Workspace/pi-ext": true
4 + "/home/me/Workspace/pi-ext": true,
5 + "C:\\Users\\okr\\Workspace\\dotfiles": true,
6 + "C:\\Users\\okr\\Workspace\\toktrak": true