Logo Configuration Drift Detection Across Environments

Configuration Drift Detection Across Environments

Cộng đồng
HimanshuJ16
configuration-drift-detection-across-environments

Dùng trước khi áp dụng cây cấu hình vào một môi trường có thể gửi lệnh, để xác minh cấu hình khớp với cấu hình chuẩn đã được phê duyệt; phát hiện khóa bị thiếu, giá trị bị thay đổi và kiểu dữ liệu bị đổi âm thầm từ phiên gỡ lỗi.

Tổng quan

Nhà phát hànhHimanshuJ16
Kho mãAlgo-Trading-Skills
Tên kỹ năngconfiguration-drift-detection-across-environments
Sao
50
Bản fork
7
Tệp đi kèm
5
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được HimanshuJ16 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Configuration Drift Detection Across Environments trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/configuration-drift-detection-across-environments
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Configuration Drift Detection Across Environments trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Configuration Drift Detection Across Environments ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Configuration Drift Detection Across Environments với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Configuration Drift Detection Across Environments làm được gì?

Dùng trước khi áp dụng cây cấu hình vào một môi trường có thể gửi lệnh, để xác minh cấu hình khớp với cấu hình chuẩn đã được phê duyệt; phát hiện khóa bị thiếu, giá trị bị thay đổi và kiểu dữ liệu bị đổi âm thầm từ phiên gỡ lỗi.

Vì sao nên dùng Configuration Drift Detection Across Environments trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Configuration Drift Detection Across Environments là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Configuration Drift Detection Across Environments trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/configuration-drift-detection-across-environments. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Configuration Drift Detection Across Environments?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Configuration Drift Detection Across Environments với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Configuration Drift Detection Across Environments với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Configuration Drift Detection Across Environments có miễn phí không?

Có. Kỹ năng này được HimanshuJ16 phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇