Repository navigation
perf: bound serve freshness to provider-declared compile inputs (#1005) - #1029
Merged
Merged
Conversation
Entry-based provider sessions now negotiate LPP 1.7 and carry the provider's `compileInputs` declaration — every path its compile observed — onto the resolved input. The freshness check hashes exactly that observation set: file contents, directory entry lists, missing paths, and symlink targets. A provider without the capability or a check-only load keeps the member-list and whole-tree fingerprints, so undeclaring providers behave exactly as before. Artifact-format negotiation now accepts any session at LPP 1.4 or later so 1.7 sessions keep mapped-text artifacts. LppSourceProvider moves to source_provider/lpp.rs to keep both files under the source-size limit. Fixes #1005
…ts (#1005) An advertised-but-empty `compileInputs` declaration degenerated the snapshot fingerprint to a constant, so no later disk change could ever invalidate it; treat an empty declaration as undeclared so the load falls back to the whole-tree fingerprint. A declared path that is not a regular file (FIFO, socket, device) could block `std::fs::read` forever inside the freshness check; hash a kind marker for non-file kinds instead of reading contents.
Collaborator
Author
|
Both review findings are fixed in 280d679:
Verified: the new tests plus the existing declared-input and LPP freshness tests pass; The PR is ready for follow-up review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Completes #1005 criterion 3 for provider-backed inputs, on the owner-chosen
LPP declaration route (provider side shipped in opy-rs#659 / LPP 1.7+).
wright-lpp: addsLPP_COMPILE_INPUTS_PROTOCOL_VERSION("1.7") to thesupported-version list,
Capabilities.compileInputs,CompileResult.compileInputs, andprotocol_version_at_least.Artifact-format negotiation now accepts LPP 1.4 or later so a 1.7
session keeps
mapped-text-v1.wright-driver: entry-based provider sessions negotiate 1.7 first andfall back to the highest mutual version; the advertised
compileInputsresult rides
ResolvedInputintoLoaded.loaded_fingerprinthashes the declared observation set —file contents, directory entry lists, missing paths, symlink targets —
when the provider advertised the capability. Providers without it
(including mapped artifacts whose
filestable omits compile-time.jsinputs, opy-rs#654), check-only loads, and non-provider inputskeep the member-list and whole-tree fingerprints unchanged.
LppSourceProvidermoves tosource_provider/lpp.rsto keep bothfiles under the source-size limit.
agent-contract.mdfreshness wording andcli/integration.mdnegotiation description updated.How verified
cargo fmt --all -- --check— clean.cargo clippy --workspace --all-targets -- -D warnings— clean.cargo test --workspace— 80 test binaries, all passing, including:check; declared-inputedits (
main.opy,hook.js) each invalidate once whilenotes.mdand added undeclared files do not; an undeclaringprovider keeps whole-tree behavior;
highest mutual version; a
compileInputsfield sent without theadvertised capability is ignored and the wide fingerprint stands;
digest_declared_inputsunit coverage for file, directory,missing-path, and symlink observations.
git diff --checkand the repository size guard — clean.opy-provider(opy-rs 0.3.28 withcompileInputs support) +
wrightagainst thelocale-hookfixture —wright check/compilesucceed end-to-end, and awright servewalk produced snapshot generations
[1, 1, 1, 2, 3]: unchangedrequest and
notes.mdedit reuse the snapshot; declared.jsand.opyedits each reload once.Unverified
LPP_MOCK_PROVIDERremain#[ignore]d as before.