feat(agent): add dynamic runtime context and domain plugin boundaries - #436
Merged
Conversation
added 6 commits
July 22, 2026 02:39
zhengdaqi
marked this pull request as ready for review
July 21, 2026 18:41
Collaborator
Author
|
Verification gate record: CodeQL passed 4/4 on the current head. Cubic was SKIPPED because no Cubic review or comment appeared during the required 10-minute bounded wait, and repository history (30 recent PRs plus recent issue and inline comments) shows no Cubic integration activity. No code changed after the passing local QA evidence and CodeQL run. |
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
This PR adds the generic Agent runtime foundations needed to adopt modern harness techniques in PilotDeck without embedding legal-domain behavior in Core. It introduces bounded, session-scoped dynamic prompt injection, mutable pre-model request hooks, reliable internal prompt arbitration, and artifact completion contracts. Legal or other specialized behavior can now activate through project/domain plugins, Skills, context pointers, and validators.
Architecture Boundary
Changes
Dynamic context and model request lifecycle
PreModelRequesthooks and allow them to block a request, add current-request context/system instructions, or patch an allowlisted provider/model/token/temperature/metadata surface.Internal prompt dispatch
SessionRouterbusy state.Artifact completion controls
Domain extension point
DomainPluginandDomainPluginRuntimecontracts for project-specific task detection, Skills/context pointers, artifact contracts, and validators.QA & Evidence
What was tested:
pnpm run buildbefore commit and again after atomic commit restructuring..omo/evidence/20260722-pilotdeck-agent-runtime/README.mdWhat was tested: 41 focused tests for context budgets/lifecycle, mutable request effects, domain activation, artifact correction, cleanup, dispatch ordering/deduplication/cancellation/timeouts/shutdown, and the WebSocket trust boundary.
.omo/evidence/20260722-pilotdeck-agent-runtime/focused-tests.txtWhat was tested: deterministic real local Gateway integration loading a temporary project command plugin from
.pilotdeck/plugins.maxOutputTokenswas patched to1234; missingfinal.xlsxtriggered correction; completion succeeded only after the artifact was created..omo/evidence/20260722-pilotdeck-agent-runtime/focused-tests.txtWhat was tested: full compiled test inventory excluding the independently reproduced baseline timer file.
.omo/evidence/20260722-pilotdeck-agent-runtime/regression-suite.txtWhat was tested: unmodified
pnpm testplus a base-branch comparison of the affected timer source/tests.tests/network/fetch.spec.tsand reproduce on Node v22.22.0 because its only pending timers areunref()'d..omo/evidence/20260722-pilotdeck-agent-runtime/baseline-known-failure.txtgit diff --exit-code origin/main -- src/network/fetch.ts tests/network/fetch.spec.tspasses.Risks & Residuals
DomainPluginboundary; this PR contains no legal-domain policy.Related Context
This implements the generic runtime half of the proposed PilotDeck architecture. Legal-domain behavior should be delivered separately as a project/plugin package containing Skills, domain context, artifact contracts, and validators built against these interfaces.