Skip to content

lorenzo/start kw integration pr 5 - #203

Draft
lorenzoberts wants to merge 10 commits into
lorenzo/start-kw-integration-pr-4from
lorenzo/start-kw-integration-pr-5
Draft

lorenzo/start kw integration pr 5#203
lorenzoberts wants to merge 10 commits into
lorenzo/start-kw-integration-pr-4from
lorenzo/start-kw-integration-pr-5

Conversation

@lorenzoberts

Copy link
Copy Markdown
Collaborator

Stack created with GitHub Stacks CLIGive Feedback 💬

@lorenzoberts
lorenzoberts force-pushed the lorenzo/start-kw-integration-pr-5 branch from 9dbca6a to 57b4e94 Compare August 20, 2026 21:01
lorenzoberts and others added 9 commits August 24, 2026 14:24
This commit makes StartBuild refuse before touching the tree when kw
is missing, the kw env cannot be resolved, or the tree is not ready.
The version floor stays advisory. A refused start leaves the actor
idle and able to accept a later job.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit runs each build on the branch the caller asked for. Start
refuses on a dirty or unverifiable worktree, switches, and leaves HEAD
on that branch after the job. Restore context is recorded only on
accept so a refused start cannot clobber a previous job's restore
target.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit lets the user switch the tree back to the branch it was on
when the last job was accepted. Restore refuses while a job runs, when
nothing was recorded, or when the worktree is dirty, and only a
successful switch consumes the context so a failed attempt can be
retried.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit replaces the skeleton's fixed argv with a reserved-flag
merge: patch-hub always wins on --alert and --save-log-to, and user
extras cannot override them. --save-log-to is reserved but not passed,
because ProcessTrait is already the sole log writer.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit finds the patchset that produced the branch a build runs
on by scanning apply history for that tree, newest timestamp winning.
The link does not depend on the caller threading a message id, so
manually typed branches and cross-session rebuilds still resolve.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit writes a build record on success and failure so
deploy-alone readiness has durable evidence of what the job produced.
Cancelled jobs write nothing; an unresolvable env at completion skips
the record rather than keying a false no-env match; a write error is
logged without changing the job's terminal status.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit refuses git am while a kw job owns the tree's branch
state. The user sees a blocked popup and the apply toggle resets; if
the actor cannot be reached, apply proceeds because an unreachable
actor cannot be running a job.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit rolls HEAD back when a start is refused after the branch
switch, so a failed spawn never mutates the tree or clobbers restore
context. Build records now reuse the output dir and arch probed at
accept instead of re-resolving at completion, which could key a
successful job as a no-env build. Checkout git calls run off the actor
task, untracked files are ignored by the dirty check, and --menu is
reserved so menuconfig cannot hang a redirected build.

This commit completes the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit drops plan section numbers, KwOps, and comments about
deploy that this change does not implement. The remaining comments
describe the checkout, argv merge, and apply-blocking behavior as
they stand.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
Co-authored-by: Cursor <cursoragent@cursor.com>
@lorenzoberts
lorenzoberts force-pushed the lorenzo/start-kw-integration-pr-5 branch from 57b4e94 to 9979cdf Compare August 24, 2026 17:27
This commit stops injecting --alert=n on kw build: lab kw (beta-0.9)
rejects unrecognized options as a hard failure, while kw's own default
is already alert=n. User --alert extras remain stripped. Cancel after a
process-group SIGTERM/SIGKILL now maps exit 143/137 to Cancelled, because
the bash kw wrapper often reports those as plain exits rather than
WIFSIGNALED.

This commit is part of the kw integration's step 5.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
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