Skip to content

Generator: a hard-killed generate leaves <path>.<guid>.tmp files that no later run removes #413

Closed as not planned

Description

@Blind-Striker

What

The generation writer's ownership-first write (#412, GEN-E8 Task 2) writes every file as a temp file plus rename, using StagedWrite.InstallAsync. The temp file is named <path>.<guid>.tmp and sits next to its target. An exception runs the finally, which deletes the temp file. A hard kill (SIGKILL, power loss, an OOM kill) skips the finally and leaves the temp file behind.

Why it matters

Nothing removes such a file later: each run writes a temp file with a new GUID name. .gitignore:108 hides it, so stray files pile up unseen under src/OpenCode.Sdk/. They are invisible to git status and to generate --verify. That is harmless to correctness, because the next run still repairs every owned path, but it is unbounded litter in the source tree.

Proposed fix

At the start of a write, after validation and before step 2, delete every *.tmp file next to an owned path whose name matches the writer's <owned path>.<guid>.tmp shape. The writer owns those names and nothing else creates them. Add a test row: a stray A.cs.<guid>.tmp from a killed run is gone after the next run, and an unrelated *.tmp is untouched.

Found at the coordinator's and the lead's review of #412 (2026-10-17). It is a small follow-up for the U7 sweep.

Activity

  1. added this to the 1.0 milestone on Oct 17, 2026
  2. added
    enhancement
    on Oct 17, 2026
  3. modified the milestones: 1.0, 1.1 on Oct 26, 2026
  4. Blind-Striker commented on Oct 26, 2026

    @Blind-Striker
    CollaboratorAuthor

    Moved to milestone 1.1 by the second 1.0 triage (2026-10-26, maintainer-approved): it is internal, additive, tooling or test structure, so it does not block 1.0.0. The issue stays as it is.

  5. Blind-Striker commented on Nov 22, 2026

    @Blind-Striker
    CollaboratorAuthor

    Moved to the roadmap board as a draft item. This is internal backlog rather than a request an outside user or contributor would act on, so it no longer lives in Issues. The history stays here.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions