feat(cli): discover, build, and cache project binary metadata - #664
Open
ElijahAhianyo wants to merge 2 commits into
Open
feat(cli): discover, build, and cache project binary metadata#664ElijahAhianyo wants to merge 2 commits into
ElijahAhianyo wants to merge 2 commits into
Conversation
|
| Project | cot |
| Branch | elijah/cot-cli-proxy/stack-2-discovery |
| Testbed | github-ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| empty_router/empty_router | 📈 view plot 🚷 view threshold | 15.44 ms(+65.13%)Baseline: 9.35 ms | 17.77 ms (86.88%) |
| json_api/json_api | 📈 view plot 🚷 view threshold | 1.12 ms(+8.74%)Baseline: 1.03 ms | 1.37 ms (82.07%) |
| nested_routers/nested_routers | 📈 view plot 🚷 view threshold | 1.06 ms(+9.63%)Baseline: 0.97 ms | 1.26 ms (84.16%) |
| single_root_route/single_root_route | 📈 view plot 🚷 view threshold | 1.02 ms(+9.26%)Baseline: 0.93 ms | 1.22 ms (83.22%) |
| single_root_route_burst/single_root_route_burst | 📈 view plot 🚷 view threshold | 17.13 ms(+1.73%)Baseline: 16.84 ms | 21.47 ms (79.78%) |
ElijahAhianyo
marked this pull request as ready for review
September 3, 2026 05:09
This was referenced Sep 3, 2026
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.
Description
Add logic to cot-cli to discover a project binary and extract its metadata.
There are 3 cases:
Slow Path
The binary exists but has not been built.
When searching for a binary, we find its exact location by delegating that responsibility to cargo_metadata, which resolves the target directory location. cargo_metadata gives us the target dir path and all present binaries. We apply some heuristics to select the right binary. If multiple binaries are found, we hard-fail and prompt the user to disambiguate. Once we have the binary path, we build it via
cargo build(since it does not exist for the slow path) at the user's request (via a--buildflag), then obtain metadata from the binary. The metadata is then cached for faster subsequent runs.Warm Path
The binary exists but has changed or been recompiled since our last run.
After obtaining the binary path as described in the slow path, we compare the binary's mtime against the value stored in the cache. In the warm path, they differ. We build the binary and obtain metadata.
Hot Path
Metadata has been cached and the binary has not been recompiled since the last run.
After obtaining the binary and checking the mtime diff, we find no change, so we safely assume no recompilation is necessary. We invoke the binary directly.
Type of change