Skip to content

Commit ed4468c

Browse files
luisleo526claude
andcommitted
Make the symbol-feed count and request-feed inventory size limits parameters, default unlimited
The runner refused more than 256 symbols or feeds and the two inventory readers refused an inventory over 8 MiB, each as a fixed constant. They are now options: --max-symbol-feeds on the runner, --max-inventory-bytes on the runner and the inventory binder, forwarded by the entrypoint through PINEFORGE_MAX_SYMBOL_FEEDS and PINEFORGE_MAX_INVENTORY_BYTES. Unset or 0 is unlimited, a positive value is the limit, and anything else is a usage error. With a limit set the typed refusals (too_many_symbols, too_many_feeds, binder exit 10, the incomplete-inventory admission refusal) are unchanged and name the actual limit. The former values live in one opt-in set, selected by --tv-compat or PINEFORGE_TV_COMPAT; an explicit limit, including 0, wins over it. Without it nothing is capped. The key-length limit is a name check and is unchanged. The two new runner options share the "--m" prefix, so the ambiguous-prefix diagnostic now lists them too; its test pins the new text. Documentation pages and anchors that cited the moved lines are updated. The BARS-BIN-INPUT design note drops statements that no longer hold, named here so the revert check can match them: "All source coordinates below refer to that tree." ; "At most 256 symbols and 256 total extra feeds across the index." ; "`_SYMBOL_FEEDS_MAX` docker/run_json.py:N;" ; "The old comment example lists only CSV feeds; it is an example, not an extension restriction (comment's `feeds` docker/run_json.py:N)." ; "The actual branch accepts binary feeds (`suffix` docker/run_json.py:N)." The sentences were introduced by 91353de; the cite `_SYMBOL_FEEDS_MAX` is too short to match by words, so it is named by that commit here as well. The first is replaced by a statement that runner and entrypoint coordinates follow the working source; the second and third by the parameter wording (default no limit); the last two are folded into one sentence saying the loader accepts CSV and binary feed paths. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent a86dbdc commit ed4468c

19 files changed

Lines changed: 554 additions & 165 deletions

‎docker/README.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,14 @@ docker run --rm \
270270
requested bar whose close is at or before the chart bar's close; with it on,
271271
the latest that opened at or before the chart bar's open. A missing requested
272272
bar carries the last value forward (`gaps` off) or reads na (`gaps` on).
273-
- Limits: at most 256 symbols and 256 feeds in one index. The chart must be its
273+
- Symbol and total feed counts default to no limit. `--max-symbol-feeds N`
274+
(`PINEFORGE_MAX_SYMBOL_FEEDS`) applies N to both counts; unset or `0` means
275+
unlimited. `--max-inventory-bytes N` (`PINEFORGE_MAX_INVENTORY_BYTES`) applies
276+
the same rule to inventory bytes in both the binder and runner. Empty,
277+
negative and non-integer values are usage errors. `--tv-compat`
278+
(`PINEFORGE_TV_COMPAT=1`) opts into defaults of 256 symbols/feeds and 8 MiB
279+
inventory from the runner's one compatibility set; explicit limits,
280+
including `0`, win. The chart must be its
274281
own input (`PINEFORGE_SCRIPT_TF` unset or equal to the input timeframe), else
275282
the run fails with `request.security of another symbol needs the chart's own
276283
bars as input; input '<i>' aggregated to chart '<s>' is not supported`. The run
@@ -284,7 +291,8 @@ docker run --rm \
284291
- An index or feed the harness cannot install (for example: not JSON, a bad
285292
timeframe spelling, two feeds at one timeframe, a CSV without `close`,
286293
timestamps that do not strictly increase, a close after the next bar's open,
287-
a non-positive `mintick`, more than 256 feeds, a library without the setters,
294+
a non-positive `mintick`, exceeding an explicit or compatibility feed limit,
295+
a library without the setters,
288296
a feed the engine refuses)
289297
fails the run before it starts: one line
290298
`{"engine":"pineforge","error":"--symbol-feeds: ...","code":"symbol_feeds_refused",...}`

‎docker/bind_compiled_inventory.py‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
Fails closed, one diagnostic line on stderr and no output file, with exit status:
3333
3434
2 usage error (argparse)
35-
10 the inventory cannot be read, or is over 8 MiB
35+
10 the inventory cannot be read, or exceeds --max-inventory-bytes
3636
11 the inventory is not strict JSON (bad UTF-8, syntax, a duplicate key or a
3737
non-finite number)
3838
12 the compiled C++ or the linked library cannot be read
@@ -61,11 +61,6 @@
6161
EXIT_BINDER_REFUSED = 14
6262
EXIT_OUTPUT_REFUSED = 15
6363

64-
# The consumer (docker/request_feed_inventory.py) reads at most this much; a
65-
# larger inventory is incomplete there, so it is refused here, before binding.
66-
INVENTORY_MAX_BYTES = 8 * 1024 * 1024
67-
68-
6964
class Refusal(Exception):
7065
"""An outcome that ends the run with exit_code and one line on stderr."""
7166

@@ -87,16 +82,19 @@ def _no_constant(name: str) -> Any:
8782
raise ValueError(f"non-finite JSON number {name}")
8883

8984

90-
def _read_inventory(path: str) -> Any:
85+
def _read_inventory(path: str, max_inventory_bytes: Optional[int] = None) -> Any:
9186
try:
9287
with open(path, "rb") as handle:
93-
data = handle.read(INVENTORY_MAX_BYTES + 1)
88+
try:
89+
data = handle.read(max_inventory_bytes + 1 if max_inventory_bytes else -1)
90+
except OverflowError: # a limit larger than a platform read size
91+
data = handle.read()
9492
except (OSError, ValueError) as error:
9593
raise Refusal(EXIT_INVENTORY_UNREADABLE,
9694
f"the inventory cannot be read: {error}") from None
97-
if len(data) > INVENTORY_MAX_BYTES:
95+
if max_inventory_bytes and len(data) > max_inventory_bytes:
9896
raise Refusal(EXIT_INVENTORY_UNREADABLE,
99-
f"the inventory is over {INVENTORY_MAX_BYTES} bytes")
97+
f"the inventory is over {max_inventory_bytes} bytes")
10098
try:
10199
return json.loads(data.decode("utf-8"), object_pairs_hook=_no_duplicate_keys,
102100
parse_constant=_no_constant)
@@ -175,6 +173,10 @@ def _publish(directory: str, out: str, text: str) -> None:
175173

176174

177175
def main(argv: Optional[List[str]] = None) -> int:
176+
# Isolated runpy callers do not add this tool's companion directory.
177+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
178+
from run_json import TV_COMPAT_LIMITS, nonnegative_limit
179+
178180
parser = argparse.ArgumentParser(
179181
prog=PROG, allow_abbrev=False,
180182
description="Bind a source-bound request-feed inventory to the linked strategy "
@@ -184,9 +186,15 @@ def main(argv: Optional[List[str]] = None) -> int:
184186
parser.add_argument("--cpp", required=True, help="the C++ file g++ compiled; only read")
185187
parser.add_argument("--so", required=True, help="the library g++ linked; read, not loaded")
186188
parser.add_argument("--out", required=True, help="the bound inventory to create")
189+
parser.add_argument("--max-inventory-bytes", type=nonnegative_limit, default=None, metavar="N",
190+
help="Maximum inventory bytes; unset or 0 = unlimited.")
191+
parser.add_argument("--tv-compat", action="store_true",
192+
help="Use the runner's compatibility default unless a limit is explicit.")
187193
args = parser.parse_args(argv)
194+
if args.tv_compat and args.max_inventory_bytes is None:
195+
args.max_inventory_bytes = TV_COMPAT_LIMITS["max_inventory_bytes"]
188196
try:
189-
inventory = _read_inventory(args.inventory)
197+
inventory = _read_inventory(args.inventory, args.max_inventory_bytes)
190198
cpp_bytes = _read_bytes(args.cpp, "compiled C++ source")
191199
artifact_bytes = _read_bytes(args.so, "linked library")
192200
directory = _check_output(args.out)

‎docker/entrypoint.sh‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
# nothing is installed and such a request stops the run where its
5252
# value is read. An index or feed the harness cannot install fails
5353
# the run (exit 4, one {"engine":"pineforge","error":...} line).
54+
# PINEFORGE_MAX_SYMBOL_FEEDS Maximum symbols and total feeds (--max-symbol-feeds).
55+
# PINEFORGE_MAX_INVENTORY_BYTES Maximum inventory bytes (--max-inventory-bytes),
56+
# forwarded to both the binder and runner. For both limits:
57+
# unset or 0 = unlimited; positive integer = limit; empty,
58+
# negative or non-integer = usage error in the receiving tool.
59+
# PINEFORGE_TV_COMPAT 1/true/yes/on opts into --tv-compat: defaults of 256
60+
# symbols/feeds and 8 MiB inventory, from run_json.py's one
61+
# compatibility set. Explicit limits, including 0, win.
5462
#
5563
# Optional env vars (selected-window mode; unset PINEFORGE_REPORT_POLICY = the
5664
# unchanged path above, which reads no inventory):
@@ -261,6 +269,9 @@ g++ -std=c++17 -O2 -ffp-contract=off -fPIC -shared \
261269
# run: there is no fallback to the ordinary path and run_json.py is not started.
262270
# Without an inventory (a .cpp the caller gave none for) nothing is bound and none is
263271
# invented; run_json.py gets no --request-feed-inventory and refuses the run.
272+
inventory_limits=()
273+
[[ "${PINEFORGE_TV_COMPAT:-}" =~ ^(1|true|yes|on)$ ]] && inventory_limits+=(--tv-compat)
274+
[[ -n "${PINEFORGE_MAX_INVENTORY_BYTES+x}" ]] && inventory_limits+=(--max-inventory-bytes "${PINEFORGE_MAX_INVENTORY_BYTES}")
264275
BOUND_INVENTORY=""
265276
if [[ "${SELECTED}" == "true" ]]; then
266277
if [[ -n "${INVENTORY_IN}" ]]; then
@@ -270,7 +281,8 @@ if [[ "${SELECTED}" == "true" ]]; then
270281
--inventory "${INVENTORY_IN}" \
271282
--cpp "${SRC}" \
272283
--so "${SO}" \
273-
--out "${BOUND_INVENTORY}" >&2 \
284+
--out "${BOUND_INVENTORY}" \
285+
${inventory_limits[@]+"${inventory_limits[@]}"} >&2 \
274286
|| { echo "[pineforge] request-feed inventory binding failed" >&2; exit 3; }
275287
else
276288
echo "[pineforge] no request-feed inventory for this strategy.cpp; none is passed on" >&2
@@ -280,7 +292,7 @@ fi
280292
echo "[pineforge] running backtest ..." >&2
281293

282294
# Optional per-run knobs (mirror scripts/run_strategy.py). Built conditionally so
283-
# unset env never passes an empty/invalid flag.
295+
# unset env never passes an empty/invalid flag; set limits are forwarded even empty.
284296
# PINEFORGE_TRADE_START_MS unix-ms; suppress orders before it
285297
# PINEFORGE_CHART_TZ IANA tz for date builtins
286298
# PINEFORGE_MAGNIFIER_VOLUME_WEIGHTED 1/true → vw magnifier (needs BAR_MAGNIFIER)
@@ -293,6 +305,8 @@ extra=()
293305
[[ "${PINEFORGE_MAGNIFIER_VOLUME_WEIGHTED:-}" =~ ^(1|true|yes|on)$ ]] && extra+=(--magnifier-volume-weighted)
294306
[[ -n "${PINEFORGE_SYMINFO:-}" ]] && extra+=(--syminfo "${PINEFORGE_SYMINFO}")
295307
[[ -n "${PINEFORGE_SYMBOL_FEEDS:-}" ]] && extra+=(--symbol-feeds "${PINEFORGE_SYMBOL_FEEDS}")
308+
[[ -n "${PINEFORGE_MAX_SYMBOL_FEEDS+x}" ]] && extra+=(--max-symbol-feeds "${PINEFORGE_MAX_SYMBOL_FEEDS}")
309+
extra+=(${inventory_limits[@]+"${inventory_limits[@]}"})
296310
[[ -n "${PINEFORGE_REPORT_SINK_FD+x}" ]] && extra+=(--report-sink-fd "${PINEFORGE_REPORT_SINK_FD}") # set values incl. empty; run_json.py validates
297311
[[ -n "${PINEFORGE_RUN_ID+x}" ]] && extra+=(--run-id "${PINEFORGE_RUN_ID}") # set values incl. empty; run_json.py validates
298312
if [[ "${PINEFORGE_BENCH:-}" =~ ^(1|true|yes|on)$ ]]; then

‎docker/request_feed_inventory.py‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
_SHA256_RE = re.compile(r"[0-9a-f]{64}")
7171
_TIMEFRAME_RE = re.compile(r"(?:(?P<minutes>[1-9][0-9]*)"
7272
r"|(?P<count>[1-9][0-9]*)?(?P<unit>[DWMS]))")
73-
_INVENTORY_MAX_BYTES = 8 * 1024 * 1024
7473
_READ_CHUNK = 1024 * 1024
7574

7675

@@ -157,16 +156,19 @@ def _policy_members(policy: Any) -> Optional[Tuple[Any, Any]]:
157156
return members[0], members[1]
158157

159158

160-
def _read_inventory_bytes(path: Any) -> bytes:
159+
def _read_inventory_bytes(path: Any, max_inventory_bytes: Optional[int] = None) -> bytes:
161160
if not isinstance(path, (str, os.PathLike)):
162161
raise _incomplete("no inventory path was given")
163162
try:
164163
with open(path, "rb") as handle:
165-
data = handle.read(_INVENTORY_MAX_BYTES + 1)
164+
try:
165+
data = handle.read(max_inventory_bytes + 1 if max_inventory_bytes else -1)
166+
except OverflowError: # a limit larger than a platform read size
167+
data = handle.read()
166168
except (OSError, ValueError) as error:
167169
raise _incomplete(f"the inventory cannot be read: {error}") from None
168-
if len(data) > _INVENTORY_MAX_BYTES:
169-
raise _incomplete(f"the inventory is over {_INVENTORY_MAX_BYTES} bytes")
170+
if max_inventory_bytes and len(data) > max_inventory_bytes:
171+
raise _incomplete(f"the inventory is over {max_inventory_bytes} bytes")
170172
return data
171173

172174

@@ -238,10 +240,12 @@ def _artifact_digest(path: Any) -> str:
238240

239241
def resolve_request_feed_inventory(inventory_path: Any, artifact_path: Any,
240242
validated_inputs: Any, *,
241-
primary_timeframe: Any) -> List[str]:
243+
primary_timeframe: Any,
244+
max_inventory_bytes: Optional[int] = None) -> List[str]:
242245
"""The sorted, unique canonical request-feed timeframes of one request, from
243246
the artifact's inventory. Reads the inventory file, then the artifact's bytes
244-
for their digest, and nothing else.
247+
for their digest, and nothing else. max_inventory_bytes absent or zero reads
248+
the whole inventory; a positive value probes one byte beyond that limit.
245249
246250
Raises InventoryAdmissionError (code window_mode_unsupported, detail
247251
{"capability": "selected_window_request_feed_inventory"}) when the inventory
@@ -255,7 +259,7 @@ def resolve_request_feed_inventory(inventory_path: Any, artifact_path: Any,
255259
primary = _require_primary(primary_timeframe)
256260
if not isinstance(validated_inputs, Mapping):
257261
raise _incomplete("the request's validated inputs are not a mapping")
258-
doc = _parse_inventory(_read_inventory_bytes(inventory_path))
262+
doc = _parse_inventory(_read_inventory_bytes(inventory_path, max_inventory_bytes))
259263
entries = _checked_entries(doc)
260264
if _artifact_digest(artifact_path) != doc["artifact_sha256"]:
261265
raise _incomplete("the inventory is bound to another artifact")
@@ -281,7 +285,8 @@ def resolve_request_feed_inventory(inventory_path: Any, artifact_path: Any,
281285

282286

283287
def admit_selected_request(primary_timeframe: Any, inventory_path: Any, artifact_path: Any,
284-
validated_inputs: Any, support_policy: Any) -> Optional[List[str]]:
288+
validated_inputs: Any, support_policy: Any, *,
289+
max_inventory_bytes: Optional[int] = None) -> Optional[List[str]]:
285290
"""Admit a selected-window request against the build's support policy, or
286291
raise InventoryAdmissionError. In this order: canonicalize the primary
287292
timeframe; enforce the policy's primary list (a policy that is missing or not
@@ -312,7 +317,8 @@ def admit_selected_request(primary_timeframe: Any, inventory_path: Any, artifact
312317
if members[1] == "all":
313318
return None
314319
tokens = resolve_request_feed_inventory(inventory_path, artifact_path, validated_inputs,
315-
primary_timeframe=primary)
320+
primary_timeframe=primary,
321+
max_inventory_bytes=max_inventory_bytes)
316322
for token in tokens:
317323
if token not in members[1]:
318324
raise InventoryAdmissionError(

‎docker/run_json.py‎

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3432,7 +3432,6 @@ def setter(name, key):
34323432
_SYMBOL_FEED_RECORD = struct.Struct("<5dqq")
34333433
# The requests manifest's timeframe spelling and caps (scripts/run_strategy.py).
34343434
_SYMBOL_TF_RE = re.compile(r"(?:[1-9][0-9]{0,4}|[1-9][0-9]{0,3}[DWMS])")
3435-
_SYMBOL_FEEDS_MAX = 256
34363435
_SYMBOL_KEY_MAX = 256
34373436
_SYMBOL_STAMP_MAX = 2**53 - 1 # unix ms; the record is fingerprinted as a JSON number
34383437
# Catalog syminfo key -> the strategy_set_symbol_facts field it sets.
@@ -3686,7 +3685,7 @@ def _resolve_chart_source(args):
36863685
args.ohlcv = binary # the effective input path used by the report
36873686

36883687

3689-
def load_symbol_feeds(index_path: Path, *, verify_bin="full") -> list:
3688+
def load_symbol_feeds(index_path: Path, *, verify_bin="full", max_symbol_feeds=None) -> list:
36903689
"""Read all CSV/binary feeds before state construction, relative to the index.
36913690
36923691
Each exact symbol key holds facts and feeds as before. Binary feed records
@@ -3696,14 +3695,15 @@ def load_symbol_feeds(index_path: Path, *, verify_bin="full") -> list:
36963695
doc = _read_symbol_index(index_path)
36973696
_index_chart_path(doc, index_path)
36983697
with ExitStack() as pending:
3699-
result = _load_index_feeds(index_path, doc["symbols"], verify_bin, pending)
3698+
result = _load_index_feeds(index_path, doc["symbols"], verify_bin, pending,
3699+
max_symbol_feeds)
37003700
pending.pop_all() # success transfers ownership to the returned records
37013701
return result
37023702

37033703

3704-
def _load_index_feeds(index_path, symbols, verify_bin, pending):
3705-
if len(symbols) > _SYMBOL_FEEDS_MAX:
3706-
raise SymbolFeedsError(f"--symbol-feeds: more than {_SYMBOL_FEEDS_MAX} symbols",
3704+
def _load_index_feeds(index_path, symbols, verify_bin, pending, max_symbol_feeds):
3705+
if max_symbol_feeds and len(symbols) > max_symbol_feeds:
3706+
raise SymbolFeedsError(f"--symbol-feeds: more than {max_symbol_feeds} symbols",
37073707
"too_many_symbols")
37083708
out, total = [], 0
37093709
for symbol, entry in symbols.items():
@@ -3717,8 +3717,8 @@ def _load_index_feeds(index_path, symbols, verify_bin, pending):
37173717
raise SymbolFeedsError(f"--symbol-feeds: {symbol}: feeds must be an object",
37183718
"feeds_not_object")
37193719
total += len(feeds)
3720-
if total > _SYMBOL_FEEDS_MAX:
3721-
raise SymbolFeedsError(f"--symbol-feeds: more than {_SYMBOL_FEEDS_MAX} feeds",
3720+
if max_symbol_feeds and total > max_symbol_feeds:
3721+
raise SymbolFeedsError(f"--symbol-feeds: more than {max_symbol_feeds} feeds",
37223722
"too_many_feeds")
37233723
named = {}
37243724
for tf, file in feeds.items():
@@ -3757,8 +3757,12 @@ def _run_symbol_feeds(args, binary_inputs):
37573757
if not args.symbol_feeds:
37583758
return None
37593759
# Keep the legacy call shape on the default path, including host test seams.
3760-
symbols = (load_symbol_feeds(args.symbol_feeds) if args.verify_bin == "full"
3761-
else load_symbol_feeds(args.symbol_feeds, verify_bin=args.verify_bin))
3760+
options = {}
3761+
if args.verify_bin != "full":
3762+
options["verify_bin"] = args.verify_bin
3763+
if getattr(args, "max_symbol_feeds", None):
3764+
options["max_symbol_feeds"] = args.max_symbol_feeds
3765+
symbols = load_symbol_feeds(args.symbol_feeds, **options)
37623766
binary_inputs.callback(close_symbol_feeds, symbols)
37633767
return symbols
37643768

@@ -4905,10 +4909,12 @@ def _selected_run(args, inputs, overrides, input_tf, script_tf, bar_magnifier,
49054909
# artifact's request-feed inventory (this --so, hashed and never loaded; the inventory
49064910
# beside it). Raises InventoryAdmissionError (window_mode_unsupported) before any feed,
49074911
# ctypes library, strategy or phase record. The refusal keeps its code and detail.
4912+
inventory_limits = ({"max_inventory_bytes": args.max_inventory_bytes}
4913+
if args.max_inventory_bytes else {})
49084914
try:
49094915
request_feed_inventory.admit_selected_request(
49104916
request.script_tf, args.request_feed_inventory, args.so, inputs,
4911-
swr.support_policy())
4917+
swr.support_policy(), **inventory_limits)
49124918
except request_feed_inventory.InventoryAdmissionError as error:
49134919
raise RunFailure(error.message, error.code, error.detail) from None
49144920

@@ -5313,6 +5319,21 @@ def _legacy_abbreviations(argv, legacy_long, all_long):
53135319
return out
53145320

53155321

5322+
# Opt-in compatibility defaults; explicit values, including zero, always win.
5323+
# The binder imports this table so both inventory readers use the same set.
5324+
TV_COMPAT_LIMITS = {"max_symbol_feeds": 256, "max_inventory_bytes": 8 * 1024 * 1024}
5325+
5326+
5327+
def nonnegative_limit(value):
5328+
try:
5329+
limit = int(value)
5330+
if limit >= 0:
5331+
return limit
5332+
except ValueError:
5333+
pass
5334+
raise argparse.ArgumentTypeError("must be a nonnegative integer (0 means unlimited)")
5335+
5336+
53165337
def _main(argv, binary_inputs) -> int:
53175338
# Host startup only: freeze the profile before any library/handle/run.
53185339
environment_profile = os.environ.get("PINEFORGE_RUN_JSON_PROFILE", "unjailed")
@@ -5377,6 +5398,12 @@ def _main(argv, binary_inputs) -> int:
53775398
# The long options of the command line BEFORE the selected-window flags below; see
53785399
# _legacy_abbreviations (the option strings of the parser, captured here and not typed out).
53795400
legacy_long = tuple(s for s in ap._option_string_actions if s.startswith("--"))
5401+
ap.add_argument("--max-symbol-feeds", type=nonnegative_limit, default=None, metavar="N",
5402+
help="Maximum symbols and total extra feeds; unset or 0 = unlimited.")
5403+
ap.add_argument("--max-inventory-bytes", type=nonnegative_limit, default=None, metavar="N",
5404+
help="Maximum request-feed inventory bytes; unset or 0 = unlimited.")
5405+
ap.add_argument("--tv-compat", action="store_true",
5406+
help="Use TradingView compatibility limits as defaults; explicit limits win.")
53805407
ap.add_argument("--ohlcv-bin", type=Path, default=None,
53815408
help="pf_bar_t/v1 binary chart (or the symbol index chart); alternative to --ohlcv.")
53825409
ap.add_argument("--verify-bin", choices=("full", "sidecar"), default="full",
@@ -5451,6 +5478,10 @@ def _main(argv, binary_inputs) -> int:
54515478
if not argv:
54525479
ap.error("the following arguments are required: --so, --ohlcv")
54535480
args = ap.parse_args(argv)
5481+
if args.tv_compat:
5482+
for name, limit in TV_COMPAT_LIMITS.items():
5483+
if getattr(args, name) is None:
5484+
setattr(args, name, limit)
54545485
if args.profile not in ("unjailed", "jailed"):
54555486
raise _request_invalid("PINEFORGE_RUN_JSON_PROFILE must be unjailed or jailed", "arguments")
54565487
missing = []

0 commit comments

Comments
 (0)