docs: tighten scheduler race-check metadata and verdict rules

This commit is contained in:
thePR0M3TH3AN committed 2026-02-13 12:07:58 -05:00
1 parent cb7b942c75
commit f6ec91bc2c
3 files changed
+38 -8

No files matched your search

+14 -2
View File
@@ -14,7 +14,7 @@ before choosing a task — is to run these two commands. Not later. NOW.
COMMAND 1 — Check for open daily agent PRs:
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, title, draft, created_at, head: {ref: .head.ref}, labels: [.labels[].name]}]}'
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, created_at, draft, head: {ref: .head.ref}, agent: ((.head.ref | capture("^agents/daily/(?<agent>[^/]+)/")?.agent) // (.title | capture("(?<agent>[A-Za-z0-9-]+-agent)")?.agent // null))}] | sort_by(.created_at, .number)}'
Normalize each PR to an agent name using this deterministic rule:
1) Preferred: parse `head.ref` as `agents/daily/<agent-name>/...`
@@ -60,6 +60,12 @@ Now proceed with the scheduler:
in docs/agents/task-logs/daily/. Both MUST exist before task execution begins.
4. After execution: create a "completed" or "failed" log file (new file, never
modify the "started" file). Commit and push.
Race check rule (must be applied after pushing your claim branch):
- Re-run the sortable PR metadata command and compare only PRs with matching derived `agent`.
- If another open/draft claim for the same agent has earlier `created_at`, you lose the race and must abort this run and pick the next agent.
- If timestamps are equal or ambiguous, lower PR `number` wins.
- Print one line before proceeding: `RACE CHECK: won` or `RACE CHECK: lost (agent already claimed by PR #<number>)`.
```
## Weekly Scheduler Meta Prompt
@@ -72,7 +78,7 @@ before choosing a task — is to run these two commands. Not later. NOW.
COMMAND 1 — Check for open weekly agent PRs:
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, title, draft, created_at, head: {ref: .head.ref}, labels: [.labels[].name]}]}'
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, created_at, draft, head: {ref: .head.ref}, agent: ((.head.ref | capture("^agents/weekly/(?<agent>[^/]+)/")?.agent) // (.title | capture("(?<agent>[A-Za-z0-9-]+-agent)")?.agent // null))}] | sort_by(.created_at, .number)}'
Normalize each PR to an agent name using this deterministic rule:
1) Preferred: parse `head.ref` as `agents/weekly/<agent-name>/...`
@@ -118,4 +124,10 @@ Now proceed with the scheduler:
in docs/agents/task-logs/weekly/. Both MUST exist before task execution begins.
4. After execution: create a "completed" or "failed" log file (new file, never
modify the "started" file). Commit and push.
Race check rule (must be applied after pushing your claim branch):
- Re-run the sortable PR metadata command and compare only PRs with matching derived `agent`.
- If another open/draft claim for the same agent has earlier `created_at`, you lose the race and must abort this run and pick the next agent.
- If timestamps are equal or ambiguous, lower PR `number` wins.
- Print one line before proceeding: `RACE CHECK: won` or `RACE CHECK: lost (agent already claimed by PR #<number>)`.
```
+12 -3
View File
@@ -76,7 +76,7 @@ If you arrived here from the meta prompt and already ran these commands and past
Run this command:
```bash
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, title, draft, created_at, head: {ref: .head.ref}, labels: [.labels[].name]}]}'
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, created_at, draft, head: {ref: .head.ref}, agent: ((.head.ref | capture("^agents/daily/(?<agent>[^/]+)/")?.agent) // (.title | capture("(?<agent>[A-Za-z0-9-]+-agent)")?.agent // null))}] | sort_by(.created_at, .number)}'
```
**Paste the complete raw output.** If the command returns nothing or errors, write: `OUTPUT: (empty — no results)`
@@ -180,9 +180,18 @@ You must create a visible claim before doing any work. This claim is a **distrib
After pushing, re-check for competing claims:
```bash
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, title, draft, created_at, head: {ref: .head.ref}, labels: [.labels[].name]}]}'
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, created_at, draft, head: {ref: .head.ref}, agent: ((.head.ref | capture("^agents/daily/(?<agent>[^/]+)/")?.agent) // (.title | capture("(?<agent>[A-Za-z0-9-]+-agent)")?.agent // null))}] | sort_by(.created_at, .number)}'
```
If you see another PR for this agent that was created *before* yours, abandon your branch and go back to Step 1 to select the next agent.
Decision logic (must be explicit):
1. Compare only open/draft PRs whose derived `agent` matches the agent you just claimed.
2. If another matching PR has an earlier `created_at`, abort this run and pick the next agent.
3. If `created_at` values are equal or ambiguous, use the lower `number` as the tie-breaker (lower number wins).
Before proceeding, print exactly one race verdict line:
- `RACE CHECK: won`
- `RACE CHECK: lost (agent already claimed by PR #<number>)`
If the verdict is lost, abandon your branch and go back to Step 1 to select the next agent.
### 2c. Log "started" in the task log immediately
+12 -3
View File
@@ -76,7 +76,7 @@ If you arrived here from the meta prompt and already ran these commands and past
Run this command:
```bash
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, title, draft, created_at, head: {ref: .head.ref}, labels: [.labels[].name]}]}'
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, created_at, draft, head: {ref: .head.ref}, agent: ((.head.ref | capture("^agents/weekly/(?<agent>[^/]+)/")?.agent) // (.title | capture("(?<agent>[A-Za-z0-9-]+-agent)")?.agent // null))}] | sort_by(.created_at, .number)}'
```
**Paste the complete raw output.** If the command returns nothing or errors, write: `OUTPUT: (empty — no results)`
@@ -175,9 +175,18 @@ You must create a visible claim before doing any work. This claim is a **distrib
After pushing, re-check for competing claims:
```bash
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, title, draft, created_at, head: {ref: .head.ref}, labels: [.labels[].name]}]}'
curl -s "https://api.github.com/repos/PR0M3TH3AN/bitvid/pulls?state=open&per_page=100" | jq '{count: length, prs: [.[] | {number, created_at, draft, head: {ref: .head.ref}, agent: ((.head.ref | capture("^agents/weekly/(?<agent>[^/]+)/")?.agent) // (.title | capture("(?<agent>[A-Za-z0-9-]+-agent)")?.agent // null))}] | sort_by(.created_at, .number)}'
```
If you see another PR for this agent that was created *before* yours, abandon your branch and go back to Step 1 to select the next agent.
Decision logic (must be explicit):
1. Compare only open/draft PRs whose derived `agent` matches the agent you just claimed.
2. If another matching PR has an earlier `created_at`, abort this run and pick the next agent.
3. If `created_at` values are equal or ambiguous, use the lower `number` as the tie-breaker (lower number wins).
Before proceeding, print exactly one race verdict line:
- `RACE CHECK: won`
- `RACE CHECK: lost (agent already claimed by PR #<number>)`
If the verdict is lost, abandon your branch and go back to Step 1 to select the next agent.
### 2c. Log "started" in the task log immediately