Skip to content

Architecture and boundaries#

PoseTestBot is deliberately acquisition-first. Ownership boundaries are part of the data-integrity and credential-isolation model, not merely deployment choices.

Component topology#

browser
  │ same-origin HTTP
  ▼
Flask operator API ─────▶ LocalJobRunner ─────▶ acquisition/calibration scripts
  │                              │
  │                              └────────────▶ run-owned logs and artifacts
  │
  ├────────▶ approved local run roots
  │            working_data/
  │            /mnt/working_data_ssd
  │
  └────────▶ loopback controller client (optional)
                    │ authenticated server-side request
                    ▼
             posetestbot-cluster companion
             SSH / archives / SLURM / estimators / BOP19 result creation

The browser never receives the controller token, cluster credential, remote path, container command, or scheduler argument. PoseTestBot only returns a curated browser-safe controller view. Estimator configuration is limited to a closed driver-advertised form: FoundationPose v2 exposes execution mode and a nonempty set of eligible BOP sensor-scene IDs. The form is a browser-local draft until submission; its normalized value then belongs immutably to the external job rather than to run_config.json or a global catalogue.

Backend modules#

Area Primary modules Persistence
Run configuration and fixed orchestration posetestbot.pipeline.run_config, .orchestration, .capture_* Run root
Sensor acquisition posetestbot.sensors.* Raw sensor directories and sidecars
Robot integration posetestbot.robot.*, iiwa/ applications Raw robot pose stream
Synchronization posetestbot.sync.non_destructive, .quality Derived synchronized frames and reports
Calibration posetestbot.calibration.* Attempt evidence, promoted profiles, immutable input snapshots
Workpieces posetestbot.pose_templates.catalog Global JSON catalogue and managed assets
Pose templates remaining posetestbot.pose_templates.* Immutable global bundles and run snapshots
BOP export posetestbot.bop.writer bop/ below the run
Inspect results and evaluation posetestbot.bop.inspection, .evaluation Read-only BOP/result views; retained evidence only in processed/bop_evaluation/
Inspect depth studies posetestbot.bop.depth_sources, .depth_metrics, .depth_evaluation BlenderProc CPU references and finish comparisons below processed/bop_evaluation/depth/
Web interface posetestbot.web.routes.* Delegates mutations to domain code or queued jobs

Request and job boundary#

HTTP handlers may validate, inspect, or perform bounded metadata mutations. Long-running, CPU/disk-heavy, or hardware-touching work is submitted to LocalJobRunner with declared resources. The response generally uses HTTP 202 and includes job_id plus a job snapshot.

Resource declarations serialize incompatible work. Camera jobs claim camera resources; physical capture also claims robot and disk resources. A browser navigation does not cancel submitted work.

Filesystem boundary#

Web paths are normalized and checked in posetestbot.web.security.

  • Run paths are confined to the repository working_data/, /mnt/working_data_ssd, and explicitly appended POSETESTBOT_WEB_RUN_ROOTS entries.
  • Run/output parameters remain below the selected run.
  • Repository-scoped inputs remain below the repository.
  • Extra input roots are opt-in through POSETESTBOT_WEB_INPUT_ROOTS.

Relative paths are resolved by their declared scope before containment is checked. API clients must not rely on .., symlinks, or absolute paths to escape these roots.

Acquisition boundary#

The acquisition boundary ends at a validated BOP dataset. The following do not belong in this repository:

  • FoundationPose, MegaPose, SAM6D, or another estimator runtime;
  • estimator-specific input or result conversion;
  • direct SSH or SLURM wrappers;
  • a general evaluation stage; or
  • cluster secrets and remote filesystem configuration.

One narrow exception is Inspect-only official BOP19 and IPD robot-consistency evaluation of an already exported annotation-bearing dataset and immutable compatible result. It writes derived evidence only below processed/bop_evaluation/. For a verified sensor-subset result, the adapter recomputes the selected inventory from the unchanged local export, writes an immutable filtered BOP19 targets file inside the evaluation folder, and constrains the pinned toolkit to those scenes. No tracking or estimator logic crosses back into this repository.

Depth-quality studies are another Inspect-only path. They consume completed pose-bearing exports and immutable geometry/calibration snapshots, render opaque reference surfaces using pinned BlenderProc 2.8.0 on CPU, and compare measured depth within reference-defined regions. Comparisons bind canonical geometry hashes and settings, retain run/sensor series, and use common distance/incidence bins. Jobs atomically publish complete reports, maps, and research bundles below processed/bop_evaluation/depth/ after source validation. This path has no estimator, hardware, or acquisition-stage role.

Robot consistency uses recorded robot poses and exported hand-eye calibration snapshots, retains hash-bound inputs and MVD/ADD evidence in the same evaluation directory, and never contacts hardware. Unavailable instance/viewpoint evidence is explicit; it never substitutes a zero score.

The sibling inspection adapter resolves only validated result, scene, frame, GT-instance, and object identifiers. It hash-checks retained CSV, provenance, and model evidence; bounds JSON rows and media; rejects symlinks and path escapes; and serves the existing BOP RGB, colorized depth, masks, and evaluation PLY. Browser projection is an x-ray view of saved BOP poses. Explicit image/video exports use the same frame filters and validated index, with a NumPy/OpenCV/Pillow/trimesh CPU renderer matching the BOP projection, colors, masks, opacity rules, hypothesis limits, and x-ray layer ordering. The renderer retains models and processes one original-resolution frame at a time. ZIP stores PNGs and a source/settings manifest; MP4 streams frames to FFmpeg/libx264 with constant FPS and even-dimension padding.

LocalJobRunner owns these cancelable CPU/disk jobs and their encoder process group. Requests bind the selected frame inventory and source file identities at submission; the worker records content hashes and rejects source changes before publishing. Outputs appear atomically below processed/bop_evaluation/visualizations/; downloads require a successful job and recheck the request, manifest, and output hashes. This remains Inspect-only derived visualization, with no estimator, metric engine, or acquisition stage.