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
6 changes: 3 additions & 3 deletions rust/crates/pumas-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ invalidation observation, not a whole-package content digest: equal-length
byte changes that restore mtime may leave it unchanged. Primary-file hashes and
managed acquisition verification remain separate evidence.

The synthetic producer tests and the pinned Pantograph guard interoperability
runner at `tests/pantograph_guard_interop/run.py` exercise this handoff without
loading model tensors. Real Cohere processor-file completeness requires a
The synthetic producer tests exercise this handoff without loading model
tensors. Consumers check their own admission rules against this public contract
in their own repositories. Real Cohere processor-file completeness requires a
separate pinned member-manifest audit, and runtime compatibility is not claimed.

See the native [local intent example](examples/intent_model.rs) and [managed
Expand Down
35 changes: 35 additions & 0 deletions rust/crates/pumas-core/src/model_library/hf_load_target_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,3 +955,38 @@ async fn hf_package_observation_child() {
Some(expected.as_str())
);
}

#[tokio::test]
async fn hf_owner_fresh_restores_a_missing_summary_and_round_trips_on_the_wire() {
let (_temp, library, _model_dir) = synthetic_cohere_library().await;
let original = ready_target(&library, PumasArtifactLoadTargetResolutionMode::OwnerFresh).await;
let detail = cached(&library, ModelPackageFactsCacheScope::Detail);
remove_summary(&library);
let response = library
.resolve_model_artifact_load_target(hf_request(
PumasArtifactLoadTargetResolutionMode::OwnerFresh,
))
.await
.unwrap();
assert!(response.is_ready(), "{response:?}");
// OwnerFresh rebuilds the Summary row from a Detail-only cache, and that
// row is exactly what the public summary API reports.
let summary = cached(&library, ModelPackageFactsCacheScope::Summary);
assert_eq!(summary.source_fingerprint, detail.source_fingerprint);
let reported = library
.resolve_model_package_facts_summary(MODEL_ID)
.await
.unwrap()
.summary
.unwrap();
assert_eq!(
serde_json::from_str::<serde_json::Value>(&summary.facts_json).unwrap(),
serde_json::to_value(reported).unwrap()
);
// Consumers receive this response serialized; decoding it must preserve
// the whole target, including path, revision and observation token.
let decoded: crate::models::ResolveModelArtifactLoadTargetResponse =
serde_json::from_slice(&serde_json::to_vec(&response).unwrap()).unwrap();
assert_eq!(decoded, response);
assert_eq!(decoded.target.unwrap(), original);
}
Loading
Loading