Skip to content

Latest commit

 

History

History
114 lines (85 loc) · 12.2 KB

bug-report-reproducibility.md

File metadata and controls

114 lines (85 loc) · 12.2 KB

Bug Report Reproducibility

Use this guide before changing /api/feedback/bug-report, feedback ticket assembly, attachment collection, cleanup, server upload handling, scripts/load_bug_repro.py, or any converter generation parameter captured for reproduction.

Ticket Storage

  • Bug reports submitted via /api/feedback/bug-report land as a ticket directory at feedback/<YYYY-MM>/<ticket_id>/
  • New ticket_id values match LUM-YYYYMM-<8-char-lowercase-hex> using the Beijing month. The random suffix prevents independent devices from relying on the same local daily counter
  • Historical LUM-YYYYMMDD-NNN ticket directories remain readable by scripts/load_bug_repro.py

Submission Protocol

  • POST /api/feedback/bug-report continues to accept the legacy application/json payload

  • The feedback dialog requests a reply by default and asks for one email address, QQ number, or WeChat ID. It sends needs_reply and user_contact; email addresses also populate user_email for existing consumers. Turning off replies sends no contact. Clients sending only the legacy optional user_email still submit successfully, with reply intent inferred from whether they supplied an email address.

  • Exact-source capture uses multipart/form-data with required request_payload JSON, optional original_image, and repeated source_files parts. Source files have no type, size, or count cap. Legacy original_image_omission_reason=too_large remains readable for older clients

  • GET /api/feedback/bug-report/<ticket_id>/status reports the upload state; POST /api/feedback/bug-report/<ticket_id>/resubmit retries a failed upload from the local ticket. Both are local-origin only

  • Local report submission and retry have no per-IP quota. The hosted feedback service owns upload throttling and abuse prevention.

Ticket Contents

  • ticket.json: canonical payload (schema_version=3) with user description, workflow snapshot, action history, client logs, attachments manifest, submission upload state, and assembly_status
  • needs_reply and user_contact appear in ticket.json, index.md, and summary.txt for support triage; the JSON keeps user_email for email-based workflows.
  • index.md: human-readable index generated by the assembler
  • summary.txt: Chinese summary optimized for AI assistants
  • Bulky files include original.<ext>, source_<index>.<ext>, final.<ext>, LUT files, materials.zip, screenshot.<ext>, session-data.zip, and backend-logs.zip
  • The browser retains every file selected, dropped, or uploaded during the current page session, including failed uploads and locally parsed reference workbooks. Sources from Converter, batch, model texture, heightmap, Extractor, Vectoriser, and single-stage workflows are also captured regardless of the active tab. Raster images, SVG, STL/models, datasets, and other inputs retain their exact bytes. Crop and rotation retain both the pre-transform original and the current derived file
  • source_files records each original filename, stored filename, size, and capture status. Uploads do not require a preview session or an original-image reference
  • Original-image collection priority is browser upload, then FileRegistry, then SessionStore. capture_source and direct_upload_status record the path taken; capture failures remain explicit in the manifest
  • workflow_state retains all current non-function store data across conversion, calibration/extraction, LUT management/comparison/details, five-color, slicer/settings, Workshop, and UI workflows. Descriptions, API response details, client diagnostics, paths, tracebacks, action history, and unknown context fields are persisted without redaction or length/depth truncation
  • Action/client-log histories have no count or age eviction. Loading browser persistence preserves distinct and repeated records in the same millisecond. If browser storage fills, the complete in-memory history remains available to submit; it cannot survive a subsequent page refresh when persistence has failed
  • session-data.zip contains registered files (including ColorChecker full images), session-owned inputs/intermediates, complete session state, the actual solver cache, and a file inventory mapping file/session IDs to archive members. The cache resolves the launcher's LUMINA_RUNTIME_CACHE_DIR override or the canonical material library. backend-logs.zip contains local backend logs and rotations, including complete Python tracebacks. These files are copied into the ticket before source-session cleanup; missing requested file IDs and failed copies mark collection incomplete
  • Session capture uses stable container snapshots, including the independently decoded PostgreSQL backend. Its authoritative session-values.json reuses api/session_value_codec.py to preserve ndarray shape/dtype, bytes, tuples/sets, dictionary keys, and serializable domain objects for restoration. file-registry.json preserves full ownership/metadata. Session and log archives record independent failures, so one failed collection does not suppress the other
  • Other files are attached independently when available via FileRegistry + copy; missing attachments are explicitly marked in the manifest
  • Final artifacts must be copied only from server-side FileRegistry ownership or an exact /api/files/<file_id> reference; client-provided disk_path values are diagnostic context only and must not authorize copying files into a ticket
  • Imported 3MF template snapshots retain all settings, including printer connection fields. Final 3MF and ZIP attachments are copied byte for byte without rewriting metadata or inspecting nested archives. Damaged source files must also be preserved because their damage may be the cause of the report
  • Every selected/custom/preset/Cloud LUT is copied into the ticket, including selections in inactive LUT workflows. Lookup and classification use the canonical LUTManager.LUT_PRESET_DIR, including installed resource locations. References to presets remain accepted only for historical tickets; new tickets survive later source changes or deletion

Assembly Model

  • submit_bug_report uses the hybrid assembly model
  • Before returning, the submission path captures browser sources, registered attachments, session data, and backend logs. Collection time depends on the complete data size
  • finalize_ticket_async runs via BackgroundTasks to pack materials.zip, render index.md / summary.txt, fix assembly_status, then upload the ticket to the feedback server
  • File copies and material packaging run in worker threads. Incoming/outgoing multipart files use reopenable streams so attachment count does not require one open file descriptor per source
  • partial_failed collection is explicitly shown in the dialog even when server upload succeeds. The dialog can recapture its frozen source files and context under a fresh ticket ID; ordinary upload retry preserves the existing ticket content

Converter Parameter Changes

When adding or changing converter generation parameters, update bug-report reproducibility capture in the same PR:

  • AdvancedParams types
  • buildAdvancedParams
  • WorkflowSnapshot.advanced_params
  • BugReportContextPayload.advanced_params
  • api/routers/feedback.py schemas when the shape changes
  • api/feedback_index.py rendering when triage should surface the value
  • Matching frontend/backend tests

Validate with a real local bug report and confirm ticket.json contains the complete state. Browser File/Blob values are represented by metadata in JSON; original source bytes travel as multipart attachments. Confirm binary hashes after server export and reproduction loading, including after the source session closes.

Creative Workshop Metadata

The compact Workshop summary includes module identity and runtime details. The full Workshop store is also retained in workflow_state, including project payloads, matrices, palettes, paths, and diagnostic data. Unknown Workshop fields are preserved by the backend. Update the context types, index rendering, and tests together when introducing new summary fields.

Materials And Server Upload

  • Coating captures its switch and thickness under advanced_params.coating. Its material type follows the selected source materials; mixed or unknown types default to PLA. Source LUT/material attachments provide the material facts for reproduction. Historical explicit coating references remain readable but no longer control generation. Independent backing output is recorded under geometry; its final artifact is a ZIP containing the original-size model and backing projects.

  • materials.zip uses the canonical MATERIALS_DIR (including installed user-data locations and LUMINA_MATERIALS_DIR) and includes every file in selected/backing material directories. The actual _solver_cache is additionally preserved in session-data.zip, including launcher runtime overrides

  • Materials bundling defaults to no timeout (LUMINA_FEEDBACK_MATERIALS_BUNDLE_TIMEOUT_S=0). Remove or set old positive overrides to zero to preserve complete material bundles

  • Clients hold no SMTP or server credentials. api/feedback_hosted.py uploads ticket.json (without the volatile submission section), index.md, summary.txt, and every regular attachment in the ticket directory, including empty files and arbitrary source types

  • There is no client attachment size, count, or whole-upload budget, no priority-based omission, and no fallback that reports success after sending only text. A server refusal leaves the complete local ticket available for retry and marks the submission failed

  • The upload targets LUMINA_FEEDBACK_SERVER_URL (default: the official Lumina Distribution feedback service; off keeps reports local). Each attempt solves the server's proof-of-work challenge; retries send an identical document so the server answers duplicate instead of creating a second ticket

  • X-Lumina-Bundle-SHA256 fingerprints the canonical document, including every attachment hash. The receiver can recover an already accepted matching receipt before reserving storage again; different content for the same ticket returns 409

  • The server contract and operator export live in the private Distribution repository under feedback-service/. Deploy its matching complete-bundle intake first. Its attachment/request/hourly-byte limits default to zero (disabled); old positive FEEDBACK_MAX_BUNDLE_MB, FEEDBACK_MAX_ATTACHMENT_MB, FEEDBACK_IP_HOURLY_MB, or FEEDBACK_GLOBAL_HOURLY_MB overrides must be removed or set to zero. Proxy limits must also permit complete bundles. Storage exhaustion remains an explicit failed submission

  • A failed upload is not a partial assembly. The dialog polls the status endpoint and offers a retry; interrupted uploads are marked failed by startup cleanup

Cleanup

  • run_startup_cleanup runs inside the FastAPI lifespan
  • Tickets older than LUMINA_FEEDBACK_TICKET_TTL_DAYS (default 30) lose bulky attachments but keep small metadata
  • Tickets stuck in in_progress past the 10-minute grace window are tagged interrupted and logged for follow-up
  • Set LUMINA_FEEDBACK_STARTUP_CLEANUP=false to disable startup cleanup

Local Reproduction

To rebuild a session locally:

python scripts/load_bug_repro.py <ticket_id>

The script accepts both new random-monthly and historical daily-serial ids, copies every available attachment to repro_sessions/<ticket_id>/, extracts materials.zip, and writes a repro_manifest.md with the action history. When opened at http://localhost:5174/?repro_session=<ticket_id>, the header's three-line "More options" button shows an amber dot, and the menu lists the ticket being reproduced.

Structured Logging

Feedback assembly events identify the relevant step in a submitted ticket. Their behavior is covered by the feedback router, assembler, and hosted-submission tests:

  • feedback_bug_report_submitted
  • feedback_ticket_assembled_init
  • feedback_ticket_assembled_done
  • feedback_attachment_collected
  • feedback_materials_bundle_packed_done

feedback_hosted_submission_done (INFO) and feedback_hosted_submission_failed (WARNING) record upload outcomes. WARNING / ERROR events (feedback_ticket_assembly_interrupted, feedback_materials_bundle_packed_failed, etc.) retain useful failure details. No source event whitelist or INFO count baseline needs updating.