Skip to content

feat: integrate MANDATE with TrueForge and Alpaca paper - #2

Closed
andreysk0304 wants to merge 57 commits into
feat/mandate-corefrom
feat/mandate-integration
Closed

feat: integrate MANDATE with TrueForge and Alpaca paper#2
andreysk0304 wants to merge 57 commits into
feat/mandate-corefrom
feat/mandate-integration

Conversation

@andreysk0304

@andreysk0304 andreysk0304 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • register a Z.AI-powered TrueForge agent with an explicit read-only Alpaca allowlist
  • add streamable HTTP guard integration, persistent JSONL journal, live headroom and wake triggers
  • enforce human-authored predecided branches from fresh broker metrics
  • make submits crash-recoverable and immutable by intent fingerprint
  • make closes opt-in risk-reducing actions and prevent cancellation of foreign orders
  • package explainable research as an optional TrueForge Git Skill with a sandbox comparison script

Verification

  • 76 mandate-guard tests pass
  • 20 mandate-research and Skill tests pass
  • TypeScript agent config passes typecheck
  • end-to-end TrueForge → guard → Alpaca paper read-only run passed
  • live predecision integration check passed
  • TrueForge Code Mode sandbox Decimal smoke-test passed
  • secret scan returned no matches
  • Qodo Deep re-review: Bugs 0, Rule violations 0

Safety

Paper endpoint only. Direct Alpaca write tools are not enabled. All irreversible guard tools require approval, and approval cannot override mandate checks. Human merge remains required.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Integrate MANDATE with TrueForge and Alpaca paper trading

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Register a Z.AI TrueForge agent with read-only Alpaca research access.
• Add persistent, idempotent guard execution with live risk and wake-state reporting.
• Restrict closes and cancellations while packaging explainable research as an optional Skill.
Diagram

sequenceDiagram
  actor Human
  participant Agent as TrueForge Agent
  participant Skill as Research Skill
  participant Data as Alpaca Research
  participant Guard as Mandate Guard
  participant Journal as JSONL Journal
  participant Paper as Alpaca Paper
  Human->>Agent: Provide intent
  Agent->>Skill: Compare signals
  Skill->>Data: Read market data
  Data-->>Skill: Bars and quotes
  Agent->>Guard: Check order
  Guard->>Paper: Fetch fresh state
  Paper-->>Guard: Account snapshot
  Guard-->>Agent: Decision and headroom
  Human->>Agent: Approve action
  Agent->>Guard: Submit stable intent
  Guard->>Paper: Deduplicate and execute
  Guard->>Journal: Append audit event
  Guard-->>Agent: Return outcome
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use Alpaca write tools with approval only
  • ➕ Less custom guard code
  • ➕ Fewer runtime components
  • ➖ Human approval could bypass deterministic mandate checks
  • ➖ Generated Alpaca tools provide incomplete safety annotations
  • ➖ Execution provenance and retry idempotency would be weaker
2. Store guard state in SQLite
  • ➕ Transactional writes and stronger concurrent access
  • ➕ Easier indexed provenance queries and migrations
  • ➖ Adds schema and operational complexity
  • ➖ Unnecessary overhead for the current local single-process integration

Recommendation: Keep the dedicated MCP guard and explicit read-only Alpaca allowlist; approval is a workflow control, not a substitute for deterministic enforcement. The JSONL journal is proportionate for a local single-process paper environment and enables fail-closed restoration, while SQLite should be reconsidered if multiple guard processes or higher write concurrency are introduced.

Files changed (27) +1722 / -63

Enhancement (7) +315 / -20
alpaca.pyExpand Alpaca state and order lookup support +19/-2

Expand Alpaca state and order lookup support

• Captures intraday position movement, reserves stop and trailing-order reference prices, and adds paper-endpoint lookups by client ID and broker order ID for deduplication and ownership checks.

mandate/mcp-guard/src/mandate_guard/alpaca.py

checks.pyCalculate live worst-case mandate usage +33/-0

Calculate live worst-case mandate usage

• Adds intraday movement to positions and computes maximum symbol and gross exposure across current positions plus pending buys and sells.

mandate/mcp-guard/src/mandate_guard/checks.py

mandate.pyValidate wake rules and close authorization +10/-0

Validate wake rules and close authorization

• Adds the explicit risk-reducing close policy and validates every configured wake expression while loading the mandate.

mandate/mcp-guard/src/mandate_guard/mandate.py

server.pyExpose the guard over configurable streamable HTTP +35/-17

Expose the guard over configurable streamable HTTP

• Configures MCP transport, host, port, server instructions, and persistent journal wiring. It exposes live mandate and session state, marks stable-ID submission as idempotent, and delegates destructive operations to service-level safety checks.

mandate/mcp-guard/src/mandate_guard/server.py

state.pyPersist and restore the audit journal as JSONL +40/-1

Persist and restore the audit journal as JSONL

• Serializes journal entries to disk with Decimal, enum, and timestamp support, restores them at startup, and fails closed when any stored entry is malformed.

mandate/mcp-guard/src/mandate_guard/state.py

wake.pyParse and evaluate bounded wake conditions +67/-0

Parse and evaluate bounded wake conditions

• Implements a strict three-token expression format over known risk metrics and returns details only for currently triggered conditions.

mandate/mcp-guard/src/mandate_guard/wake.py

compare_signals.pyAdd a sandbox signal comparison command +111/-0

Add a sandbox signal comparison command

• Parses timezone-aware JSON bars and news, removes future and duplicate events, computes four explainable current signals, and emits comparable backtest metrics using Decimal values.

mandate/research/scripts/compare_signals.py

Bug fix (1) +188 / -11
service.pyEnforce idempotent and provenance-safe broker actions +188/-11

Enforce idempotent and provenance-safe broker actions

• Returns projected portfolio state, live headroom, wake triggers, and session snapshots. Stable intent IDs deduplicate submissions, closes require explicit risk-reduction authorization plus valid session state, and cancellations are limited to orders proven by the restored guard journal.

mandate/mcp-guard/src/mandate_guard/service.py

Tests (6) +362 / -14
test_alpaca.pyTest broker reference prices and ownership lookups +61/-1

Test broker reference prices and ownership lookups

• Covers stop-order risk reservations, paper order retrieval, percentage conversion for intraday movement, and fail-closed handling when no bounded order price exists.

mandate/mcp-guard/tests/test_alpaca.py

test_server.pyVerify idempotent MCP submission annotations +1/-1

Verify idempotent MCP submission annotations

• Updates the MCP contract assertion to require the submit tool's idempotency hint while retaining destructive annotations.

mandate/mcp-guard/tests/test_server.py

test_service.pyTest live state and destructive-action safeguards +167/-12

Test live state and destructive-action safeguards

• Expands broker doubles and coverage for projected portfolios, live mandate headroom, wake triggers, stable retry deduplication, serialized submissions, explicit close authorization, and journal-proven cancellation ownership.

mandate/mcp-guard/tests/test_service.py

test_state.pyTest journal restoration and corruption failure +29/-0

Test journal restoration and corruption failure

• Verifies JSONL entries survive service recreation with normalized values and malformed persisted state prevents startup.

mandate/mcp-guard/tests/test_state.py

test_wake.pyTest wake expression validation and triggering +40/-0

Test wake expression validation and triggering

• Covers valid comparisons, unknown metrics, unsupported operators, non-finite thresholds, malformed expressions, and missing metric behavior.

mandate/mcp-guard/tests/test_wake.py

test_compare_signals_script.pyTest point-in-time signal comparison output +64/-0

Test point-in-time signal comparison output

• Confirms the script normalizes symbols, excludes future news, and returns current signals and backtests for all four strategies.

mandate/research/tests/test_compare_signals_script.py

Documentation (3) +85 / -17
README.mdDocument the verified TrueForge paper-trading integration +38/-9

Document the verified TrueForge paper-trading integration

• Explains the approval boundary, read-only Alpaca allowlist, idempotency, journal-backed cancellation ownership, guard startup, agent registration, optional private-repository Skill behavior, and verified end-to-end results.

README.md

SPEC.mdCorrect milestone dates and trading-day cutoff +10/-8

Correct milestone dates and trading-day cutoff

• Fixes weekday labels for the August plan and clarifies that live-market capture must finish on the final trading day before the deadline.

SPEC.md

SKILL.mdPackage research as a TrueForge Git Skill +37/-0

Package research as a TrueForge Git Skill

• Defines the research-only workflow, point-in-time news filtering, sandbox invocation, expected JSON input, strategy comparison requirements, and mandate separation.

mandate/research/SKILL.md

Other (10) +772 / -1
.gitignoreIgnore guard journals and model scratch files +2/-0

Ignore guard journals and model scratch files

• Excludes generated MANDATE JSONL audit logs and '*_think.md' scratch artifacts from version control.

.gitignore

.env.exampleAdd guard transport, journal, and Skill settings +6/-0

Add guard transport, journal, and Skill settings

• Provides defaults for persistent journal storage, streamable HTTP binding, optional research Skill enablement, and the Git reference used during registration.

mandate/.env.example

package-lock.jsonLock TrueForge agent tooling dependencies +576/-0

Lock TrueForge agent tooling dependencies

• Pins the TrueForge SDK and TypeScript execution toolchain, including platform-specific esbuild packages, for reproducible agent provisioning.

mandate/agent/package-lock.json

package.jsonDefine the agent configuration package +17/-0

Define the agent configuration package

• Adds scripts for strict TypeScript validation and applying the TrueForge agent manifest with the pinned SDK.

mandate/agent/package.json

prompt.mdDefine MANDATE agent safety instructions +31/-0

Define MANDATE agent safety instructions

• Establishes paper-only execution, stable intent IDs, denial handling, approval requirements, untrusted-content treatment, deterministic calculations, evidence standards, and fail-closed behavior.

mandate/agent/prompt.md

agentSpec.tsBuild the constrained TrueForge agent manifest +46/-0

Build the constrained TrueForge agent manifest

• Configures the Z.AI model, sandbox and agent capabilities, mandatory approval for irreversible guard tools, explicit Alpaca research access, and optional Skill attachment.

mandate/agent/src/agentSpec.ts

alpacaTools.tsDeclare explicit Alpaca read and write tool lists +33/-0

Declare explicit Alpaca read and write tool lists

• Allow-lists market research operations and separately deny-lists order, position, watchlist, option, and account mutations to prevent direct broker execution.

mandate/agent/src/alpacaTools.ts

createAgent.tsProvision MCP servers, Skill, and TrueForge agent +48/-0

Provision MCP servers, Skill, and TrueForge agent

• Creates or updates the remote guard registration, conditionally registers the Git Skill, and idempotently creates or updates 'mandate-paper-agent'. Research Skill registration remains disabled unless explicitly enabled, keeping private repository downloads fail closed.

mandate/agent/src/createAgent.ts

tsconfig.jsonEnable strict NodeNext TypeScript checks +11/-0

Enable strict NodeNext TypeScript checks

• Sets ES2022 and NodeNext compilation with strict typing and unchecked-index safeguards for the agent configuration package.

mandate/agent/tsconfig.json

example.yamlAuthorize risk-reducing closes in the example mandate +2/-1

Authorize risk-reducing closes in the example mandate

• Adds explicit permission for risk-reducing market closes and extends the sample mandate expiration so integration runs do not fail due to stale example data.

mandate/mandates/example.yaml

@qodo-code-review

qodo-code-review Bot commented Aug 27, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Denied intents can execute ✓ Resolved 🐞 Bug ≡ Correctness
Description
submit() only deduplicates intents that already have a broker order, so an intent previously
denied and journaled can later be retried and submitted when state changes. This violates the
agent's hard rule that a denial is final for that intent and permits the same human decision to
transition from denied to executed.
Code

mandate/mcp-guard/src/mandate_guard/service.py[R206-207]

+            existing = await self.broker.find_order_by_client_id(client_order_id)
+            if existing is not None:
Evidence
The new flow checks only Alpaca for an existing order before reevaluating; denied attempts create no
broker order and their journal details omit intent_id, so there is no mechanism that can enforce
denial finality. The newly added agent instruction explicitly declares denials final for an intent.

mandate/mcp-guard/src/mandate_guard/service.py[203-224]
mandate/agent/prompt.md[7-11]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A denied `intent_id` is not remembered as final, so retrying it can later execute.

## Issue Context
Record the intent ID on denied submissions and consult durable journal state before broker lookup/evaluation. A previously denied ID must return the original denial or a terminal-denied response rather than being reevaluated.

## Fix Focus Areas
- mandate/mcp-guard/src/mandate_guard/service.py[206-224]
- mandate/mcp-guard/src/mandate_guard/state.py[21-64]
- mandate/mcp-guard/tests/test_service.py[256-270]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Crash loses order provenance ✓ Resolved 🐞 Bug ☼ Reliability
Description
The broker order is submitted before the journal’s ownership record is persisted, so a process crash
or journal-write failure in that interval leaves a real guard-created order represented after
recovery only by a deduplicated event rather than submitted. Because cancellation ownership
accepts only persisted submitted events, the recovered order is classified as foreign and the
guard cannot cancel its own outstanding order.
Code

mandate/mcp-guard/src/mandate_guard/service.py[R226-235]

            response = await self.broker.submit_order(order, client_order_id=client_order_id)
            self.journal.append(
                "submit_order",
                "submitted",
                rationale,
-                {"client_order_id": client_order_id, "order": asdict(order)},
+                {
+                    "client_order_id": client_order_id,
+                    "intent_id": intent_id,
+                    "order": asdict(order),
+                },
Evidence
The Alpaca submission occurs before the submitted journal append, making broker acceptance and
ownership persistence separate operations with a failure window between them. After process
recreation, the journal is rebuilt only from persisted lines, while recovery records the matching
broker order as deduplicated; because cancellation authorization explicitly requires a submitted
outcome, neither the broker proof nor the recovery event restores ownership.

mandate/mcp-guard/src/mandate_guard/service.py[226-237]
mandate/mcp-guard/src/mandate_guard/service.py[292-308]
mandate/mcp-guard/src/mandate_guard/state.py[25-43]
mandate/mcp-guard/src/mandate_guard/state.py[55-60]
mandate/mcp-guard/src/mandate_guard/service.py[206-237]
mandate/mcp-guard/src/mandate_guard/service.py[288-307]
mandate/mcp-guard/src/mandate_guard/state.py[45-61]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The guard performs the irreversible broker submission before persisting the `submitted` event later used to prove cancellation ownership. If the process crashes or the journal write fails between those operations, recovery records the successfully created order only as `deduplicated`, causing the guard to classify its own order as foreign and refuse cancellation.

## Issue Context
The client order ID is deterministic, so make the submission intent durable before the broker call and reconcile a durable pre-submit or submitting journal record against the matching Alpaca order into an ownership-proving terminal event. Ensure cancellation recognizes verified, reconciled guard intents and recovery events while handling incomplete records safely and continuing to reject spoofed client IDs.

## Fix Focus Areas
- mandate/mcp-guard/src/mandate_guard/service.py[203-237]
- mandate/mcp-guard/src/mandate_guard/service.py[288-308]
- mandate/mcp-guard/src/mandate_guard/state.py[45-61]
- mandate/mcp-guard/tests/test_service.py[273-316]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Intent reuse changes order silently ✓ Resolved 🐞 Bug ≡ Correctness
Description
The client order ID is derived only from the mandate name and intent_id, and an existing match is
returned as submitted without comparing its symbol, side, quantity, order type, or price to the
requested OrderIntent. Reusing an ID with materially changed terms can therefore silently return
the prior broker order as a success, leaving the agent or user believing the changed trade was
executed.
Code

mandate/mcp-guard/src/mandate_guard/service.py[R204-218]

+            digest = hashlib.sha256(f"{self.mandate.name}:{intent_id}".encode()).hexdigest()[:24]
+            client_order_id = f"mandate-{digest}"
+            existing = await self.broker.find_order_by_client_id(client_order_id)
+            if existing is not None:
+                self.journal.append(
+                    "submit_order",
+                    "deduplicated",
+                    rationale,
+                    {"client_order_id": client_order_id, "intent_id": intent_id},
+                )
+                return {
+                    "submitted": True,
+                    "deduplicated": True,
+                    "client_order_id": client_order_id,
+                    "broker": existing,
Evidence
The hash input contains only the mandate name and intent ID, excluding every execution-relevant
order field, while the lookup uses only that generated client order ID and the deduplication branch
returns immediately before the fresh evaluate(order) call. Because the actual order terms are sent
separately to Alpaca and recorded only on the first successful submission, they cannot be recovered
from the ID and are never checked against the changed payload on retry.

mandate/mcp-guard/src/mandate_guard/service.py[204-220]
mandate/mcp-guard/src/mandate_guard/service.py[226-237]
mandate/mcp-guard/src/mandate_guard/alpaca.py[164-176]
mandate/mcp-guard/src/mandate_guard/service.py[203-219]
mandate/mcp-guard/src/mandate_guard/alpaca.py[178-189]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A caller can reuse an `intent_id` with different order terms. Because the client order ID contains no order fingerprint, the guard silently returns the earlier order as a successful deduplication instead of rejecting the conflicting request.

## Issue Context
Idempotency must apply only to the same immutable intent. Keep the stable ID intent-based, but persist a canonical fingerprint of all execution-relevant fields—including symbol, side, quantity, order type, and bounded price—with durable journal data, or compare canonical submitted terms from the broker response, and reject reuse when any execution field differs.

## Fix Focus Areas
- mandate/mcp-guard/src/mandate_guard/service.py[203-235]
- mandate/mcp-guard/tests/test_service.py[256-270]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (2)
4. Market closes default to allowed ✓ Resolved 🐞 Bug ⛨ Security
Description
Adding this field with a True default lets every existing mandate that omits it submit a market
close even when its order_types permits only limit orders. The new close path explicitly bypasses
check_order, so the policy is not an explicit opt-in as intended and expands execution authority
for old mandates.
Code

mandate/mcp-guard/src/mandate_guard/mandate.py[45]

+    allow_risk_reducing_market_close: bool = True
Evidence
The default applies when a pre-existing mandate lacks the new field, while the new close flow only
checks that field rather than the mandate's order types. The existing test fixture demonstrates such
a limit-only mandate omits the new setting.

mandate/mcp-guard/src/mandate_guard/mandate.py[41-46]
mandate/mcp-guard/src/mandate_guard/service.py[249-282]
mandate/mcp-guard/tests/conftest.py[16-29]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`allow_risk_reducing_market_close` defaults to true, so mandates created before this field was introduced implicitly authorize market closes despite not allowing market orders.

## Issue Context
`close_position` now bypasses normal order-type evaluation and relies on this field as its authorization gate. Make this capability opt-in for every mandate.

## Fix Focus Areas
- mandate/mcp-guard/src/mandate_guard/mandate.py[45-45]
- mandate/mcp-guard/src/mandate_guard/service.py[249-281]
- mandate/mcp-guard/tests/conftest.py[13-30]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. News revisions erase history ✓ Resolved 🐞 Bug ≡ Correctness
Description
analyze() deduplicates all news before applying the evaluation cutoff, so a later revision with
the same source and external ID replaces an earlier eligible event and can then be filtered out. It
also removes the earlier event from pre-revision backtest windows, making the advertised
point-in-time-safe news results incorrect.
Code

mandate/research/scripts/compare_signals.py[R61-62]

+    cutoff = bars[-1].timestamp
+    events = [event for event in deduplicate(_news(item) for item in payload.get("news", [])) if event.published_at <= cutoff]
Evidence
The script calls deduplicate before cutoff filtering and passes that globally reduced collection
to every historical strategy invocation. The helper keeps only the event with the greatest
publication time for each source/external-ID key, while the signal's per-window cutoff cannot
restore the discarded earlier revision.

mandate/research/scripts/compare_signals.py[56-80]
mandate/research/src/mandate_research/news.py[231-238]
mandate/research/src/mandate_research/signals.py[172-188]
mandate/research/SKILL.md[12-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Global latest-revision deduplication removes news that was available at earlier evaluation times.

## Issue Context
Filter to the relevant cutoff before deduplicating current results, and ensure every historical strategy window deduplicates only events published by that window's timestamp. Add a test with an original event and a later same-ID revision.

## Fix Focus Areas
- mandate/research/scripts/compare_signals.py[61-79]
- mandate/research/src/mandate_research/news.py[231-238]
- mandate/research/src/mandate_research/signals.py[172-188]
- mandate/research/tests/test_compare_signals_script.py[31-64]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

6. Whitespace breaks news matching ✓ Resolved 🐞 Bug ≡ Correctness
Description
The comparison script uppercases news symbols without trimming them, so a value such as " AAPL "
does not match the normalized target "AAPL" and the event contributes no news score. This bypasses
the repository's established symbol normalization and can incorrectly flatten a news-confirmation
signal.
Code

mandate/research/scripts/compare_signals.py[R49-52]

+        headline=str(item["headline"]),
+        summary=str(item.get("summary", "")),
+        symbols=tuple(str(symbol).upper() for symbol in item.get("symbols", [])),
+        url=str(item["url"]) if item.get("url") else None,
Evidence
The new parser applies only .upper() to event symbols, whereas the existing normalization helper
strips whitespace, uppercases, and removes blanks. Signal scoring uses exact tuple membership, so
the untrimmed value is excluded.

mandate/research/scripts/compare_signals.py[44-57]
mandate/research/src/mandate_research/news.py[83-85]
mandate/research/src/mandate_research/signals.py[159-161]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Whitespace in input news symbols prevents exact symbol matching.

## Issue Context
Reuse the established strip/uppercase/nonblank normalization behavior for both the payload symbol and every event symbol. Add coverage for surrounding whitespace and blank symbols.

## Fix Focus Areas
- mandate/research/scripts/compare_signals.py[44-57]
- mandate/research/src/mandate_research/news.py[83-85]
- mandate/research/src/mandate_research/signals.py[159-161]
- mandate/research/tests/test_compare_signals_script.py[31-64]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Guard endpoint ignores configuration ✓ Resolved 🐞 Bug ☼ Reliability
Description
Agent registration hard-codes 127.0.0.1:8010 even though the guard host and port are configurable,
so changing MANDATE_GUARD_PORT or deploying TrueForge separately registers an unreachable MCP
endpoint. The server can start successfully at the configured address while the agent continues
calling the old loopback URL.
Code

mandate/agent/src/createAgent.ts[R21-24]

+    type: "remote",
+    name: "mandate-guard",
+    url: "http://127.0.0.1:8010/mcp",
+    description: "Deterministic paper-only mandate enforcement and auditable execution boundary.",
Evidence
The manifest always uses the literal loopback URL, while the environment example and guard startup
code expose and consume configurable host and port values. There is no corresponding agent-side
endpoint setting.

mandate/agent/src/createAgent.ts[8-24]
mandate/.env.example[9-11]
mandate/mcp-guard/src/mandate_guard/server.py[120-126]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The registered MCP endpoint does not follow the guard's deployment configuration.

## Issue Context
Introduce an explicit externally reachable guard URL setting rather than constructing a client URL from the bind host, since values such as `0.0.0.0` are valid bind addresses but invalid destinations. Validate the URL and use it in the MCP manifest.

## Fix Focus Areas
- mandate/agent/src/createAgent.ts[8-24]
- mandate/.env.example[9-11]
- mandate/mcp-guard/src/mandate_guard/server.py[120-126]
- README.md[75-90]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Web pages:
  +2 more
Review mode: 🧠 Deep: This is a security- and financial-risk integration spanning guard logic, broker execution, persistence, concurrency, HTTP transport, agent tool allowlists, and research paths, with many independent logic sites where redundant review can catch subtle defects.

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread mandate/mcp-guard/src/mandate_guard/service.py
Comment thread mandate/research/scripts/compare_signals.py Outdated
Comment thread mandate/agent/src/createAgent.ts
Comment thread mandate/research/scripts/compare_signals.py Outdated
Comment thread mandate/mcp-guard/src/mandate_guard/mandate.py Outdated
Comment thread mandate/mcp-guard/src/mandate_guard/service.py Outdated
Comment thread mandate/mcp-guard/src/mandate_guard/service.py
…verse

Add Microsoft/Google/AWS/Meta official RSS + Fed for SPY,
extend CIK mapping to 19 issuers (GOOG, AMZN, META, AMD, etc),
keep issuer rebinding guard, 2 new tests
@mikhailkhorokhorin
mikhailkhorokhorin deleted the branch feat/mandate-core August 29, 2026 21:12
@mikhailkhorokhorin
mikhailkhorokhorin deleted the feat/mandate-integration branch August 29, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants