Skip to content

refactor(runtime): move permission planning to Agent Runtime - #2019

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/permission-planning-owner-pr16
Aug 4, 2026
Merged

refactor(runtime): move permission planning to Agent Runtime#2019
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/permission-planning-owner-pr16

Conversation

@limityan

@limityan limityan commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary - move provider-neutral permission intent planning from bitfun-core into the existing bitfun-agent-runtime::permission owner - keep workspace/remote scope derivation, grant-store IO, native hook ordering, interactive request lifecycle, and concrete tool execution in Core - make the narrow Core agent-runtime feature compile without referring to the disabled external-sources module, while preserving feature-on behavior - rewrite the compile/dependency governance document into a conclusion-first roadmap and reduce the root AGENTS.md files to stable repository entry points - return module-specific build and test commands to their owning app/crate guides instead of accumulating a repository-wide test matrix ## Architecture and behavior This is an owner migration of pure policy evaluation, not a second Permission Runtime and not a public SDK expansion. The existing runtime manager, contracts, and Core product pipeline remain the single production path. The following behavior is explicitly preserved by contract and Core end-to-end tests: - policy denial remains stronger than hook preapproval and remembered grants - Bash allow rules and remembered grants still require exact commands, except the existing global */* full-access baseline - constraints can tighten but never widen host policy - fresh approval overrides allow and remembered grants but never overrides denial - multi-intent approval order, denial short-circuiting, cancellation, Once/Always, delegation, and feedback remain unchanged - local Windows resource matching remains case-insensitive; remote/non-Windows matching remains case-sensitive - disabling external-sources exposes only the local agent route instead of advertising an unavailable capability ## Build and dependency impact | Evidence | Before | After | |---|---:|---:| | Pure permission-policy test graph | Core minimum: ~449 package/version nodes | Agent Runtime: ~78 nodes | | Product build closure | unchanged | unchanged | | New direct dependencies | 0 | 0 | | New Cargo features | 0 | 0 | | New test targets | 0 | 0 | | New CI jobs or workflow steps | 0 | 0 | The ~371-node reduction applies to the isolated pure-policy contract path; it is not presented as a product build-time reduction. Core end-to-end permission tests intentionally retain the real product orchestration path and use the current minimum agent-runtime,canvas-runtime feature closure rather than product-full. ## Documentation and command ownership - docs/performance/01-compile-performance.md now leads with measured conclusions, separates completed work from remaining debt, and requires every follow-up to prove closure or wall-time benefit without adding duplicate CI coverage. - Root AGENTS.md / AGENTS-CN.md now document only installation, the primary desktop loop, changed-Rust formatting, and repository-level governance checks. - Web UI, mobile web, Desktop, CLI, Core, and Agent Runtime commands are maintained by their nearest owner guides. Cross-owner guides route to those owners instead of copying their test lists. - Focused Rust verification uses one package, one target/filter, and the minimum feature set. Workspace, product-full, and all-feature checks are not presented as default local shortcuts. - Non-default product definitions must pass --product-config <path> so validation cannot silently check the default BitFun definition. - No workflow, CI matrix, source dependency, Cargo feature, or superpowers document was added by this documentation update. Remaining roadmap order: 1. audit and narrow the App Server / Server product-full boundary 2. move one proven ACP host-service slice off Core 3. converge Installer lockfile, Reqwest, and unused Tokio/full ownership 4. revisit the screenshots -> image 0.24 duplicate only when a supported behavior-equivalent upstream path exists ## Validation Runtime change: - cargo test --locked -p bitfun-agent-runtime --test agent_interaction_contracts permission_contracts:: (22 passed) - cargo test --locked -p bitfun-agent-runtime (full package passed before the final rebase; upstream rebase changes were unrelated) - cargo check --locked -p bitfun-core --no-default-features --features agent-runtime - cargo test --locked -p bitfun-core --no-default-features --features agent-runtime,canvas-runtime --lib agentic::tools::pipeline::tool_pipeline::tests:: (37 passed) - cargo check --locked --workspace Final rebased documentation and boundary checks: - pnpm run check:repo-hygiene - pnpm run check:core-boundaries - git diff --check gcwing/main...HEAD The runtime owner migration received two independent adversarial reviews. The documentation follow-up received two additional readability/command-ownership review passes; all reported P2 issues were fixed, with no remaining P0-P3 findings. ## Remote CI

Exact head 721d8f8 passed all 7 existing CI jobs in run 30875641107. No job or workflow step was added by this revision.

Job Result Duration
Shell Deploy Scripts passed 8s
CLI Tests (macOS) passed 4m53s
CLI Tests (Ubuntu) passed 7m21s
Frontend Build passed 9m46s
Rust Build Check (Ubuntu) passed 9m09s
Rust Build Check (macOS) passed 15m46s
Rust Build Check (Windows) passed 16m13s

The previous Appearance audit failure is no longer present after rebasing onto the upstream fix.

Keep product-specific scope, hooks, request lifecycle, and tool execution in Core while moving provider-neutral policy evaluation into Agent Runtime. Preserve narrow feature checks and refresh the dependency-governance roadmap.
@limityan
limityan force-pushed the yanzhn/permission-planning-owner-pr16 branch from 437dc80 to 721d8f8 Compare August 4, 2026 03:45
@limityan
limityan merged commit d93b3ea into GCWing:main Aug 4, 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