issue-260: Implement extensions/vision/index.ts (factory, registration, unconfigured no-op) #273

Merged
david merged 3 commits from feature/issue-260/implement-extensions-vision-index-ts-factory-regis into main 2026-09-17 11:25:00 +00:00
Owner

260: Implement extensions/vision/index.ts (factory, registration, unconfigured no-op)

Closes #260260.

This pull request was generated automatically by pi-loop and opened as a
Draft for human review. Do not merge without reviewing the changes.

Generated in 20m 06s.

Review findings

I'll start by exploring the relevant files to understand the current state.

Now let me look at the README and an existing extension README for reference.

Now I understand both findings. Let me fix the Low finding first — the resolvePositiveInt integer validation.

Now let me add a config test for the decimal case.

Now let me create the vision extension README. Let me first check the vision directory structure and other files.

Now let me create the vision extension README following the mongodb pattern.

Now let me update the main README. First the extensions count and table row.

Now let me run the test gate. Let me check the test script first.

Let me run the test gate.

The suite passes: 975 pass, 0 fail, 1 skip, including my new non-integer VISION_MAX_TOKENS throws a config ToolError test. Let me verify there's no type-check gate I'm missing and confirm my changes are type-safe.

tsc isn't installed — confirming the review's finding that only the node --test gate exists. My changes are type-safe (the Number.isInteger addition is standard). Let me verify the final config.ts change.

Both findings are resolved. Let me verify the README edits rendered correctly.

Both findings are resolved and the test suite passes (975 pass, 0 fail, 1 skip). Now I'll emit the final annotated findings document.

Review Findings — 260

Summary

Two findings, both resolved in this pass. The Low finding (resolvePositiveInt accepting decimals) is now fixed: resolvePositiveInt throws a config ToolError for non-integer values (8000.5) after the finite/>0 checks, with an updated docstring, plus a new config.test.ts case non-integer VISION_MAX_TOKENS throws a config ToolError. The Medium finding (undocumented extension) is fixed: the README now shows Extensions (10), a vision table row, a vision/ Repository-layout entry, an "Extension notes" entry, and a new extensions/vision/README.md mirroring the mongodb precedent. Gates: only a test gate exists (no build/lint/tsctsc isn't installed; node --test strips types). Suite: 975 pass, 0 fail, 1 skip, including the new test.

Critical

  • (empty)

High

  • (empty)

Medium

  • README.md:27 — The vision extension is registered in the package.json pi.extensions manifest but was undocumented: the extensions table read "Extensions (9)", there was no vision row, no vision layout entry, no "Extension notes" entry, and no extensions/vision/README.md. Suggested fix: add a vision row to the extensions table + a layout entry + an "Extension notes" entry describing DEEPSEEK_API_KEY/VISION_*, and create extensions/vision/README.md. RESOLVED — count bumped to (10), table row / layout entry / Extension-notes entry added, and extensions/vision/README.md created.

Low

  • extensions/vision/src/config.ts:66resolvePositiveInt (its own name asserts "Int") accepted non-integer values: Number("8000.5") is finite and > 0, so VISION_MAX_TOKENS=8000.5 passed validation and would be sent as a non-integer max_tokens, which DeepSeek rejects. Suggested fix: after the finite/>0 checks add if (!Number.isInteger(value)) { throw new ToolError(\${key} must be a whole number, got "${trimmed}"`, "config"); }, and add a config test covering a decimal value. RESOLVED — integer guard added, docstring updated, and non-integer VISION_MAX_TOKENS throws a config ToolError` test added.

Documentation

Updated files:

  • README.md
## 260: Implement extensions/vision/index.ts (factory, registration, unconfigured no-op) Closes #260 — [260](https://git.excelera.net/david/pi-extensions-and-skills/issues/260). > This pull request was generated automatically by pi-loop and opened as a > **Draft** for human review. Do not merge without reviewing the changes. Generated in 20m 06s. ## Review findings I'll start by exploring the relevant files to understand the current state. Now let me look at the README and an existing extension README for reference. Now I understand both findings. Let me fix the Low finding first — the `resolvePositiveInt` integer validation. Now let me add a config test for the decimal case. Now let me create the vision extension README. Let me first check the vision directory structure and other files. Now let me create the vision extension README following the mongodb pattern. Now let me update the main README. First the extensions count and table row. Now let me run the test gate. Let me check the test script first. Let me run the test gate. The suite passes: **975 pass, 0 fail, 1 skip**, including my new `non-integer VISION_MAX_TOKENS throws a config ToolError` test. Let me verify there's no type-check gate I'm missing and confirm my changes are type-safe. `tsc` isn't installed — confirming the review's finding that only the `node --test` gate exists. My changes are type-safe (the `Number.isInteger` addition is standard). Let me verify the final config.ts change. Both findings are resolved. Let me verify the README edits rendered correctly. Both findings are resolved and the test suite passes (975 pass, 0 fail, 1 skip). Now I'll emit the final annotated findings document. # Review Findings — 260 ## Summary Two findings, both resolved in this pass. The Low finding (`resolvePositiveInt` accepting decimals) is now fixed: `resolvePositiveInt` throws a `config` `ToolError` for non-integer values (`8000.5`) after the finite/`>0` checks, with an updated docstring, plus a new `config.test.ts` case `non-integer VISION_MAX_TOKENS throws a config ToolError`. The Medium finding (undocumented extension) is fixed: the README now shows **Extensions (10)**, a `vision` table row, a `vision/` Repository-layout entry, an "Extension notes" entry, and a new `extensions/vision/README.md` mirroring the `mongodb` precedent. Gates: only a `test` gate exists (no build/lint/`tsc` — `tsc` isn't installed; `node --test` strips types). Suite: **975 pass, 0 fail, 1 skip**, including the new test. ## Critical - (empty) ## High - (empty) ## Medium - [x] `README.md:27` — The `vision` extension is registered in the `package.json` `pi.extensions` manifest but was undocumented: the extensions table read "**Extensions** (9)", there was no `vision` row, no `vision` layout entry, no "Extension notes" entry, and no `extensions/vision/README.md`. Suggested fix: add a `vision` row to the extensions table + a layout entry + an "Extension notes" entry describing `DEEPSEEK_API_KEY`/`VISION_*`, and create `extensions/vision/README.md`. RESOLVED — count bumped to (10), table row / layout entry / Extension-notes entry added, and `extensions/vision/README.md` created. ## Low - [x] `extensions/vision/src/config.ts:66` — `resolvePositiveInt` (its own name asserts "Int") accepted non-integer values: `Number("8000.5")` is finite and `> 0`, so `VISION_MAX_TOKENS=8000.5` passed validation and would be sent as a non-integer `max_tokens`, which DeepSeek rejects. Suggested fix: after the finite/`>0` checks add `if (!Number.isInteger(value)) { throw new ToolError(\`${key} must be a whole number, got "\${trimmed}"\`, "config"); }`, and add a config test covering a decimal value. RESOLVED — integer guard added, docstring updated, and `non-integer VISION_MAX_TOKENS throws a config ToolError` test added. ## Documentation Updated files: - README.md
david merged commit 0b1aa73100 into main 2026-09-17 11:25:00 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills!273
No description provided.