Skip to content

Reject figure-coverage invocations without --kb - #1173

Closed
rudycelekli wants to merge 1 commit into
deeplethe:devfrom
rudycelekli:fix/figures-require-kb-argument
Closed

rudycelekli wants to merge 1 commit into
deeplethe:devfrom
rudycelekli:fix/figures-require-kb-argument

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Without --kb, indexOf returned -1 and argv[0] became the knowledge-base identifier. The script queried the database and printed an empty NaN coverage report instead of usage. Explicitly require a real --kb position before reading its value, preserving the existing missing-value checks.

Validation: node --test scripts/bench/figures.arguments.test.mjs (4 tests pass; 2 regression failures on the original source). Offline subprocess fixtures replace only the external service/process boundary. No database or live-network validation is claimed.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
@WaylandYang

Copy link
Copy Markdown
Contributor

Thank you for going through the codebase this carefully. We are taking eight from this batch (#1140, #1143, #1147, #1148, #1157, #1163, #1166, #1168), each a behaviour someone using Utopia would hit.

We are closing this one: it guards against an input we have not seen in use, and we keep the code and its tests to what the product needs today. For the scripts under scripts/, CI runs only scripts/bench/lib.test.mjs, so the added tests would not run.

If you see this happen in a real deployment, please open an issue with the case and we will take it. For future sweeps, one issue listing the findings first would let us pick together before you write the fixes.

Thanks again for the time you put into this.

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.

2 participants