Repository navigation
Fix worktree session scope and bot UI wake auth - #37
Merged
Merged
Conversation
worktree-audit.sh encodes the main worktree with the DSH projectKey rule and reads session logs only from that directory, so LAST_CHAT cannot come from another project. The make-bot-ui sample checks BOT_UI_KEY on POST /wake using the HttpOnly cookie GET / sets, and the probe sends that cookie. Co-authored-by: Kaitian Xie <caelaxie@users.noreply.github.com>
caelaxie
commented
Nov 17, 2026
caelaxie
left a comment
Contributor
Author
There was a problem hiding this comment.
#33: worktree-audit.sh now encodes the main worktree with the same projectKey as session-log.sh and searches only $DSH_HOME/sessions/<projectKey>/. #36: the sample POST /wake checks the HttpOnly bot_ui cookie GET / sets; the page still has no key; the probe was updated.
harness: dsh plugin --profile ci add on 99620dee93087c9e42e79e13da1428556c91b6e9 plus list/dump-config, and 61 skills including deslop, control-cli, and control-ui. validate and mount-bundle ci are green. #32, #34, and #35 correctly left open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33
Closes #36
#33
worktree-audit.shencodes the main worktree path with the DSHprojectKeyrule and searches only$DSH_HOME/sessions/<projectKey>/.LAST_CHATcan no longer come from another project's session logs.The encoder matches
session-log.shand@deepseek-ai/dsh-session-persistence-jsonl@0.2.2-rc.3: separators become-, runs collapse, a code unit outside[A-Za-z0-9._-]becomes~plus 4 uppercase hex, leading hyphens are stripped, the body is cut at 251 characters, and the result is wrapped in--.#36
The sample
POST /wakehandler returns 401 unless thebot_uicookie matchesBOT_UI_KEY.GET /sets that cookie (HttpOnly; SameSite=Strict). The page script still posts JSON and does not contain the key. The probe saves the cookie fromGET /and sends it on the post.The CI DSH pin and peer ranges are unchanged.
Harness proof
Base is
f91273cf(pstack 0.15.42). Head is99620dee93087c9e42e79e13da1428556c91b6e9. Runtime is@deepseek-ai/dsh@0.2.2-rc.3on Node v22.23.4 (the CI node).dshwarns that it wants Node>=24.9.0; the profile still booted.npm test: validated 61 skills, 23 playbooks, 24 principles, and the bundle manifest.bash -n .agents/skills/poteto-mode/scripts/worktree-audit.shpassed.bun run typecheckpassed, andbun testpassed 61 tests.projectKeyfrom the shell function matcheddsh-session-persistence-jsonl@0.2.2-rc.3projectKey, including the documented path/Users/you/My Projects/repo→--Users-you-My~0020Projects-repo--, plus drive-letter, collapse, truncation, and non-ASCII cases.Session-scope fixture: a linked worktree mentioned by an older log in the main worktree's project key, a newer
.jsonl.zstdlog in that same key, and a still newer log under a different project key.LAST_CHATwas2025-03-01(the in-project zstd log). The other project's2026-06-01log was ignored. A second linked worktree mentioned only by the other project stayed-.Wake auth, using the sample server extracted from
make-bot-ui/SKILL.mdand a stubdshonPATH:POST /wakewith no cookie: 401unauthorizedGET /: 200, body does not contain the key,Set-CookieisHttpOnly; SameSite=Strictand matchesBOT_UI_KEYPOST /wakewith that cookie: 202accepteddsh headlessran once, and the prompt did not contain the keyBOT_UI_KEYunset exits 1 (set BOT_UI_KEY)Bundle mount:
dsh plugin --profile ci add <checkout>linkeddsh-pstackdsh plugin --profile ci list --depth 0showsdsh-pstackdsh --profile ci --dump-configcontains# == dsh-pstack,- id: pstack, andname: dsh-pstack.github/prove-dsh-profile.mjs: started bundles includedsh-pstack; the pstack provider listed 61 skills, includingpoteto-mode,setup-pstack,deslop,control-cli,control-ui, andmake-bot-ui