Feature/save current work 2026 07 01#456
Conversation
- Add ImportDxfButton to CommunityViewerToolbarLeft; opens ImportDxfTool in a fixed overlay (click backdrop to dismiss) - Add optional `badge` slot to TreeNodeWrapper rendered between label and actions - WallTreeNode reads metadata.needsReview and shows an amber AlertCircle with a tooltip when the DXF merge engine flagged a position mismatch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d, add furniture to MergeResult fixture
…print, mm units, command palette entry - Fix $INSUNITS from 6 (m) to 4 (mm); all coordinates ×1000 - Break walls at door/window openings (solidSegments algorithm) - Export Item nodes as rotated rectangle footprints (PASCAL_FURNITURE layer) - Improve door: sill line + 90° swing arc oriented to wall angle - Improve window: two face lines + jamb lines (proper gap rectangle) - Add "Export AutoCAD (DXF)" to Ctrl+K command palette (Export & Share group) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es on export Pascal stores wall Y = -DXF_Y (same flip applied during DXF import in madori-xml-parser.ts). Without the inverse flip on export the floor plan was mirrored vertically. Fix: - Negate Y in point2d() and dxfPolyline() vertex loop - Swap and negate arc start/end angles in dxfArc() (CCW [s→e] → CCW [-e→-s]) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AutoCAD rejected the file with "group code 90 undefined at line 20" because: 1. LWPOLYLINE's vertex-count (code 90) requires a preceding "100 AcDbPolyline" subclass marker — without it AutoCAD can't identify the code 2. No $ACADVER header → AutoCAD fell back to R12 (AC1009) which predates LWPOLYLINE 3. Missing TABLES / BLOCKS / OBJECTS sections required by AC1015 structure Fix: - Add $ACADVER=AC1015 to HEADER section - Add 100-subclass markers to all entity types (AcDbEntity + AcDbLine / AcDbPolyline / AcDbText / AcDbCircle + AcDbArc), with layer (code 8) placed after AcDbEntity per spec - Add empty TABLES, BLOCKS, OBJECTS sections to complete the 6-section layout Online viewers were unaffected because they use lenient parsers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DXF import: - Expand SiteNode polygon to building bbox + 2m margin (fixes 30m default square) - Hide import warnings from UI, log to console only - Remove auto-created slab (was not requested) DXF export (AutoCAD compatibility): - Add AC1015 version, handles, AcDbSymbolTable markers, TABLES/BLOCKS structure - Fix Y-axis mirror (negate Y on output, swap arc angles) - Wall breaks at door/window openings - Furniture footprint export - Add to Ctrl+K command palette Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three separate counters (th for tables, bh for blocks, nextH for entities) could generate overlapping handles, causing AutoCAD's eHandleInUse error. Fix: - Replace makeHandleGen(start) with makeHandleGen() starting at 1 - Use the single nextH() counter for tables, blocks, and entities - Pre-compute APPID table/entry handles before building the string to avoid the evaluation-order bug where body args run before tbl() assigns the TABLE handle (so owner references were pointing to wrong entities) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| } catch (err) { | ||
| setErrorMsg(err instanceof Error ? err.message : 'Failed to write scene.') | ||
| setPhase('error') | ||
| } |
There was a problem hiding this comment.
Job marked merged too early
Medium Severity
In the geo+ai path, saveRunOutput (which sets job status to merged) runs before importSceneViaServer finishes. If scene persistence fails afterward, the audit trail shows merged with no sceneId or imported status, contradicting actual outcome.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0473177. Configure here.
| sceneResult = await buildAndSaveScene(mergeResult, coords, { | ||
| name: job.jobId, // caller can rename the scene later | ||
| operation: 'madori_import', | ||
| }) |
There was a problem hiding this comment.
Madori rerun duplicates scenes
Medium Severity
Each POST .../madori (including ?rerun=1) always calls buildAndSaveScene and sets a new sceneId on the job. Re-running import without re-calling Madori creates another published scene instead of updating the existing one.
Reviewed by Cursor Bugbot for commit 0473177. Configure here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…明 + case-19 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| { error: 'ANTHROPIC_API_KEY not configured' }, | ||
| { status: 503 }, | ||
| ) | ||
| } |
There was a problem hiding this comment.
Vision API route unauthenticated
High Severity
POST /api/vision-analyze accepts arbitrary image payloads and calls Anthropic when ANTHROPIC_API_KEY is set, with no auth or rate limit. Any client that can reach the editor can trigger paid vision usage.
Reviewed by Cursor Bugbot for commit 9f7ff3a. Configure here.
…豁免衣柜 + eval 合并空间语义/几何断言/碰撞明细 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify({ name, mergeResult, coords, guideImageUrl }), | ||
| }) |
There was a problem hiding this comment.
Geo AI import missing auth
High Severity
The geo+AI path posts to /api/dxf-import-scene with only Content-Type, while that route uses guardSceneApiRequest. When PASCAL_SCENE_API_TOKEN is set, the import fails with 401/503 even though Madori import can still succeed via other routes.
Reviewed by Cursor Bugbot for commit 10882b5. Configure here.
| } catch (err) { | ||
| console.error('[dxf-jobs] createJob failed:', err) | ||
| return NextResponse.json({ error: 'Failed to create job' }, { status: 500 }) | ||
| } |
There was a problem hiding this comment.
DXF job API unauthenticated writes
Medium Severity
POST /api/dxf-jobs accepts arbitrary dxfText and preview payloads with no auth or size cap, writing under PASCAL_DATA_DIR/dxf-imports/. Related job routes can trigger Madori calls and status updates with only a guessable 8-hex jobId.
Reviewed by Cursor Bugbot for commit ff040f2. Configure here.
|
|
||
| export async function POST(request: NextRequest): Promise<NextResponse> { | ||
| const guard = guardSceneApiRequest(request) | ||
| if (guard) return guard |
There was a problem hiding this comment.
Geo import missing scene token
Medium Severity
dxf-import-scene requires guardSceneApiRequest, but the geo+ai client fetch to that route sends only Content-Type, not Authorization or x-pascal-scene-token. With PASCAL_SCENE_API_TOKEN set on a non-trusted host, import fails after merge.
Reviewed by Cursor Bugbot for commit ff040f2. Configure here.
… 4 参照 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…用判定) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…+ runChat 三挂载点) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| return NextResponse.json( | ||
| { error: 'metadata is invalid.', details: parsed.error.flatten() }, | ||
| { status: 400 }, | ||
| ) |
There was a problem hiding this comment.
Invalid catalog metadata returns 500
Low Severity
JSON.parse(metadataRaw) runs inside the broad try without a dedicated catch. Malformed metadata JSON yields a 500 instead of a 400 validation error.
Reviewed by Cursor Bugbot for commit 02a405a. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 32 total unresolved issues (including 31 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f239c3e. Configure here.
| } | ||
|
|
||
| const confidence = typeof r['confidence'] === 'number' ? r['confidence'] : 0 | ||
| if (confidence < MIN_CONFIDENCE) return fallback('confidence_too_low') |
There was a problem hiding this comment.
Missing confidence rejects vision
Medium Severity
normalizeSemanticResponse treats a missing top-level confidence as 0, then returns valid: false when below 0.55. A well-formed model payload with rooms and openings but no confidence field is discarded and merge falls back to geometry-only.
Reviewed by Cursor Bugbot for commit f239c3e. Configure here.


What does this PR do?
How to test
Screenshots / screen recording
Checklist
bun devbun checkto verify)mainbranchNote
High Risk
Large feature surface touching scene persistence, external APIs (Anthropic vision, Madori, ComfyUI), and optional catalog source mutation; misconfiguration or API key handling could affect imports and deployed data.
Overview
Adds an end-to-end DXF floor-plan import path: canvas preview/validation UI, file-based job APIs under
PASCAL_DATA_DIR, optional vision analysis (/api/vision-analyze+ prompt file), geo+AI merge run recording, scene build (/api/dxf-import-scene), and an alternate 3dMadori pipeline (/api/dxf-jobs/.../madori). Entry points include/import-dxf, home/scenes modals, and supporting components (ImportDxfTool, progress/settings/feedback).Also wires AI agent proxy (
/api/ai/[...path]), expands env for Azure/OpenRouter andPASCAL_DATA_DIR, and registers Pascal MCP in.mcp.json/ Codex / Claude settings.Catalog dev workflow: POST/PATCH/DELETE
/api/catalog-items(optional source writes viaPASCAL_ALLOW_CATALOG_SOURCE_WRITE) plus dev overlay API; docs inCATALOG_ITEMS.md.Image → 3D via ComfyUI (
/api/pic-to-3d/*and/pic-to-3dpage). Editor shell gains sidebar tabs (AI, Add catalog, 360, walkthrough) and MeasureNavi theming (Inter/JetBrains,measurenavi-editor-theme.css).Documentation/skills:
.agents/skills/dxf-import/SKILL.md, DXF job rules inAGENTS.md,SAVE_BUILD_JSON.md,WINDOWS_DEPLOY_RUNBOOK.md; gitignore for reverse-proxy build artifacts.Reviewed by Cursor Bugbot for commit 02f8436. Bugbot is set up for automated code reviews on this repo. Configure here.