Skip to content

refactor: harden orcs-lua module visibility and add safety assertions#30

Merged
ynishi merged 4 commits intomainfrom
refactor/lua-visibility-hardening
Mar 5, 2026
Merged

refactor: harden orcs-lua module visibility and add safety assertions#30
ynishi merged 4 commits intomainfrom
refactor/lua-visibility-hardening

Conversation

@ynishi
Copy link
Owner

@ynishi ynishi commented Mar 5, 2026

Summary

  • Send/Sync static assert: Add compile-time assertion tests verifying LuaComponent implements Send + Sync (component/tests.rs)
  • git_info AUDIT NOTE: Document the intentional design decision for orcs_helpers::git_info calling Command::new("git") directly without ChildContext (read-only, hardcoded literals, scoped to sandbox root)
  • pub visibility narrowing: Change 8 modules from pub mod to pub(crate) mod (http_command, llm_adapter, llm_command, orcs_helpers, sandbox_eval, sanitize, tool_registry, tools). All pub use re-exports consumed by downstream crates are preserved

Test plan

  • cargo check passes
  • cargo clippy -p orcs-lua -- -D warnings passes
  • cargo test -p orcs-lua — all 73 tests pass
  • Full CI verification

ynishi added 4 commits March 5, 2026 09:06
Add orcs-acp crate implementing the ACP Agent trait from
agent-client-protocol v0.9. Enables ORCS to run as an ACP-compatible
agent over stdio, registerable in ACP-aware editors (Zed, JetBrains).

P1 implementation: initialize, authenticate, new_session, prompt,
cancel handlers with echo response. Engine integration planned for P2.

CLI: `orcs --acp` starts the ACP server mode.
Replace echo-based engine_worker with real ORCS engine integration.
The ACP server now sends user prompts through IOInputHandle and
streams engine output back as ACP SessionUpdate notifications,
using the same idle-timeout pattern as run_command().
Track pending approval IDs from ShowApprovalRequest and attach them
as InputContext when the next prompt is a HIL response (y/n),
enabling the engine's IOBridge to dispatch correct approve/reject
signals. Add comprehensive tests for convert and server modules.
- Add Send/Sync static assertion tests for LuaComponent
- Add AUDIT NOTE to git_info documenting intentional sandbox bypass
- Narrow 8 modules from pub to pub(crate): http_command, llm_adapter,
  llm_command, orcs_helpers, sandbox_eval, sanitize, tool_registry, tools
- Retain pub use re-exports for symbols used by downstream crates
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Code Metrics

Metric Value
Code units 5363
Line coverage 86.6%
Function coverage 84.7%
Region coverage 86.6%
High complexity (cyclo>=15) 158
Large functions (>=100 lines) 209
Domain breakdown
Domain Nodes %
orcs-runtime 1908 35.6%
orcs-lua 1637 30.5%
orcs-component 578 10.8%
orcs-types 223 4.2%
orcs-lint 211 3.9%
orcs-hook 207 3.9%
orcs-auth 153 2.9%
orcs-cli 118 2.2%
orcs-app 117 2.2%
orcs-event 111 2.1%
other 56 1.0%
orcs-mcp 44 0.8%

@ynishi ynishi merged commit 2a0b119 into main Mar 5, 2026
7 checks passed
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.

1 participant