Backtest Audit Trail For Regulatory Reviewのロゴ

Backtest Audit Trail For Regulatory Review

コミュニティ
HimanshuJ16
backtest-audit-trail-for-regulatory-review

バックテスト結果を生成した内容を正確に記録し、永続的に保存する必要がある場合に使用します。git commit SHA、ファイルごとのデータチェックサム、ハイパーパラメータマニフェスト、環境情報を記録し、外部の第三者に対する完全性を確保するためHMACで署名します。

Add to TypingMind

概要

公開者HimanshuJ16
リポジトリAlgo-Trading-Skills
スキル名backtest-audit-trail-for-regulatory-review
スター
50
フォーク
7
同梱ファイル
5
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    HimanshuJ16がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Backtest Audit Trail For Regulatory Review」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-audit-trail-for-regulatory-review
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをその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/backtest-audit-trail-for-regulatory-review .claude/skills/backtest-audit-trail-for-regulatory-review
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでBacktest Audit Trail For Regulatory Reviewを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にBacktest Audit Trail For Regulatory Reviewを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Backtest Audit Trail For Regulatory Reviewは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

When to Use

Invoke this skill when performing strategy validation prior to live deployment or institutional client presentation, and you need a durable record of exactly what code, data, and parameters produced a set of backtested numbers. It captures git commit SHA, per-file input data checksums, hyperparameters, performance metrics, and execution environment, then authenticates the record with HMAC-SHA256 so later modification by anyone without the signing key is detectable.

When NOT to Use

  • As proof to a regulator that your firm did not alter its own results. HMAC is symmetric: whoever can sign can also forge. This gives integrity against outsiders, not non-repudiation against the issuer. See the trust-boundary note below.
  • As a substitute for compliant recordkeeping storage. Under 17 CFR 240.17a-4(f) the durability obligation is met by the storage system (WORM or the audit-trail alternative), not by a hash embedded in a file.
  • For live order/trade event capture. Order and execution event reporting is a different obligation with different systems — see the CAT and RTS 25 notes in references/standards.md.
  • When you have not yet eliminated lookahead bias. An impeccably signed manifest for a biased backtest is a precisely documented wrong answer.

Trust Boundary — read before relying on this

An unkeyed hash over a manifest is not tamper-evidence. Anyone can edit the file, recompute the hash, and every check passes. Earlier versions of this skill made exactly that mistake. This version emits two separate values:

ValueWhat it provesWhat it does not prove
content_digest_sha256The bytes were not corrupted in transit or at rest. Anyone can recompute it.Nothing about authenticity.
manifest_hmac_sha256The record was produced by a holder of the signing key and has not been altered since.Nothing against the key holder themselves.

For assurance against the issuing firm, anchor trust outside it: asymmetric signatures with the private key held independently, an RFC 3161 timestamp authority, or third-party-administered write-once storage.

Prerequisites

  • Git repository with clean working tree — a commit SHA taken against uncommitted changes documents code that never existed.
  • Input data files accessible for checksumming.
  • Strategy parameter configuration (all tunable hyperparameters).
  • A signing key of ≥32 random bytes from a secrets manager or environment variable — never committed to the repository and never stored alongside the manifests it authenticates.
  • Standard library only: hashlib, hmac, json, platform.

Workflow

  1. Capture Lineage Metadata: Record git commit SHA (git rev-parse HEAD), UTC timestamp as integer nanoseconds, OS/architecture, and Python version. Confirm the working tree is clean first — if git status --porcelain is non-empty, stop; the SHA does not describe the code that ran.
  2. Compute Per-File Data Checksums: Stream each input file to compute SHA256 individually. Never hash a concatenation of files: a single aggregate digest tells you something changed but not which file, which is exactly what an auditor asks.
  3. Assemble Manifest: Organization, strategy ID, git SHA, per-file checksum map, all hyperparameters, performance metrics, execution metadata, data sources, notes. Any field left out of the signed payload is a field an attacker can change undetected — including the key ID.
  4. Digest and Authenticate: Serialize as canonical JSON (sorted keys, no whitespace, allow_nan=False), then compute both the unkeyed digest and the keyed HMAC. Reject non-finite metrics rather than serializing them — Python writes bare NaN, which is invalid JSON and unparseable by strict verifiers in other languages.
  5. Verify on Load: Check the HMAC, not just the digest. A manifest whose digest matches but whose HMAC does not has been re-digested by someone without the key — treat it as forged, not as corrupted.
  6. Store & Archive: Write to storage whose retention controls match your regulatory status. If you are a registered broker-dealer, 17 CFR 240.17a-4(f) requires either WORM or an audit-trail system that can recreate a modified or deleted record. Determine the applicable retention tier from the record's classification under 17a-3 — do not assume six years applies (see references/standards.md).

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

Common Pitfalls

  • Calling an Unkeyed Hash a Signature: A plain SHA256 embedded in the record it describes is a checksum. Recomputing it after editing takes three lines. Use a keyed MAC or an asymmetric signature.
  • Testing Tamper Detection Without Re-Signing: Mutating a field and asserting verification fails only proves the digest covers that field. The real adversary recomputes the digest. A tamper test that never re-signs tests nothing about forgery.
  • Storing the Signing Key With the Manifests: A key in the same bucket, repo, or backup set as the records it authenticates provides no protection against anyone who can reach the records.
  • Untracked Code Modifications: Running a backtest against a dirty working tree — the SHA is meaningless for audit.
  • Single Aggregate Checksum: Hashing concatenated data instead of per-file checksums masks which input changed.
  • Non-Canonical JSON Serialization: Unsorted keys, incidental whitespace, or NaN/Infinity values break verification across implementations.
  • Aliasing Caller State: Holding a reference to the caller's parameter dict rather than a copy means the "immutable" manifest silently changes after signing.
  • Float Formatting Across Languages: Metrics stored as JSON floats may re-serialize differently in another runtime and break byte-level canonical comparison. Where cross-toolchain verification matters, encode metrics as decimal strings.
  • Assuming a Retention Period: 17a-4 sets different tiers for different record classes and applies to registered broker-dealers. Asserting "six years" for a research artifact is unsupported.

Verification

  • Run python -m unittest discover -s skills/backtest-audit-trail-for-regulatory-review/scripts — 100% pass rate (32 tests).
  • Forgery test (the one that matters): modify a metric, recompute content_digest_sha256, then verify. The digest will match and verification must still fail on the HMAC.
  • Confirm a manifest signed with a different key, or a different signing_key_id, fails verification.
  • Confirm mutating the caller's parameter dict after build_manifest does not change the manifest.
  • Confirm non-finite metrics are rejected at build time rather than serialized.

Related Skills

  • backtest-determinism-and-reproducibility — ensures bit-identical runs; this skill records what was run
  • paper-to-live-promotion-checklist — final gate before live capital; requires a valid audit trail
  • lookahead-bias-elimination — must pass before an audit trail is meaningful
  • walk-forward-validation-setup — validation methodology whose results belong in the manifest
  • centralized-secrets-management-vault-integration — where the signing key should live
  • record-retention-periods-by-jurisdiction — determining the applicable retention tier

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Backtest Audit Trail For Regulatory Review」では何ができますか?

バックテスト結果を生成した内容を正確に記録し、永続的に保存する必要がある場合に使用します。git commit SHA、ファイルごとのデータチェックサム、ハイパーパラメータマニフェスト、環境情報を記録し、外部の第三者に対する完全性を確保するためHMACで署名します。

TypingMindでBacktest Audit Trail For Regulatory Reviewを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Backtest Audit Trail For Regulatory Reviewはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにBacktest Audit Trail For Regulatory Reviewをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/backtest-audit-trail-for-regulatory-reviewを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Backtest Audit Trail For Regulatory Reviewを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Backtest Audit Trail For Regulatory Reviewで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもBacktest Audit Trail For Regulatory Reviewを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Backtest Audit Trail For Regulatory Review」は無料ですか?

はい。HimanshuJ16がApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇