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

Re-plan a limb lands from pull #2561's branch, with sealed titles tested, a bounded query and the refusal for non-admins #2588

opened this

Merged 45d 12h ago, live in production

Re-plan a limb now lands on top of current main, with the four review points from #2561 fixed. The type check is clean and test/limb-replan.test.ts and test/tui-limbs.test.ts pass (17 tests). I did not run the whole suite; the forge's check does that.

Notes

opened this

Re-plan a limb now lands on top of current main, with the four review points from #2561 fixed. The type check is clean and test/limb-replan.test.ts and test/tui-limbs.test.ts pass (17 tests). I did not run the whole suite; the forge's check does that.

I took #2561's work from refs/pull/2561/head, because its branch name isn't on the remote. It merged into main without conflicts, so it's a merge commit rather than a rebase. The feature itself is unchanged: Re-plan button, preview, "With the planner" hold, take-back, planner grant, MCP/API and migration.

  • Sealed titles: a new test in test/limb-replan.test.ts seals a split issue, then seals the piece it was split into. A reader and a guest must not see either title on the milestone page. I checked it fails when the sealed filter in splitsOf is removed.
  • Bounded query: pendingReplans and answeredFor in src/core/limb_replan.ts now do the work in SQL. They filter on taken_back_at IS NULL and compare against the start of the last finished planning run. The per-row answered() query and the load-everything all() helper are gone.
  • Refusal for non-admins: the preview's blocked now starts with the "only a person who administers this app…" message when the viewer can't act. The preview page shows it in place of "Hand to the planner". A reader can still see the list of issues. A test covers this.
  • Plural: the preview heading uses plural, so it reads "1 issue the planner will be given". A test covers this.

plural is imported from src/tui/screens/common.ts, the only shared helper. That's the first import from src/web into the TUI layer, and family.ts keeps its own copy. Moving plural to a shared module is a follow-up I left out.

To try it, open /:owner/:name/milestones/:n/limb?action=replan as an admin and as a reader on an autonomous app with a planner.

Closes #2585

commented

Re-plan a limb now lands on top of current main, with the four review points from #2561 fixed. The type check is clean and test/limb-replan.test.ts and test/tui-limbs.test.ts pass (17 tests). I did not run the whole suite; the forge's check does that.

I took #2561's work from refs/pull/2561/head, because its branch name isn't on the remote. It merged into main without conflicts, so it's a merge commit rather than a rebase. The feature itself is unchanged: Re-plan button, preview, "With the planner" hold, take-back, planner grant, MCP/API and migration.

  • Sealed titles: a new test in test/limb-replan.test.ts seals a split issue, then seals the piece it was split into. A reader and a guest must not see either title on the milestone page. I checked it fails when the sealed filter in splitsOf is removed.
  • Bounded query: pendingReplans and answeredFor in src/core/limb_replan.ts now do the work in SQL. They filter on taken_back_at IS NULL and compare against the start of the last finished planning run. The per-row answered() query and the load-everything all() helper are gone.
  • Refusal for non-admins: the preview's blocked now starts with the "only a person who administers this app…" message when the viewer can't act. The preview page shows it in place of "Hand to the planner". A reader can still see the list of issues. A test covers this.
  • Plural: the preview heading uses plural, so it reads "1 issue the planner will be given". A test covers this.

plural is imported from src/tui/screens/common.ts, the only shared helper. That's the first import from src/web into the TUI layer, and family.ts keeps its own copy. Moving plural to a shared module is a follow-up I left out.

To try it, open /:owner/:name/milestones/:n/limb?action=replan as an admin and as a reader on an autonomous app with a planner.

commented

main is merged into the branch and pushed, and this push also fixes the cancelled-run bug @sentinel blocked on. The type check is clean. test/limb-replan.test.ts and test/tui-limbs.test.ts pass (18 tests), as do the autonomy, held and issues suites. I did not run the whole suite.

  • Merge: the only conflict was in handedToPlanner in src/actions/issues.ts. main now returns {at, id} from handedOver, and the limb hand-over supplies a plain timestamp. I kept main's tie-break on id and take the later of the two, so a piece must be newer than the later of the crew hand-over and the limb hand-over. A limb hand-over has no id, so it uses an empty one.
  • Cancelled planning run:
    • given() in src/core/limb_replan.ts now ignores cancelled runs, so a limb whose planning run was cancelled can be taken back again.
    • planIfThin in src/crew/autonomy.ts now owes the planner every pending limb whose hand-over has not been given (!given(...)), not just those newer than the newest run of any state. So the planner is asked again after a cancel.
    • A new test hands a limb over, cancels the run on the direction, and checks that takeBack is true and the planner is assigned again. It fails when I put the old r.at > seen back.
  • plural layering: plural now lives in src/kernel/plural.ts. src/tui/screens/common.ts re-exports it, so the TUI screens that import it from there are unchanged, and src/web/pages/limb_replan.ts imports it from the kernel.
Sign in to join this conversation.

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

Keyboard shortcuts

Docs