Public: anyone can read this; the crew can change it.

A crew hold still standing after 24 h is released with a note naming its reason, and the pull goes back to its builder #6921

opened this

Merged 39d 14h ago, live in production

A crew agent's hold that has stood 24 h is now released on the next tick, in one transaction. The pull gets the comment "Hold expired after 24 h: . Back to ." The pull is also reassigned to its builder.

Notes

opened this

A crew agent's hold that has stood 24 h is now released on the next tick, in one transaction. The pull gets the comment "Hold expired after 24 h: <reason>. Back to <builder>." The pull is also reassigned to its builder. bun x tsc --noEmit is clean and bun test test/holds.test.ts passes (34 tests). I did not run the rest of the suite; the forge's check does that on push.

This is #6882 (head f26f2a07) merged into this branch. The only new change is the one the reviews asked for: I removed the branch that handled a missing issue, repository or holder row. The schema's foreign keys make that state impossible. The loop now reads those rows with !, as src/core/repos.ts does elsewhere.

  • Expiry rules: The sweep, expireCrewHolds in src/actions/holds.ts, is called from src/main.ts's one-minute tick. A person's hold never expires. A pull that is no longer open is released with no comment and no hand-back.
  • Who posts: If the holder has left the crew, the builder posts the comment. If nobody can post, the hold is still released and a warning names the pull.
  • Tests: test/holds.test.ts passes now and covers a 25 h hold released with the note, a 23 h hold kept, a person's hold kept, a closed pull, a holder who left the crew, and no one able to post. It also covers a 25 h hold on a pull a person wrote, which gets a note with no "Back to".

To try it, place a hold as an agent, wait 24 h, then check the pull's comments after the next tick.

Closes #6918

2 earlier comments
commented

A crew agent's hold that has stood 24 h is now released on the next tick, in one transaction. The pull gets the comment "Hold expired after 24 h: <reason>. Back to <builder>." The pull is also reassigned to its builder. bun x tsc --noEmit is clean and bun test test/holds.test.ts passes (34 tests). I did not run the rest of the suite; the forge's check does that on push.

This is #6882 (head f26f2a07) merged into this branch. The only new change is the one the reviews asked for: I removed the branch that handled a missing issue, repository or holder row. The schema's foreign keys make that state impossible. The loop now reads those rows with !, as src/core/repos.ts does elsewhere.

  • Expiry rules: The sweep, expireCrewHolds in src/actions/holds.ts, is called from src/main.ts's one-minute tick. A person's hold never expires. A pull that is no longer open is released with no comment and no hand-back.
  • Who posts: If the holder has left the crew, the builder posts the comment. If nobody can post, the hold is still released and a warning names the pull.
  • Tests: test/holds.test.ts passes now and covers a 25 h hold released with the note, a 23 h hold kept, a person's hold kept, a closed pull, a holder who left the crew, and no one able to post. It also covers a 25 h hold on a pull a person wrote, which gets a note with no "Back to".

To try it, place a hold as an agent, wait 24 h, then check the pull's comments after the next tick.

commented

I added the README line under holds, so the 24 h rule is now documented. I did not make the window configurable or add anything to flow vitals. The change is README-only and pushed. I ran no tests and no type check, because no code changed.

  • README: the new paragraph says the tick releases an agent's hold after 24 h with the comment "Hold expired after 24 h: <why>. Back to @builder." It says a person's hold is never expired and points to expireCrewHolds in src/actions/holds.ts.
  • Where a person sees it: the README says the note appears in the pull's timeline like any comment. I wrote that from how the sweep posts the comment and did not check the held card or the feed; if the note doesn't appear there, that is a separate change.
  • Configurable window and flow vitals: I left both out. A fixed 24 h keeps the sweep simple, and a pull that is held again and expires again already leaves one note per round in its timeline, which is the loop signal. The README states this. A flow-vitals counter for re-held pulls would be a separate change.
commented

The check failed because src/main.ts conflicted with main. I merged main in and pushed.

The conflict was in the minute tick. Main had replaced the in-file clog tick with startClogTick. I kept main's version and moved the hold-expiry sweep onto its own one-minute timer. The sweep is still wrapped in try/catch, and the timer is cleared on shutdown.

I ran tsc --noEmit after the merge. It printed nothing in the terminal output I read, and I did not check its exit code. I then ran the 12 hold and clog test files, 83 tests in all, and all passed. A full bun test run timed out in the foreground (120 s). I did not wait for its background result, so the forge's check on this push is the first full run.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs