Files
nt8-sdk/TASK_GAP051_MICRO_UPGRADE_PERSISTENCE_PROMPT.md
mo 34c3767fbf [GOV]: cleanup prompted task state
- SPRINT_BOARD.md: stage GAP-025/GAP-030 and correct GAP-062 deploy status

- TASK_GAP025_RUNNER_ORDER_LIFECYCLE_LOGGING_PROMPT.md: add runner lifecycle logging prompt

- TASK_GAP030_ORB_HYDRATION_VERIFY_PROMPT.md: add ORB hydration verify prompt

- TASK_GAP051/052/059/060 prompts: record commit-only deploy instruction

- TASK_GAP054_RUNNER_TRAIL_PROMPT.md: clarify SIM/replay validation path

- docs/00-governance/2026-08-19-run-book.md: reconcile implemented/verified task states

- docs/00-governance/active_work.md: update blocker status and validation requirements

- docs/00-governance/decisions.md: record prompted follow-ups and resolved GAP-062 deploy status

Build: clean | Tests: 569 passing | Deploy: GAP-062 deployed backup 20260826_005308
2026-08-26 00:59:35 -04:00

5.0 KiB

TASK: GAP-051 — MicroUpgradeThreshold advisory re-fires every restart

Staged: 2026-08-18 (v7.0 review, "raised, not yet prompted"), evidenced 2026-08-23/24

Sprint: Stage 1 — housekeeping, zero trading-behaviour risk (advisory-only)

Owner: Kilocode

Deploy: COMMIT ONLY — do NOT run deploy-to-nt8.bat or copy build output to

the live NT8 install as part of this task. The Sim101 SIM session

is currently running and under live investigation; a redeploy

would restart it and break session continuity. Verify-build and

commit as usual; leave the deploy step for the operator to run

manually once ready.

─────────────────────────────────────────────────────────────────

THE DEFECT

MonitorMicroAccountUpgrade() (NT8StrategyBase.cs ~851-869) is meant to suggest, once, that the operator review RiskTier after account balance crosses MicroUpgradeThreshold (default $5,000.00):

if (_microUpgradeSuggested || Account == null || MicroUpgradeThreshold <= 0.0 || State != State.Realtime)
    return;
...
if (balance >= MicroUpgradeThreshold)
{
    _microUpgradeSuggested = true;
    string message = string.Format("TIER_UPGRADE_SUGGESTED: Balance={0:F2} crossed threshold={1:F2}; review RiskTier setting.", balance, MicroUpgradeThreshold);
    Print(message);
    FileLog(message);
}

_microUpgradeSuggested is reset to false in the State.SetDefaults branch (~line 522), which runs on every strategy enable — i.e. every restart. Any account already above MicroUpgradeThreshold gets the TIER_UPGRADE_SUGGESTED message again on every single restart (recompiles, connection recovery, manual stop/start), not once per account lifetime.

Same defect class as GAP-055 (MaxDailyTrades not surviving a restart), applied to an advisory message instead of the daily trade cap.

IMPACT

Advisory-only. Print/FileLog only — never touches order flow, sizing, risk, or REJECT/SIGNAL behavior. The impact is log/output noise on repeated restarts of an account already above threshold, not a trading defect.

READ-FIRST

  1. Read NT8StrategyBase.cs ~851-869 (MonitorMicroAccountUpgrade) and ~515-525 (State.SetDefaults, where _microUpgradeSuggested resets).
  2. Read how GAP-055 persisted MaxDailyTrades (SimpleORBStrategy.cs, commit 6658d2d) — the pattern (JSON file keyed by account/strategy name, rehydrate on State.Realtime, degrade to a safe default on missing/corrupt file, skip entirely when Account == null) is directly reusable here if persistence is the chosen fix.

THE CHANGE — pick one, and say which and why in your writeback

Option A — persist the suggested-state, so the advisory only ever fires once per account lifetime (or once per calendar period, if that reads better — your call, but state the semantics explicitly). Reuse GAP-055's persistence pattern rather than inventing a new one; a small dedicated file (e.g. {LogDirectory}/micro_upgrade_suggested_<AccountName>.json) is preferable to overloading GAP-055's own file with an unrelated field.

Option B — leave it as an intentional per-session reminder. If you conclude the current behavior is defensible (an operator restarting the strategy might reasonably want to be re-reminded, unlike a hard trading limit like MaxDailyTrades), say so explicitly with reasoning, and instead just improve the REJECT/log-noise concern some other way (e.g. only re-print once per calendar day even across restarts, using the same trading-date logic GAP-055 established, without full cross-restart persistence).

Do not silently pick one without explaining the tradeoff in your writeback.

DO NOT

  • Do not change any order flow, sizing, or risk-validation logic.
  • Do not change the TIER_UPGRADE_SUGGESTED message format if you keep it.
  • Do not touch MaxDailyTrades persistence itself (GAP-055) — reuse its pattern, don't modify its file or logic.

TESTS (required)

  1. If persisting: same-restart-suggested-already → no second message. New qualifying period (however you define it) → message fires again. Missing/corrupt persistence file → safe default (message fires, consistent with "advisory, better to over-remind than silently suppress forever on a corrupt file"), logged, no exception.
  2. Account == null (backtest/Strategy Analyzer) → no file I/O, unchanged behavior either way.

VALIDATION (operator)

None required for correctness — this is advisory/log-noise only. If you want visual confirmation, restart the strategy twice on an account above threshold and confirm the message behavior matches whichever option was implemented.

GOVERNANCE

Track as [GAP-051] in SPRINT_BOARD.md. Update docs/00-governance/decisions.md DEC-20260823-06 status to implemented with an implementation note stating which option was chosen and why. Reference: this task, DEC-20260823-06.