Skip to content

feat(cli): discover, build, and cache project binary metadata - #664

Open
ElijahAhianyo wants to merge 2 commits into
elijah/cot-cli-proxy/stack-1-metadatafrom
elijah/cot-cli-proxy/stack-2-discovery
Open

feat(cli): discover, build, and cache project binary metadata#664
ElijahAhianyo wants to merge 2 commits into
elijah/cot-cli-proxy/stack-1-metadatafrom
elijah/cot-cli-proxy/stack-2-discovery

Conversation

@ElijahAhianyo

@ElijahAhianyo ElijahAhianyo commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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 --build flag), 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

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

@github-actions github-actions Bot added A-deps Area: Dependencies C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) labels Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Projectcot
Branchelijah/cot-cli-proxy/stack-2-discovery
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark 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%)
🐰 View full continuous benchmarking report in Bencher

@ElijahAhianyo
ElijahAhianyo marked this pull request as ready for review September 3, 2026 05:09
@ElijahAhianyo ElijahAhianyo changed the title elijah/cot cli proxy/stack 2 discovery feat: discover, build, and cache project binary metadata Sep 3, 2026
@ElijahAhianyo ElijahAhianyo changed the title feat: discover, build, and cache project binary metadata feat(cli): discover, build, and cache project binary metadata Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-deps Area: Dependencies C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant