Summary
Filing as a follow-up to #49 (which you closed as not-a-bug because the request.security subprocess is historical-only by design). Agreed on that design intent — but the AST transformer rewrites every barstate.isconfirmed reference into a property call, and the historical-mode subprocess assigns the literal True to that name. The two are incompatible: any compiled strategy that references barstate.isconfirmed inside a code path reachable from the subprocess crashes with:
TypeError: 'bool' object is not callable
This is internal PyneCore behavior (AST transformer ↔ historical-mode subprocess) rather than a TV-divergence issue, which is why it deserves its own report.
Reproduction
Any compiled strategy that uses barstate.isconfirmed and also calls request.security will crash on the first subprocess iteration. Minimal Pine source:
//@version=6
strategy("isconfirmed_subprocess_crash")
htf_close = request.security(syminfo.tickerid, "60", close)
if barstate.isconfirmed
strategy.entry("L", strategy.long)
Compile with PyneSys, run on any data. Expected: strategy evaluates barstate.isconfirmed correctly inside the subprocess. Observed: TypeError: 'bool' object is not callable on the first subprocess bar.
Suspected cause
The AST transformer (likely in the compile pipeline that PyneSys produces) rewrites barstate.isconfirmed into a property / method call site. The historical-mode subprocess module (around core/security_process.py:150-160 in our v6.4.5 install) assigns the literal True to that name in the subprocess namespace. Literal True isn't callable, so the rewritten call crashes.
Proposed fix direction
Either:
- The historical-mode subprocess assigns a callable wrapper (e.g., a
lambda: True or a property descriptor) instead of the literal, OR
- The AST transformer detects historical-mode subprocess context and doesn't rewrite
barstate.isconfirmed into a call there.
We've been running with a local patch at security_process.py:150-160 that swaps the literal for a callable _isconfirmed_true marker. With the patch removed (per your #49 verdict), our test pipeline crashes immediately on the first subprocess bar regardless of strategy logic.
Environment
- PyneCore version:
pynesys-pynecore 6.4.5
- Python: 3.13.7
- OS: Windows 11
Related
Summary
Filing as a follow-up to #49 (which you closed as not-a-bug because the
request.securitysubprocess is historical-only by design). Agreed on that design intent — but the AST transformer rewrites everybarstate.isconfirmedreference into a property call, and the historical-mode subprocess assigns the literalTrueto that name. The two are incompatible: any compiled strategy that referencesbarstate.isconfirmedinside a code path reachable from the subprocess crashes with:TypeError: 'bool' object is not callableThis is internal PyneCore behavior (AST transformer ↔ historical-mode subprocess) rather than a TV-divergence issue, which is why it deserves its own report.
Reproduction
Any compiled strategy that uses
barstate.isconfirmedand also callsrequest.securitywill crash on the first subprocess iteration. Minimal Pine source:Compile with PyneSys, run on any data. Expected: strategy evaluates
barstate.isconfirmedcorrectly inside the subprocess. Observed:TypeError: 'bool' object is not callableon the first subprocess bar.Suspected cause
The AST transformer (likely in the compile pipeline that PyneSys produces) rewrites
barstate.isconfirmedinto a property / method call site. The historical-mode subprocess module (aroundcore/security_process.py:150-160in our v6.4.5 install) assigns the literalTrueto that name in the subprocess namespace. LiteralTrueisn't callable, so the rewritten call crashes.Proposed fix direction
Either:
lambda: Trueor a property descriptor) instead of the literal, ORbarstate.isconfirmedinto a call there.We've been running with a local patch at
security_process.py:150-160that swaps the literal for a callable_isconfirmed_truemarker. With the patch removed (per your #49 verdict), our test pipeline crashes immediately on the first subprocess bar regardless of strategy logic.Environment
pynesys-pynecore 6.4.5Related