chore(agent-harness): register workspaces and enforce CI boundaries - #5632
Open
iscekic wants to merge 1 commit into
Open
chore(agent-harness): register workspaces and enforce CI boundaries#5632iscekic wants to merge 1 commit into
iscekic wants to merge 1 commit into
Conversation
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Executive SummaryUnused Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)CRITICAL
Files Reviewed (17 files)
Reviewed by grok-4.6 · Input: 239.5K · Output: 33.9K · Cached: 1.5M Review guidance: REVIEW.md from base branch |
This was referenced Aug 28, 2026
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.
No new behavior — This foundation adds development checks and prepares later agent work without changing how people use the product.
Summary
@kilocode/agent-harnessexposes onlyAGENT_HARNESS_PROTOCOL_VERSION = 1; this change does not implement the harness runtime or client hosts. Its export map reserves@kilocode/agent-harness/reactand TypeScript subpaths, and blocks test imports. React 19 stays optional so non-React consumers can use the portable core without a React dependency.Files
packages/agent-harness/package.json— registers the private package, exports, gateway/Zod dependencies, and test, typecheck, lint, and format commands (source; added; 38 changed lines).packages/agent-harness/src/version.ts— defines protocol version 1 (source; added; 1 changed line).The
portable-corerule permits only the shared core,@kilocode/mcp-gateway, and Zod; TypeScript rejects ambient browser and Node globals. Theno-client-executors-or-credentialsrule blocks transitive server, credential, database, and model-execution imports from browser, native, Quick Chat, and React entrypoints. The checks usedependency-cruiserto resolve aliases and symlinks, scan present entrypoints, and exercise forbidden dependencies through temporary fixtures.Files
packages/agent-harness/tsconfig.json— limits strict checks to ES2022 without ambient platform types; excludes tests and emits no files (source; added; 15 changed lines).packages/agent-harness/vitest.config.ts— runs the shared tests in Node (source; added; 3 changed lines).packages/agent-harness/src/boundaries.test.ts— adds live-source and transitive-import checks, including browser globals and aliased credential imports (test; added; 184 changed lines).@kilocode/agent-harness-workeradds a private Worker workspace with model clients, Model Context Protocol (MCP), validation, authentication, routing, and storage dependencies. ThecloudflareTestsetup usesremoteBindings: falseandnodejs_compat, with optional Wrangler settings to keep checks local.passWithNoTests: truepermits setup checks before any Worker entrypoint or runtime test exists; this change adds no deployment.Files
services/agent-harness/package.json— adds source exports, excludes tests, and registers the shared contract, runtime dependencies, and Worker tools (source; added; 39 changed lines).services/agent-harness/tsconfig.json— enables strict ES2022 checks with Worker/Node types, JSON imports, and generated-binding support (source; added; 15 changed lines).services/agent-harness/vitest.config.ts— sets local compatibility to2026-06-05, loads optional Wrangler settings, and permits an empty test suite (source; added; 17 changed lines).webandkilo-appnow depend on@kilocode/agent-harness, withdependenciesMetasettinginjected: truefor mobile React isolation. The web dependency set addsidb, Testing Library,fake-indexeddb, andjest-environment-jsdomfor browser storage and component tests. These dependencies prepare host work without adding a client host or changing Quick Chat behavior.Files
apps/mobile/package.json— adds the harness dependency and pnpm injection for the mobile React peer (source; modified; 4 changed lines).apps/web/package.json— adds the harness,idb,@testing-library/dom,@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,fake-indexeddb, andjest-environment-jsdom(source; modified; 8 changed lines).Continuous integration (CI) now accepts every target branch for
pull_requestevents, while mobile checks retain their path filters.@kilocode/agent-harnesschanges select web and mobile checks;test:agent-harness-ciruns the setup and import checks before typechecking.pushremains limited tomain, so stacked pull requests receive checks without expanding push triggers.Files
.github/workflows/ci.yml— removes the target-branch filter, selects web checks for harness changes, and runs the contract command before typechecking (source; modified; 5 changed lines)..github/workflows/kilo-app-ci.yml— removes the pull-request target filter and adds harness paths for push and pull-request checks (source; modified; 3 changed lines).package.json— adds the combined Node contract and Vitest boundary command (source; modified; 1 changed line).scripts/agent-harness-ci.test.mjs— covers workflow contracts, workspace imports, stacked/push/local selection, and Jest component/server fixtures (test; added; 220 changed lines).pull_requestworkspace selection now readspull_request.head.shaandpull_request.base.sha, rather than comparing the checkout withorigin/main. Dependency, package, and workspace checks use the target merge base and actual head, excluding unrelated base changes and synthetic merge changes. Invalid pull-request revisions fail explicitly; push and local fallback behavior stays unchanged.Files
scripts/changed-workspaces.sh— passes the target/head revision pair through every change detector and preserves push/local fallbacks (source; modified; 23 changed lines).testMatchnow discovers Quick Chat tests written in TSX without adding unrelated component tests. The TSXtransformuses the automatic React runtime and keeps decorator metadata; other TypeScript and JavaScript transforms remain separate.testEnvironmentremainsnode; component tests opt intojsdominstead of changing server-test behavior.Files
apps/web/jest.config.ts— adds scoped TSX discovery and a separate@swc/jesttransform while retaining the Node default (source; modified; 21 changed lines).Tests: 2 added files, 404 added lines —
packages/agent-harness/src/boundaries.test.ts(184) andscripts/agent-harness-ci.test.mjs(220).Generated: 1 modified lockfile —
pnpm-lock.yaml(418 changed lines).Visual Changes
Visual Changes: N/A
Verification
No manual end-to-end (E2E) tests ran. This level changes no user-facing runtime behavior.
Reviewer Notes
Automated checks
Human steps
No human step is required before or after merge for this foundation level.
Scope
Kilo-Org/cloud./Users/igor/Projects/.worktrees/shared-agent-harness-3bb0.shared-agent-harness-3bb0; base:origin/main; commit:4c4cd031b8dca9e119eaa4d15165de3a23b24f1d.Notes
E2E: This level changes no user-facing runtime behavior. Full backend, browser, iOS, and Android verification runs on the completed stack tip.
Stacked PRs — merge bottom to top. Each level shows only its own diff.
Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.
shared-agent-harness-3bb0— chore(agent-harness): register workspaces and enforce CI boundaries #5632 ← this PRshared-agent-harness-3bb0-s2— feat(agent-harness): define portable domain and snapshots #5637shared-agent-harness-3bb0-s3— feat(agent-harness): define commands tools and permission policy #5639shared-agent-harness-3bb0-s4— feat(agent-harness): share client state and cursor recovery #5643shared-agent-harness-3bb0-s5— feat(agent-harness): persist command intents and execution receipts #5647shared-agent-harness-3bb0-s6— feat(db): add harness ingress grants and retirement fences #5655shared-agent-harness-3bb0-s7— feat(agent-harness): deliver legacy history and project durable text #5659shared-agent-harness-3bb0-s8— feat(agent-harness): authorize durable grants and registered clients #5662shared-agent-harness-3bb0-s9— feat(agent-harness): fence retirement and retry payload cleanup #5667 (tip)