refs: keep plain-file fragments unverified and cover missing targets
A fragment on a verified non-program file is coverage the loaded catalog does not have; report not_loaded instead of a file success. Add explicit-refs tests for verified plain files, symlink refusal, encoded traversal, missing unimported programs and lock snapshot digests.
This commit is contained in:
1 parent
93e125e921
commit
0b7f238fd8
2 files changed
+109
No files matched your search
@@ -528,6 +528,12 @@ pub fn resolve_link(
|
||||
.module_for(&source.instance, &candidate_path)
|
||||
.cloned()
|
||||
else {
|
||||
// A plain local file can be verified to exist, but a fragment on it is
|
||||
// not a Marqdo anchor: coverage remains unverified, never `missing`.
|
||||
if !candidate_path.ends_with(".mq.md") && reference.fragment.is_some() {
|
||||
reference.state = ReferenceState::NotLoaded;
|
||||
return reference;
|
||||
}
|
||||
let key = (source.instance.clone(), candidate_path.clone());
|
||||
if catalog.verified_files.contains(&key) {
|
||||
reference.state = ReferenceState::Resolved;
|
||||
|
||||
Reference in new issue
Block a user