feat(agent-harness): define portable domain and snapshots - #5637
Open
iscekic wants to merge 1 commit into
Open
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by grok-4.6 · Input: 110.4K · Output: 23.7K · Cached: 553.7K Review guidance: REVIEW.md from base branch |
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 change adds data definitions without changing the running product.
Summary
ConversationSchemaandPermissionModeSchemadefault missing settings toask/revision0;LegacyMessageSchema,MessageSchema,MessagePartSchema,ConversationProducer, andMessageProducernormalize legacy text without authority.ProtocolVersionSchema,ContextSchema,ErrorSchema,WaitingSchema,RunStateSchema,RunSchema,ToolOutcomeSchema,ExecutionTargetSchema,ApprovalRecordSchema, andToolCallSchemavalidate portable recovery records and preserve complete tool calls.InteractionSchema,ClientSchema,ExecutionGrantSchema,PendingClientActionSchema,SnapshotSchema,EventEnvelopeSchema,HistoryCursorSchema, andEventCursorSchemapreserve recovery state; callers must authenticate producers that claim harness provenance.Files
packages/agent-harness/src/contracts.ts— added (A; source; +271/−0 lines). Reuses gateway context directly to avoid Web globals. Adds protocol, identifier, timestamp, error, and strict variant validation. Keeps owner and legacy message client identifiers as strings. Permissions allowaskoryolo. Runs retain origin, model, and variant metadata; waiting and failed states require their payloads. Freezes validated tool records, contexts, targets, approvals, and nested arguments. Calls retain definitions, effects, approvals, and backend/client/interaction targets; results exist exactly when settled. Outcomes distinguish success, failure, denial, cancellation, and uncertainty, including reasons and optional provider references. Interactions retain approval decisions or question answers and dismissals. Browser/mobile clients retain supported tool versions and revocation times. Grants bind the owner, conversation, client, call, context, definition, input digest, generation, and expiry. Pending actions require client targets and retain their blocking reason and nullable grant. Harness messages require the protocol version and run identity; tool parts retain complete records without extra lookups. Citations allow onlyhttp/httpsURLs. Missing message fields default to text parts,clientId: null, and harnessincomplete: false. Legacy parsing discards supplied authority and parts; compatibility defaults remain until old records and callers disappear. Snapshots require recovery fields independently of recent messages, including opaque history cursors, pending actions, and unresolved interactions. Active runs must be running, waiting, or stopping; queued runs must be queued. Events carry conversation, message, run, interaction, or nullable client-action payloads. Event cursors accept zero, while event sequences require positive integers. Exports the normalizedConversation,Message,Run,ToolCall,ToolOutcome,Interaction,Client,ExecutionGrant,Snapshot, andEventEnvelopetypes separately from producer inputs.Tests: 1 file added (A; test; +410/−0 lines):
packages/agent-harness/src/contracts.test.ts. Covers normalization, serialization, authority retention, immutability, recovery fields, and invalid variants. The handoff reports 114 passing contract tests and passing scoped checks.Generated: 0 files changed.
Verification
No manual tests ran for this description. This level adds inert portable schemas only.
Visual Changes
Visual Changes: N/A
Reviewer Notes
Human steps
No human steps are required before or after merge.
Scope and worktrees
Kilo-Org/cloud./Users/igor/Projects/.worktrees/shared-agent-harness-3bb0.shared-agent-harness-3bb0-s2; base:origin/shared-agent-harness-3bb0.Notes
E2E: This level adds inert portable schemas only. Full runtime 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 #5632shared-agent-harness-3bb0-s2— feat(agent-harness): define portable domain and snapshots #5637 ← this PRshared-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 #5647 (tip)