Skip to content

Plan 321 P0 — record the shepherd's four measured inputs - #117

Merged
munchist merged 4 commits into
mainfrom
aflow/321-p0-measurements
Oct 16, 2026
Merged

munchist merged 4 commits into
mainfrom
aflow/321-p0-measurements

Conversation

@munchist

Copy link
Copy Markdown
Contributor

Records the four measured inputs of the shepherd's P0 in docs/plans/321-the-loop-recovers-from-ci.md §5, each with the command that produced it, and sets P0's exit as met — then, on two review rounds, changes the decisions the measurements contradict (a measurement that contradicts a decision changes the decision, never sits beside it):

  1. Schedule-to-skill-input path (code read at a7939a7) — a schedule starts an agent run, never a skill; the skill runs because that agent calls workflow.run.start with the inputs its template carries. D1/D2 name the design the code already allows: the agent that decides nothing is a custom agent — an operator-authored step-graph agent (agent.manage.create, packages/schemas/src/runtime/agentTarget.ts custom-agent) whose definition is one operation step, workflow.run.start of local-pr-shepherd with bindingId as a literal, and no model turn at all — no ai.agent.turn, no prompt, nothing to drift. The schedule targets that agent by slug; the Local PR Shepherd bundle installs the agent beside the skill so the operator creates nothing by hand; D2 names the same agent. Templates carry static JSON, $now, and (on completion) the source runId/status/outputRef; $memoryRef always fails the firing; the template is checked only for non-emptiness at creation; a repo coordinate is campaign config, not a run input.
  2. GitHub rate budget (gh api rate_limit live probe of the binding's token) — core limit 5,000 requests/hour; x-ratelimit-*/Retry-After reach the agent unparsed; the generic retry never reads them, the exhausted-limit 403 is not retried, POST/PATCH calls are never retried on 429. The interval is derived in the plan: one pass for N open PRs costs the list + one check-runs read per PR + one jobs read per failing run + one log read per failing job, and the default interval follows with a wide margin, written as the number and the arithmetic.
  3. Size of a failing job's log (gh api repos/aflowai/aflow/actions/runs/37460214524/attempts/1/jobs, then gh api repos/aflowai/aflow/actions/jobs/<job_id>/logs) — Test job 923,330 bytes / 5,955 lines (failure in the last 280), Dependency audit job 32,310 bytes / 421 lines (advisories in the last 35). A last-300-lines, under-60 KB tail bound carried the failure for both job kinds observed; a bound needs no endpoint binding to hold.
  4. Attention list (workflow.run.list_attention) — items name a run, never a branch, PR or repo. D3.4 names the mechanism that replaces it, a bounded read of the space's runs by workflow and input field, and §4 turns its conditional into the packages/schemas change that read needs, with the P2 exit following.

Status: P0 measured, P1 next. Citations are repository-relative paths (the P0.1 $memoryRef line range names its own file); no systemRole: 'helmsman' remains; nothing else in the document changes.

Schedule-to-skill-input path (code read at a7939a7), GitHub rate budget
(gh api rate_limit live probe, 5000 req/h core), failing-job log sizes
(gh api .../actions/jobs/<id>/logs on CI run 37460214524 — Test job
923,330 bytes / 5,955 lines, audit job 32,310 bytes / 421 lines; a
last-300-lines, under-60 KB tail bound carried the failure for both job
kinds), and the attention list's fields (no branch, PR or repo). P0's
exit is met.
D1/D2 now say a schedule starts an agent run and the skill runs because
that agent calls workflow.run.start with the inputs its template carries
(the agent target and the folder binding named as static JSON). D3.4
names the mechanism replacing the attention list's missing branch — a
bounded read of the space's runs by workflow and input field — and §4
turns its conditional into the packages/schemas change that read needs,
with the P2 exit following. The polling interval is derived: one pass
for N open PRs costs the list + one check-runs read per PR + one jobs
read per failing run + one log read per failing job, against the
5,000-an-hour core budget, with the default interval written as the
number and the arithmetic. Status: P0 measured, P1 next.
…argets

There is no platform role 'helmsman' — the Helmsman's systemRole is
cybernetic-helmsman — and a Helmsman run acting on a template is the
prompt D1 rejects. A schedule carries only a persistent target,
platform-role or custom-agent, never an inline agent
(scheduleCrud.ts, comment near :388). The agent that decides nothing is
a custom agent: an operator-authored step-graph agent
(agent.manage.create, packages/schemas/src/runtime/agentTarget.ts
custom-agent) whose definition is one operation step, workflow.run.start
of local-pr-shepherd with bindingId as a literal, and no model turn at
all — no ai.agent.turn, no prompt, nothing to drift. The schedule
targets that agent by slug; the Local PR Shepherd bundle installs the
agent beside the skill so the operator creates nothing by hand; D2
names the same agent. Every systemRole: 'helmsman' is replaced; the
P0.1 $memoryRef citation names its own file by repository-relative
path.
…e decide rule

(a) The §3.1 task table's read-in-flight reads workflow.run.list by
workflow and input field, as D3.4 says — not workflow.run.list_attention.
(b) P0.2's arithmetic is recomputed from what the plan's own tasks cost:
three reads and one write per pull request per pass — the check runs,
the jobs of a failing run, the log of a failing job, and the handoff
comment — against the 5,000-an-hour core budget, with the per-pass cost,
the budget share and the break-even N written as arithmetic.
(c) §3.1 states the decide rule the measurements answer: the four inputs
decide fix, wait, abandon and leave by rule, and a model is reached for
only to read a log excerpt a rule cannot. The open question closes.
@munchist
munchist merged commit aad041a into main Oct 16, 2026
3 checks passed
@munchist
munchist deleted the aflow/321-p0-measurements branch October 16, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant