Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e9b1763
infra: mandatory PR hygiene gate + CI hardening [Build 1111.011]
mkalhitti-cloud May 20, 2026
f44543b
fix: purge non-ASCII from Markdown to satisfy Jules audit [Build 1111…
mkalhitti-cloud May 20, 2026
c74c8e0
fix: PHS Perfection Loop - PR #110
mkalhitti-cloud May 20, 2026
c546920
fix: purge emojis from workflow_health.md to satisfy Jules ASCII audi…
mkalhitti-cloud May 20, 2026
8810b9c
infra: upgrade Jules to Native GitHub Check Run (Kilo-parity) [Build …
mkalhitti-cloud May 20, 2026
6432df4
fix: Jules API 401 - restore exact manual trigger logic [Build 1111.015]
mkalhitti-cloud May 20, 2026
006b56e
fix: rewrite Jules trigger to use fetch API to prevent 401 header ble…
mkalhitti-cloud May 21, 2026
751d385
fix: Jules API - use Authorization: Bearer for OAuth token support [B…
mkalhitti-cloud May 21, 2026
2a12a92
fix: Jules API - revert to proven https and x-goog-api-key pattern [B…
mkalhitti-cloud May 21, 2026
db40d90
infra: switch to official Jules SDK for Gemini-style native audits [B…
mkalhitti-cloud May 21, 2026
18b4b87
fix: remove npm cache to unblock Jules SDK workflow [Build 1111.020]
mkalhitti-cloud May 21, 2026
71ca4c0
fix: convert Jules SDK script to ESM (.mjs) to satisfy export require…
mkalhitti-cloud May 21, 2026
4893acc
fix: Jules SDK - correct API method names to session() and result() […
mkalhitti-cloud May 21, 2026
3b525ae
infra: restore full PR review team - expanded path filters [Build 111…
mkalhitti-cloud May 21, 2026
8a009cc
infra: force trigger full 28-audit fleet - fixed path filters [Build …
mkalhitti-cloud May 21, 2026
74ceaab
infra: force-trigger AI audits - removed path filters for diagnostics…
mkalhitti-cloud May 21, 2026
515398d
diag: Jules API 401 - bypass script and use official CLI to confirm k…
mkalhitti-cloud May 21, 2026
7453cec
fix: Jules REST API - implement documented X-Goog-Api-Key pattern [Bu…
mkalhitti-cloud May 21, 2026
d877eb2
fix: indestructible Jules reporting - ensure failure conclusion on 40…
mkalhitti-cloud May 21, 2026
3a0c4c5
fix: apply Jules native integration fix from extracted zip [Build 111…
mkalhitti-cloud May 21, 2026
38dd7d8
infra: remove redundant custom Jules workflow in favor of official Gi…
mkalhitti-cloud May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .bob/commands/pr-loop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
description: Repeatable 100/100 Perfection Loop. Iteratively repairs and verifies code until the Project Health Score is 100/100.
argument-hint: <pr-number>
---
# PR PERFECTION LOOP (pr-loop)
**Target PR:** $1
**Goal:** 100/100 (25/25 Points)
**Mode:** Orchestrator (YOLO-parity)
**Protocol:** V12 Autonomous Perfection mandate.

You are the V12 Perfection Orchestrator. You MUST NOT STOP until PHS is 100/100.

---

## ORCHESTRATION RULES

- **SCORE 100 MANDATE**: You are BANNED from merging or ending the loop if PHS < 100.
- **HYGIENE GATE**: You MUST pass Step 0 (Clean Branch & Diff Size) before every push.
- **LOCAL FIRST**: You must achieve Local Score 15/15 before every push.
- **FORENSIC AUDIT**: Every failure must be categorized as [VALID], [HALLUCINATION], [INFRA-NOISE], or [ACCESS_BLOCKED].
- **F5 GATE**: The only manual action is the final NinjaTrader verification at Score 100.

---

## THE PERFECTION CYCLE

### Step 0: Pre-Flight Hygiene (MANDATORY)
**Switch to: Advanced mode**
Hand off:
```
TASK: Verify PR Hygiene
PROTOCOL:
1. Run `powershell -File .\scripts\verify_pr_hygiene.ps1`.
2. If FAIL: HALT and report the violation (e.g. "Diff > 10k" or "Branch is dirty").
3. If PASS: Advance to Step 1.
```
Comment on lines +30 to +36

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add language identifiers to fenced code blocks.

The three fenced blocks are missing language tags, which triggers markdownlint MD040 and can fail docs hygiene checks.

Suggested patch
-```
+```text
 TASK: Verify PR Hygiene
 PROTOCOL:
   1. Run `powershell -File .\scripts\verify_pr_hygiene.ps1`.
   2. If FAIL: HALT and report the violation (e.g. "Diff > 10k" or "Branch is dirty").
   3. If PASS: Advance to Step 1.

@@
- +text
TASK: Local Repair & Hygiene
INPUT: PR #$1 bot findings + local lint/test results.
PROTOCOL:

  1. FIX all surgical violations (braces, sealed classes, complexity).
  2. CATEGORIZE issues in docs/brain/workflow_health.md ([VALID], [HALLUCINATION], [INFRA-NOISE]).
  3. VERIFY: Run powershell -File .\scripts\calculate_fleet_score.ps1.
  4. If Score < 15, repeat Step 1.
  5. If Score = 15, emit: [LOCAL-READY] PHS 15/15.
@@
-```
+```text
TASK: Global Audit & Monitor
PROTOCOL:
  1. git add . && git commit -m "fix: PHS Perfection Loop - PR #$1" && git push
  2. monitor_pr_checks $1 (Wait for all bots).
  3. Run `powershell -File .\scripts\calculate_fleet_score.ps1 -PrNumber $1`.
  4. If Score < 100, emit: [PHS-RETRY] Current: X/100.
  5. If Score = 100, emit: [PHS-PERFECT] 100/100.
</details>
 


Also applies to: 41-50, 55-63

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 30-30: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.bob/commands/pr-loop.md around lines 30 - 36, Add language identifiers to
the three fenced code blocks so markdownlint MD040 is satisfied: update the
fences surrounding the blocks that start with "TASK: Verify PR Hygiene", "TASK:
Local Repair & Hygiene", and "TASK: Global Audit & Monitor" to use a language
tag such as "text" (i.e., change totext for each of those fenced blocks)
so the docs pass hygiene checks; apply the same change to the other occurrences
mentioned (lines referenced in the review: the additional blocks at 41-50 and
55-63).


</details>

<!-- fingerprinting:phantom:poseidon:hawk -->

<!-- This is an auto-generated comment by CodeRabbit -->


### Step 1: Local Integrity (Goal: 15/15)
**Switch to: v12-engineer mode**
Hand off:
```
TASK: Local Repair & Hygiene
INPUT: PR #$1 bot findings + local lint/test results.
PROTOCOL:
1. FIX all surgical violations (braces, sealed classes, complexity).
2. CATEGORIZE issues in docs/brain/workflow_health.md ([VALID], [HALLUCINATION], [INFRA-NOISE]).
3. VERIFY: Run `powershell -File .\scripts\calculate_fleet_score.ps1`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: Missing required script scripts/calculate_fleet_score.ps1. Both Step 1 (Local Integrity) and Step 2 (Global Audit) instruct the orchestrator to run this script to calculate the fleet/health score, but the file does not exist in the repository. The workflow will fail at runtime when attempting to execute this command.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .bob/commands/pr-loop.md, line 47:

<comment>Missing required script `scripts/calculate_fleet_score.ps1`. Both Step 1 (Local Integrity) and Step 2 (Global Audit) instruct the orchestrator to run this script to calculate the fleet/health score, but the file does not exist in the repository. The workflow will fail at runtime when attempting to execute this command.</comment>

<file context>
@@ -0,0 +1,73 @@
+PROTOCOL:
+  1. FIX all surgical violations (braces, sealed classes, complexity).
+  2. CATEGORIZE issues in docs/brain/workflow_health.md ([VALID], [HALLUCINATION], [INFRA-NOISE]).
+  3. VERIFY: Run `powershell -File .\scripts\calculate_fleet_score.ps1`.
+  4. If Score < 15, repeat Step 1.
+  5. If Score = 15, emit: [LOCAL-READY] PHS 15/15.
</file context>

4. If Score < 15, repeat Step 1.
5. If Score = 15, emit: [LOCAL-READY] PHS 15/15.
```

### Step 2: Global Integrity (Goal: 25/25)
**Switch to: Advanced mode**
Hand off:
```
TASK: Global Audit & Monitor
PROTOCOL:
1. git add . && git commit -m "fix: PHS Perfection Loop - PR #$1" && git push
2. monitor_pr_checks $1 (Wait for all bots).
3. Run `powershell -File .\scripts\calculate_fleet_score.ps1 -PrNumber $1`.
4. If Score < 100, emit: [PHS-RETRY] Current: X/100.
5. If Score = 100, emit: [PHS-PERFECT] 100/100.
```

### Step 3: Loop Control
- If [PHS-RETRY]: **Restart at Step 1.**
- If [PHS-PERFECT]: **Advance to final F5 verification.**

---

## FINAL HANDSHAKE
Once 100/100 is achieved, STOP and ask Director:
"PHS 100/100 achieved. Please press F5 in NinjaTrader. Type 'F5 done' to merge."
30 changes: 24 additions & 6 deletions .codacy.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Removing obj/** and bin/** from exclude_paths will cause Codacy to scan .NET build output directories. This wastes CI resources on compiled binaries/intermediate artifacts and can produce false positives from auto-generated code. Add both back to exclude_paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .codacy.yaml, line 14:

<comment>Removing `obj/**` and `bin/**` from `exclude_paths` will cause Codacy to scan .NET build output directories. This wastes CI resources on compiled binaries/intermediate artifacts and can produce false positives from auto-generated code. Add both back to `exclude_paths`.</comment>

<file context>
@@ -1,17 +1,35 @@
+  remark-lint: false
+
 exclude_paths:
+  - "scripts/**"
   - "docs/**"
-  - ".github/**"
</file context>

engines:
csharp: true
markdown: false
python: false
shell: false
duplication: false
prospector: false
pylint: false
bandit: false
remark-lint: false

exclude_paths:
- "scripts/**"
- "docs/**"
- ".github/**"
- "**/*.md"
- "testsprite_tests/**"
- ".agent/**"
- ".agents/**"
- ".bob/**"
- ".codex/**"
- ".cursor/**"
- ".gemini/**"
- ".antigravitycli/**"
- "Traycerrefactor/**"
- "artifacts/**"
- "benchmarks/**"
- "node_modules/**"
- "obj/**"
- "bin/**"
- "**/*.md"
- "**/*.py"
- "**/*.ps1"
- "**/*.bat"
- "**/*.json"
- "**/*.yaml"
- "**/*.yml"
- "deploy-sync.ps1"
- "check_ascii.py"
- "fix_skills.py"
22 changes: 22 additions & 0 deletions .codacyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
scripts/**
docs/**
testsprite_tests/**
.agent/**
.agents/**
.bob/**
.codex/**
.cursor/**
.gemini/**
.antigravitycli/**
Traycerrefactor/**
artifacts/**
**/*.md
**/*.py
**/*.ps1
**/*.bat
**/*.json
**/*.yaml
**/*.yml
deploy-sync.ps1
check_ascii.py
fix_skills.py
8 changes: 8 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ lang_version = "8.0"
exclude_patterns = [
"docs/**",
".github/**",
"scripts/**",
"**/*.md",
"**/*.py",
"**/*.ps1",
"**/*.bat",
"**/*.json",
"**/*.yaml",
"**/*.yml",
".agent/**",
".agents/**",
".bob/**",
".codex/**",
".cursor/**",
".gemini/**",
".antigravitycli/**",
"Traycerrefactor/**",
"artifacts/**",
"benchmarks/**"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ name: CodeQL
on:
push:
branches: ["main", "dev"]
paths:
- 'src/**/*.cs'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The added paths filter under pull_request contradicts the existing comment, which states CodeQL runs on ALL PRs for maximum coverage. The paths filter will silently skip CodeQL on PRs that change only non-C# files (e.g., workflow YAML, scripts, docs), reducing PR-time coverage. Either remove the paths filter from pull_request (to preserve all-PR coverage) or update the comment to reflect the new narrower scope.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/codeql.yml, line 7:

<comment>The added `paths` filter under `pull_request` contradicts the existing comment, which states CodeQL runs on ALL PRs for maximum coverage. The `paths` filter will silently skip CodeQL on PRs that change only non-C# files (e.g., workflow YAML, scripts, docs), reducing PR-time coverage. Either remove the `paths` filter from `pull_request` (to preserve all-PR coverage) or update the comment to reflect the new narrower scope.</comment>

<file context>
@@ -3,9 +3,14 @@ name: CodeQL
   push:
     branches: ["main", "dev"]
+    paths:
+      - 'src/**/*.cs'
+      - 'tests/**/*.cs'
   pull_request:
</file context>

- 'tests/**/*.cs'
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
pull_request:
# CodeQL runs on ALL PRs regardless of target branch for maximum coverage.
# Previously limited to main -- expanded to catch vulnerabilities in feature branches before merge.
paths:
- 'src/**/*.cs'
- 'tests/**/*.cs'
schedule:
- cron: "0 6 * * 1"

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/gemini-pr-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Gemini Standards Auditor (Vertex AI)
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'src/**/*.cs'
- 'tests/**/*.cs'

jobs:
gemini-audit:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/jules-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Jules PR Review (Sovereign Auditor)
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'src/**/*.cs'
- 'tests/**/*.cs'
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
issue_comment:
types: [created]

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Markdown Link Check
on: [push, pull_request]
on:
push:
paths:
- '**/*.md'
pull_request:
paths:
- '**/*.md'

jobs:
markdown-link-check:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/sentinel-pyramid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# [SENTINEL] V12 Autonomous Testing Pyramid
# Implements Unit, Property, and TDD validation suites on hosted CI.
# Bypasses NinjaTrader DLL dependency via tests/NinjaTrader.Mocks.cs

name: "Sentinel Testing Pyramid"

on:
push:
branches: ["main", "build/**"]
paths:
- "src/**.cs"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The path filters use **.cs instead of recursive **/*.cs, so nested C# file changes may not trigger the workflow.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/sentinel-pyramid.yml, line 11:

<comment>The path filters use `**.cs` instead of recursive `**/*.cs`, so nested C# file changes may not trigger the workflow.</comment>

<file context>
@@ -0,0 +1,82 @@
+  push:
+    branches: ["main", "build/**"]
+    paths:
+      - "src/**.cs"
+      - "tests/**.cs"
+      - "Testing.csproj"
</file context>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Invalid glob "src/**.cs"** within a filename segment does not decompose into directory separators on all runners. A file at src/Sub

- "tests/**.cs"
Comment on lines +11 to +12

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

In GitHub Actions on.push.paths, does src/.csmatch nested files under multiple subdirectories, or should it besrc//*.cs?

💡 Result:

To match files nested under subdirectories in GitHub Actions on.push.paths, you should use src//*.cs [1][2]. While src/.cs might work in some glob implementations, src//*.cs is the standard and recommended syntax for matching files recursively within directories [3][1]. The `` wildcard is used to match any number of directories recursively [3]. If you use src/.cs, it may not behave consistently across all contexts or may be misinterpreted depending on the underlying matcher. Using `src//*.cs` ensures that the pattern explicitly indicates "any file ending in.cs located within `src/` or any of its subdirectories" [3][1].

Citations:


Use recursive path globs to match all nested C# files in the workflow trigger.

The patterns src/**.cs and tests/**.cs won't reliably match files in nested subdirectories. Use src/**/*.cs and tests/**/*.cs to ensure all C# files at any nesting level trigger this workflow.

Proposed fix
-      - "src/**.cs"
-      - "tests/**.cs"
+      - "src/**/*.cs"
+      - "tests/**/*.cs"
📝 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.

Suggested change
- "src/**.cs"
- "tests/**.cs"
- "src/**/*.cs"
- "tests/**/*.cs"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sentinel-pyramid.yml around lines 11 - 12, Replace the
non-recursive file globs "src/**.cs" and "tests/**.cs" with recursive patterns
so nested C# files trigger the workflow; specifically update the trigger entries
that currently reference src/**.cs and tests/**.cs to use src/**/*.cs and
tests/**/*.cs respectively.

- "Testing.csproj"
pull_request:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: pull_request trigger lacks paths filter while push has one (lines 269-272). Adds paths: ['src/**/*.cs', 'tests/**/*.cs', 'Testing.csproj'] to pull_request.

branches: ["main"]

jobs:
test-pyramid:
name: Build & Run Pyramid Suites
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0

Comment on lines +28 to +32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/sentinel-pyramid.yml

Repository: mkalhitti-cloud/universal-or-strategy

Length of output: 3518


🌐 Web query:

actions/checkout persist-credentials security risk github documentation

💡 Result:

Risk summary: Using actions/checkout with the default persist-credentials behavior can increase impact if later steps in the job are compromised, because the GitHub token used for authenticated git operations may be written to the runner’s local git configuration and be available to subsequent steps until cleanup. The safer configuration (when you don’t need authenticated git push/fetch) is to set persist-credentials: false on the checkout step. What persist-credentials does (per GitHub docs) - actions/checkout “persists the token in the local git config” so scripts can run authenticated git commands, and the token is “removed during post-job cleanup”. Setting persist-credentials: false “opt-out[s]” of this behavior. [1][2] Why that can be a security risk - Because the token is available to later steps, any malicious/compromised code running in the same job after checkout could potentially read and use it to perform operations with the token’s permissions (the practical impact depends on the token’s permissions configured for the workflow). This “credentials being persistent … gives every step … implicit access to the token” concern is explicitly discussed in the actions/checkout issue. [3] - OWASP’s GitHub Actions security guidance recommends using actions/checkout with persist-credentials: false “to prevent Git credentials from being persisted to the workflow’s environment, reducing the risk of credential exposure if the workflow is compromised.” [4] Mitigations / best practices (grounded in the sources above) 1) Set persist-credentials: false on actions/checkout unless you truly need authenticated git operations that require the token (e.g., pushing back to the repo). [1][4] 2) Ensure least-privilege token permissions (both the checkout docs and the discussion around this risk emphasize using minimal permissions). [1][3] Example workflow snippet - uses: actions/checkout@v5 with: persist-credentials: false Note on “how bad is it?” - The exact exploitation path isn’t fully described in the official checkout docs snippet we captured, but the core risk mechanism is: token persistence makes it accessible to subsequent steps in the same workflow run until post-job cleanup. [1][2]

Citations:


Add persist-credentials: false to reduce token exposure risk.

actions/checkout persists credentials in local git config by default until post-job cleanup. Since this workflow doesn't perform authenticated git operations after checkout, explicitly disabling credential persistence follows GitHub and OWASP security best practices.

Proposed fix
       - name: Checkout repository
         uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5  # v4
         with:
           fetch-depth: 0
+          persist-credentials: false
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 23-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sentinel-pyramid.yml around lines 23 - 27, Update the
"Checkout repository" step that uses actions/checkout (uses:
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5) to explicitly disable
credential persistence by adding persist-credentials: false under the with
block; this keeps the checkout behavior but prevents the action from writing
credentials into the local git config, reducing token exposure risk.

- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: "8.0.x"

- name: Restore dependencies
run: dotnet restore Testing.csproj --nologo
shell: pwsh

- name: 1. Unit Tests (Pure Logic)
# Validates math, sizing, and rounding kernels.
run: dotnet test Testing.csproj --filter "FullyQualifiedName~UniversalOrStrategy.Tests.LogicTests" --no-restore --nologo --logger "trx;LogFileName=unit-results.trx"
shell: pwsh

- name: 2. TDD Concurrency Suites (Epic 1 Delta)
# Validates lock-free patterns and atomic FSM transitions.
run: dotnet test Testing.csproj --filter "FullyQualifiedName~UniversalOrStrategy.Tests.Epic1DeltaTests" --no-restore --nologo --logger "trx;LogFileName=tdd-results.trx"
shell: pwsh

- name: 3. Property-Based Testing (FsCheck)
# [FUTURE] This will run FsCheck properties once defined in tests.
run: |
Write-Host "Searching for property tests..."
dotnet test Testing.csproj --filter "Category=Property" --no-restore --nologo
shell: pwsh

- name: Check for non-ASCII characters (ASCII Gate)
# [MANIFESTO] Section 7: Mandatory ASCII check for NT8 compiler safety.
run: |
$files = Get-ChildItem -Path "src" -Filter "*.cs" -Recurse
$violations = @()
foreach ($f in $files) {
$content = [System.IO.File]::ReadAllBytes($f.FullName)
foreach ($byte in $content) {
if ($byte -gt 127) {
$violations += $f.FullName
break
}
}
}
if ($violations.Count -gt 0) {
Write-Host "ASCII GATE FAILED -- non-ASCII bytes found in:"
$violations | ForEach-Object { Write-Host " - $_" }
exit 1
} else {
Write-Host "ASCII Gate PASSED."
}
shell: pwsh

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-results
path: "**/TestResults/*.trx"
7 changes: 6 additions & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ on:
push:
branches:
- main
paths:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Using paths on pull_request causes required status checks to remain in 'Pending' forever when no C# files change, blocking PRs that only touch docs, config, or workflow files. Use the workflow-level trigger without paths and gate the job with a paths-filter action instead so the check reports as 'Skipped' (passing).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/sonarcloud.yml, line 7:

<comment>Using `paths` on `pull_request` causes required status checks to remain in 'Pending' forever when no C# files change, blocking PRs that only touch docs, config, or workflow files. Use the workflow-level trigger without paths and gate the job with a paths-filter action instead so the check reports as 'Skipped' (passing).</comment>

<file context>
@@ -4,8 +4,14 @@ on:
   push:
     branches:
       - main
+    paths:
+      - 'src/**/*.cs'
+      - 'tests/**/*.cs'
</file context>

- 'src/**/*.cs'
- 'tests/**/*.cs'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'src/**/*.cs'
- 'tests/**/*.cs'

jobs:
sonarcloud:
Expand Down Expand Up @@ -39,7 +45,6 @@ jobs:
# [NOTE] Hosted CI lacks proprietary NinjaTrader assemblies (targets .NET 4.8).
# Analysis is partial (no NinjaTrader refs), but we must allow it to proceed for SCA.
continue-on-error: true
continue-on-error: true
run: |
dotnet-sonarscanner begin /k:"mkalhitti-cloud_universal-or-strategy" /o:"mkalhitti-cloud" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vstest.reportsPaths="**/*.trx" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.exclusions="docs/**,.github/**,**/*.md,.agent/**,.agents/**,.bob/**,.codex/**,.cursor/**,.gemini/**,Traycerrefactor/**,artifacts/**"
dotnet build Linting.csproj
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/stylecop-enforcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ name: StyleCop Enforcement Pipeline
on:
push:
branches: ["main"]
paths:
- 'src/**/*.cs'
- 'tests/**/*.cs'
pull_request:
branches: ["main"]
paths:
- 'src/**/*.cs'
- 'tests/**/*.cs'

jobs:
lint:
Expand Down
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ artifacts/
.agent/
.agents/
.mcp/
.antigravitycli/

# JavaScript / TestSprite noise
node_modules/
Expand Down Expand Up @@ -54,4 +55,10 @@ tmp/
.claude/
.gemini/
.agent/
graphify-out/
graphify-out/

# Project pollution ignore rules
infrastructure/
experts/
docs/brain/run2-stickystate/
agy_log.txt
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
- **Sovereign Audit**: `droid /review` (Focus on P0-P3 severity findings).
- **Readiness Check**: `droid /readiness-report` (Maintain Level 2+).
- **Forensic Scan**: `grep -r "lock(" src/` (Zero-match requirement).
- **Jane Street KB Query**: `& "%USERPROFILE%\AppData\Local\Programs\Python\Python312\python.exe" scripts/query_kb.py "<term>"` (Retrieves HFT and high-performance system guidelines from the Firestore knowledge base).

Check notice on line 33 in AGENTS.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

AGENTS.md#L33

Undefined acronym "KB" — define on first use or add to glossary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the specific Python installation path (including the version Python312) reduces the portability of this command across different developer environments. It is better to rely on the system's PATH by using the generic python command.

Suggested change
- **Jane Street KB Query**: `& "%USERPROFILE%\AppData\Local\Programs\Python\Python312\python.exe" scripts/query_kb.py "<term>"` (Retrieves HFT and high-performance system guidelines from the Firestore knowledge base).
- **Jane Street KB Query**: `python scripts/query_kb.py "<term>"` (Retrieves HFT and high-performance system guidelines from the Firestore knowledge base).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Added line documents a scripts/query_kb.py invocation and a RAG protocol step referencing it, but this script does not exist in the codebase. Both the command and the protocol step are non-functional. Also, the hardcoded %USERPROFILE%\...\Python312\python.exe path is not portable across team members or CI.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At AGENTS.md, line 33:

<comment>Added line documents a `scripts/query_kb.py` invocation and a RAG protocol step referencing it, but this script does not exist in the codebase. Both the command and the protocol step are non-functional. Also, the hardcoded `%USERPROFILE%\...\Python312\python.exe` path is not portable across team members or CI.</comment>

<file context>
@@ -30,11 +30,13 @@ Welcome, Agent. You are operating within the **V12 Universal OR Strategy** repos
 - **Sovereign Audit**: `droid /review` (Focus on P0-P3 severity findings).
 - **Readiness Check**: `droid /readiness-report` (Maintain Level 2+).
 - **Forensic Scan**: `grep -r "lock(" src/` (Zero-match requirement).
+- **Jane Street KB Query**: `& "%USERPROFILE%\AppData\Local\Programs\Python\Python312\python.exe" scripts/query_kb.py "<term>"` (Retrieves HFT and high-performance system guidelines from the Firestore knowledge base).
 
 ## 4. Communication & Context
</file context>


## 4. Communication & Context

- **Active Task**: Always check `docs/brain/task.md` before initiating work.
- **Handoffs**: Use the `docs/brain/nexus_a2a.json` via the **Nexus Bridge** for inter-agent state synchronization.
- **Expert Knowledge Base (RAG)**: Before starting complex design, refactoring, or performance engineering tasks, query the Jane Street Knowledge Base using `scripts/query_kb.py` to retrieve verified microsecond-latency patterns and testing standards.

## 5. Karpathy Behavioral Protocols (LLM Coding Hygiene)

Expand All @@ -59,7 +61,7 @@
- Touch only what you must. Clean up only your own mess.
- Do NOT "improve" adjacent code, comments, or formatting.
- **WHITESPACE MUTATION BANNED**: Never mutate whitespace, line endings, or indentation across files. This creates bloated diffs that obscure logic and break CI limits.
- **STRICT DIFF LIMIT**: Pull Request diffs MUST remain under 150,000 characters.
- **STRICT DIFF LIMIT**: Pull Request diffs MUST target less than 10,000 characters of source code changes (in `src/`). Split larger epics into smaller, focused PRs.
- **DIFF PRE-CHECK**: Before pushing, run `powershell -File .\deploy-sync.ps1`. If the **DIFF GUARD** fails, you must isolate the logic changes and revert whitespace/artifact bloat.
- If unrelated dead code is noticed, REPORT it -- do not act on it.
- Every changed line must trace directly to the Mission Brief.
Expand Down
Loading
Loading