fix(install): drop stale skills and stamp dream once per repository
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c914687804
commit
846ab487c1
4 files changed
+28
-3
No files matched your search
+2
-1
@@ -23,10 +23,11 @@ if [[ ! -d "${TARGET}" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${REPO_ROOT}"
|
cd "${REPO_ROOT}"
|
||||||
|
src="${REPO_ROOT}/.agents/skills"
|
||||||
|
rm -rf "${src}"
|
||||||
log "skills: restoring from skills-lock.json..."
|
log "skills: restoring from skills-lock.json..."
|
||||||
npx --yes skills experimental_install
|
npx --yes skills experimental_install
|
||||||
|
|
||||||
src="${REPO_ROOT}/.agents/skills"
|
|
||||||
if [[ ! -d "${src}" ]]; then
|
if [[ ! -d "${src}" ]]; then
|
||||||
warn "skills: ${src} not found after install."
|
warn "skills: ${src} not found after install."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ for the operator corrections the window revealed. Both keep their own
|
|||||||
confirmation steps; the dream never writes a skill on their behalf.
|
confirmation steps; the dream never writes a skill on their behalf.
|
||||||
|
|
||||||
Close the run by refreshing this repository's reminder stamp, so the next hint
|
Close the run by refreshing this repository's reminder stamp, so the next hint
|
||||||
is twelve hours out: `date +%s > "$(git rev-parse --absolute-git-dir)/.dream-stamp"`.
|
is twelve hours out: `date +%s > "$(git rev-parse --path-format=absolute --git-common-dir)/.dream-stamp"`.
|
||||||
|
|
||||||
## Rules
|
## Rules
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ interval="${DREAM_INTERVAL_SECONDS:-43200}"
|
|||||||
if [[ -n "${DREAM_STAMP:-}" ]]; then
|
if [[ -n "${DREAM_STAMP:-}" ]]; then
|
||||||
stamp="${DREAM_STAMP}"
|
stamp="${DREAM_STAMP}"
|
||||||
else
|
else
|
||||||
git_dir="$(git rev-parse --absolute-git-dir 2>/dev/null)" || exit 0
|
git_dir="$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null)" || exit 0
|
||||||
stamp="${git_dir}/.dream-stamp"
|
stamp="${git_dir}/.dream-stamp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,30 @@ class TestDreamHook(unittest.TestCase):
|
|||||||
self.assertTrue((repo / ".git" / ".dream-stamp").is_file())
|
self.assertTrue((repo / ".git" / ".dream-stamp").is_file())
|
||||||
self.assertEqual(_run_hook(repo).stdout, "")
|
self.assertEqual(_run_hook(repo).stdout, "")
|
||||||
|
|
||||||
|
@unittest.skipUnless(shutil.which("git"), "git not installed")
|
||||||
|
def test_linked_worktrees_share_the_stamp(self):
|
||||||
|
repo = self.cwd / "main"
|
||||||
|
tree = self.cwd / "tree"
|
||||||
|
env = {
|
||||||
|
"PATH": "/usr/bin:/bin",
|
||||||
|
"HOME": str(self.cwd),
|
||||||
|
"GIT_AUTHOR_NAME": "t",
|
||||||
|
"GIT_AUTHOR_EMAIL": "t@t",
|
||||||
|
"GIT_COMMITTER_NAME": "t",
|
||||||
|
"GIT_COMMITTER_EMAIL": "t@t",
|
||||||
|
}
|
||||||
|
repo.mkdir()
|
||||||
|
for args in (
|
||||||
|
["init", "-q"],
|
||||||
|
["commit", "-q", "--allow-empty", "-m", "init"],
|
||||||
|
["worktree", "add", "-q", str(tree)],
|
||||||
|
):
|
||||||
|
subprocess.run(
|
||||||
|
["git", *args], check=True, capture_output=True, env=env, cwd=str(repo)
|
||||||
|
)
|
||||||
|
self.assertIn("/dream", _run_hook(repo).stdout)
|
||||||
|
self.assertEqual(_run_hook(tree).stdout, "")
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(shutil.which("node"), "node not installed")
|
@unittest.skipUnless(shutil.which("node"), "node not installed")
|
||||||
class TestSettingsRegistration(unittest.TestCase):
|
class TestSettingsRegistration(unittest.TestCase):
|
||||||
|
|||||||
Reference in new issue
Block a user