refactor(runtime): move permission planning to Agent Runtime - #2019
Merged
limityan merged 1 commit intoAug 4, 2026
Merged
Conversation
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
force-pushed
the
yanzhn/permission-planning-owner-pr16
branch
from
August 4, 2026 03:45
437dc80 to
721d8f8
Compare
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.
Summary - move provider-neutral permission intent planning from
bitfun-coreinto the existingbitfun-agent-runtime::permissionowner - keep workspace/remote scope derivation, grant-store IO, native hook ordering, interactive request lifecycle, and concrete tool execution in Core - make the narrow Coreagent-runtimefeature compile without referring to the disabledexternal-sourcesmodule, while preserving feature-on behavior - rewrite the compile/dependency governance document into a conclusion-first roadmap and reduce the rootAGENTS.mdfiles 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 - disablingexternal-sourcesexposes 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 minimumagent-runtime,canvas-runtimefeature closure rather thanproduct-full. ## Documentation and command ownership -docs/performance/01-compile-performance.mdnow 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. - RootAGENTS.md/AGENTS-CN.mdnow 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, orsuperpowersdocument was added by this documentation update. Remaining roadmap order: 1. audit and narrow the App Server / Serverproduct-fullboundary 2. move one proven ACP host-service slice off Core 3. converge Installer lockfile, Reqwest, and unused Tokio/full ownership 4. revisit thescreenshots -> image 0.24duplicate 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 --workspaceFinal rebased documentation and boundary checks: -pnpm run check:repo-hygiene-pnpm run check:core-boundaries-git diff --check gcwing/main...HEADThe 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 CIExact head 721d8f8 passed all 7 existing CI jobs in run 30875641107. No job or workflow step was added by this revision.
The previous Appearance audit failure is no longer present after rebasing onto the upstream fix.