Skip to content

Remove generated launch briefs on landed teardown - #6102

Open
AnPod wants to merge 5 commits into
kunchenguid:mainfrom
AnPod:cursor/teardown-brief-cleanup-3697
Open

AnPod wants to merge 5 commits into
kunchenguid:mainfrom
AnPod:cursor/teardown-brief-cleanup-3697

Conversation

@AnPod

@AnPod AnPod commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Landed teardown of a ship or scout now removes generated launch inputs from data/<id>/: brief.md, launch-brief.md, ship-instructions.md, and their in-progress render temps. report.md, contributions.json, and any other durable task file stay.

A --force discard and a held-task retain still leave the briefs, because a later spawn of that same id reads brief.md. A manual backlog does not record that retain, so teardown asks the same open question and keeps the briefs unless the read proves the item is not held.

Fixes #5290.

Test plan

  • tests/fm-teardown.test.sh covers landed removal, a refused teardown, --force, a held retain, a manual backlog with and without a hold, and scout report retention
  • bin/fm-lint.sh bin/fm-teardown.sh tests/fm-teardown.test.sh

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes task cleanup logic for generated launch files.

The PR appears safe to merge based on the reviewed changes and resolved findings.

Reviews (4) · Last reviewed commit: "fix(bin): skip the captain-hold lookup w..."

Comment thread bin/fm-teardown.sh Resolved
Comment thread bin/fm-teardown.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: First stamp this fetch vs tip 1f2c9548f4680efeda76fabe9f057b4021b97272.

HEAD dbb6dbd8c602b63554230e1a499d8dd46abec7d5. Fixes #5290 intent verified (landed teardown left generated brief.md / launch-brief.md / temps; those are launch inputs, not deliverables). Diff: remove_landed_launch_briefs on landed ship/scout only; --force and captain-held retain keep briefs for successor spawn; manual backlog re-asks hold via fm-captain-hold.sh open; report.md/contributions.json kept; symlinks not followed.

contract-class: restore — landed path should keep durable deliverables, not generated launch scaffolds; force/held successor-read path preserved as already specified.

VISION: scripts own mechanics; unlanded/held refusal path strengthened; no new captain-facing surface.

Blockers (author): NM 36532038948 FAILURE (attestation/compliance — raise via no-mistakes). CI 36532038966 serial-9 FAILURE. Greptile FAILURE (P1 concurrent spawn race on brief.md during cleanup; P2 find exit status). Not otherwise-ready → Firstmate flag no. Waiting author.

Comment thread bin/fm-teardown.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: whole thread re-read (body + prior stamp + Greptile P1s). Diff vs main fd325b1ba16b0caa2c19fa0992b130bacba0dca8: remove_landed_launch_briefs on landed ship/scout teardown; --force/held retain keep briefs for successor spawn; report.md/contributions.json kept. Author AnPod not blocked. Closes ready-for-pr #5290: yes.

HEAD 4a41ee8612422e179572610e24fba319263db9cd. MERGEABLE/UNSTABLE. Attestation: MISSING. Tip NM FAILURE. Behavior portable serial 3 FAILURE. Greptile FAILURE with open P1s (concurrent same-id spawn can lose briefs; lock-read failure skips cleanup then removes record). Other portable/Herdr/lint green.

contract-class: restore — landed teardown should keep durable deliverables, not generated launch scaffolds; force/held successor-read path preserved as already specified.

VISION (per-rule)

  • One captain / Authority: aligns — cleanup honesty; held/unlanded refuse path preserved.
  • Scripts own mechanics: aligns — teardown file policy is exact.
  • Delegation with a spine: aligns — unlanded/held work not torn down; landed scaffolds may go.
  • Restart is a non-event: aligns — durable report stays; spawn-lock serialization matters (Greptile P1 still open).
  • Fleet / Scope: aligns — operational home layout / teardown.

Waiting on author for: (1) no-mistakes attest, (2) serial-3 fix or green re-run, (3) address Greptile P1 lock/spawn races. No Firstmate flag.

@AnPod
AnPod force-pushed the cursor/teardown-brief-cleanup-3697 branch from 4a41ee8 to 0fd12c6 Compare October 1, 2026 05:46
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: re-stamp after new head 0fd12c65 (spawn lock held through landed launch-input cleanup) vs tip 549e07f37fd73aa01d74cd126b1111c99175abed. Closes #5290: yes. Tip still leaves brief.md / launch-brief.md after landed teardown.

Attestation: MISSING. NM FAILURE. Lint 1 FAILURE (bin/fm-teardown.sh reason=memory ~8.4 GiB RSS under the 12 GiB address-space cap). Behavior portable serial 3 FAILURE (relay-disabled unmarked teardown must not invoke tasks-axi) and serial 5 FAILURE (remote retirement bypassed an active backlog handoff). Greptile check SUCCESS on this head (0 new comments); prior P1 threads remain in history — please confirm the lock-through-cleanup term closes the concurrent same-id spawn / lock-read skip cases. MERGEABLE/UNSTABLE. Author AnPod not blocked.

contract-class: restore — landed teardown should drop generated launch scaffolds while keeping durable deliverables; force/held successor-read path preserved.

VISION (per-rule)

  • One captain / Authority: aligns — cleanup honesty; held/unlanded refuse path preserved.
  • Scripts own mechanics: aligns — teardown file policy is exact.
  • Delegation with a spine: aligns — unlanded/held work not torn down; landed scaffolds may go.
  • Restart is a non-event: aligns — durable report stays; spawn-lock serialization matters.
  • Scope: aligns — teardown + layout skill note + tests.

Waiting on you: attestation via git push no-mistakes; clear Lint1 memory (teardown root) and the two serial failures. Not otherwise-ready → no Firstmate flag.

cursoragent and others added 5 commits October 5, 2026 07:22
A landed ship or scout close left brief.md and launch-brief.md in the task data directory. Teardown now removes those generated launch inputs, along with ship instructions and render temps, and keeps the report and other durable records. A forced discard and a captain-held retain still leave the briefs so a later spawn of the same id can read them.

Co-authored-by: AnPod <[email protected]>
A manual backlog never records the held-task retain, so landed teardown
was deleting brief.md even while that hold was still open. Ask the same
open question at removal time and keep the briefs unless the read proves
the item is not held.

Co-authored-by: AnPod <[email protected]>
Take the per-task spawn lock (try-acquire, never wait) before removing
generated launch inputs so a concurrent fresh spawn keeps its brief.md and
render temps; a busy lock leaves the inputs with a warning and teardown
still succeeds. Enumerate the render-temp sweep into a manifest so find's
exit status is checked, and keep the task record for retry when enumeration
or removal fails.
Greptile P1s on kunchenguid#6102: take .spawn-$ID.lock before the meta lock and
hold it through brief cleanup and record removal. Contention or
unverifiable acquisition refuses teardown so inputs and metadata remain
for retry, instead of racing a same-id spawn or skipping cleanup.
The landed-teardown brief cleanup looked up captain holds before
checking that the task directory still existed, so a relay-disabled
unmarked teardown invoked tasks-axi (tests/fm-public-followup.test.sh
"relay-disabled unmarked teardown must not invoke tasks-axi"). Check
for the directory first and cover the no-directory case.
@AnPod
AnPod force-pushed the cursor/teardown-brief-cleanup-3697 branch from 0fd12c6 to cfc956d Compare October 5, 2026 05:52
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: re-stamp for the new head cfc956d6 (prior stamp was 0fd12c65). It is still waiting on you, the author. It is not a captain hold.

New commit: cfc956d6 moves the missing or non-directory data/<id> checks ahead of the manual-backlog hold lookup. So teardown with no task directory no longer calls tasks-axi, and there is a new test for that. The rest of the change is as described in my earlier stamps. Closes #5290: yes. Main f470a01c still leaves brief.md / launch-brief.md after a landed teardown.

Gates on this head:

  • Attestation MISSING. PR must be raised via no-mistakes run 37269690887 is FAILURE.
  • CI run 37269690850: Behavior portable serial 5 FAILURE with not ok - remote retirement bypassed an active backlog handoff. That is the same case that failed on 0fd12c65, so it looks tied to this teardown change, not flaky. Lint 1, serial 3, and every other lane are green now.
  • Greptile check SUCCESS (5/5). MERGEABLE/UNSTABLE. No workflow files changed.

contract-class: restore (unchanged). Landed teardown should drop generated launch inputs and keep durable deliverables. The force and held paths that a successor spawn reads from stay as specified.

VISION (per rule): unchanged. One captain/one interface, authority explicit, scripts own the mechanics (exact teardown file policy), restart is a non-event (spawn lock held through cleanup), delegation with a spine (held and unlanded work kept), fleet outlives any vendor, and scope all align.

What unblocks it: fix the serial-5 remote-retirement/backlog-handoff case, then run git push no-mistakes so the body attests the new head.

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.

fm-teardown.sh leaves data/<task-id>/brief.md and launch-brief.md behind after a landed task

3 participants