Skip to content

fix(skills): lyria-recipe replaces a link at its --output instead of writing through it - #8838

Closed
WaterrrForever wants to merge 1 commit into
mainfrom
miao/secops-3949-lyria-symlink
Closed

WaterrrForever wants to merge 1 commit into
mainfrom
miao/secops-3949-lyria-symlink

Conversation

@WaterrrForever

@WaterrrForever WaterrrForever commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closed in favour of #8830, which covers this change.

…writing through it (SECOPS-3949)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@miguel-heygen miguel-heygen left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at ef52bf0.

The fix itself is the right shape. The temp file is created exclusively (open(temp, "xb")) beside --output, and os.replace swaps it in, so the name is replaced rather than written through. Both link tests fail on main and pass here.

#8830 rewrites write_wav in this same file, and its version covers everything this one does, plus a few things this one changes from today's behaviour:

  • A file already at --output keeps its permissions. Here the new file gets 0o666 & ~umask (lyria-recipe.py:58), so a WAV someone kept at 0600 comes back group- and world-readable under a common umask.
  • A read-only file at --output is still refused. Today the truncating open fails on it. Here os.replace replaces it whenever the folder is writable, with no check on the file itself.
  • A failed cleanup doesn't hide the original error. The bare os.unlink(temp) in the except (:67) can raise and mask the exception that got there.
  • A brief hold on Windows is retried around os.replace.

Its tests include both link cases here, plus three more: permissions kept, read-only refused, and an owner-only temp file. So this PR has no case of its own. As noted in the thread, I'd hold this until #8830 lands, then rebase to any remaining delta or close it.

The title, body and commit messages also carry an internal tracker ID. Please drop it from all three, since this is a public repo.

CI at ef52bf0: Skills: manifest in sync is red, and it's a required check. Build is still running.

Verdict: COMMENT
Reasoning: The fix is correct, but #8830 already covers it with stronger guarantees on the same file. A required check is also red.

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes; details sent to you directly.

@WaterrrForever

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #8830, which rewrites the same write_wav with stronger guarantees (keeps an existing file's permissions, still refuses a read-only one, retries a brief hold on Windows) and covers both link cases tested here. Thanks @miguel-heygen.

@WaterrrForever
WaterrrForever deleted the miao/secops-3949-lyria-symlink branch November 25, 2026 10:26
@WaterrrForever WaterrrForever changed the title fix(skills): lyria-recipe replaces a link at its --output instead of writing through it (SECOPS-3949) fix(skills): lyria-recipe replaces a link at its --output instead of writing through it Nov 25, 2026
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.

2 participants