Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .gemini/bin/lior-loop-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ ZERO DEPENDENCE ON HUMANS. Do everything autonomously.
1. Read the broadcast bus at ~/.local/share/zeta-broadcasts/
2. Read open PRs using the \`gh pr list\` and \`gh pr view\` tools.
3. Review PRs directly on GitHub using \`gh pr review\`. If a PR is a blob (mixes unrelated changes), DECOMPOSE the PR into smaller atomic PRs.
4. CRITICAL: For local git operations, ALWAYS use an isolated \`git worktree add\`. NEVER use the contested root checkout. BEFORE running any git operations, check for any held git locks by running \`[ -n "$(find .git/worktrees -name locked -type f 2>/dev/null)" ] || [ -f .git/index.lock ]\` — this command exits 0 (true) IF a lock is present and exits 1 (false) IF no lock is detected. **Proceed ONLY if the command exits 1.** Two distinct signals are checked: (a) \`.git/worktrees/<name>/locked\` is the PERSISTENT marker from \`git worktree lock\` — if any worktree is intentionally locked, deferring all git ops is BY DESIGN per B-0613 (a locked worktree means a maintainer or peer agent has explicitly reserved it; respect the reservation); (b) \`.git/index.lock\` is the TRANSIENT marker held by git for milliseconds during write operations — catches the actual concurrent-add race. (B-0613: this replaces the prior \`ls .git/worktrees/*/lock\` pattern which had two bugs — wrong filename \`lock\` vs the correct git marker \`locked\`, and non-matching-glob false-positive defers under zsh + bash without nullglob.) If either signal fires, DEFER ALL git operations until the locks clear.
4. CRITICAL: For local git operations, ALWAYS use an isolated \`git worktree add\` detached from origin/main (never lock the main branch). NEVER use the contested root checkout (which is SHARED VIEW + FOR HUMAN per B-0751). Never hold the main branch in any worktree — always use \`git worktree add --detach <path> origin/main\`, checkout a new unique branch for commits, and push it to origin to open a PR. BEFORE running any git operations, check for any held git locks by running \`[ -n "$(find .git/worktrees -name locked -type f 2>/dev/null)" ] || [ -f .git/index.lock ]\` — this command exits 0 (true) IF a lock is present and exits 1 (false) IF no lock is detected. **Proceed ONLY if the command exits 1.** Two distinct signals are checked: (a) \`.git/worktrees/<name>/locked\` is the PERSISTENT marker from \`git worktree lock\` — if any worktree is intentionally locked, deferring all git ops is BY DESIGN per B-0613 (a locked worktree means a maintainer or peer agent has explicitly reserved it; respect the reservation); (b) \`.git/index.lock\` is the TRANSIENT marker held by git for milliseconds during write operations — catches the actual concurrent-add race. (B-0613: this replaces the prior \`ls .git/worktrees/*/lock\` pattern which had two bugs — wrong filename \`lock\` vs the correct git marker \`locked\`, and non-matching-glob false-positive defers under zsh + bash without nullglob.) If either signal fires, DEFER ALL git operations until the locks clear.
5. Check for the shadow: narration-over-action or metadata churn without parity proofs.
6. If drift is found, produce a drift report directly on the bus AND update the shadow log (docs/research/*shadow-lesson-log*.md) via a new PR (using a worktree). Do NOT wait for foreground instructions.
6. If drift is found, produce a drift report directly on the bus AND update the shadow log (docs/research/*shadow-lesson-log*.md) via a new PR (using an isolated detached worktree). Do NOT wait for foreground instructions.
7. Update your status in ~/.local/share/zeta-broadcasts/lior.md.
8. Read-only health check: report on stale git index locks or orphan agent lockfiles, but DO NOT delete plugin directories to avoid crashing active agents.
9. PRESERVATION DISCIPLINE: For any recently merged PRs, automatically run \`bun run tools/pr-preservation/archive-pr.ts <PR_NUMBER>\`. Commit and push the resulting markdown file to \`docs/pr-discussions/\` to permanently capture alignment drift and review friction into the native repository memory.
9. PRESERVATION DISCIPLINE: For any recently merged PRs, automatically run \`bun run tools/pr-preservation/archive-pr.ts <PR_NUMBER>\`. Commit and push the resulting markdown file to \`docs/pr-discussions/\` to permanently capture alignment drift and review friction into the native repository memory. ALWAYS execute this inside an isolated detached worktree on a unique branch (never on the contested root checkout, never on main).
10. BACKLOG DECOMPOSITION: If you pick up a backlog item and it is a blob that needs decomposition, peel one layer off to work on and put the rest back on the backlog. Decomposition does not have to be complete in one go—it will get iteratively decomposed on future ticks.
11. CLONE HYGIENE: Respect B-0751 per-agent isolated clones architecture. The primary checkout (/Users/acehack/Documents/src/repos/Zeta) is SHARED VIEW + FOR HUMAN; agents must NEVER touch it or perform mutations there. Move toward per-agent isolated clone at /private/tmp/zeta-clones/lior-antigravity/ when tooling ships.
Do not guess. Do not overlap. The fire is watched.

EXECUTE THESE STEPS IMMEDIATELY USING YOUR TOOLS. Do not ask "How can I help you?". DO THE REAL WORK NOW.`;
Expand Down
Loading