Skip to content

chant approve reports success when the ledger push was rejected #2310

Closed

Description

@lex00

What

Found while landing #2301/#2303 (PR #2309), and deliberately left out of scope there.

recordGateApproval pushes the ledger branch and discards the outcome:

// packages/core/src/op/gate.ts:71
await pushLifecycle(opts).catch(() => undefined);

pushLifecycle can reject with StaleLifecycleBranchError (packages/core/src/lifecycle/git.ts:521) when the remote branch has moved under the local one. That rejection is swallowed, and chant approve prints success regardless.

Why it matters

#2309 fixed the local half: the append now fetches first and parents on real history, so the pending record survives instead of being force-written away. What it did not fix is the report. An operator who approves against a chant/lifecycle that has since moved gets a success line for an approval that never reached the remote, and the next run gates again with nothing explaining why.

That is the same failure shape #2301 was about — an operation that could not complete its write saying nothing — one layer further out. #2301 closed it in the executor; this is the remaining instance in the approve path.

Do

Report the push outcome. A rejected push should name the branch and the reason rather than resolving quietly. Decide whether a stale-branch rejection should be retried after a fetch (the branch is append-only, so a retry is usually safe) or surfaced for the operator to resolve, and say which in the docs.

Check the other pushLifecycle caller at packages/core/src/cli/handlers/operator.ts for the same pattern.

Proof

An approve against a remote whose ledger branch has moved, asserting the command reports the failure rather than printing success. Red today: there is no failure text to assert on.

Refs #2301, #2303, #2289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions