Skip to content

factory: landing approve step waits for its answer; Manual hold is approve_step; removed pipeline drops its own steps - #2493

Merged
santoshkumarradha merged 9 commits into
factory/general-intakefrom
factory/gi-hold-fixes
Nov 7, 2026
Merged

santoshkumarradha merged 9 commits into
factory/general-intakefrom
factory/gi-hold-fixes

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Fixes three engine findings from the live desk journey walk (NOTES.md Part 7, items 1–3).

1. An approve step at the end of a run was passed by landing (serious)

Job #176 ran planfix → writefix → runvetand → proof2 (approve step). It was held in Manual before runvetand, then switched to Auto. It published PR #179 while proof2 still read "to come".

Cause. The Auto switch passing the standing Manual ask is by design. The bug is in what happens next. approve() in internal/factory/run/loop.go treated an approve step that is the run's last step as "the landing". It marked the step done itself, with no answer recorded. On a worker, which never reports approve steps (run/diff.go stepsMoved), the service kept the step pending. Either way, the proof approval then published past a step that nobody had passed.

Fix.

  • The run now lands with that step waiting (factory.LandingGate, set in landItem), on both the local runner and a worker report.
  • The proof approval (approveStored) is what passes the step.
  • ApprovalRefused refuses publication, in Auto and in Manual, while any other approve step that is switched on is unpassed: has an approve step nobody has passed yet: <step>.
  • A step that is switched off still passes quietly.

Judgement to check: Auto still passes a routine, non-fixed last approve step through its recorded proof approval, as AutonomyBlockReason and the manual already describe. A step that is fixed or names an approver still waits for that person. If a last approve step should never pass in Auto, that is a one-line change in AutonomyBlockReason. It is a policy change, so it is not made here.

2. A Manual hold read as "Plan ready"

The hold was approve_plan, gate plan, reason approval_plan (needs.go:260). It is now:

  • the Needs-you kind approve_step
  • gate step, reason approval_step, approval kind step (an older stored plan approval still counts for the hold)
  • needs_you.step holding the step's label
  • state_presentation.detail reading RunVetAndTest is next · waiting for you to go on

Send back and Auto passing the hold work exactly as before. The desk needs to learn approve_step and gate step.

3. Removing a pipeline left its step definitions behind

remove_pipeline now drops the definition of each step only that pipeline listed. It keeps any step that another pipeline lists, that the fixed: list names, or that codeaf ships. The clash refusal now names the step on the wire: There is already a step named lint-it with other words. Pick another name, or add it with the words it has. Before, it was "That value is out of bounds".

Proof

  • Each fix has a new test that fails on the old code: run/landing_gate_test.go (3), serve/manual_steps_test.go, pipeline/edit_remove_pipeline_steps_test.go (2) and appwire/factory_pipeline_edit_clash_test.go.
  • go test -count=1 passes for factory, run, serve, lease, worker, api, pipeline and appwire.
  • make test-laws and go test ./internal/manual/ pass.
  • The manual pages in factory.md and factory-stage-conversations.md are updated.

🤖 Generated with Claude Code

… is its own Needs-you kind; a removed pipeline takes its own steps

An approve step that is a run's last step marked itself done on landing (local
runner) or stayed pending (worker), so publication went past a step nobody had
passed. It now lands waiting, the proof approval passes it, and an approval is
refused while any other approve step is unpassed.

Manual's hold before a step read as approve_plan ("Plan ready"). It is now
approve_step, gate step, approval kind step, and names the next step by label.

remove_pipeline left its own step definitions behind, so a later add_step of
the same name was refused as "That value is out of bounds". It now drops the
steps only it used, and the clash refusal names the step.
…s in person words

After "mark it ready" the manager said merge was not offered while the job
page offered Merge: the press reply never read the job again, so the model
repeated its draft-era status. The mark-ready reply now re-reads the job and
says what the page offers, and the page's merge block, the manager's status
and its press all read factory.MergeOffered.

factory_status named steps by their stored keys (followpr); it now uses the
step's label, or Follow PR for the follow step.
The approve_step kind accepted a stored plan approval as the hold's own, so
an earlier gate's settled consent closed a later Manual hold's Approve
(TestAppFactoryApprovalSurvivesLaterGatesAndRestart). Only an open plan
approval carries over; a settled step approval is an earlier hold's, as a
settled plan approval already was.
…window

The approval settles and write runs; the next hold, before test, reads as
approve_step with an approval of kind step, never as the plan hold again.
@santoshkumarradha
santoshkumarradha merged commit 04a4c82 into factory/general-intake Nov 7, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the factory/gi-hold-fixes branch November 7, 2026 08:50
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