Skip to content

feat: Gremlin chaos adapter + arch-gate governance#2

Merged
johnpatrickwarren-oss merged 2 commits into
mainfrom
feat/gremlin-adapter
Jun 4, 2026
Merged

feat: Gremlin chaos adapter + arch-gate governance#2
johnpatrickwarren-oss merged 2 commits into
mainfrom
feat/gremlin-adapter

Conversation

@johnpatrickwarren-oss
Copy link
Copy Markdown
Owner

Finishes the Gremlin chaos-platform adapter (was a v1 stub) and arms anvil with an architectural-invariant gate.

What's here

  • Gremlin adapter — pure translateGremlinAttack (network-free) split from the network call, mirroring the Chaos Mesh pattern; fetchExpectedFailurePattern GETs /v1/attacks/{ref} via an injectable fetch client. +14 tests (45 total, green).
  • Governancearch-invariants.json (no-god-functions/files, no-secrets, self-guard meta-ratchet) + a PR gate (.github/workflows/arch-gate.yml) that runs the public sprag engine and blocks on a violation or a rule relaxation.

Note

This PR was built under its own gate: the classifier is a taxonomy lookup (not an 8-case switch) so complexity stays under the no-god-functions limit by construction. The arch-gate check on this PR is the gate enforcing itself.

🤖 Generated with Claude Code

johnpatrickwarren-oss and others added 2 commits June 3, 2026 16:05
Arms an architectural-invariant contract on anvil (previously the only DeploySignal-family
repo without one) and a PR gate that enforces it:

- arch-invariants.json / .baseline.json — no-god-functions (ts, complexity ≤12),
  no-god-files (≤500), no-secrets, and self-guard (the meta-ratchet: the config itself
  can't be relaxed to pass).
- .github/workflows/arch-gate.yml — runs the gate (public sprag) on every PR and blocks
  on a violation or a rule relaxation. No dependency on private tooling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirrors the Chaos Mesh split — pure translation separated from the network call:

- adapters/gremlin-translate.ts — pure, network-free translateGremlinAttack(attack, now).
  Table-driven attack-type taxonomy (latency/blackhole/packet_loss → network_*; cpu/memory
  → *_stress; shutdown/process_killer → pod_*; time_travel → time_skew; unknown →
  gremlin_<type>), attack.length → recovery_seconds; throws on a missing/zero fault window.
- adapters/gremlin.ts — fetchExpectedFailurePattern / fetchChaosExperimentContext now GET
  /v1/attacks/{ref} via an injectable FetchLike client (defaults to globalThis.fetch), then
  delegate to the translator. fetchDeployContext/emitVerdict remain stubs.
- test/q29-gremlin-translation.test.ts — a case per attack-type mapping, missing/zero-length
  throws, and a fetch test with a fake client (URL + auth headers, non-2xx rejection).

The classifier is a taxonomy lookup (not an 8-case switch) so cyclomatic complexity stays
under the gate's limit by construction — the no-god-functions invariant never had to fire.
+14 tests (45 total green); the arch-gate passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@johnpatrickwarren-oss johnpatrickwarren-oss merged commit ed2c248 into main Jun 4, 2026
1 check passed
@johnpatrickwarren-oss johnpatrickwarren-oss deleted the feat/gremlin-adapter branch June 4, 2026 03:13
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