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
40 changes: 40 additions & 0 deletions docs/AUTONOMOUS-LOOP-PER-TICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,46 @@ non-git-mutating work, and log the failure in the tick shard for
future-Otto context. The safe assumption under unknown state is to
avoid operations that contend on `.git/objects/pack`.

#### Step 1a — Unfinished-PR check (Aaron 2026-05-23)

After refresh, query for unfinished PRs authored by this agent
surface that need attention BEFORE picking new speculative work:

```bash
gh pr list --state open \
--search "author:@me head:otto-cli/* OR head:otto-desktop/* OR head:otto-vscode/* OR head:otto/* -label:\"deferred-to-human\"" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Group OR clauses so author/label filters apply to all heads

The --search expression combines multiple OR branch clauses without parentheses, so author:@me and -label:"deferred-to-human" are not guaranteed to constrain every branch term. gh pr list explicitly uses GitHub advanced issue-search syntax (https://cli.github.com/manual/gh_pr_list), and GitHub’s boolean-search docs require parentheses for grouped qualifiers (https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/filtering-and-searching-issues-and-pull-requests#using-parentheses-for-more-complicated-filters). In this flow, that can surface PRs outside the intended lane or include deferred PRs, and the subsequent “act on each unfinished PR” instruction can close the wrong PRs.

Useful? React with 👍 / 👎.

--json number,title,createdAt,mergeable,updatedAt \
--limit 50
```

For each unfinished PR returned, apply
[`.claude/rules/pr-triage-tiers.md`](../.claude/rules/pr-triage-tiers.md)
classification (Tier 1 redundant / Tier 2 recoverable / Tier 3
superseded / Tier 4 re-derivable / Tier 5 deferred-to-human). Act
on Tier 1-4 closes immediately (substrate-honest comment +
`gh pr close`). For Tier 5, tag `deferred-to-human` via
`gh pr edit <N> --add-label "deferred-to-human"` and post the
substrate-at-risk comment; future scans skip these.

**Lane discipline** (per [`.claude/rules/agent-roster-reference-card.md`](../.claude/rules/agent-roster-reference-card.md)):
filter to YOUR surface's branch prefixes — Lior owns `lior/*`,
peer Otto-CLI vs Otto-Desktop vs Otto-VSCode each own their
surface-tagged prefixes. Do NOT triage another agent's lane
unless explicit coordination has transferred ownership.

**Substrate-honest framing**: this step prevents cross-session
amnesia — each cold-boot picks new work without seeing the
unfinished PRs the same surface left behind. Aaron 2026-05-23:
*"plase updates your background server for this... lirs background
service is what's leaving prs sometime so we are updateing to check
for unfinsihed prs first when it starts"* — the same fix applies
to Otto.

**Only proceed to Step 3 (pick new work) if no unfinished PRs
need attention.** Step 2 (Holding discipline) still applies if
the unfinished-PR check itself surfaces a real bounded wait
(e.g., PR in CI awaiting required check).

### 2. Apply Holding-without-named-dependency discipline

[`.claude/rules/holding-without-named-dependency-is-standing-by-failure.md`](../.claude/rules/holding-without-named-dependency-is-standing-by-failure.md).
Expand Down
Loading