Skip to content

refactor: consolidate first-class tools — colocate compile-time and runtime code per tool#290

Merged
jamesadevine merged 4 commits intomainfrom
copilot/refactor-consolidate-first-class-tools
Apr 22, 2026
Merged

refactor: consolidate first-class tools — colocate compile-time and runtime code per tool#290
jamesadevine merged 4 commits intomainfrom
copilot/refactor-consolidate-first-class-tools

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

First-class tools (tools: front matter) had compile-time and runtime code scattered across compile/extensions/, tools/, and runtimes/ with no consistent pattern. Cache memory's compile-time lived in one directory and its Stage 3 runtime in another.

New layout

Each tool/runtime owns a single directory containing all of its code:

  • src/tools/<name>/extension.rs (CompilerExtension impl) + optional execute.rs (Stage 3 runtime)
  • src/runtimes/<name>/mod.rs (config types/helpers) + extension.rs (CompilerExtension impl)
  • src/compile/extensions/ — trait definition, Extension enum, collect_extensions(), and always-on infra extensions (GitHub, SafeOutputs) that aren't user-configured

File moves

Before After
compile/extensions/cache_memory.rs tools/cache_memory/extension.rs
tools/cache_memory.rs tools/cache_memory/execute.rs
compile/extensions/azure_devops.rs tools/azure_devops/extension.rs
compile/extensions/lean.rs runtimes/lean/extension.rs
runtimes/lean.rs runtimes/lean/mod.rs

Wiring

compile/extensions/mod.rs re-exports tool/runtime extension types from their new homes so existing import paths (crate::compile::extensions::CacheMemoryExtension, etc.) continue to work. ADO_MCP_* constants are re-exported from compile/mod.rs since the azure-devops extension now lives outside the private compile::common module.

Docs

AGENTS.md architecture diagram and "Adding New Features" section updated. New "Code Organization Principles" section documents the colocation methodology.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dev.azure.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-beb2180dce8ef554.0ixq20/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-49cb495e99e732cb.3608h8sipq36hxu94zkzu7duh.0qhh069.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-beb2180dce8ef554.0jlbih/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-49cb495e99e732cb.3ar2kv94emcaau5up6629u0n2.0qhh069.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-beb2180dce8ef554.0k7rcs/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-49cb495e99e732cb.3eajnfm4bnpmtfrxbgscvtlpm.0qhh069.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-beb2180dce8ef554.0kwm7w/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-49cb495e99e732cb.3iilq4w8mhj2na1l3eehlyh7n.0qhh069.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-beb2180dce8ef554.0lklpl/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/init_tests-49cb495e99e732cb.3qmayg8wuxe9xp91j7yx6bko8.0qhh069.rcgu.o d.0oo30tlv22o5mbt2bzyaecx62.1l0jmaj.rcgu.o d.0ppm7acpzj9pose041bmuqgpm.1l0jmaj.rcgu.o d.0tviedpuoz1b291l92tcn0dx4.1l0jmaj.rcgu.o d.0vm8jrl97m68uvl00ag7gz1p5.1l0jmaj.rcgu.o d.0ybq5glinpj9818of2ja1npyy.1l0jmaj.rcgu.o d.11ql65wk2qkw8dv87qp088o22.1l0jmaj.rcgu.o d.14722s5epvjae3nn3ylxkucko.1l0jmaj.rcgu.o d.148cy3pq04g1un12o6x1quzon.1l0jmaj.rcgu.o d.17tgrokgra7a7wujk7ooupq97.1l0jmaj.rcgu.o d.17vd3t69cj94hlwno3z871y8p.1l0jmaj.rcgu.o d.18wuz8jn1878w063h8qkflpn2.1l0jmaj.rcgu.o d.1ank73sfegqlunuub7fovwm0g.1l0jmaj.rcgu.o d.1cuken4jbrqqg32ejpkaakkhq.1l0jmaj.rcgu.o d.1j7uup3w3mvzupdpgrflqfbdd.1l0jmaj.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e s/ado_aw-0dd8581remote s/ado_aw-0dd8581get-url s/ado_aw-0dd8581origin s/ad�� s/ado_aw-0dd8581e95bf1852.0td2lgfsmh4fziua58ad057cn.17l5ako.rcgu.o s/ado_aw-0dd8581e95bf1852.0v4gio0nkgr7nr19dc2o05vhr.17l5ako.rcgu.o de/node/bin/cc target/debug/depgit target/debug/depls-files target/debug/dep--exclude-standard target/debug/dep--others targ�� target/debug/deps/rustcVq2Vz3/symbols.o target/debug/deps/ado_aw-0dd8581e95bf1852.00lgh8dwo7wkwfsn7eb7zrd0y.17l5ako.rcgu.o target/debug/deps/ado_aw-0dd8581e95bf1852.02phk1b9kdu9tqq4iumazmebe.17l5ako.rcgu.o target/debug/depcut target/debug/dep-c1 target/debug/deps/ado_aw-0dd8581get-url target/debug/deps/ado_aw-0dd8581origin (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-d5652daa30dfc52e lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --check-cfg cfg(docsrs,test) --check-cfg cfg(feature, values()) -C remo�� (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits April 21, 2026 21:28
…odules

Move compile-time (CompilerExtension) and runtime (Stage 3) code for
each tool/runtime into a single directory:

- tools/cache_memory/ — extension.rs + execute.rs
- tools/azure_devops/ — extension.rs
- runtimes/lean/ — extension.rs + mod.rs (config/helpers)

Infrastructure extensions (GitHub, SafeOutputs) remain in
compile/extensions/ as they are always-on and not user-configured.

compile/extensions/mod.rs re-exports tool/runtime extensions from
their new colocated homes.

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/3cae398b-84f6-450a-8e39-31f2c20687f3

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
…thodology

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/3cae398b-84f6-450a-8e39-31f2c20687f3

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor first-class tools for consolidated organization refactor: consolidate first-class tools — colocate compile-time and runtime code per tool Apr 21, 2026
Copilot AI requested a review from jamesadevine April 21, 2026 21:34
@jamesadevine
Copy link
Copy Markdown
Collaborator

/rust-review

@jamesadevine jamesadevine marked this pull request as ready for review April 21, 2026 21:40
@jamesadevine
Copy link
Copy Markdown
Collaborator

approved

@jamesadevine
Copy link
Copy Markdown
Collaborator

/rust-review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Rust PR Reviewer completed successfully!

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Rust PR Review

Summary: Looks good — clean structural refactoring with no functional changes, all tests pass.

Findings

⚠️ Suggestions

  • src/compile/mod.rs:26pub use common::MCPG_PORT generates a compiler warning (unused import) because nothing outside the compile module consumes the re-export (callers within the module use super::common::MCPG_PORT directly). This warning is pre-existing and not introduced by this PR, but since you're already touching this file to add the four new ADO_MCP_* re-exports, it's a natural moment to clean it up — either remove the MCPG_PORT re-export if no external consumer needs it, or add #[allow(unused_imports)] with a note explaining it's reserved for future external use.

✅ What Looks Good

  • Circular-module concern: compile::extensions re-imports from tools::* and runtimes::*, while those modules import back from compile::extensions. This is valid Rust (intra-crate cycles are fine) and the successful build confirms it.
  • Re-export strategy: Using pub use crate::tools::... / pub use crate::runtimes::... in compile/extensions/mod.rs preserves all existing import paths for callers, making this a zero-churn refactor from a consumer perspective.
  • ADO_MCP_ re-exports* in compile/mod.rs correctly unlock those constants for tools/azure_devops/extension.rs which now lives outside the private compile::common module — this was the right fix.
  • tests.rs import fix (crate::compile::{ADO_MCP_SERVER_NAME, parse_markdown} instead of crate::compile::common::...) aligns with the new public surface.
  • New mod.rs doc comments clearly describe each tool's compile-time vs. Stage 3 responsibilities.
  • All 8 compiler tests, 8 MCP HTTP tests, and 3 init tests pass cleanly.

Generated by Rust PR Reviewer for issue #290 · ● 539.8K ·

@jamesadevine
Copy link
Copy Markdown
Collaborator

@copilot src/compile/mod.rs:26 — pub use common::MCPG_PORT generates a compiler warning (unused import) because nothing outside the compile module consumes the re-export (callers within the module use super::common::MCPG_PORT directly). This warning is pre-existing and not introduced by this PR, but since you're already touching this file to add the four new ADO_MCP_* re-exports, it's a natural moment to clean it up — either remove the MCPG_PORT re-export if no external consumer needs it, or add #[allow(unused_imports)] with a note explaining it's reserved for future external use.

MCPG_PORT is only used within the compile module (onees.rs,
standalone.rs import via super::common). The pub re-export was
generating an unused_imports warning.

Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/cf879e88-1dcc-48b9-94d4-3d0df7bbaba4

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 21, 2026

@copilot src/compile/mod.rs:26 — pub use common::MCPG_PORT generates a compiler warning (unused import) because nothing outside the compile module consumes the re-export (callers within the module u...

Removed the MCPG_PORT re-export — it's only consumed within the compile module via super::common::MCPG_PORT (by onees.rs and standalone.rs), so no external consumer needs it. Build is now warning-free. See 249c92e.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dev.azure.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-c05a54f0ee13c0b7 /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0cvrpt/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-a8a48394b293b055.17unxb5laoekqixkf4qnr6sbw.16ugjda.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0dqwns/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-a8a48394b293b055.18g4t9rqadmplukldxxwfdghh.16ugjda.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0ho0zn/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-a8a48394b293b055.1if8uc8ofutahxkln01oe5axr.16ugjda.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0n1d34/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-a8a48394b293b055.1qlvx6rnt00u2kwrwh6tk8tw3.16ugjda.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-a820d47d98270560.0nnyqf/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-a8a48394b293b055.21b9o5zsud4g3k1pq9q72uu2y.16ugjda.rcgu.o 0.03l0815d29lj002ae3mmxfl3m.1k8z6ro.rcgu.o 0.0tn8ejcnvgjygdyylhtak9lpf.1k8z6ro.rcgu.o 0.0xx92o0xvmao3s3mmpaude4gm.1k8z6ro.rcgu.o 0.11wu39pl8x5unsfa0pm0sx7i8.1k8z6ro.rcgu.o 0.15ekd7s10qhmgvd15js1u58j5.1k8z6ro.rcgu.o 0.20695tlwm01eu06f6nytfaj15.1k8z6ro.rcgu.o 0.25dmyxexlbrf6s096aq9lq99g.1k8z6ro.rcgu.o 0.26zkdc197kx7li1nwob9t5xj9.1k8z6ro.rcgu.o 0.2cvf4nkhwgdzrg6bb0j1g45xz.1k8z6ro.rcgu.o 0.2figln0c2pfqzi2e08i006o8u.1k8z6ro.rcgu.o 0.2fla2kplyo8fcs0of160c962a.1k8z6ro.rcgu.o 0.2ikaohql56ne0w9lfnxyhwv2k.1k8z6ro.rcgu.o 0.2oqlsydd3dffl94jckwj4qblh.1k8z6ro.rcgu.o 0.2pfydlp0bjr74wlj1t3r6ms18.1k8z6ro.rcgu.o (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@jamesadevine jamesadevine merged commit 75b5f57 into main Apr 22, 2026
7 checks passed
@jamesadevine jamesadevine deleted the copilot/refactor-consolidate-first-class-tools branch April 22, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: consolidate first-class tools — colocate compile-time and runtime code per tool

2 participants