Skip to content

perf(core): isolate document and subscription capability closures - #2199

Open
limityan wants to merge 1 commit into
GCWing:mainfrom
limityan:yanzhn/perf-runtime-capability-closures
Open

perf(core): isolate document and subscription capability closures#2199
limityan wants to merge 1 commit into
GCWing:mainfrom
limityan:yanzhn/perf-runtime-capability-closures

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

Summary

  • split document conversion and local subscription authentication out of the bitfun-core/agent-runtime baseline into additive weak modifiers owned by their existing runtimes
  • keep full-product and CLI behavior explicit, while App Server and the minimal Agent Runtime stop compiling capabilities they do not consume
  • move Reqwest data/transport features to the direct capability owners and guard both exact metadata profiles and workspace-version provenance
  • preserve fail-closed behavior when document conversion or subscription authentication is not compiled

Architecture and behavior

Area Result
Core baseline agent-runtime keeps runtime lifecycle/basic owners; it no longer activates document conversion or subscription credential storage
Product assembly product-full, CLI, and ACP select the capabilities they actually require; no new product umbrella was introduced
Document read lightweight extension recognition remains available; conversion is compiled only with document-read; unavailable conversion and broken documents return explicit errors without source-byte fallback
Subscription auth API-key authentication remains a no-op through the subscription hook; subscription credentials return a typed unavailable error when subscription-auth is absent
Reqwest the workspace owns only the compatible version/default policy; each direct consumer owns its exact protocol features, and native TLS remains rejected

Dependency impact

Counts are unique normal/build package-version instances after removing Cargo tree duplicate-display markers.

Closure Windows macOS Linux
Core agent-runtime 343 -> 274 (-69) 330 -> 266 (-64) 375 -> 265 (-110)
App Server 490 -> 429 (-61) 477 -> 421 (-56) 508 -> 430 (-78)
Core product-full 570 -> 570 557 -> 557 601 -> 601
CLI 649 -> 649 649 -> 649 672 -> 672
ACP 589 -> 587 (-2) 574 -> 572 (-2) 594 -> 592 (-2)
  • new crates: 0
  • new third-party dependencies: 0
  • Cargo.lock: byte-identical to main (51e9c22e5ed74f54d64f4ae707c5ef010d6c0940)
  • GitHub workflow / CI changes: 0

These are dependency-graph reductions; this PR does not claim an unmeasured wall-clock improvement for product-full.

Validation

  • rebased onto gcwing/main@3dfc37245
  • node --test scripts/check-core-boundaries.test.mjs (75/75)
  • pnpm run check:core-boundaries
  • exact-head Cargo checks for Remote Connect, minimal Core Agent Runtime, Core with both modifiers, App Server, CLI, and ACP
  • focused document recognition, feature-off document behavior, broken-document no-fallback, feature-off subscription behavior, and feature-on API-key no-op tests
  • all reviewed Services Integration Reqwest owner profiles checked independently
  • git diff --check
  • two independent adversarial review rounds across architecture, behavior, cross-platform feature closure, and scope; no P0-P3 findings remain

Cross-platform dependency evidence uses Cargo target resolution for Windows, macOS, and Linux. Native macOS/Linux compilation remains covered by the existing CI matrix; this PR adds no new CI checks.

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