Logo: Configuration Drift Detection Across Environments

Configuration Drift Detection Across Environments

Communautéit
HimanshuJ16
configuration-drift-detection-across-environments

Benotzt dëst, ier e Konfiguratiounsbaum op enger Plaz a Kraaft trëtt, vun där aus Orderen ausgeléist kënne ginn, fir sécherzestellen, datt en der approuvéierter Basisversioun entsprécht. Erkannt feelend Schlësselen, geännert Wäerter an onbemierkt Ännerunge vun Datentypen, déi aus enger Debugging-Sessioun iwwerholl goufen.

Iwwersiicht

EditeurHimanshuJ16
RepositoryAlgo-Trading-Skills
Skill-Nummconfiguration-drift-detection-across-environments
Stären
50
Forks
7
Matgeliwwert Dateien
5
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    HimanshuJ16 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Configuration Drift Detection Across Environments an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/configuration-drift-detection-across-environments
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/configuration-drift-detection-across-environments .claude/skills/configuration-drift-detection-across-environments
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Configuration Drift Detection Across Environments an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Configuration Drift Detection Across Environments automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Configuration Drift Detection Across Environments net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

When to Use

Invoke this skill when a configuration tree is about to take effect in an environment that can send orders, and you need positive evidence that it matches the baseline someone actually approved. The failure it prevents is specific: a risk parameter edited in staging for a debugging session and carried into production, a broker_endpoint still pointing at sandbox after a promotion, a max_order_usd that arrived as the string "100000" and silently disabled a numeric comparison downstream.

Use it in two places, not one: as a CI/CD gate before an artifact is promoted, and again during process initialization before the trading socket opens. The first catches the mistake earlier; the second is the one that actually protects live capital, because it runs on the host and against the file the engine will really read.

When NOT to Use

Do not use it when:

  • The two environments are supposed to differ structurally. This detector compares one tree against one baseline. A research sandbox with a different schema entirely will produce noise, not signal — see research-environment-vs-production-environment-parity for that comparison.
  • You need to know what changed over time in one environment. This is a two-way comparison at a point in time, not a change log. Use audit-logging-for-configuration-changes for the who/when/why record.
  • You have not decided which config is authoritative. If two candidate baselines exist, the audit result is arbitrary. Designate the Golden Source first (reference-data-golden-source-designation).
  • What you actually need is approval workflow. Detecting that a risk limit drifted is not the same as governing who may change it; see risk-control-configuration-change-approval-workflow.
  • The value you care about is not in the config file. A limit injected at runtime by a feature-flag service or mutated by an operator after startup is invisible to this audit, which compares configuration to configuration.

Prerequisites

  • A single designated Golden Source configuration tree, version-controlled, loaded as a dict.
  • The target environment configuration, loaded from the same source the trading process will actually read — not a copy prepared for the audit.
  • An explicit override policy, split two ways:
    • allowed_overrides — connectivity, naming and logging keys that legitimately differ (env_name, api_url, broker_endpoint, log_level, port, host, db_name). Pass an empty set for zero-tolerance auditing.
    • protected_keys — risk-control parameters that may never be whitelisted. The built-in DEFAULT_PROTECTED_KEYS is a starting point keyed on leaf name; extend it with the risk parameters your own schema uses.
  • A caller that treats is_compliant is False as a hard stop, with the authority to fail the pipeline or abort startup.

Workflow

  1. Ingest both trees. Load golden_baseline and target_config as dicts. Non-dict input raises TypeError rather than being audited partially.
  2. Flatten to dot-separated paths. Nested dicts collapse to system.api_url. Two distinct keys that flatten to the same path (a literal "a.b" alongside a nested {"a": {"b": ...}}) raise ValueError — one branch would otherwise be dropped from the audit and real drift could surface as a PASS. An empty nested dict is kept as a leaf so a whole missing section is still reported.
  3. Classify every key in the union of both trees:
    • Key in baseline, missing from target → CRITICAL. This holds even for whitelisted keys: an override may change a value, not delete a setting the engine expects to read.
    • Value or type differs on a protected key → CRITICAL, regardless of the whitelist.
    • Value or type differs on a whitelisted, non-protected key → ALLOWED.
    • Value or type differs otherwise → CRITICAL.
    • Key in target, absent from baseline → WARNING.
  4. Decide. critical_drift_count > 0 sets is_compliant = False. Block the promotion or abort initialization before the socket opens — do not connect first and alert afterwards. On a compliant report with warnings, proceed but route the WARNING items to human review.
  5. Record. Persist report.drift_items to the deployment audit log alongside the authorizing person. For firms in scope of MiFID II RTS 6 this record supports the Art. 5(7) and Art. 11 obligations — see references/standards.md for what those articles do and do not require.

Full procedure: see references/workflows.md. Standards reference: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Whitelisting a risk parameter to silence a noisy alert. Adding max_position_size to allowed_overrides does not fix the drift; it disables the gate on exactly the value the gate exists to protect. The detector refuses this at construction time, but the same instinct reappears as "let me just widen protected_keys's exceptions" — resolve the drift instead.
  • Assuming an empty whitelist means strict. It does now, and that is a fix, not a given: this detector previously treated allowed_overrides=set() as falsy and substituted the permissive built-in default, turning the strictest possible request into the loosest available policy. If you have forked or reimplemented this pattern, check that line.
  • Reading a PASS as "the environments are identical." Extra keys in the target are WARNING and never block, because the baseline cannot know what a legitimately-added key means. A config with an unreviewed extra flag passes this audit.
  • Whitelisting by bare leaf name when you meant one section. api_url in allowed_overrides whitelists that name everywhere in the tree, including under a section you never intended to relax. Use the exact path system.api_url when the override should be scoped.
  • Ignoring type coercion drift. max_order_qty as the string "100" instead of the integer 100 compares as drift here precisely because it will not compare as a number downstream. Do not "fix" a type-mismatch alert by relaxing the comparison.
  • Post-startup auditing. Running the check after the trading engine is live reports a breach rather than preventing one.
  • Auditing a file the engine never opens. A pipeline that audits prod_baseline.json from the repo while the host loads a locally-templated config proves nothing about the host.

Verification

  • Instantiate ConfigurationDriftDetector with allowed_overrides={"api_url"}. Feed a Golden Source config and a target whose max_order_usd is 1,000,000 against a baseline of 100,000: the report must show CRITICAL severity, the description must name it as a protected risk-control parameter, and is_compliant must be False. Change only api_url instead: allowed_override_count must be 1 and is_compliant True.
  • Confirm the gate cannot be disabled: ConfigurationDriftDetector(allowed_overrides={"max_position_size"}) must raise ValueError.
  • Confirm zero tolerance is honoured: ConfigurationDriftDetector(allowed_overrides=set()) must flag a broker_endpoint change as CRITICAL, not ALLOWED.
  • Run python -m unittest discover -s skills/configuration-drift-detection-across-environments/scripts and confirm all 28 tests pass.

Related Skills

  • research-environment-vs-production-environment-parity
  • environment-parity-dev-staging-production
  • blue-green-deployment-for-live-strategy-updates
  • audit-logging-for-configuration-changes
  • risk-control-configuration-change-approval-workflow
  • reference-data-golden-source-designation

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Configuration Drift Detection Across Environments?

Benotzt dëst, ier e Konfiguratiounsbaum op enger Plaz a Kraaft trëtt, vun där aus Orderen ausgeléist kënne ginn, fir sécherzestellen, datt en der approuvéierter Basisversioun entsprécht. Erkannt feelend Schlësselen, geännert Wäerter an onbemierkt Ännerunge vun Datentypen, déi aus enger Debugging-Sessioun iwwerholl goufen.

Firwat Configuration Drift Detection Across Environments op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Configuration Drift Detection Across Environments besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Configuration Drift Detection Across Environments an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/configuration-drift-detection-across-environments an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Configuration Drift Detection Across Environments benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Configuration Drift Detection Across Environments benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Configuration Drift Detection Across Environments domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Configuration Drift Detection Across Environments gratis?

Jo. HimanshuJ16 huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇