You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SessionStart: 50-git-restore.sh runs as a foreground child and re-sources the whole lib chain even when git_restore is disabled (Part of #660) #663
filed-by-loopFiled by the maintainer loop, not by a human. Sets the author axis in dispatch_rank.lane-capturein-session hooks and the summarizer — post-tool, prompt, session-start/end, haiku.py, prompts/priority:highBlocks work or has already caused damage
session-start-hook.sh:302 dispatches before_session_start hooks through log.sh:1014-1166. For the one shipped hook, hooks.d/before_session_start/50-git-restore.sh, the dispatcher spawns $(id -u) (log.sh:1033), two $(config) calls, $(stat -c %u) (:1060), $(find "$hook" -maxdepth 0 -perm -002) (:1066), two rm -f, a supervise watcher subshell with sleep 1 (:955-985), and then a whole child bash (:1111) which the parent waits on.
In legacy layout the child exits at 50-git-restore.sh:12 before spawning anything. In external data_dir layout it runs git rev-parse --show-toplevel, two $(cd; pwd -P), then source log.sh -- and because _LIB_MEMORY_DIR_LOADED is not exported, the child re-runs the full lib-memory-dir.sh + log.sh chain: mktemp, jq -s merge, jq flatten, six $(config) calls, trap plumbing (~25-30 spawns) -- before it reads $(config .git_restore.enabled) at :25 and exits if false.
Also: find at log.sh:1066 and bootstrap-dirs.sh:143 is exposed to the System32 find.exe PATH-shadow on Windows.
Cost
Estimated 0.5-1.5s legacy, 2-5s external mode, per start (reasoned, not measured on Windows).
Fix shape
In the hook: test git_restore.enabled before source log.sh -- cheapest is to have the parent export the flattened config (the _RCFG_* cache, or one REMEMBER_CFG_FLAT string) so the child skips _config_load and the merge entirely; or a plain grep on the exported $REMEMBER_CONFIG path.
In dispatch: $EUID instead of $(id -u); fold stat %u and find -perm -002 into one stat -c '%u %a' and test the world-writable bit in bash.
Larger option, if the above is not enough: run git-restore in the detached phase and emit a "restored, memory will be re-read next start" notice.
Positive control: a test that flips git_restore.enabled and shows the child still runs the restore; negative: with it disabled, the child spawns nothing beyond the exit.
filed-by-loopFiled by the maintainer loop, not by a human. Sets the author axis in dispatch_rank.lane-capturein-session hooks and the summarizer — post-tool, prompt, session-start/end, haiku.py, prompts/priority:highBlocks work or has already caused damage
Activity
SessionStart: 50-git-restore.sh no longer re-sources the whole config…
fix(#740,#744): sanitize the untrusted project layer with a Windows-p…
fix(#740): strip haiku from every document of an untrusted project co…