I thought I was pretty familiar with the basic rules of notation, and yet this thread seems to make it sound like a very complex question.
I always thought the situation was crystal clear: accidentals apply only to the exact pitch, not to notes of the same letter-name in higher or lower octaves; and they apply till the end of the bar or until negated by some other accidental.
Composers, usually in a rather advanced or complex style, may adopt another rule occasionally - but they should *always* clearly explain the rule they're adopting in an easily visible footnote. The commonest alternative rule is to let each accidental last for one note only, or (sometimes) also for immediately repeated notes - although I believe even that additional clause can introduce ambiguity.
I have composed music, and I tend towards complexity and chromaticism. I normally use the conventional rule (except that when notes tie into a new bar I prefer to repeat any accidentals in the new bar); but on occasion I have judged that the score would be easier to read if I used accidentals on every note that needed them (without the additional provision about immediately repeated notes which can be ambiguous on occasion). But I put a note in the score saying that I am adopting that rule, and that each accidental lasts for the one note only. But I still defer to the conventional rule and put in cautionary accidentals that, under my adopted rule, would not be needed, but which would be needed under the normal rule. I tend to find that this arrangement makes very chromatic music easiest to read - especially when bars are long, with many notes in them.
And in more ordinary situations, when I use the normal rule, I am generous in providing cautionary accidentals wherever I think confusion could potentially arise. If anything, I err on the side of too many cautionaries, rather than too few; but I think that is better, on the whole.
(I hope I haven't confused things further - the basic situation, though, is very simple and quite clear, and not subject to opinion.)
Regards, Michael.