Skip to content

Commit aa30961

Browse files
authored
Make the symbol-feed count and request-feed inventory size limits parameters, default unlimited (#675)
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. Unset or 0 means no limit; a positive value is a limit; anything else is a usage error. The previous fixed values (256 feeds, 8 MiB) are available only through the opt-in --tv-compat table, where an explicit value still wins. ## Ambiguous-prefix message (named behaviour change) Registering `--max-symbol-feeds`, `--max-inventory-bytes` and `--tv-compat` adds them to the candidate lists of the runner parser's ambiguous-prefix refusal: - `--t` now also names `--tv-compat` (`ambiguous option: --t could match --transpiled, --trade-start-ms, --tv-compat`); - `--m` and `--ma` also name `--max-symbol-feeds` and `--max-inventory-bytes`. The exit status (2), the failure code (`run_request_invalid`) and its args (`{"option":"arguments"}`) are unchanged. The `--m` text is pinned by `test_existing_ambiguous_prefix_keeps_its_error`; the `--t` and `--ma` texts are pinned by `test_the_limit_options_join_the_ambiguous_prefix_lists`. The changelog states the change. ## Disclosures - One sentence of `docs/design/BARS-BIN-INPUT.md` ("source tree" note) was rewritten, and statements about the old fixed limits were replaced by the parameter wording. - Two existing tests were adapted: the 256-feed refusal row now passes `max_symbol_feeds=256`, and the `--m` prefix row expects the two new option names after the frozen text. - Still capped by default outside this change (not touched): `scripts/run_strategy.py` (256 requests-manifest entries) and the converter's 2 MiB summary cap (`docker/pineforge_sink_to_json.py`). - Open follow-ups from the independent read (not in this PR): the failure-catalog `english` templates still say "more than 256"; the binder imports the limits table from the runner module; non-regular inventory files and very large positive limits are not guarded. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Commits: * ed4468c 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]> * 15dab60 Merge main into the runner limits branch Takes main's run quota admission change; no conflict. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * a334e0f Name the ambiguous-prefix message change of the limit options and pin it Registering --max-symbol-feeds, --max-inventory-bytes and --tv-compat adds them to the candidate lists of the runner parser's ambiguous-prefix refusal: --t now also names --tv-compat, and --m and --ma also name the two limit options. The exit status, the failure code and its args are unchanged. The changelog now states this, and a test pins the exact new text of the --t and --ma refusals (the --m text is pinned by the existing prefix test). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * 59bd663 Merge main into the limits branch Takes the output series limit parameter that landed on main. The runner parser now parses through the output-series helper and then applies the compatibility defaults of the limit options; the changelog keeps both entries; the memory page keeps main's text with the run_json.py citations re-pinned to the merged file. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * 2ee8cf7 Native live startup test: the example exports engine layout stamp 2 The output series limit change raised PF_STREAM_ENGINE_LAYOUT_VERSION from 1 to 2 on purpose (the engine gained a member), and the module-layout assertion in native_live_startup_e2e.py still pinned version 1, so the native-live legs failed on main. The pin moves to 2: the normally linked native example must still export the stamp, and it must still be exactly the version the runner accepts; an accidental bump stays a test failure. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --- Merge note (L6 super top): train T3 = CR-566 (#675) + the red-main fix for #677. #677 bumped PF_STREAM_ENGINE_LAYOUT_VERSION 1 -> 2 on purpose (include/pineforge/pineforge.h); the native-live startup test still pinned 1, so main 78f369e went red in post-merge native-live (TEST-BUG, triaged by ORG). The fix is a literal pin to 2 in tests/native_live_startup_e2e.py (2ee8cf7), deliberately not derived from the header so an accidental bump still fails. Merge gate on head 2ee8cf7: pineforge/verify 8/8 (rj-20261031t160031-f332e3, verdict cb43df2d), pineforge/parity success (sweep exp-engine-pr675-2ee8cf74-20261101, 7989 probes, cov lost 0, band1/band2 +0/-0, hard reg 0, leavers 0; verdict b61016c9), GKE PR CI green. Native-live on this exact head on spot boxes before merge: native shards 1-4 passed 1,550/1,550 with skipped-test names identical to main's GitHub run 41211922405; live-sanitizers and live-tsan 118/119 each, the one red being native_live_ratio_interval_e2e, a timing case already present on main (GitHub ran it at 149.30 s sanitizers / 67.33 s tsan, passing at its stdin-idle bound; our loaded boxes 154.5 s / 132.6 s failed; alone on the idle box it passed 3/3 at 65.7-66.0 s, 0 sanitizer reports). Carded CR-583: make that test load-proof (parameterized idle bound).
1 parent 78f369e commit aa30961

22 files changed

Lines changed: 592 additions & 166 deletions

‎CHANGELOG.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ version number follows semantic versioning over the surfaces the
77

88
## Unreleased
99

10+
- The runner no longer refuses more than 256 symbols or total extra feeds in a
11+
`--symbol-feeds` index, and the two request-feed inventory readers (the
12+
runner's and `bind_compiled_inventory.py`) no longer refuse an inventory over
13+
8 MiB: both limits are now parameters whose default is no limit.
14+
`--max-symbol-feeds N` and `--max-inventory-bytes N` (environment
15+
`PINEFORGE_MAX_SYMBOL_FEEDS` and `PINEFORGE_MAX_INVENTORY_BYTES` in the
16+
container entrypoint) set a limit; unset or `0` is unlimited and anything
17+
else that is not a nonnegative integer is a usage error. With a limit set the
18+
typed refusals (`too_many_symbols`, `too_many_feeds`, the inventory
19+
incompleteness refusal, binder exit 10) are unchanged and name the limit in
20+
force. `--tv-compat` (`PINEFORGE_TV_COMPAT`) selects the former values, 256
21+
and 8 MiB, as defaults; an explicit value, including `0`, wins. The key
22+
length limit is unchanged. The ambiguous-prefix message of the runner's
23+
argument parser now lists the new options where they share a prefix:
24+
`--t` also names `--tv-compat`, and `--m` and `--ma` also name
25+
`--max-symbol-feeds` and `--max-inventory-bytes`. The exit status, the code
26+
`run_request_invalid` and its args are unchanged.
1027
- Recorded output series are unlimited by default; 0 or omission of `--limit-output-series` means no limit, while a positive N is the operator's cap and any refusal reports that positive N as `max`. Report-window memory follows the declared count: 6 MiB + 64 KiB × S + a 64 KiB reader with the default I/O sizes.
1128
- Reading a map is cheaper: each map now keeps a fixed read cache of 8 slots
1229
for the keys and values it has just read, so a repeated `get` or `contains`

‎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(

0 commit comments

Comments
 (0)