-
Notifications
You must be signed in to change notification settings - Fork 3
Build 956: Audit Remediation #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3b43e6
a38e7df
2043e37
67e94d0
9c86228
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "customInstructions": "CRITICAL: You must read, ingest, and strictly adhere to the permanent project standards defined in the `.agent/standards_manifesto.md` file before making any code suggestions or architectural decisions. Do not deviate from those rules. The manifesto is the absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity." | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,39 +1,6 @@ | ||||||
| # Cursor Rules: Universal OR Strategy V12 (Full Mirror) | ||||||
| # Cursor Rules: Universal OR Strategy V12 | ||||||
|
|
||||||
| Follow these rules for ALL code modifications. Reference **[.agent/standards_manifesto.md](file:///.agent/standards_manifesto.md)** for permanent safety standards. | ||||||
| **CRITICAL INSTRUCTION FOR CURSOR AI:** | ||||||
| You must read, ingest, and strictly adhere to the permanent project standards defined in the `c:\WSGTA\universal-or-strategy\.agent\standards_manifesto.md` file before making any code suggestions or architectural decisions. | ||||||
|
||||||
| You must read, ingest, and strictly adhere to the permanent project standards defined in the `c:\WSGTA\universal-or-strategy\.agent\standards_manifesto.md` file before making any code suggestions or architectural decisions. | |
| You must read, ingest, and strictly adhere to the permanent project standards defined in the `.agent/standards_manifesto.md` file before making any code suggestions or architectural decisions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical inline rules removed — AI reviewers lose key guardrails
The previous .cursorrules contained several project-specific rules that are not derivable from a general read of the manifesto, including:
- ASCII-only string literals — Unicode in
Print()causes 300+ NinjaTrader compile errors (Build 936 incident). stateLockrequirement for allactivePositions/expectedPositionsmutations.- Auto-reject conditions (e.g.
Account.Flatten()on background threads, stateless IPC decoder, blanketexpectedPositions[key] = 0). - Naming conventions for signals (BMad Protocol).
Cursor AI reads .cursorrules directly as its active context — it does not automatically chase transitive references to other files. Replacing all inline rules with a single-line pointer means any Cursor session operating outside this repository root (or without the manifesto pre-loaded) will have no actionable constraints. The high-severity rules that caused real production incidents (ASCII-only, stateLock) should stay inline, even if abbreviated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "absolute absolute" (duplicate word).
Line 6 contains a repeated word.
✏️ Proposed fix
-Do not deviate from those rules. The manifesto is the absolute absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity.
+Do not deviate from those rules. The manifesto is the absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Do not deviate from those rules. The manifesto is the absolute absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity. | |
| Do not deviate from those rules. The manifesto is the absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursorrules at line 6, Remove the duplicated word "absolute" in the
manifesto sentence that currently reads "absolute absolute single source of
truth" by editing the phrase to "absolute single source of truth" (locate the
occurrence of "absolute absolute" and delete the extra "absolute").
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,49 +1,6 @@ | ||||||
| # Copilot Code Review Instructions — Universal OR Strategy V12 | ||||||
| # GitHub Copilot / Codex Rules: Universal OR Strategy V12 | ||||||
|
|
||||||
| You are reviewing a **high-integrity institutional futures trading strategy** for NinjaTrader 8 (C#). | ||||||
| Lives and capital are on the line. Apply Zero-Trust protocols to every review. | ||||||
| **CRITICAL INSTRUCTION FOR COPILOT/CODEX:** | ||||||
| You must read, ingest, and strictly adhere to the permanent project standards defined in the `.agent/standards_manifesto.md` file before making any code suggestions or architectural decisions. | ||||||
|
|
||||||
| ## Primary Review Focus | ||||||
|
|
||||||
| ### 1. Zero-Trust IPC (CRITICAL) | ||||||
| - All TCP commands must arrive via loopback (127.0.0.1) only — reject any external binding | ||||||
| - Every command must pass the `AllowedIpcActions` allowlist before execution | ||||||
| - UTF-8 decoding must use a **stateful per-client decoder** — never `Encoding.GetString()` on a raw buffer (split-packet risk) | ||||||
| - Queue depth must be bounded (`IpcMaxQueueDepth`) to prevent memory exhaustion | ||||||
| - No command longer than `IpcMaxCommandLength` should be processed | ||||||
|
|
||||||
| ### 2. SIMA Fleet Dispatch (CRITICAL) | ||||||
| - `expectedPositions` mutations MUST be serialized under `stateLock` | ||||||
| - `_dispatchSyncPendingExpKeys` barriers must be set before and cleared after every fleet submit | ||||||
| - Reserved quantities must be rolled back (`AddExpectedPositionDeltaLocked(key, -delta)`) on any Submit exception | ||||||
| - Fleet registration (activePositions, entryOrders, stopOrders) must happen BEFORE `expectedPositions` is incremented | ||||||
|
|
||||||
| ### 3. REAPER Safety (CRITICAL) | ||||||
| - Fill-grace must be **per-account** (`_accountFillGraceTicks[expKey]`), never a single global timestamp | ||||||
| - Repair orders must be gated by `min(ATR bound, RepairTickFence)` distance from current price | ||||||
| - REAPER must never fire on the Master account (uses `SubmitOrderUnmanaged`, not follower path) | ||||||
| - `_repairInFlight` guard must be set before and cleared after every repair submit | ||||||
|
|
||||||
| ### 4. Order Callbacks (HIGH) | ||||||
| - Callback fills must use **signed delta rollback**, never blanket zeroing of `expectedPositions` | ||||||
| - Ghost/zombie cleanup: only clear the specific `expKey` that was filled, not the entire account state | ||||||
| - Bracket orders must not be submitted until the master entry is confirmed filled | ||||||
|
|
||||||
| ### 5. Threading (HIGH) | ||||||
| - `Account.Flatten()` and `acct.Submit()` must NEVER be called from a background thread — always via `TriggerCustomEvent` | ||||||
| - No UI Updates (Draw*, Chart*) from background threads | ||||||
| - All `ConcurrentDictionary` reads are safe from background threads; `HashSet` reads MUST use `lock(stateLock)` | ||||||
|
|
||||||
| ## Naming Conventions (BMad Protocol) | ||||||
| - Entry signals: `Fleet_{AccountName}_{TradeType}_{index}` | ||||||
| - Stop signals: `Stop_{entryName}` (max 40 chars via `SymmetryTrim`) | ||||||
| - Target signals: `T{N}_{entryName}` (max 40 chars) | ||||||
| - Repair signals: must reuse the original `repairEntryName` key (NOT prefixed with "Repair_") | ||||||
|
|
||||||
| ## Auto-Reject Conditions | ||||||
| Do NOT approve any PR that contains: | ||||||
| - `Account.Flatten()` called directly on a background/Reaper thread | ||||||
| - `expectedPositions[key] = 0` without `stateLock` (blanket zeroing) | ||||||
| - `IsReaperFillGraceActive()` without an account key argument (global grace bug) | ||||||
| - `Encoding.UTF8.GetString(buffer, ...)` in the IPC receive loop (stateless decoder) | ||||||
| - Any IPC command processed without passing through `AllowedIpcActions` check | ||||||
| Do not deviate from those rules. The manifesto is the absolute absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: Duplicated word "absolute". The phrase "absolute absolute single source of truth" contains a duplicated word. Proposed fix-Do not deviate from those rules. The manifesto is the absolute absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity.
+Do not deviate from those rules. The manifesto is the absolute single source of truth for architecture, locking, repo hygiene, and multi-agent parity.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the Antigravity plan-audit gate back into the default loop.
The new loop and autonomy text jump from Sonnet handoff straight into implementation and PR creation. In a live-trading repo, that teaches agents to skip the explicit Antigravity review step that is supposed to catch mistakes before code lands.
Based on learnings,
Paste Sonnet's plan to Antigravity for audit before approving any live trading fix. Sonnet may catch brief errors.Also applies to: 168-173
🤖 Prompt for AI Agents