Skip to content

test(runtime): define fault injection contract#925

Closed
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/fault-injection-contract
Closed

test(runtime): define fault injection contract#925
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/fault-injection-contract

Conversation

@luoye520ww

Copy link
Copy Markdown
Collaborator

Problem

The reliability plan needs deterministic fault injection for crash, SSE, network, storage, and credential-store scenarios, but there is no constrained contract to keep test faults out of normal behavior.

Scope

Adds a fixed fault-kind allowlist, disabled-by-default spec normalization, one-shot/repeated activation semantics, and a bounded delay (0-60 seconds). Trigger checks revalidate untrusted specs and fail closed.

Non-goals

No production runtime hooks, environment activation, network interception, storage mutation, or UI are included. Those are separate integration PRs.

Tests

  • npm.cmd --prefix kun test -- tests/fault-injection.test.ts (9 passed)
  • npm.cmd run typecheck
  • npm.cmd --prefix kun run typecheck
  • npm.cmd run lint
  • npm.cmd run build
  • git diff --check

Review

Completed functional, lifecycle, data integrity, security, cross-platform, compatibility, and scope review. No package smoke is claimed because this PR contains a pure test contract.

Issue

Part of #885

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

This is superseded by #953, which keeps the fault-injection contract and wires it into the bounded Node HTTP/SSE runtime boundary with full typecheck, test, Linux, Windows, and macOS validation. Closing the contract-only PR to avoid duplicate review.

@luoye520ww luoye520ww closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant