Adds the generic harness contract types for @mosaicstack/types (pure TypeScript: interfaces, discriminated unions, typed const arrays). No runtime behavior, no adapters, no Gateway/Web wiring — those are later Slice Zero tasks.
Traceability
Approved design:docs/plans/2026-08-11-p3-pi-first-harness-adapter-design.md, approval recorded in 18e0488d0.
Exactly 9 capabilities; exactly 19 stable error codes (both as typed const arrays with exhaustive assertNever switches).
HarnessEventEnvelope carries every persisted field (conversationId, nativeSessionId, turnId?, correlationId, sequence, nativeEntryCursor?, occurredAt, harnessId, selection).
No-substitution invariant type-enforced: effective selection is absent or exactly equals the selected selection; there is no field through which a divergent effective selection could be reported (spec runtime-asserts 'effectiveSelection' in error/receipt === false).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
P3 Slice Zero, Task 1 — generic harness contract types
Adds the generic harness contract types for
@mosaicstack/types(pure TypeScript: interfaces, discriminated unions, typed const arrays). No runtime behavior, no adapters, no Gateway/Web wiring — those are later Slice Zero tasks.Traceability
docs/plans/2026-08-11-p3-pi-first-harness-adapter-design.md, approval recorded in18e0488d0.575ad743a; base-pin/lane SSOT5f3ababd8.next@9185b0cc(unchanged at PR time).Files (6, path-fenced)
packages/types/src/harness/contracts.ts(new)packages/types/src/harness/events.ts(new)packages/types/src/harness/errors.ts(new)packages/types/src/harness/contracts.spec.ts(new)packages/types/src/harness/index.ts(new)packages/types/src/index.ts(appendexport * from './harness/index.js';)Design conformance (independently reviewed)
HarnessAdapter,HarnessSessionHandle,HarnessConversationService) reproduced verbatim.assertNeverswitches).HarnessEventEnvelopecarries every persisted field (conversationId, nativeSessionId, turnId?, correlationId, sequence, nativeEntryCursor?, occurredAt, harnessId, selection).'effectiveSelection' in error/receipt === false).Set(ids).size === 7).IProviderAdapter,AgentRuntimeProvider, orpackages/types/src/agent/**.Independent gates (author = pi ≠ verifier ≠ reviewer)
@mosaicstack/typespackage 77/77, typecheck/build/lint rc=0; path-fence holds (exactly the 6 files); parent == base.anyescape hatches defeating the discriminated-union exhaustiveness.Pre-push hook (typecheck/lint/format) passed on push. Merge-gate re-derivation to follow before merge.