Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ record_id = "rec-17"
filename.
3. Run `willitcall validate results/<file>.json`; new runs must pass as schema v3
against `schemas/result-v3.schema.json`. The CLI continues to accept schema v1
and v2 files without upgrading them during `annotate` or `rescore`.
and v2 files without upgrading them during `rescore`, and v2 files during
`annotate`.
4. Open a pull request that adds the file and its `evidence/` directory under `results/`. State the hardware and the server version.

Never hand-edit a result file. Each scenario record carries an evidence hash, so edited results are not comparable.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ cargo run -p willitcall -- validate willitcall-result.json
New runs use result schema v3 (`schemas/result-v3.schema.json`). The CLI
resolves the model selector through `registry/models-v1.json` and embeds the
resolved model and artifact metadata in the result. Legacy schema v1 and v2
files are still valid input to `validate`, `site`, `annotate`, and `rescore`.
Editing a legacy file keeps its original schema version.
files are still valid input to `validate`, `site`, and `rescore`, and v2 files
to `annotate`. The v1 schema has no `cause` field. Each file must pass the
schema of its own version. Editing a legacy file keeps its original schema
version.

`--server` selects a preset (`llamacpp`, `ollama`, `mlx-lm`, `lmstudio`,
`vllm`, `custom`). The preset only supplies request defaults. The result file
Expand Down
2 changes: 1 addition & 1 deletion crates/wic-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true

[dependencies]
include_dir.workspace = true
jsonschema.workspace = true
reqwest.workspace = true
ring.workspace = true
serde.workspace = true
Expand All @@ -16,7 +17,6 @@ unicode-normalization = "0.1"

[dev-dependencies]
axum.workspace = true
jsonschema.workspace = true

[lints]
workspace = true
17 changes: 9 additions & 8 deletions crates/wic-core/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,18 @@ fn is_safe_registry_selector(selector: &str) -> bool {
&& !is_local_absolute_path(selector)
}

fn is_local_absolute_path(selector: &str) -> bool {
// A drive letter counts only with a separator later in the value, because an
// Ollama tag such as `q:8b` has the same first two characters.
pub fn is_local_absolute_path(selector: &str) -> bool {
let bytes = selector.as_bytes();
selector.starts_with('/')
|| selector.starts_with("~/")
|| selector.starts_with("~\\")
|| selector.starts_with("\\\\")
|| selector.starts_with("file://")
|| (bytes.len() >= 3
selector.starts_with(['/', '\\', '~'])
|| selector
.get(..5)
.is_some_and(|scheme| scheme.eq_ignore_ascii_case("file:"))
|| (bytes.len() >= 2
&& bytes[0].is_ascii_alphabetic()
&& bytes[1] == b':'
&& matches!(bytes[2], b'/' | b'\\'))
&& selector.contains(['/', '\\']))
}

fn is_sha256(value: &str) -> bool {
Expand Down
Loading
Loading