Skip to content

fix(cli): a deadline is not a changed repository - #58

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/deadline-is-not-a-stale-plan
Aug 29, 2026
Merged

fix(cli): a deadline is not a changed repository#58
rldyourmnd merged 1 commit into
mainfrom
fix/deadline-is-not-a-stale-plan

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

gds module update-pin --apply re-runs the module's required lanes inside its precondition observer. For the GDS module that takes over two minutes, and the CLI default was 2m0s for every command — so the deadline fired mid-observation and the engine reported the only thing it could see:

GDS_STALE_PLAN — Repository "repo_…" changed before its first mutation step;
                 its action handler was not called.

Nothing had changed.

attempt flag result wall
1–3 default blocked GDS_STALE_PLAN 2m00.158s
4 --timeout 20m succeeded, gitlink staged 2m27s

The plan's own worktree_fingerprint was byte-identical across consecutive plans and gds status was byte-identical before and after planning, so the state genuinely did not move. That message sends the reader looking for a concurrent writer that does not exist, which is worse than a plain failure.

Two changes

Commands that execute another repository's verification lanes default to twenty minutes. update-pin runs them twice — once to plan at the target commit, once when the engine re-observes preconditions before mutating. An explicit --timeout still wins: a caller choosing a deadline is a decision, not an oversight.

An expired context is named. Any command whose deadline fires while failing now carries GDS_COMMAND_DEADLINE_EXCEEDED alongside whatever the interrupted step reported, with the deadline and the flag that sets it in its evidence.

Proof

Three tests — the expired deadline is named and states what it is not, a successful command near its deadline is not labelled with one, and the lane default applies only when the caller did not choose. All three fail with either half reverted, checked by reverting each.

go test ./... and scripts/validate_ci_tier.sh pr-required pass; projections are current.

Closes #57.

https://claude.ai/code/session_01BjpW1NtF1oik18aEMMGtMP

`gds module update-pin --apply` re-runs the module's required lanes inside its
precondition observer. For the GDS module that takes over two minutes, and the
CLI default was 2m0s for every command, so the deadline fired mid-observation
and the engine reported the only thing it could see:

  GDS_STALE_PLAN -- Repository "repo_..." changed before its first mutation
  step; its action handler was not called.

Nothing had changed. Measured three times at exactly 2m00.158s; with
--timeout 20m the same plan applied in 2m27s. That message sends the reader
looking for a concurrent writer that does not exist, which is worse than a
plain failure.

Two changes. Commands that execute another repository's verification lanes now
default to twenty minutes -- update-pin runs them twice, once to plan and once
to re-observe before mutating -- and an explicit --timeout still wins, because
the caller choosing a deadline is a decision, not an oversight. And any command
whose context expires while failing now carries
GDS_COMMAND_DEADLINE_EXCEEDED alongside whatever the interrupted step reported,
naming the deadline and the flag that sets it.

Three tests: the expired deadline is named and says what it is not, a successful
command near its deadline is not labelled with it, and the lane default applies
only when the caller did not choose. All three fail with either half reverted.

Closes #57.

Claude-Session: https://claude.ai/code/session_01BjpW1NtF1oik18aEMMGtMP
@rldyourmnd
rldyourmnd merged commit f0a4453 into main Aug 29, 2026
7 checks passed
@rldyourmnd
rldyourmnd deleted the fix/deadline-is-not-a-stale-plan branch August 29, 2026 08:51
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.

update-pin --apply exceeds its own default deadline and reports it as a stale plan

1 participant