feat: Gremlin chaos adapter + arch-gate governance#2
Merged
Conversation
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>
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.
Finishes the Gremlin chaos-platform adapter (was a v1 stub) and arms anvil with an architectural-invariant gate.
What's here
translateGremlinAttack(network-free) split from the network call, mirroring the Chaos Mesh pattern;fetchExpectedFailurePatternGETs/v1/attacks/{ref}via an injectable fetch client. +14 tests (45 total, green).arch-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-functionslimit by construction. The arch-gate check on this PR is the gate enforcing itself.🤖 Generated with Claude Code