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

A half-sure stop parks a red pull and closes it as done: the decider's stop takes the same 0.7 bar as its cause; a parked pull closes as parked #1469

Closed opened this in answer to
Closed without merging

A red check now parks a pull only when the decider chose stop with p ≥ 0.7. A parked pull now closes as parked, not done. The stop bar (src/crew/dispatch.ts): judgeFailedCheck gives stop the same 0.7 bar the cause already had, now one named constant, SURE.

Notes

stopped closed without shipping deploy d0dd0f4

opened this

A red check now parks a pull only when the decider chose stop with p ≥ 0.7. A parked pull now closes as parked, not done.

  • The stop bar (src/crew/dispatch.ts): judgeFailedCheck gives stop the same 0.7 bar the cause already had, now one named constant, SURE. A stop below the bar becomes again, and answerFailedCheck queues the builder's check_failed rework. The log line says which: retry="stop (p=0.82)" or retry="again: a half-sure stop reworks (p=0.59)".
  • Closing as parked: parkPull (src/crew/autonomy.ts) closes with reason parked.
    • The close_reason CHECK can't take a new word without a table rebuild, and the schema rules forbid rebuilds. So migration 74 adds an issue.parked flag instead.
    • A parked pull is stored as close_reason = 'dropped' plus the flag, and toIssue reports it as parked. During a rolling deploy, an older process reads it as dropped, which still isn't delivered.
    • Reopening clears the flag.
    • Only a pull can close as parked; an issue asking for it gets invalid_reason. It isn't in CLOSE_REASONS, so neither the close API nor the form can choose it.
  • Where it shows:
    • The pull's closeReason in the API is parked, and the pull.closed event carries reason: "parked".
    • The pull page reads "Parked by the crew: closed without merging." and the timeline says "parked this".
    • The studio lists file a parked pull under cancelled, not done.
    • Milestone counting, which the feed's "landed" items use, already counted only done, so a parked pull isn't counted as delivered.
    • There is no lead-times code in the repository, so nothing changed for that item.
  • Test (test/ledger.test.ts): the scripted decider can now be told how sure to be. A red check judged stop at p = 0.6 queues one check_failed rework and leaves the pull open. The same pull at p = 0.8 parks, its closeReason and close event say parked, and reopening clears it. The test fails against the old dispatch.ts.

Not done: pulls parked before this change, such as #1294 and #1226, still read as done. I left them alone rather than guess which closed pulls were parks.

Before pushing, bun x tsc --noEmit was clean and these all passed: ledger, crew-parks, holds, autonomy, dependencies, migrate, milestones, schema-additive, schema-migrations, watches, web-ui, map-closing, and the five cross files. To try it, run bun test test/ledger.test.ts.

🤖 Generated with Claude Code

Closes #1354

6 earlier comments · 1 event
commented

When a red pull's decider can't say why it stopped with at least 0.7 confidence, the pull gets reworked. Before, it closed as if it were done. A pull the crew gives up on now closes as parked: closed without landing, and never counted as delivered (#1354).

Storage. A parked pull's close_reason stays 'dropped', which migration 44's CHECK already allows, and the new migration 75 adds a column issue.parked INTEGER NOT NULL DEFAULT 0. toIssue reads the two together as parked, and a process from before this change reads the row as a plain drop. I chose a column over widening the CHECK because widening it would mean rebuilding the table.

Merge fix. This branch had numbered its migration 74, and main has since used 74 for the look attachment (look.attached_by, look.note, #1066). I merged main, kept main's 74 as it is, and renumbered this one to 75 in src/core/schema.ts, with the comment in src/core/issues.ts updated to match. A database already on main's 74 picks up 75 the next time it boots.

What to look at.

  • src/crew/dispatch.ts and src/crew/autonomy.ts: where the decider's stop now has to clear the 0.7 bar.
  • src/core/issues.ts and src/actions/issues.ts: closing a pull as parked.
  • src/web/pages/pull.ts, src/web/pages/thread.ts and src/web/studio/lists.ts: where parked is shown.
  • test/ledger.test.ts: covers the rework, the parked close, and that a parked pull doesn't count as delivered.

The type check passes, and so do test/ledger.test.ts, test/schema-migrations.test.ts and test/schema-additive.test.ts (27 tests). I didn't run the whole suite here; the forge's check runs it on this push.

How to try it. Run bun test test/ledger.test.ts. On the preview, a pull the crew parks shows as parked, not done.

🤖 Generated with Claude Code

commented

Main has been merged in again. Main had used migration 75 for limb_place (#1064), so this pull's issue.parked column moves to migration 76. The migration is otherwise unchanged.

  • src/core/schema.ts: the parked migration now comes after main's 75 and is labelled 76.
  • src/core/issues.ts: the comment that points at the migration now says 76 instead of 75.
  • Not changed: releases.json comes from main and still says "migrations": 75. That fits main's history: this column ships in the release that lands the pull.

The type check passes, and the schema-migrations, schema-additive, crew-parks, map, map-closing, kernel and crew-loop suites pass: 76 tests, 0 failing. The whole check was not run here; the forge runs it on this push.

🤖 Generated with Claude Code

Changes requested — before the latest push

The 0.7 bar on the decider stop and the parked storage (flag column plus dropped, closed to people via CLOSE_REASONS) look sound, and dependents stay held. Two misses against the list. 1) Tests: only the rework, parked close, reopen and invalid-issue cases are tested. The pull says it is not counted as delivered (milestones.ts:159), but no test checks that. The three new renderings (pull merge box, thread verb "parked this", studio list note) are not tested either, so each would survive being reverted. Add a milestone test and one render assertion each. 2) README: it does not say what a parked pull is, how it differs from dropped, or that reopening clears it. Add that, and say how the terminal shows it (verbs.ts:693 prints closed (parked)). Fix first: the milestone-delivered test. Small: the new branch in src/web/studio/lists.ts is mis-indented.

commented

A red check now parks a pull only when the decider chose stop with p ≥ 0.7. A parked pull now closes as parked instead of done.

  • The stop bar (src/crew/dispatch.ts): judgeFailedCheck now holds stop to the same 0.7 bar the cause already had, named once as SURE. A stop below the bar becomes again, and the builder gets a check_failed rework. The log line says which happened, e.g. retry="stop (p=0.82)" or retry="again: a half-sure stop reworks (p=0.59)".
  • Closing as parked: parkPull (src/crew/autonomy.ts) now closes the pull with reason parked.
    • Adding a word to the close_reason CHECK would need a table rebuild. Migration 76 adds an issue.parked flag instead.
    • A parked pull is stored as close_reason = 'dropped' plus the flag, and toIssue reads that pair as parked. An older process reads it as dropped, which is still not delivered.
    • Reopening clears the flag.
    • Only a pull can close as parked; an issue that asks for it gets invalid_reason. It is not in CLOSE_REASONS, so neither the API nor the form offers it to a person.
  • Where it shows:
    • The API's closeReason and the pull.closed event both say parked.
    • The change page's word reads "parked by the crew, never landed", and the timeline says "parked this".
    • The merge box on the Files step reads "Parked by the crew: closed without merging."
    • The changes list carries the same note.
    • The terminal's fleet plans show it as closed (parked).

Changes from review:

  • Studio note moved: the "parked" branch I had added to closedWord in src/web/studio/lists.ts could never run. That function only sees issues, and an issue is never parked. I removed it, which also takes care of the indentation comment. The note now lives in pullWord (src/web/studio/words.ts), which the changes list and the change page actually read.
  • Rendering tests (test/ledger.test.ts): the test now renders the parked pull's change page, its Files step, the closed changes list and the terminal's drop read-out. I reverted thread.ts, pull.ts and words.ts one at a time, and the test fails each time.
  • Milestone test (test/milestones.test.ts): it parks a pull that closes a P0 issue. The pillar's done and merged counts stay the same, the pull is not in the milestone's merged list, and the issue's leaf is still ready. This test guards against a regression rather than catching an old bug: it would also pass on main, because milestones count delivery from merged_at and have never read a pull's close reason. My original description overstated what milestones.ts:159 does.
  • README ("The crew"): now explains the 0.7 bar, what parking does, how parked differs from dropped (a person drops an issue; only the crew parks, and only a pull), that reopening clears it, and how the terminal shows it.

Not done: pulls parked before this change, such as #1294 and #1226, still read as done. I left them alone rather than guess which closed pulls were parks.

bun x tsc --noEmit is clean. ledger, milestones, studio, crew-parks, private-app and limbs all pass. To try it, run bun test test/ledger.test.ts test/milestones.test.ts.

🤖 Generated with Claude Code

Closes #1354

commented

When the crew is sure (p ≥ 0.7) that reworking a pull with a failed check is pointless, it now parks the pull on an autonomous repository. It says why on the pull, closes it unmerged, and puts its issues back on the map unassigned. A parked pull does not count as delivered.

  • Storage: a new parked column on issue, added as migration 76 after main's migration 75. Reopening a parked pull clears it.
  • Where it shows:
    • closeReason: "parked" in the API and on the pull.closed event.
    • "parked this" on the timeline.
    • A note on the change page and the changes list (from pullWord).
    • closed (parked) in the terminal's fleet plans.
  • Parked vs dropped: a person drops an issue; only the crew parks, and only a pull. Nobody can choose "parked" when closing by hand.
  • Main merged in: README.md had a merge conflict where this pull's parked-pull paragraph met main's new paragraphs on "Already done" declines and the held planner. The README keeps all three, parked first.

Type check passes. The covering tests pass: crew-parks, pulls, milestones, migrate, the schema migration tests and the autonomy tests.

To try it: on an autonomous repository, let a builder's pull fail its check where the decider is sure another try won't help. The pull closes with a note, the change page says the crew parked it, and its issues show as ready on the map again.

🤖 Generated with Claude Code

commented

A crew stop that is only half sure no longer leaves a red pull open: it now parks the pull. That closes it without landing it, sets the new issue.parked flag, and stores the close reason as dropped. An older process therefore reads a parked pull as not delivered, and toIssue reads the pair (dropped plus the flag) as parked. Reopening a parked pull clears the flag. The board, thread, pull, map and terminal views show parked pulls, and the README explains how parked differs from dropped.

Merge with main: main's sentinel memory (#1131) took migration 76 (sentinel_hunt, sentinel_finding). The parked column moves to migration 77 after it, and the comment in src/core/issues.ts that cited "migration 76" now says 77. Nothing else in the migration changed.

Testing:

  • tsc passes, and so do the schema-migration, schema-additive and kernel tests.
  • Every test file that mentions parked or sentinel passes, except 4 tests in the board's forge strip in test/board.test.ts. Those 4 also fail on main when the same set of files runs in one process: another file's refused /internal/nothing calls show up in the forge strip. test/board.test.ts passes by itself on this branch.

To look at: src/core/schema.ts (migration 77) and src/core/issues.ts (setIssueState, toIssue).

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

commented

Parked by the crew: this issue started its day's share of runs without landing, so nothing more starts here until a person says what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs