chore: nudge cooldown sentinel opens its file with its own O_NOFOLLOW code instead of internal/nofollow

Open Beginner friendly
#379 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend

Research direction

Read internal/nudge/cooldown.go and inspect recordFire, then check the internal/nofollow API added in #378. Change the sentinel open to use nofollow.OpenFile while keeping the existing Lstat checks on the directory and sentinel; look for tests covering refused symlinks and matching error types in the nudge gate and index files.

Written by the indexing model from the issue text.

Description

chore needs-triage
What kind of chore?

Other

What needs doing?

internal/nudge/cooldown.go opens its sentinel file with its own os.OpenFile(path, os.O_WRONLY|os.O_CREATE|syscall.O_NOFOLLOW, 0o600) call in recordFire. #378 added internal/nofollow, which opens a file without following a symbolic link. It also maps ELOOP, and EEXIST on a link, to *nofollow.SymlinkError, which matches nofollow.ErrSymlink.

Change recordFire to use nofollow.OpenFile. Keep the existing Lstat checks on the directory and the sentinel. Then a refused link gives the same error type in the nudge gate as in the index files.

Why now?

Tidiness. The sentinel already refuses a link, so this is not a security fix. It removes a second copy of the open rule that #378 put in one place.

Does this touch anything load-bearing?
  • None of these
Before submitting
  • I searched existing issues and this is not a duplicate

🤖 Generated with Claude Code

Dominant language
Go
Stars
0
Forks
0
Avg merge
5h 16m
Merged PRs (30d)
107

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seanb4t/codegraph-go

All issues in seanb4t/codegraph-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.