docs: define RunContract harness boundary#108
Conversation
There was a problem hiding this comment.
kapi-agent review
Verdict: APPROVE
Final approval summary
Review journey
This PR’s original goal is to define the RunContract Harness boundary before implementation work lands. The semantic scope is intentionally docs-only: add a README source-of-truth section that keeps RunContract generic and prevents GitHub/PR, Discord, kapi-agent, or Kade/Ragna semantics from leaking into core. There was no prior kapi-agent review ping-pong for this PR.
What changed
README.md adds a RunContract Harness Boundary section defining:
- RunContract as a projection over existing
WorkflowStateandWorkflowDefinition. - Core/runtime-adapter/external-adapter ownership boundaries.
- Explicit exclusions from core policy ownership.
- Small candidate vocabulary.
- A behavior-preserving implementation sequence for follow-up slices.
Why this is correct
The change is documentation-only and aligns with the stated issue: establish the boundary before code. It keeps core generic, reserves presentation/runtime rendering for adapters, and explicitly prevents external workflow policy semantics from becoming generic Kapi primitives.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 16 changed lines, below the 200-line limit.
- Revision-explanation status: not required; found.
- Inspected files/diff:
README.md,git diff origin/dev...HEAD.
Remaining risks and approval rationale
Remaining risk is limited to wording interpretation in later implementation PRs, not runtime behavior. Approval is justified because the PR is small, docs-only, passes verification, stays within the requested boundary, and introduces no blocking correctness, safety, or workflow-contract issue.
Blocking issues
None.
Warnings / risks
README.md: “pre-workflow projection” could be read ambiguously in future implementation work because the text also says it reads existingWorkflowStateplusWorkflowDefinition. This is not blocking, but follow-up PRs should preserve the intended meaning: pre-workflow-policy / supervisor projection, not a replacement lifecycle source of truth.
Suggestions
- In the first implementation PR, consider adding tests that assert RunContract does not persist
contract.jsonand does not introduce GitHub/PR-specific fields into core types.
Looks good
- The boundary clearly separates generic core concepts from external adapter interpretations.
- The vocabulary is intentionally small and additive.
- The implementation rhythm explicitly preserves existing workflow APIs, artifacts, validation gates, and CLI behavior.
Verification notes
- Verifier gate status: PASS —
npm ci && npm run verifyexited 0. - Size gate status: PASS — 16 changed lines < 200.
- Revision-explanation status: not required; found.
- Local inspection confirmed this PR only modifies
README.md.
Engine: pi
|
@kapi-agent review |
Summary
README.mdbefore the implementation slices land.Linked issue
Closes #97
Problem
Kapi already has workflow state, artifacts, evidence, workers, quality probes, and supervisor surfaces, but the docs did not define where the upcoming RunContract layer belongs. Without that boundary, later implementation slices could accidentally put GitHub issues, PR review, Discord lanes, or Kade/Ragna authority semantics into generic core types.
Options considered
Selected approach
Selected option: documentation-first boundary slice.
Why this one: issue #97 is design-sensitive and intentionally precedes #98-#102. A small README addition is enough to define RunContract as a generic, pre-workflow projection while keeping implementation and adapter semantics for later slices.
Risks/trade-offs: this is intentionally docs-only; the runtime projection still needs to land in follow-up PRs.
Implementation by file/surface
README.mdRunContract Harness Boundarysection.Ilchulremains product/documentation branding only; reusable identifiers should stay semantic.Why this fixes it
The issue asks for a source-of-truth boundary before implementation. The README now gives later slices a concrete contract: build generic RunContract primitives in core, keep presentation/runtime mapping in adapters, and keep GitHub/Ragna semantics outside the generic layer.
QA / Verification
git diff --cached --check— passnpm run verify— pass locally before the docs-only commit; output includedtests 393,pass 382,skipped 11, plustsc --noEmit,tsc --noEmit --noUnusedLocals --noUnusedParameters, andquality:budgetspassing with the existing non-failingcode_smellswarning.git diff --shortstat origin/dev...HEAD—1 file changed, 16 insertions(+).Anomalies observed
npm run verifyreports the existing non-failing quality budget warning:code_smells value=46 target="<=20" status=warn.Risks / Follow-up
kapi-agent review expectations and current-head merge gate
kapi-agentapproval and a successfulkapi-agent/reviewcheck when present.