fix: make derive_path actors conform to the base schema#87
Merged
Conversation
|
🔍 Preview deployed: https://6fd8540c.toolpath.pages.dev |
20867cb to
acf4ffd
Compare
Path documents produced by this project's own provider crates failed the base JSON Schema, and nothing tested it. derive_path emitted actor strings the base actorRef rejected: - provider:<name> on event steps - system:<provider> on system turns - <role>:unknown on Role::Other turns None of those prefixes are in the human|agent|tool|ci vocabulary. Separately the actorRef name segment disallowed '.', so any agent:<model> with a dotted model name (e.g. gpt-5.5) failed. - toolpath: actorRef's name segment now allows '.'. - toolpath-convo: event steps, system turns, and Role::Other turns all map to tool:<provider>; the role label is preserved in the change's 'role' field. - toolpath-convo: new test derives a path covering every actor variant and an event, then validates it against the embedded base schema.
acf4ffd to
5648012
Compare
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.
Problem
Path documents produced by this project's own provider crates fail the project's own base JSON Schema, and nothing tested it.
derive_pathemitted three actor forms the base schema'sactorRefrejects:provider:<name>on event steps (hundreds per Claude session)<role>:unknownonRole::Otherturns (pi'sbash/tool/customoutputs)agent:<model>whose model contains a.(e.g.gpt-5.5,claude-sonnet-4.6) — theactorRefname segment disallowed.Real claude/codex sessions produced 15–41 violations each against
toolpath.schema.json.Fix
toolpath—actorRefpermits thesystemprefix and.in the name segment.toolpath-convo—derive_pathmaps event steps andRole::Otherturns totool:<provider>. No information is lost: the role label already lives in the change'srolefield, so the actor string doesn't need to carry it.toolpath-convo— new test derives a path covering every actor variant (human/agentwith a dotted model/system/Role::Other) plus an event, then validates the result against the embedded base schema. This is the missing coverage; it'll catch any future derive/schema drift. Pullsjsonschemain as a dev-dependency only (not in the published dep graph).Test plan
cargo test -p toolpath -p toolpath-convocargo clippy --workspace --tests -- -D warningsderived_path_validates_against_base_schemapasses; fails if revertedNeed help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.