Skip to content

Resolve empty timeframe arguments consistently - #399

Closed
luisleo526 wants to merge 3 commits into
mainfrom
fix/issue-394-empty-timeframe
Closed

luisleo526 wants to merge 3 commits into
mainfrom
fix/issue-394-empty-timeframe

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Empty strings passed to timeframe.in_seconds and timeframe.change could produce incorrect values instead of resolving to the chart timeframe. Resolve the evaluated argument consistently across literals, inputs, variables and helper calls, and preserve keyword and positional argument binding for dotted builtins. Reserve generated conversion names and preserve stable library-call arguments.

Validation is pending on this commit: the original reporter values and generic native cases, the full test selection including literal-safety and name-hygiene regressions, parity, hosted CI and independent review. Test expectations and fixtures are unchanged.

Thirty-nine added test lines are long identifiers that an automated long-token check flags: 34 trace labels in tests/fixtures/empty_timeframe/arguments.pine and 5 test function names in tests/test_e2e_empty_timeframe.py. Each was reviewed and exempted line by line; none is a credential.

Closes #394

Resolve dotted builtin signatures through the same registry record for
argument ordering and validation. Retain direct nonempty stable arguments,
single evaluation of effectful arguments and chart fallback for empty values.
Reserve the existing coercion temporary family through normal name escaping.

Integrate the complete generic corrections for #394's returned 75 cases.
Existing tests, fixtures, literals and expectations are unchanged.

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; formal verification proved 0 of 2 changed function(s) (2 not verified).

Formal verification. PR-changed functions: 0/2 verified (0 proven, 0 may-equivalent, 0 distinguished) · 2 not verified (2 unsupported).

Not verified on this run: \_resolve\_func\_args (unsupported), \_visit\_func\_call (unsupported).


Graphify review — findings

Makes timeframe.in_seconds and timeframe.change treat an evaluated empty string as the chart period, whether it comes from a literal, input, variable, function return or named argument. Plain reads are tested for emptiness inline and nonempty values pass through untouched. Anything that could carry state is evaluated once into a _pf_timeframe_arg lambda-local, so side effects don't run twice. Fixes argument binding for dotted builtin signatures like timeframe.change, so supplied arguments (including escaped string literals and VWAP anchors) are no longer dropped. _bind_func_args now looks up the intrinsic by namespace first, then by the full key, and takes parameter names from that record. Reserves _pf_timeframe_arg and the _pf_w / _pf_w_+ nested-conversion temporaries so script identifiers with those spellings get the generator's reserved-name escaping. Adds an e2e fixture and tests for empty-timeframe arguments and name hygiene, plus changelog entries.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 4231 functions depend on the 279 functions this change touches.

Health — this change adds coupling hotspots:

  • new: argument_runs() — 0 callers, 8 callees

Verification — 4231 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 2963 function(s) in the blast radius were not formally verified this run

Cross-repo impact

Cross-repo impact

This change impacts 2 symbol(s) across 1 peer repo(s) — blast radius over derived cross-repo edges:

  • pineforge-4pass/pineforge-hpo — python/pineforge_hpo/transpile.py (via import_moniker, heuristic), tests/python/test_transpile.py (via import_moniker, heuristic)

1 peer repo(s) in this group are not yet indexed — cross-repo impact may be incomplete.

Cross-repo linkage is derived (SCIP-moniker matches are sound; name/contract matches are heuristic) and ADVISORY — it never affects this check's conclusion.

Test selection

Test selection

528 of 528 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety (noncode-change, uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_action_pins.py — full-run-safety
  • tests/test_allow_entry_in_qualifier.py — impact, full-run-safety
  • tests/test_allow_entry_in_request_const.py — impact, full-run-safety
  • tests/test_analyzer.py — full-run-safety
  • tests/test_analyzer_matrix_inference.py — full-run-safety
  • tests/test_analyzer_ta_return_types.py — full-run-safety
  • tests/test_anchor_tf_change.py — impact, full-run-safety
  • tests/test_anchor_time.py — impact, full-run-safety
  • tests/test_anchor_vwap.py — impact, full-run-safety
  • tests/test_array_bounds_insert_fill_slice.py — impact, full-run-safety
  • tests/test_array_checked_access.py — impact, full-run-safety
  • tests/test_array_empty_aggregates.py — impact, full-run-safety
  • tests/test_array_history.py — impact, full-run-safety
  • tests/test_array_missing_integer_index.py — impact, full-run-safety
  • tests/test_array_new_color_fill_and_na_size.py — impact, full-run-safety
  • tests/test_array_new_defaults_and_order.py — impact, full-run-safety
  • tests/test_array_reference_semantics.py — impact, full-run-safety
  • tests/test_array_retained_alias.py — impact, full-run-safety
  • tests/test_array_slice_view.py — impact, full-run-safety
  • tests/test_array_sort_indices.py — impact, full-run-safety
  • tests/test_array_terminal_returns.py — impact, full-run-safety
  • tests/test_arrseg_coded_run_stops.py — impact, full-run-safety
  • tests/test_arrseg_review_fixes.py — impact, full-run-safety
  • tests/test_binop_operand_order.py — impact, full-run-safety
  • tests/test_block_shadow_primitive_types.py — impact, full-run-safety
  • tests/test_block_var_plain_siblings.py — impact, full-run-safety
  • tests/test_bool_na_refusal.py — impact, full-run-safety
  • tests/test_bool_na_refusals_2.py — impact, full-run-safety
  • tests/test_bool_na_values.py — impact, full-run-safety
  • tests/test_bool_string_inference.py — impact, full-run-safety
  • tests/test_builtin_name_shadow.py — impact, full-run-safety
  • tests/test_builtin_named_locals_compile.py — impact, full-run-safety
  • tests/test_builtin_named_locals_price_refusal.py — impact, full-run-safety
  • tests/test_builtin_named_locals_receipt.py — impact, full-run-safety
  • tests/test_builtin_named_locals_scope.py — impact, full-run-safety
  • tests/test_builtin_named_parameters.py — impact, full-run-safety
  • tests/test_builtin_named_parameters_reference.py — full-run-safety
  • tests/test_calc_on_order_fills_codegen.py — impact, full-run-safety
  • tests/test_calendar_lambda_locals.py — impact, full-run-safety
  • tests/test_call_argument_order.py — impact, full-run-safety
  • tests/test_callable_local_histories.py — impact, full-run-safety
  • tests/test_callable_series_param_types.py — impact, full-run-safety
  • tests/test_callable_string_series_type.py — impact, full-run-safety
  • tests/test_callable_ta_forwarded_length.py — impact, full-run-safety
  • tests/test_callable_var_first_reach.py — impact, full-run-safety
  • tests/test_checked_settings.py — impact, full-run-safety
  • tests/test_ci_engine_main_touched.py — full-run-safety
  • tests/test_closed_trade_fold.py — full-run-safety
  • tests/test_closed_trade_fold_emission.py — full-run-safety
  • tests/test_closed_trade_text_equals.py — impact, full-run-safety
  • … and 478 more

non-code file(s) changed (CHANGELOG.md, tests/fixtures/empty_timeframe/arguments.pine, tests/fixtures/empty_timeframe/reporter-change.pine, tests/fixtures/empty_timeframe/reporter-seconds.pine) → running the full suite for safety (a code graph can't see config/fixture/data deps)

changed code file(s) with no mapped test (CHANGELOG.md) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

Formal verification

Could not verify: Could not verify \_resolve\_func\_args.

The verifier did not have enough to check \_resolve\_func\_args, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)

Could not verify: Could not verify \_visit\_func\_call.

The verifier did not have enough to check \_visit\_func\_call, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)

· 1 grounded finding(s) anchored inline below.



@pytest.fixture(scope="module")
def argument_runs(tmp_path_factory):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression — argument_runs()

fans out to 8 callees (efferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

@luisleo526

Copy link
Copy Markdown
Contributor Author

Superseded by #401: the same change on a corrected base (this branch cannot be updated by a fast-forward).

@luisleo526 luisleo526 closed this Nov 15, 2026
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.

An empty timeframe string in timeframe.in_seconds("") and timeframe.change("") is not read as the chart timeframe: 0 seconds, and never a change

1 participant