Skip to content

egocap: judge each take when it ends, set bad takes aside, recover or discard from the page - #1638

Open
NVshawnhwang wants to merge 4 commits into
nvShawnHwang/egocap_calibration_pagefrom
nvShawnHwang/egocap_quality_control
Open

NVshawnhwang wants to merge 4 commits into
nvShawnHwang/egocap_calibration_pagefrom
nvShawnHwang/egocap_quality_control

Conversation

@NVshawnhwang

Copy link
Copy Markdown
Collaborator

Branch: nvShawnHwang/egocap_quality_control, opened against nvShawnHwang/egocap_calibration_page.

Commits in this pull request:

  1. egocap: do not skip camera frames when the poll falls in step with the camera
  2. egocap: judge each take when it ends, set bad takes aside, recover or discard from the page
  3. egocap: calibration takes are exempt from the capture checks

Summary

Three commits.

  1. egocap: do not skip camera frames when the poll falls in step with the camera — a capture fix that stands on
    its own. The adapter for directly connected cameras asked its latest-frame queue once per frame interval, so a
    frame that arrived a moment after a poll was never made up; a 30 fps camera recorded 22 to 27 fps against the
    mock. It now asks several times per interval. Without this fix the rate rule below rejects healthy takes.
  2. The capture checks. Each take is judged once, when it stops:
    • a camera under 0.86 of its declared rate (over its own frames, and counted against the take's length) rejects
      the take and removes its media
      ;
    • a tracking stream that does not change for a second marks the take bad: it is kept, not time-aligned, and
      with the station's quarantine switch on (the default) finalized under a quarantine folder apart from its session;
    • tracking gaps, take length and the other checks warn.
      An interrupted take can be recovered or discarded from the page, in the open session and in earlier sessions
      of the station. Every outcome and refusal is a fixed sentence that names the stream, what was measured, the limit
      and what to check.

What to know before relying on it

  • No real camera has been run against the rate rule. It removes media. The example's README ("Capture checks")
    has a table of how late a healthy camera would have to start to lose a take, says how a station switches the rule
    off or loosens it in its own file, and the Settings view shows a notice when it is off or loosened.
  • One recording folder per machine. If machines share one, give each its own station name. An open session is
    told by its lock, and where a lock does not reach by a marker the recorder refreshes every second. A recorder that
    is frozen or whose disk stalls for a few seconds can look closed to another machine. No network share was tested.
  • Every way recorded media is removed: a camera rejection; Discard of a pending take; Discard of the take being
    recorded; and, unchanged by this pull request, a backend shut down while a take is being recorded.
  • Calibration takes. A take can be started exempt from the checks by a server-side flag that no command from the
    page can set. The third commit makes the calibration tools' takes use it.
  • Takes rejected for integrity with their data kept stay on disk; after New batch or a restart no page lists them.

How it was tested

  • tests/recording at 100% line and branch coverage; tests/recording_service; tests/capture_server;
    tests/backend; the page's lint, tests and build.
  • The recorder was stopped dead before every file-changing call of a start, a keep, a rejection, a quarantine and
    each kind of discard (533 points): every take is then resolved by Recover or Discard, and nothing outside the
    take's own directory changes.
  • An independent reviewer attacked the deletion paths in three rounds with its own scripts (wrong-take deletion,
    crashes, races, anything the page can send). Nothing was deleted outside the judged take's own pending directory.
  • Run against the mock capture server with its stalled-camera and frozen-tracking faults.
  • One test on main is sensitive to machine load and is not part of this change:
    tests/recording/unit/test_video_writer_backends.py::test_release_raises_when_ffmpeg_does_not_exit_after_stdin_closes.

Not yet verified on hardware

The rate a real camera records at on either path (direct or LiveKit); real tracking when it stops or rests; real
gloves; a camera unplugged during a take; a shared recordings folder on a network; power loss.

🤖 Generated with Claude Code

NVshawnhwang and others added 3 commits November 27, 2026 09:39
…e camera

The camera adapter asked its latest-frame queue once per frame interval.
When that cadence fell in step with the camera's, a poll that came a
moment before a frame found nothing and the frame was never made up: on
a device the size-one queue is then overwritten, and the mock passes the
frame over. A 30 fps camera recorded 22 to 27 fps this way.

Ask the queue several times per frame interval, so a frame waits at most
a fraction of an interval and the next cannot arrive before it is taken.
Everything defined on the frame interval stays on it: the no-frame
timeout still counts from the last frame, and the host-sampling time is
still taken at the poll that returned the frame. An empty poll returns
nothing, as before, and callers already skip it.

Tests drive the real adapter against the mock queue with its frame grid
in step with the poll clock and with polls that wake early and late, and
against a one-slot queue that overwrites as a device's does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
… discard from the page

Capture checks
- Each take is judged once, after it stops, by checks whose limits come
  from a documented defaults file and the station's own data_check
  section. A camera that averaged under the minimum share of its
  declared rate, or recorded under that share of the frames a take of
  that length holds, rejects the take and removes its media. A tracking
  stream that does not change for longer than the limit marks the take
  bad. Tracking gaps, take length and the other checks warn.
- A take too short to measure is not judged by the rate rule.
- A take marked bad is kept and not time-aligned. With the station's
  quarantine switch on, which is the default, it is finalized under the
  quarantine folder, apart from its session, and counted on its own.
- A take can be started exempt from the checks by a server-side flag
  that no command from the page can set.

Takes that wait
- An interrupted take can be recovered or discarded from the page, in
  the open session and in earlier sessions of the station. A discard
  records its intent before it removes anything, and removes only the
  take's own pending directory.
- A session another recorder has open is told by its lock, and where a
  lock does not reach by a marker the recorder refreshes every second,
  and nothing in it is listed or acted on.
- Stopping the recorder before any file-changing call of a start, a
  keep, a rejection, a quarantine or a discard leaves a take that
  recover or discard resolves.

What the operator is told
- Every outcome and refusal is a fixed sentence that names the stream,
  what was measured, the limit and what to check. No reply carries a
  path, an exception's text or a recorder state name. A full, read-only
  or unwritable recordings disk is named.
- The page shows what became of each take above the cameras, never
  shows an outcome it does not know as kept, asks before a discard in a
  dialog of its own, counts each kind in the end-of-day summary, and
  shows the checks in force, with a notice when a station runs with one
  switched off or loosened.

The mock capture server gains a camera fault that withholds frames for
the manual run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
The calibration tools and the capture checks were built apart. Joined,
a calibration take (a board waved at one camera, hands held still) is
what the checks reject for its camera's rate or set aside for tracking
that does not change. Every take the headset calibration tool and the
controller-glove offset tool start is therefore started with the
recorder's exemption flag: it is checked for storage integrity only and
kept unjudged, and its manifest and metadata say so. The flag is the
calibration service's own. No field of a request is read for it, and a
take started with Record is always judged.

What the tools read of the recorder is what the recording page is told:
- What became of a take is read from the page's own description of it
  (take_outcome.describe_result). A take is saved only when that says
  kept; any other outcome is told with the page's sentences, whole ones
  only. A take the integrity check rejects is said to keep its data
  until it is discarded on the recording page, which lists it.
- An interrupted calibration take waits in the page's list like any
  other and is recovered or discarded there. The tools say so, where
  they sent the operator to a new batch. One that is recovered is
  finished exempt, as it was started.
- A refusal of the recorder at a take's start or end is answered with
  the sentence a refused recording command gets
  (recording_command.refusal_sentence), readiness is asked as Record
  asks it, and a full recordings disk is named. What the coordinator or
  the recording service raised stays in the log.

Found by running the two pieces together:
- The configuration that only looks at what earlier sessions left is
  built every few seconds, during a take too. It wrote the session
  files of a run that corrects a camera again at each build, so a copy
  found missing held recording in the middle of a take and interrupted
  it. That configuration names those files without writing them.
- A take left waiting by a run that corrected no camera is listed in a
  run that corrects one, and neither command resolves it there: its
  session does not hold the files that run requires, and a session is
  reopened only as it was recorded. A test pins it, and the guide and
  the README say to resolve such a take in a run started without the
  correction.
- The camera adapter asks for a frame sooner after it starts, so a
  camera's first picture can arrive before the first tracking sample.
  The tests of the real application wait for both before a take.

The tools' guide, the READMEs and the design say that calibration takes
are exempt, where they said the checks judge them like any other take.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@gareth-morgan-nv

Copy link
Copy Markdown
Contributor

🤖 Agent-generated (Claude Code · claude-sonnet-5-5)

Summary

This stacks three commits: a poll-cadence fix in the DepthAI camera adapter, per-take capture checks with a quarantine folder and Recover/Discard of interrupted takes (in the open session and in earlier ones), and an exemption of the calibration tools' takes from the checks. The file-moving code is careful: every destructive step is preceded by a durable manifest write, ownership is stamped and re-verified before any rename or delete, and the stamp is removed last so an interrupted delete can be repeated. I found no path that deletes outside the judged take's own pending directory. The adapter fix is sound in logic, but the 22 to 27 fps figure is a mock artefact and is not evidence about a device. My concerns are about what changes for existing stations without opting in, one irreversible default (media removal on a camera rate rule that has never seen a real camera), and scope: this is several features in one review. I read the source and docs of the whole diff and the adapter tests; I did not run anything (the example's uv environment does not resolve in a scratch worktree here, so the cadence tests were not executed).

Legend: 🚫 Blocker · 💡 Suggestion · 🔍 Nit

Finding
🚫 app.py _recording_config_factory / capture_qc_policy.py CaptureQcPolicy defaults — this changes what every existing station records, with no opt-in. Before, capture QC existed only when a LiveKit stream was offered (CaptureQcConfig(camera_expected_fps=...) over the LiveKit cameras, otherwise None), so no pose stream was ever judged. Now every camera and every Pico and (if gloves_expected) glove pose stream is judged by default, a camera under 0.86 of its rate removes the take's video and tracking with no copy kept (FINALIZATION_REMOVE), and a 1 s frozen pose moves the take out of its session into _quarantine/ (quarantine: true). The PR states that no real camera has run against the rate rule, and the rate rule is the only irreversible one. Please ship the removal behind a default that keeps the data until it has been measured on hardware: either default camera_min_fps_enabled to off, or route a camera rejection through the quarantine path (kept, marked, not aligned) first, and make removal the second step.
💡 capture_qc.py frames_needed / check_capture_quality camera_min_fps — the new coverage question (needed = ratio x (expected_fps x take_seconds - 3)) is a second removal rule that the native recording path does not have: it only checks the average rate over the camera's own frames, so a camera that starts late or stops early is accepted there. For a healthy camera the two agree. For a camera that delivers its first frame late (a LiveKit track that joins a second or two after the take starts) the take is now deleted. At 30 fps and a 30 s take the camera may start about 4.2 s late plus the three phase intervals before the take is rejected, which is generous, but at 60 fps and short takes (13 to 20 s) the margin shrinks to a couple of seconds. Please confirm this is wanted, since it is the one rule here that rejects data the native path keeps.
💡 capture_qc.py / capture_qc_policy.py capture_config_for — the Avatar hand-liveness and Pico body-joint gates exist in capture_qc.py and the README lists avatar_hand_liveness as opt-in via avatar_hand_sources, but no policy key sets avatar_hand_sources or pico_body, so neither gate can run from a station file. The native recording path treats a dead or never-connected glove hand as a fatal tracking failure by default on glove stations. Either wire them (a gloves_expected-style switch) or drop the README row.
💡 recording_service.py _same_configuration — a SEALED take is recoverable only if the whole configuration digest matches, and that digest includes every capture threshold and the camera set (_digest keeps qc["capture"] minus source). So after a crash, editing a threshold, adding or dropping a camera, or upgrading to this version (ALGORITHM_VERSION, the new capture fields) leaves a fully written, sealed take that can only be discarded. A CHECKED take is spared this by layout_digest. For a SEALED take the checks have not yet run, so the layout digest plus re-running the checks under the current policy (which is what the docstring says Recover does) would be enough. As written, the page's own advice is "discard it", which is a data loss path for a good take.
💡 recording_command.py _COMMAND_REFUSALS, _PENDING_REFUSALS; take_outcome.py _NOTE_KINDS; livekit_recording.py _START_REFUSALS — operator sentences are chosen by substring or prefix match on exception text and on recorder notes written elsewhere ("already has a", "did not settle", "session beat stopped", a regex copy of the LiveKit sentences). Rewording any message in recording_service.py or recording_session.py silently turns the operator's sentence into the generic "see the backend log", and nothing fails. A small set of typed refusals (an enum or exception subclass on StateError / CoordinatorBusyError) would let the mapping be exhaustive and testable.
💡 PR scope — one review carries the frame-skip fix, the QC rules, quarantine, cross-session Recover/Discard, a recorder heartbeat thread and reader-side watch for shared recording folders (SessionLock.beat, output_scan.py), station rename history across days (station_uptime.py all_names, station_service.py), a rewording layer for every recorder refusal, a wheel package-data change, and the calibration tools' wording rework (calibration_service.py, with_sentences). The PR says no network share was tested, yet the heartbeat adds a thread and a once-a-second file write to every station's recorder and a state machine (OutputScan.judge/note_closed) that can only matter on a shared disk. I suggest at least: the poll fix alone (it is already commit 1 and stands alone), the checks plus quarantine plus Recover/Discard for the open session, and the shared-folder watch and rename history as a separate PR once a shared folder is actually in use.
💡 auto_align.py submit / scan — a take the checks flagged bad is no longer time-aligned, where before it was. That is a change to what an existing station produces, separate from quarantine (it applies with quarantine: false too). It is documented in the README, but it is not in the PR's list of behaviour changes.
💡 recording_service.py _attributes / quality_attributes — recorded episodes gain quarantined, capture_qc_exempt and, inside capture_qc_policy, the defaults file name, its SHA-256 and the station's overrides. These are new fields in the recorded metadata, and the file name and hash describe a deployment, not the take. If the dataset layout is meant to stay as it is for downstream readers, please say which of these are intended, and consider keeping the policy source in the manifest only.
💡 episode_layout.py SessionLock — a beat that fails is logged once and retried; a stalled disk is then reported on the snapshot as a warning, but another machine that has already judged the session "not open" (two looks 2.5 s apart with an unchanged beat) may Recover or Discard a take in a session that is open. The PR describes this honestly; I only add that Discard is not reversible, so on a shared folder the recorder holding the session is the one place this should be impossible. Flock does not provide that over a network file system, so I would keep cross-machine resolution out of this PR.
🔍 depthai.py _POLLS_PER_FRAME — the new cost is one executor hop per poll, so four per frame per camera (240 per second at 60 fps, per camera), most of them empty. It is probably fine, but it is not measured. A one-line note of the CPU cost on the station PC would settle it.
🔍 depthai.py comments — the KNOWN LIMITATION block and the new _POLLS_PER_FRAME comment together run to about 25 lines and tell the same story twice (overwritten frames are invisible to counters). Per the repo's comment rule, keep the constraint and drop the argument.
🔍 capture_qc.py module docstring — the list of advisories names two names for the same check (tracking_gap_warning, duration_warning) and a seven-name run of advisories; the file now carries the decision table in the docstring, the README and recording_service/README.md. One authority (the docstring, linked) would avoid the three copies drifting.
🔍 data_check_config.yaml — this file went from "reference data, not read by any code" to the live defaults. The shipped values equal the previous reference values except quarantine and gloves_expected, which are new, which is good. The timestamp: section of the old file (max_missing_frames, frame_drop_window_s, coverage_threshold) was removed rather than left inert; worth a line in the PR description since sites that read it for tuning will notice.

On the frame-skip fix (commit 1). The reasoning is correct for a device queue of size one that is refilled on the device's own clock: with one poll per interval, any poll gap longer than one interval (the sleep that ends late, followed by one that ends on time) lets two frames arrive between polls, and the first is overwritten. Four polls per interval need a wake-up that is three poll periods late to lose a frame. The tests (test_camera_poll_cadence.py) model exactly that with a device-like queue and an exact clock, which is the right way to test it. The 22 to 27 fps figure is a different matter: the mock queue generates a frame only when it is polled and then skips every overdue slot in one step (MessageQueue._advance), so with one poll per interval and any jitter it loses frames far more readily than a real device, and the figure says nothing about a real OAK. The PR says as much under "Not yet verified on hardware", so I would drop the number from the commit message and say only that the fix removes the loss in the mock and in a device-like queue. The HOST_POLL timestamp is now taken within a quarter interval of arrival instead of up to a full one, which is a small timing improvement, not a regression.

On the capture-check rules. The thresholds match what the native recording path uses: a camera average of at least 0.86 of its rate, a pose still for 1 s at 1e-6 flagging the take, the same pose fields (head and controller poses, glove hands), advisory drops, flat motion and dead streams. The differences from the native path I checked in the code: it judges only the head and two wrist cameras (this PR judges every camera); it counts a camera with fewer than two frames as 0 fps and rejects it, where this PR says "not judged" for a take too short to measure; it treats a dead glove hand as fatal by default (see the finding above); and its coverage, time-range overlap and consecutive-gap timestamp checks are advisory there and are not carried over here. The rate rule applied to short takes (under ten frame intervals of camera span) is now skipped, which is the sensible fix for the "one frame moves the average" problem. The tolerance constant INTERVAL_TOLERANCE and CAMERA_PHASE_INTERVALS = 3 are well explained; I could not find a way for a healthy continuous camera to fail the second question when it passes the first, since needed is always below ratio x full.

On state-machine and file-moving safety. I traced _finish_impl, _discard_impl, finalize_episode_dir, remove_owned_episode, claim_quarantine_group and discardable_pending. Points that hold: the finalization intent (KEEP, QUARANTINE, REMOVE, RETAIN) is written to the manifest in the same atomic checkpoint as CHECKED before anything moves; a rename into the quarantine folder only happens after the folder was built stamped inside the session's sidecar and renamed into place (so it never exists unstamped); a repeat after a crash between the rename and the FINALIZED/QUARANTINED checkpoint takes the "final exists, pending gone, identity matches" branch; discard is refused with AlreadyPublished when the take is already in its final place; discard_requested is durable before the first delete, and the zarr stamp is removed last so a half-removed directory still proves ownership. A quarantine folder that is a link or on another file system is refused before recording starts and again at recovery. The remaining exposure is the REMOVE path itself: it is correct, and it is also the only step in the module that cannot be undone, which is why it is the first finding.

Questions for the author

  • Is the camera-removal default meant for the first release on stations, or only after a hardware run? If the latter, can it be off until then?
  • Should the coverage question (frames against the take's length) apply to a late-joining camera, given the native path does not do that?
  • Should flagged takes stay unaligned on a station with quarantine: false?
  • Are quarantined, capture_qc_exempt and the policy source meant to be part of the recorded dataset's metadata?
  • What happens to a SEALED take after an upgrade of this PR (digest changes)?

Actionables (for bots — copy-paste-ready for AI)

Agent-generated suggestions, not human-vetted obligations. Skip anything wrong, already addressed, or not worth the churn.

  • capture_qc_policy.py / data_check_config.yaml — keep the removal of a camera-rejected take off by default (or route it through quarantine) until a real camera has been measured; keep the switch documented.
  • capture_qc.py frames_needed — decide whether the coverage question should reject a late-starting camera; if not, drop it or make it advisory.
  • capture_qc_policy.py capture_config_for — either set avatar_hand_sources / pico_body from policy switches, or remove the README rows that promise them.
  • recording_service.py _same_configuration — for a SEALED take compare layout_digest and judge under the current policy, so a threshold edit or an upgrade does not leave a good take discard-only.
  • recording_command.py, take_outcome.py, livekit_recording.py — replace substring matching of refusal and note text with typed refusals or codes.
  • depthai.py — shorten the two comment blocks; drop the 22 to 27 fps figure from the commit text.
  • Split the shared-folder heartbeat and watch (SessionLock.beat, output_scan.py) and the station rename history into their own PR.
  • State the aligner change for flagged takes and the new recorded attributes in the PR description.

@NVshawnhwang
NVshawnhwang requested a review from NVdejung December 1, 2026 20:25

@NVdejung NVdejung left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated first-pass review (Claude, for Dejun) — I'll follow up personally where needed.

Summary — Stacked on #1637, this PR does three things. The DepthAI adapter now polls four times per frame interval. Every take is judged when it stops, by a file-driven policy: a camera rate/coverage rule that removes media, freeze/gap/length gates, and a _quarantine/ folder, with calibration takes exempt. Interrupted or left-behind takes, including earlier sessions' takes found by a beat-aware output scan, can be recovered or discarded from the page. The file-moving code is careful: ownership is checked before every rename or delete, the intent is recorded first and the stamp removed last. I found no path that deletes outside a take's own pending directory. Two blockers remain, one of them already raised. I read all non-test source and docs. I only skimmed the ~60 test files and styles.css, and I ran nothing.

Must fix

  1. Still open from the earlier review: capture checks are on by default for every station and remove media on a camera rule that has not yet been measured on a real camera (capture_qc_policy.py:57, data_check_config.yaml:24). I won't repeat that review here. I agree it should be settled before merge: either ship the rule off (or log-only) until a station's cameras are measured, or get an explicit sign-off from the stations' owners.
  2. Two places call OutputScan.note_closed() synchronously on the event loop: recording_session.py:1035 (New batch) and recording_session.py:881 (after every Recover/Discard of an earlier take).
    • It takes _guard (output_scan.py:180), which read() holds in a worker thread for its whole walk of the output (output_scan.py:115). The loop then stops until the read in flight ends, and with it the preview, every viewer's socket and the CaptureServer client.
    • The wait is short in steady state. But the first read after a start, or after the station's names change, is a full one: about half a minute per ~12k take records by the README's own figure.
    • note_closed() also reads the lock file on the loop.
    • Fix: await asyncio.to_thread(self._output_scan.note_closed, …), as judge() already is. Alternatively, hold _guard only around the state updates, not the I/O.

Suggestions

  • recording_session.py:1038, :883: New batch and Recover/Discard of an earlier take await refresh_pending() inside the owned operation. They queue behind any read in flight (same durations as above), and Record is refused meanwhile. The page gives New batch 45 s. Please verify on a large folder. Scheduling the refresh, or setting a dirty flag, would avoid the wait.
  • app.py:386: with gloves_expected: true, manus_glove is a required source for every take. The exemption only skips the capture checks (recording_service.py:1296). So a head- or wrist-camera calibration take with no glove rows fails required_sources_nonempty and is rejected with its data kept. Meanwhile the guide's tracking_recorded, which looks at headset and controllers only, reads ready. Either exempt calibration takes from the glove requirement, or say so in the hints and CALIBRATION_TOOLS.md. No test covers this case.
  • recording_command.py:124: the operator's sentence is chosen by matching substrings of exception text raised in other modules. The same applies to _PENDING_REFUSALS, take_outcome._NOTE_KINDS and livekit_recording._START_REFUSALS. A reworded raise silently falls back to the generic sentence. Broad markers ("already has a", "a recording session (", "calibration asset") can match the wrong one. Exception subclasses or a code attribute would be safer.
  • recording_command.py:754: every ConfigurationError raised while reopening an earlier session is answered with "its source declarations or calibration files have changed". That includes an invalid QC policy (the factory raises QC_CONFIG_INVALID) and a session folder that no longer exists.
  • capture_qc.py:783: stale docstring. TRACKING_GATES now includes tracking_gap, so with tracking_gap_marks_bad a gap writes the native freeze_check_passed = False.
  • day_report.py:257: a session whose files raise OSError is now dropped silently. backend/README.md:237 still says an unreadable record "is reported with its session, never dropped".
  • takeOutcomeText.ts:50: after an earlier session's take is resolved, the banner says "Take N …" without naming the session. That is easy to read as take N of the current batch.
  • CI: no workflow runs examples/egocap/tests, and the recording-service README says those tests are local-only. With deletion on by default, the self-contained tests/recording_service and tests/recording suites are worth wiring into CI.
  • Internal names: the scan found one hit (test_take_outcome.py:407). It is a private-range IP address in a fixture that checks raw error text never reaches the page. It reads as a generic placeholder, so it is not a must-fix. A documentation-range address would make that obvious. I found nothing else in the added fixtures or docs.

Conflicts

  • With nvShawnHwang/egocap_calibration_page (head of #1637): 0 commits behind and the local 3-way merge is clean, so no rebase is needed. The PR sits mid-stack above #1634–#1637; retarget it to main once those land.
  • Stack children by the same author: #1639 (based on this branch, 41 shared files) and #1640–#1646. No textual conflicts were found, but each will need restacking after changes here. Check #1644 (upload) against _quarantine/, schema-5 manifests and the QUARANTINED phase.
  • #1586 (gareth-morgan-nv, base main, 14 shared files including app.py, recording_session.py, recording_command.py and useCaptureSession.ts): conflicts were not computed because the base differs. Expect textual conflicts, since the snapshot parser moved to recordingSnapshotParser.ts. There is also a semantic risk: any new coordinator refusal there falls back to the generic sentence unless it is added to _COMMAND_REFUSALS. Whichever PR lands second rebases.
  • #1625 (Yunjuliii, draft) shares recording_adapter.py. MANUS_POSE_STREAMS picks up every 4×4 field of MANUS_GLOVE_SPEC, so a 4×4 field added there becomes a judged stream on glove stations.
  • #1566, #1571, #1587 and #1591 each share one README or test file; low risk.
Change-by-change (130 files)
File / area What changed Makes sense?
capture_server/.../depthai.py, mock/mock_depthai.py, test_camera_poll_cadence.py, test_mock_sdks.py Poll 4× per frame interval (timeout still in frame intervals); mock camera_stall fault ✅ empty polls are not counted anywhere (server.py skips them)
recording/egocap/recording/capture_qc.py, capture_measure.py Two-question camera rule (frames_needed), switchable gap/duration gates, new advisories (zero pose, fps deviation, resolution, rate-measurable), ALGORITHM_VERSION 4, quarantine finalization ✅ ⚠️ stale quality_attributes docstring
capture_qc_policy.py, config/data_check/data_check_config.yaml, pyproject.toml Defaults file is now read and shipped as package data; strict key/type/range validation; station data_check overrides; capture_config_for ✅ fails closed on a bad file ⚠️ defaults (earlier review)
episode_layout.py, route.py, episode_store.py Schema 5, QUARANTINED phase and stamped _quarantine/<session> claim, discard_requested, misplaced records, session beat in SessionLock, naming_the_file ✅ ownership checked before each rename/delete
recording_service/recording_service.py, output_scan.py, models.py, __init__.py, README Quarantine finalize, exempt takes, retained integrity rejections, discard intent, storage_problem, beat notes, pending_under_output_root with OutputScan ✅ ⚠️ _guard held across the whole read (must-fix 2)
backend/egocap_web/recording_session.py Earlier-session listing and resolution through a second service, PendingTake, beat-stopped readiness, exempt flag ⚠️ must-fix 2, first suggestion
recording_command.py, take_outcome.py, readiness_text.py, livekit_recording.py Fixed operator sentences for outcomes, refusals and notes; per-outcome counts; pending_takes; recover_pending/discard_pending ✅ no raw text reaches the page ⚠️ substring mapping
app.py, settings_routes.py, station_config.py, recording_adapter.py QC policy load (holds Record when invalid), scan config factory, station names, 5 s refresh; quality_checks with notices in settings ✅ ⚠️ glove requirement
calibration_service.py, calibration_common.py; comment-only edits in rectification_service.py, CalibrationRecorder.tsx, GloveOffsetDialog.tsx, HeadsetCalibrationDialog.tsx Calibration takes started exempt; outcome read via describe_result; refusals via refusal_sentence ✅ location matches the old take_name() form
auto_align.py Takes marked bad are not aligned (submit and scan) ✅
station_service.py, station_uptime.py A rename is recorded for any station; all_names() follows renames across days ✅ (a name given up and retaken belongs to both; documented)
day_report.py, day_report_routes.py, count_daily_trajectories.py quarantined disposition; reasons and warnings via describe_manifest; quarantined takes excluded from valid time ✅ ⚠️ silent session skip
Frontend model: recordingSnapshotParser.ts (moved out of useCaptureSession.ts), recordingTypes.ts, recordingEligibility.ts, recordingUiReducer.ts, recordingWire.ts, recordingActions.ts Per-row/per-outcome tolerant parsing; resolvePending eligibility; a reply whose snapshot cannot be read settles as unknown ✅
Frontend UI: TakeOutcomeBanner, PendingTakeActions, PendingTakesCard, DiscardTakeDialog, RecordingPanel, OperatorBar, WrapUpDialog, App, SettingsPanel, outcomeMarks, takeOutcomeText, formatElapsed, dayReportApi, settingsApi, settingsParts, styles.css Outcome banner above the cameras, pending rows with Recover/Discard and one confirm, not-kept counts, Capture checks card ✅ hooks before early returns, Discard asks once ⚠️ banner names no session
Docs: README.md, DESIGN.md, CALIBRATION_TOOLS.md, backend/README.md, frontend/README.md, recording/README.md, recording_service/README.md, ego_stations.example.yaml Capture checks, quarantine, pending takes, exact limits, what is unverified on hardware ✅ thorough ⚠️ "never dropped" vs the new silent skip
Tests (~60 files, ~12k lines; skimmed) New suites: QC rules, policy, quarantine, removal scope, stop-at-every-step, takes left behind, wire, frontend ✅ edited tests were updated, not weakened (e.g. test_capture_qc.py fixture lengthened to 3 s, test_configuration.py drops the "quarantine unsupported" case)

Reviewed at 468e42a · 130 files · 2026-12-01 13:30 PST

…/egocap_quality_control

The recording coordinator takes both sides' arguments. A take the capture
checks set apart in quarantine is given the capture-session facts like a
kept one, which the textual merge had left out.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Shawn Hwang <shhwang@nvidia.com>

This branch was successfully deployed

1 active deployment
dev — 89322122 Deployed Dec 2, 2026 by NVshawnhwang via publish-wheel #7718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants