Repository navigation
Control Point link v1.2: STEP files and part pictures reach Control Point; AI review runs through it when linked - #61
Merged
Conversation
… and AI review runs through it when linked - The STEP zip is always a reference uploaded right after the send, so it never changes the key and adding it later reaches the same import. POST /api/control-point/file streams files unread (64 MB) for the caller's own latest send; the card offers Add STEP files until the zip is there. - Part pictures: Control Point's keys are listed, pictures it holds are skipped, cached ones go free, and at most 30 parts it has no picture of are drawn per send. /api/preview?cached=1 never asks Onshape. - AI review without this Worker's keys goes to Control Point with the link's token (190 s, no retries); the allowance, cache and parseAiReview stay here, a 401 answers 409 revoked, and /api/ai/status reports it. - Contract v1.2 (docs/control-point-link.md, sections 6 and 7), mock Control Point, tests, CLAUDE.md.
[Medium impact] The changes since the last review appear safe to merge. SummaryThis PR adds STEP uploads, part pictures, and AI review through a linked Control Point workspace. Since the last review:
The earlier fixes remain present: uploads are recorded separately by import, duplicate sends retain their records, changed archive bytes are uploaded again, and picture runs track failures and run one at a time. No new actionable issue was found. Reviews (4) · Last reviewed commit: "Greptile: allow the upload hash header i..." · Reviewed by Greptile |
…gain, one picture run at a time, failed pictures shown
Contributor
Author
|
@greptile review |
# Conflicts: # CLAUDE.md # apps/web/src/app/useControlKit.ts # packages/shared/src/index.ts
Contributor
Author
|
@greptile review |
…rtial STEP export holds every part
Contributor
Author
|
@greptile review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The owner asked: "i should also be able to download all the parts in control point itself, also show the preview images in control point too", and for AI review, "when control point is linked it should work". This builds Control Kit's side of link contract v1.2 (
docs/control-point-link.md§6 and §7). Control Point's side is ZOGWORK/control-point#340, and the two must merge together.Files after a send
referencein the bundle, and so is anything over 4 MB. The panel uploads them right after the send, including a duplicate send, to the import Control Point answered with.POST /api/control-point/filestreams the bytes unread, within the free plan's 10 ms CPU limit:Content-Lengthrequired;cp-sent, so the card shows "STEP files … are in Control Point".Part pictures
pictureTargets: one line per part identity, parts to make first, with Not needed and undrawable lines left out.POST /api/control-point/pictures, streamed unread with an 8 MB cap.controlPointPictureKeyis the revision the Worker caches a picture at, plus a line hash, so pictures Control Point already holds are skipped.GET /api/preview?…&cached=1returns a picture already drawn, or 404not_cached, without ever asking Onshape.PICTURE_FILL_PER_SEND= 30 per send. A part with a newer revision that was never drawn keeps its older picture.shaded-viewrequests, fewer for parts whose drawer was already opened.AI review through Control Point
/api/ai/statusanswers{enabled: true, via: 'control-point'}, and the panel asks again when the link or workspace changes;/api/ai/reviewsendsaiReviewAsk(trustedAiRequest(…))with the link's bearer token, waits at most 190 seconds, and never retries.AiAllowanceper-person and global limits;ai-review:{hash}:control-point;parseAiReviewcheck of every answer.revoked, like the other link routes.Screenshots
Control Point's pages are in its PR. On the Control Kit card, the visible change is the "STEP files are / are not in Control Point" line, the Add STEP files button, and the part picture note shown after a send.
Tests
apps/worker/src/control-point.test.ts, against mock Control Point and mock Onshape, covers:cached=1never reaching Onshape;packages/shared/src/control-point.test.tscovers the new key rule,pictureTargetsordering, and picture keys.corepack pnpm typecheck,eslint --ignore-pattern '.claude/**',pnpm test(294 tests),pnpm -r buildandpnpm test:smoke(11) all pass.Not verified