Skip to content

factory: AgentField steps end in plain words; outcome, failed state and start time kept - #2514

Merged
santoshkumarradha merged 2 commits into
factory/general-intakefrom
fix/factory-e2e-r7-wording
Nov 8, 2026
Merged

santoshkumarradha merged 2 commits into
factory/general-intakefrom
fix/factory-e2e-r7-wording

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Fixes the engine wording and state findings from WorkAF live e2e rounds 6 and 7.

What changed

  1. The step's label, not the reasoner's id. An agentfield step's text now uses the step's label: swe-planner.build_issue no longer appears.
    • A finished step reads "finished and opened ".
    • A failed run reads " did not succeed: ".
    • A run that failed or was cancelled on the control plane reads " failed: …" or " was cancelled: …".
    • The job log reads "started its run on AgentField".
  2. The run's outcome sentence is stored on the job. The engine now reads the run's notes (GET /api/v1/executions/<id>/notes). The plain outcome goes into failure.summary, and state_presentation.detail prefers the summary. The outcome is worked out from the shape of the words alone (factory.AgentFieldOutcome), never from a pipeline or step name:
    • A leading grade (OVERALL: FAIL.) is dropped, and the reason is cut before any quoted command. SWE-AF 7321e7c writes the summary as OVERALL: FAIL. The project does not build or its tests fail: `go build ./...` exited 1. …, which now reads "The project does not build or its tests fail".
    • A note that starts with "No pull request:" reads ", so no pull request was opened".
    • snake_case codes and banned words (verification, verified, verdict, refuted, auditor) are reworded.
    • The raw report, command output included, is kept as the failed step's output, which is the folded full text.
  3. No "verified" in the native Follow PR wording. Merge gate, publish, follow-up and chat-spend lines say "checked" instead.
  4. A failed job's file says "State": "failed". It is written by Item.MarshalJSON. UnmarshalJSON reads it back as new with its failure, so memory and every door behave exactly as before.
  5. A revived step keeps its start. When revive takes a running step back after a restart, the step keeps its Started time, and its chat says "resumed" without a second " started". This also holds for chat-less steps such as AgentField runs.

Manual: a new factory-agentfield section, "an AgentField step that did not succeed", plus a probe and a line in the restart section.

Not in this PR

Risk

  • Older builds and "failed". An older build that reads a failed job written by this one sees an unknown state, and its Run again says "already running". Its floor still groups the job by its failure.

Proof

  • New tests:
    • TestAFailedRunEndsItsStepWithTheRunsOutcomeNoteInPlainWords
    • TestAnAgentFieldOutcomeIsReadFromItsWordsShape
    • TestAFailedJobsFileSaysFailedAndReadsBackAsItWas
    • TestARevivedStepWithNoChatKeepsItsStartAndSaysStartedOnce, which is red without the fix.
  • Updated tests: the existing step tests now expect the new wording.
  • make pr-ready BASE=origin/factory/general-intake.

🤖 Generated with Claude Code

WorkAF live e2e rounds 6 and 7:

- A step run on AgentField reads as its label, never as its reasoner's id.
  A finished step says "finished and opened <link>". A run that did not
  succeed fails with "<step> did not succeed: <why>". The why comes from
  the shape of the run's own last note or its summary: a leading grade is
  dropped, the reason is cut before any quoted command, and "No pull
  request:" reads "…, so no pull request was opened". This is the
  failure's summary. The raw report, command output included, stays as
  the step's output.
- The control plane's notes are read (GET …/notes) so the run's own
  outcome sentence lands in failure.summary; state_presentation.detail
  prefers the summary.
- Engine sentences a person reads no longer say "verified".
- A failed job's file says State "failed" and reads back as new with its
  failure, so every door behaves as before.
- A step revived after a restart keeps its start time and does not say
  "<step> started" a second time.
@santoshkumarradha
santoshkumarradha merged commit 8d9e2ca into factory/general-intake Nov 8, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the fix/factory-e2e-r7-wording branch November 8, 2026 14:59
santoshkumarradha added a commit that referenced this pull request Nov 8, 2026
…restart, empty PRs, plain step words, kept keys (#2520)

* factory: WorkAF r9 engine correctness — an ended run is read after a restart, empty PRs, plain step words, kept keys

- An agentfield step's run record now says its end is owed to the step
  (AgentFieldRun.EndOwed, set at dispatch, cleared when the step reads the
  end). A restarted round adopts an owed end — its pull request or its own
  outcome — instead of starting a second run, in Manual or Auto, whatever the
  step's start time says (r9 job 306: the start had moved past the run's and
  a second run asked for plan approval again). The lease's owed check reads
  the same field. A stopped or rejected run is never a later round's end.
- An open pull request read on its head as 0 files, with GitHub's own counts
  agreeing, is an empty change: Merge refuses it, the job reads "Nothing to
  change", and one the factory's job opened is closed with a comment and a
  plain note.
- Rejected and stopped jobs' files say "rejected" and "stopped", read back as
  new with that end on them, as #2514 did for failed.
- A resumed step chat's brief goes to the model under a whole-prefix lead the
  transcript display hides, so the person never sees it as their line.
- A reader's job shows an agentfield step's label where its note named the
  reasoner (node.reasoner).
- A failed run's headline names a short, plain failing command
  ("… (go build ./... failed), so no pull request was opened") when it fits.
- The AgentField key and internal token, and a pasted GitHub token, are kept
  in the engine's own profile (0600) as well as handed to the app, so a
  desk-launched engine keeps them across restarts.

* changes: entry for #2520

* changes: entry for #2520

* factory: only a shipped, unstopped job closes its empty pull request; a relaunch reads the kept token

* factory: keys stay off disk in app mode — revert the r9 key persistence

Owner decision 2026-11-08. In app mode the AgentField key and internal
token and a pasted or browser-signed-in GitHub token are held in memory
only again; the app hands them over at every engine start. The config,
setup and connection writes are reverted, the tests that pinned the old
rule are restored, and the manual and change entry say so.
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