Skip to content

fix(pstack): make worktree-audit's LAST_CHAT work with GNU stat and date - #805

Merged
poteto merged 1 commit into
mainfrom
lauren/worktree-audit-gnu-stat-a7d7
Oct 23, 2026
Merged

poteto merged 1 commit into
mainfrom
lauren/worktree-audit-gnu-stat-a7d7

Conversation

@poteto

@poteto poteto commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Replaces #707 by @surlymochan. The commit is the same, rebased onto current main, and Chao Chen is still its author. GitHub refused the push to the fork branch: the rebase brings in main's newer .github/workflows/validate-plugins.yml, and the app cannot update workflow files on a fork.

Problem

worktree-audit.sh reads transcript mtimes with BSD stat -f '%m %N' and date -r <epoch>. GNU coreutils (Linux, Homebrew gnubin) reads stat -f as file-system status and date -r as a file path. The result is that LAST_CHAT is always empty, and a worktree with a recent chat is bucketed safe to delete.

Fix

Probe stat -c %Y / once. Use stat -c '%Y %n' and date -d "@<epoch>" when it succeeds. Otherwise keep the BSD flags.

Verification

  • node scripts/validate-plugins.mjs, node scripts/generate-pstack-harness-trees.mjs --check, node scripts/check-pstack-docs.mjs: pass.
  • bun test (68 pass) and bun run typecheck in pstack/skills/poteto-mode/scripts; node tests for pstack skill scripts (58 pass). Main has no test for worktree-audit.sh.
  • Direct run on Linux (GNU coreutils) with a fake transcript dated 2026-10-21 in a temp repo with one linked worktree:
    • main: LAST_CHAT empty, bucket safe.
    • this branch: LAST_CHAT 2026-10-21, bucket verify-recent-chat.
  • No pstack version bump.
Open in Web Open in Cursor 

@poteto
poteto merged commit f83fbe6 into main Oct 23, 2026
2 checks passed
caelaxie added a commit to pstack-ports/devin-pstack that referenced this pull request Oct 24, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
synced to
[`e73df47`](cursor/plugins@e73df47).
compared `4ec7ffa..e73df47` for `pstack/`. `origin/main` is that commit.
version is `0.15.32` in `plugin.json`, `.devin-plugin/plugin.json`, and
the readme marker.

ported:
-
[`076f4b2`](cursor/plugins@076f4b2)
([#791](cursor/plugins#791)) statechart skill
update and the pele renderer. scripts copied verbatim, including the
removal of the outputfolder model. `SKILL.md` keeps `/pstack:statechart`
and `triggers: [user]`.
-
[`642289e`](cursor/plugins@642289e)
([#792](cursor/plugins#792)) bump to 0.15.31,
folded into the 0.15.32 bump in `plugin.json` and
`.devin-plugin/plugin.json`.
-
[`00d5dec`](cursor/plugins@00d5dec)
([#794](cursor/plugins#794)) generated verify
skills read each model-check result with `/pstack:statechart`.
-
[`3c0fdb4`](cursor/plugins@3c0fdb4)
([#797](cursor/plugins#797)) add the
ketchup-video skill. poteto-help, the readme skill table, and guide page
10 match. slash commands keep the `/pstack:` prefix.
`disable-model-invocation: true` stays `triggers: [user]`.
-
[`b1a1298`](cursor/plugins@b1a1298)
([#798](cursor/plugins#798)) bump to 0.15.32, in
`plugin.json`, `.devin-plugin/plugin.json`, and the readme marker.
-
[`7054003`](cursor/plugins@7054003)
([#800](cursor/plugins#800)) reflect edits leave
`plugins/cache/` (devin's checkout is
`~/.local/share/devin/cli/plugins/cache`). the destination is
`.devin/skills/<skill>/` or `~/.config/devin/skills/<skill>/`. no pr and
no push.
-
[`96dec8e`](cursor/plugins@96dec8e)
([#801](cursor/plugins#801)) watch-pr
distinguishes fork heads. the pstack scripts were copied verbatim.
-
[`fe096ef`](cursor/plugins@fe096ef)
([#802](cursor/plugins#802)) watch-pr caps
polling sleeps at the deadline. scripts copied verbatim.
-
[`86c2448`](cursor/plugins@86c2448)
([#803](cursor/plugins#803)) check-plan
recognizes matching inline code delimiters. scripts copied verbatim.
-
[`3c596e7`](cursor/plugins@3c596e7)
([#804](cursor/plugins#804)) orch prefers the
active pr. the changed files are under
`pstack/skills/poteto-mode/scripts/orch/` and were copied verbatim.
-
[`f83fbe6`](cursor/plugins@f83fbe6)
([#805](cursor/plugins#805)) worktree-audit
reads transcript mtimes with gnu stat and date. kept `rg -a` and the
devin `sessions.db` directory.
-
[`e73df47`](cursor/plugins@e73df47)
([#807](cursor/plugins#807)) swarm phase a is
numbered 1 to 4, phase b points at step 3, and phase d asks for a result
table.

skipped:
-
[`a0b0ad9`](cursor/plugins@a0b0ad9)
([#806](cursor/plugins#806)) claude code
auto-update note. it sits in the claude code install section, and this
readme has no such section.
- `harness/pstack/claude-code/` copies in every commit above. this port
does not carry the generated claude code tree.
- [#792](cursor/plugins#792) and
[#798](cursor/plugins#798)
`pstack/.cursor-plugin/plugin.json`. cursor packaging. the version bump
lands in `.devin-plugin/plugin.json` instead.

harness proof (`devin plugins install`, `devin plugins list`,
`/pstack:statechart`, `/pstack:ketchup-video`, `/pstack:poteto-mode`)
will follow as a comment. the devin cli can't log in from this cloud
environment.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-1991bcdf-ceba-5d68-8535-0ec4d1228e4e?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-1991bcdf-ceba-5d68-8535-0ec4d1228e4e&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Kaitian Xie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants