Skip to content

[monitor] Accept worktrees in daily dogfood sync #88

Description

@s-hiraoku

Summary

The daily dogfood sync helper should accept Git worktrees as valid target repositories. The current helper rejects isolated default-branch worktrees because it requires each target checkout to contain .git as a directory, while normal Git worktrees have .git as a file pointing at the common gitdir.

Observed evidence

During the 2026-06-30 organization monitor run, I created isolated temporary worktrees from the fetched default branches and ran the documented sync checks. The contract check passed, but the sync script failed before drift verification:

Daily dogfood sync contract is present.
target root must be a git repository: /tmp/kaizen-monitor.IbVQUB/builder-agent

Default-branch evidence from kaizen-agents-org/.github@9186c247cd36212b7b0039b70cddff25d264b826:

  • scripts/sync-daily-dogfood.sh checks [[ ! -d "${target_root}/.git" ]] and exits with target root must be a git repository when .git is not a directory.
  • automations/kaizen-agents-org-monitor.prompt.md says to prefer reading and running default-branch checks from isolated temporary worktrees created from origin/main.
  • docs/daily-dogfood-sync.md defines the daily dogfood sync as the deterministic scheduled/post-merge contract for managed paths and says the monitor should check drift outside manifest-managed paths.

Affected repositories

  • Primary target: kaizen-agents-org/.github
  • Affected downstream sync targets when using worktree-based monitor verification: builder-agent, kaizen-loop, verifier, plus downstream sync targets coderabbit and renovate-config.

Recommended action

Update scripts/sync-daily-dogfood.sh so repository validation accepts both regular clones and Git worktrees. A focused fix could replace the .git directory test with git -C "${target_root}" rev-parse --is-inside-work-tree, then add a small regression case using a temporary worktree target.

This is related to, but distinct from, #87, which covers the narrower scripts/sync-kaizen-shared-skills.sh helper.

Documentation basis

  • automations/kaizen-agents-org-monitor.prompt.md at .github@9186c247cd36212b7b0039b70cddff25d264b826: instructs the monitor to prefer isolated temporary worktrees from origin/main for default-branch checks.
  • docs/daily-dogfood-sync.md, "Workflow" and "Monitor Contract" at the same default-branch ref: establishes scripts/sync-daily-dogfood.sh as the deterministic manifest-driven sync path and says the monitor should verify sync health and drift.
  • docs/org-monitor.md, "What It Checks" and "Relationship To Daily Dogfood Sync" at the same default-branch ref: says the monitor checks daily dogfood/shared-skill sync health and local runner refresh readiness.

Duplicate-check summary

Checked open issues and PRs across .github, builder-agent, kaizen-loop, and verifier for worktree, daily dogfood worktree, sync-daily-dogfood, .git directory, and target root must be a git repository. Existing issue #87 covers scripts/sync-kaizen-shared-skills.sh; no open issue or PR covers the daily dogfood helper accepting worktrees.

PR linkage requirement

The implementation PR for this issue must target the repository default branch,
include Closes #88 for same-repository work or Closes kaizen-agents-org/.github#88
for cross-repository work in the PR body, and verify
gh pr view <pr> --json baseRefName,closingIssuesReferences,isDraft before
reporting the PR ready. Do not rely on a PR title, branch name, or issue comment
as proof that GitHub will close the issue on merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kaizenIssue processed by Kaizen Loopkaizen:needs-humanNeeds human input before retry

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions