test: board-frame guards slice fixed character windows
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with dashboard/backend/tests/test_frontend_board_frame.py and read _extract_function to see how it locates a bounded source section. Add a matching helper for the createEndpointLabelPlugin({ call, then replace the six fixed-character slices with the exact call text. Run this test file; done means all six assertions inspect only their own call site and pass.
Written by the indexing model from the issue text.
Description
dashboard/backend/tests/test_frontend_board_frame.py verifies several call-site
facts by slicing a fixed number of characters forward from an index() hit:
call = _SRC[_SRC.index("createEndpointLabelPlugin({") :][:800]
assert "currentChartView === 'absolute'" in call
Six sites do this — [:800], [:1000], [:400], [:700] (×2), [:900] — and
every assertion inside them is positive (in).
Why the number is unsafe in both directions. The windows are hand-tuned to
land just past the last option of the call they are reading:
- Too short: add a comment or an option to the call and the target slides out of
the window. The assertion fails, but the failure says "the tab does not inject
hoveredDatasetIndex" when the tab plainly does. Loud, but false. - Too long: the window runs past the call's closing paren into whatever follows,
and the assertion can then pass on text from an unrelated function. Silent.
Neither bound is checked, and the file already knows this — one site carries the
comment "it needs the wider window to stay inside the same call site rather than
spilling into whatever follows it." That is a defended magic number, not a bound.
Fix. The module already solves the equivalent problem for functions:
_extract_function brace-matches by name. Add the paren-matching twin — find
createEndpointLabelPlugin({, walk to its balanced closing paren, and assert
against exactly that call site. Then the window is the call, the six magic
numbers go away, and both failure directions become impossible rather than
improbable.
Found during the whole-branch review of the nof1 board frame work; no current
test is known to be wrong today.
Surfaced by the whole-branch review of #382.
- Dominant language
- Python
- Stars
- 767
- Forks
- 156
- Avg merge
- 22h 57m
- Merged PRs (30d)
- 84
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Open-Finance-Lab/AgenticTrading
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Open-Finance-Lab/AgenticTrading#663 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Open-Finance-Lab/AgenticTrading#661 ·
Maintainers usually reply within 1 day
-
fix(llm): a non-ASCII execution handoff raises UnicodeEncodeError instead of ExecutionHandoffErrorPossibly taken @subidhkhanal claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Open-Finance-Lab/AgenticTrading#659 ·
Maintainers usually reply within 1 day
-
fix(backtests): an LLM action with trailing whitespace ("buy ") is silently droppedPossibly taken @subidhkhanal claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Open-Finance-Lab/AgenticTrading#658 ·
Maintainers usually reply within 1 day
-
fix(llm): Gemini adapter drops thinking tokens from the output countPossibly taken @subidhkhanal claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Open-Finance-Lab/AgenticTrading#657 ·
Maintainers usually reply within 1 day
All issues in Open-Finance-Lab/AgenticTrading
Similar issues
-
Project submission:Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
slavakurilyak/awesome-ai-agents#845 ·
Maintainers usually reply within 1 day
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryPossibly taken A pull request linked to this issue is open or already merged. Opendifficulty:2 enhancement good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
MakazhanAlpamys/Soup#2178 ·
Maintainers usually reply within 1 day
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
scverse/rapids-singlecell#854 ·
Maintainers usually reply within 1 day
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLPossibly taken @ninglinLiu claimed this today. Openarea:frontend backend:slang bug direction:input
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalsePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 13 days