build: one-command vendored-asset sync (make sync-vendored)#75
Merged
Merged
Conversation
…ropagate canonical assets (WOR-1474) Some workspace-root files (the JSON schemas, pricing table, agent-skill markdown) are vendored as byte-identical copies into publishable crates because `cargo publish` only packages files inside a crate dir and they are embedded via `include_str!`. The script only checked drift; after editing a canonical file you had to remember to `cp` it over each vendored sibling, which is easy to miss (a root-schema edit synced two of three copies and failed the cli_schema tests in CI). - check-vendored-assets.sh gains a `--fix` mode: it copies each canonical file over its vendored sibling(s), driven by the same PAIRS list the check uses, so the source of truth stays single. The no-arg check (the CI gate, run by check.sh) is unchanged and now points the fix message at `make sync-vendored`. - Makefile: `make sync-vendored` (propagate) and `make vendored-check` (gate). - AGENTS.md documents the workflow: edit the canonical file, run `make sync-vendored`, commit the copies alongside the source. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Keeps the byte-identical vendored copies of workspace-root assets (the JSON schemas, pricing table, agent-skill markdown) in sync with one command instead of remembering to
cpeach one.These files are embedded into publishable crates via
include_str!;cargo publishonly packages files inside a crate directory, so each canonical file is vendored as an in-crate copy (e.g.schemas/v1.jsonhas copies under bothcrates/mcptest-config/andcrates/mcptest/, the latter emitted bymcptest schemaand asserted byte-for-byte bycli_schema.rs). Until nowcheck-vendored-assets.shonly checked drift; a root-schema edit that synced two of the three copies slipped through and failed CI ~13 min later.Changes
scripts/check-vendored-assets.sh --fix: copies each canonical file over its vendored sibling(s), driven by the samePAIRSlist the check already uses (single source of truth). The no-arg check (CI gate, run bycheck.sh) is unchanged; its fix message now points atmake sync-vendored.make sync-vendored(propagate) andmake vendored-check(gate).make sync-vendored, commit the copies.Why not the alternatives
cargo publish— theinclude_str!target would not be packaged.build.rsthat writes the source tree is an anti-pattern (dirty tree, rebuild churn) and cannot copy from the workspace root on a published crate.Testing
--fixon an in-sync tree is a no-op; a drift→--fix→restore cycle leaves git clean;make sync-vendored/make vendored-checkwork; bad args error with usage (rc 2); em-dash and shellcheck clean.