fix: address Copilot review round 16 on #2248
**A hole my own round-13 change opened.** The byte budget added a `break`, and `manifestListsSelf` described the bounded slice rather than the rows the walk reached — so breaking before a later self-entry left the flag true, suppressed the fallback, and skipped the mandatory frontmatter check entirely. It is `selfAttempted` now, set inside the loop, and marked before the read: a row the walk reached but could not read has still been attempted, and its failure belongs to the loop rather than to a second fetch. **A preview could overwrite a verification's own bytes.** The digest verdict on screen was computed from the verification's fetch; replacing only the text let the frontmatter findings describe different bytes, recreating the mixed-fetch verdict that state exists to prevent. `entryTextVerified` marks which read produced it, and a preview no longer wins over a verification. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ND46Ci64DC3tzBy9aG81Nc Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
89438d1a4b
commit
5a1f0efb5a
1 changed files with 141 additions and 23 deletions
|
|
@ -105,6 +105,18 @@ interface VerificationState {
|
|||
* has not clicked Verify should still get the check.
|
||||
*/
|
||||
entryText?: string;
|
||||
/**
|
||||
* True when {@link entryText} came from a **verification** rather than the
|
||||
* preview read.
|
||||
*
|
||||
* A later preview of the same `SKILL.md` must not overwrite text a
|
||||
* verification produced: the digest verdict on screen was computed from that
|
||||
* fetch, and replacing only the text would let the frontmatter findings
|
||||
* describe different bytes — recreating the mixed-fetch verdict this state
|
||||
* exists to prevent (Copilot). A verification always wins, since it brings a
|
||||
* matching digest verdict with it.
|
||||
*/
|
||||
entryTextVerified?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -963,9 +975,12 @@ export function SkillsScreen({
|
|||
// anything not named here is dropped — which silently discarded the
|
||||
// verified `SKILL.md` text the frontmatter check depends on.
|
||||
...(entryText !== undefined
|
||||
? { entryText }
|
||||
? { entryText, entryTextVerified: true }
|
||||
: prev.key === key && prev.entryText !== undefined
|
||||
? { entryText: prev.entryText }
|
||||
? {
|
||||
entryText: prev.entryText,
|
||||
entryTextVerified: prev.entryTextVerified,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
});
|
||||
|
|
@ -1076,16 +1091,19 @@ export function SkillsScreen({
|
|||
} catch {
|
||||
return; // neither text nor blob; the viewer reports it
|
||||
}
|
||||
setVerification((prev) =>
|
||||
prev.key !== null && prev.key !== key
|
||||
? prev
|
||||
: {
|
||||
...prev,
|
||||
key,
|
||||
files: prev.key === key ? prev.files : {},
|
||||
entryText: text,
|
||||
},
|
||||
);
|
||||
setVerification((prev) => {
|
||||
if (prev.key !== null && prev.key !== key) return prev;
|
||||
const sameKey = prev.key === key;
|
||||
// Never over a verification's own text — see
|
||||
// `entryTextVerified`.
|
||||
if (sameKey && prev.entryTextVerified) return prev;
|
||||
return {
|
||||
...prev,
|
||||
key,
|
||||
files: sameKey ? prev.files : {},
|
||||
entryText: text,
|
||||
};
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err: unknown) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue