feat(onboard): stream machine-readable progress events#6820
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughOnboarding now supports ChangesOnboard JSONL event streaming
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant OnboardCliCommand
participant withOnboardJsonlEventStream
participant OnboardMachine
participant stdout
participant stderr
OnboardCliCommand->>withOnboardJsonlEventStream: run with --events=jsonl
withOnboardJsonlEventStream->>OnboardMachine: observe onboarding events
OnboardMachine->>stdout: write redacted JSONL event
withOnboardJsonlEventStream->>stderr: route human progress output
withOnboardJsonlEventStream-->>OnboardCliCommand: return onboarding result
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — InformationalAdvisor assessment: Informational / medium confidence Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 3 optional E2E recommendations
1 warning · 0 suggestionsWarningsWarnings do not block.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/onboard/machine/jsonl-events.ts`:
- Around line 26-30: Update writeStdoutLine to avoid synchronous stdout writes
blocking the onboarding machine-event listener: use a queued, nonblocking
transport that disables observation or drops output when backpressure or write
errors occur. Preserve event-line delivery when stdout is available and add
coverage for a stalled consumer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 322fa0a6-1cb3-416c-89b4-529a47c8169f
📒 Files selected for processing (7)
docs/reference/commands.mdxsrc/commands/onboard.tssrc/lib/onboard/command-support.test.tssrc/lib/onboard/command-support.tssrc/lib/onboard/machine/jsonl-events.test.tssrc/lib/onboard/machine/jsonl-events.tstest/cli/onboard-compatibility.test.ts
61abf6e to
feb7f78
Compare
Signed-off-by: Ho Lim <subhoya@gmail.com>
feb7f78 to
4d55000
Compare
|
✨ Thanks for the feature, @HOYALIM. Adding a stable machine-readable event stream for onboarding automation is a great improvement. Ready for maintainer review. Related open issues: |
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Reviewed exact head 009cabb on current main. The JSONL observer remains read-only and best-effort, stdout backpressure and write failures cannot stall or alter onboarding, and credential-bearing event fields stay bounded/redacted. Focused validation passed: CLI build, 31 onboarding/JSONL/CLI tests, and CLI typecheck. Automated advisors report 0 blockers, 0 warnings, and 0 suggestions; no unresolved review threads.
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
laitingsheng
left a comment
There was a problem hiding this comment.
Verified against the linked issue and project criteria at head 215dab4c:
- Mechanism — the observer captures the original
stdout.writebeforewithStdoutRedirectedToStderrswaps it, so versioned JSONL reaches stdout while human progress is routed to stderr. Ordering confirmed correct. - Event flow — the onboarding FSM emits through
emitOnboardMachineEventinonboard-session.tsandruntime.ts; the observer registers as a listener, so--events=jsonlproduces real output rather than an empty stream. - Redaction —
model,sandboxName,metadata, anderrorall pass throughredactUrl/redactSensitiveText/redactForLog; only credential environment-variable names are exposed, matching the documented contract, and tests assert no secret survives serialisation. - No second state machine — reuses the existing event bus; observation is read-only and best-effort, and a closed pipe or sustained backpressure disables observation without altering onboarding control flow.
- Alias isolation —
--eventsis exposed only on the canonicalonboardcommand;setupandsetup-sparkbuild flags without it, and a test asserts the alias rejects the flag. - Reliability — asynchronous write path with error-handler lifetime tracking; the closed-stdout asynchronous-write-failure path is covered.
- Docs — usage line and the
--events=jsonlreference section updated with envelope, schema-evolution, and redaction notes. - Hygiene — no stray markers, SPDX headers present, the new file is co-located beside
events.ts, and the spelling register is consistent with the repository. - Discussion — the single CodeRabbit finding (synchronous stdout write) was addressed and re-confirmed resolved; no outstanding threads.
- CI — all required checks are green on the head SHA, and the PR Review Advisor reports zero findings at
215dab4c.
apurvvkumaria
left a comment
There was a problem hiding this comment.
Exact-head review at 215dab4 found a correctness blocker. JSONL purity only intercepts process.stdout.write, while reachable OpenShell and Ollama child processes inherit fd 1. A real child can therefore emit raw progress before the JSON event, and a closed JSONL consumer can EPIPE that child and change onboarding behavior. Route child stdout away from the machine-readable stream and add a real-child regression test proving stdout remains JSONL-only and consumer closure does not alter child/onboard success. Persisted sessionId and credentialEnv also need structural sanitization before emission so untrusted resumed state cannot be echoed verbatim.
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Addressed the requested JSONL hardening in two append-only commits, with original-author credit preserved:
Validation: independent audit PASS; 77 focused tests PASS; CLI typecheck PASS; Biome and diff checks PASS. Both commits are DCO-signed and GitHub Verified. I will keep the exact head under CI/advisor monitoring before clearing the superseded review state. |
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Follow-up 4f6ac24 removes the test-helper conditional flagged by the codebase growth guard while preserving both open-stdout and closed-stdout child-process regressions. The focused 22-test file, conditional scan, CLI typecheck, Biome, and diff checks pass; the commit is signed, credited, and GitHub Verified. I approved the exact-head fork workflows so CI can proceed. |
Signed-off-by: Ho Lim <subhoya@gmail.com>
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Maintainer follow-up on exact head
Validation: 42 focused tests pass, CLI typecheck passes, Biome is clean, |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Re-reviewed at exact refreshed head f18acfc. The prior blockers are addressed: persisted sessionId and credentialEnv values are structurally validated before serialization; child fd 1 is isolated across the shared runner, OpenShell, Ollama, installer, and BuildKit paths; and real-child regressions prove JSONL stdout purity plus closed-consumer independence. The branch merged current main cleanly with a Verified DCO commit, 97 focused tests pass, and pre-push type checks pass. The remaining Ollama-specific assertion is test-depth only and safe fix-forward.
Co-authored-by: Ho Lim <subhoya@gmail.com> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary This PR adds the canonical dated release entry for NemoClaw v0.0.94 before the tag is cut. The entry reconciles all 26 commits since v0.0.93 and links each user-visible change to its owning documentation. ## Changes - Add `docs/changelog/2026-07-24.mdx` with the exact `## v0.0.94` heading, parser-safe SPDX comment, release summary, and detailed bullets. - Record sandbox restore and update behavior, onboarding and inference changes, network policy behavior, security evidence, Hermes build performance, DGX Station guidance, and E2E validation changes. - Preserve `docs/` as the source of truth without changing the AI-agent documentation routing skill. - Use [E2E run 30075443016](https://github.com/NVIDIA/NemoClaw/actions/runs/30075443016) for release QA evidence at exact tested SHA `04e6dfa883071dda9df429c66e73168e1a995cba`. ### Source summary - [#7461](#7461) -> `docs/changelog/2026-07-24.mdx`: Record the ownership-preserving Hermes image layer reduction and hosted timing comparison. - [#7460](#7460) -> `docs/changelog/2026-07-24.mdx`: Record removal of candidate Hermes swap setup from E2E validation. - [#7458](#7458) -> `docs/security/fern-5.80.1-dependency-review.md`, `docs/changelog/2026-07-24.mdx`: Record the reviewed Fern CLI update. - [#7457](#7457) -> `docs/changelog/2026-07-24.mdx`: Record periodic runner-pressure telemetry. - [#7455](#7455) -> `docs/changelog/2026-07-24.mdx`: Record non-blocking absent Fern previews. - [#7450](#7450) -> `docs/changelog/2026-07-24.mdx`: Record stable cancellation handling for live-test child processes. - [#7449](#7449) -> `docs/changelog/2026-07-24.mdx`: Record parallel plugin EXDEV coverage. - [#7448](#7448) -> `docs/changelog/2026-07-24.mdx`: Record isolated long-running E2E lanes. - [#7444](#7444) -> `docs/changelog/2026-07-24.mdx`: Record exact-head Hermes swap validation. - [#7437](#7437) -> `docs/manage-sandboxes/backup-restore.mdx`, `docs/changelog/2026-07-24.mdx`: Record gateway pairing and authenticated verification after cross-sandbox restore. - [#7436](#7436) -> `docs/manage-sandboxes/backup-restore.mdx`, `docs/reference/commands.mdx`, `docs/changelog/2026-07-24.mdx`: Record selected stale-state cleanup and Hermes virtual-environment access repair. - [#7385](#7385) -> `docs/network-policy/customize-network-policy.mdx`, `docs/changelog/2026-07-24.mdx`: Record the read-only agent-variant route check. - [#7371](#7371) -> `docs/changelog/2026-07-24.mdx`: Record host-artifact verification for session exports. - [#7359](#7359) -> `docs/changelog/2026-07-24.mdx`: Record platform validation for managed vLLM model overrides. - [#7356](#7356) -> `docs/changelog/2026-07-24.mdx`: Record token-shaped value redaction for `sandbox doctor --json`. - [#7354](#7354) -> `docs/security/advisory-early-warning.md`, `docs/changelog/2026-07-24.mdx`: Record advisory correlation and retained audit provenance. - [#7352](#7352) -> `docs/network-policy/customize-network-policy.mdx`, `docs/network-policy/integration-policy-examples.mdx`, `docs/reference/commands.mdx`, `docs/changelog/2026-07-24.mdx`: Record preset reapplication and bounded `tls: skip` guidance. - [#7345](#7345) -> `docs/security/openclaw-2026.6.10-dependency-review.md`, `docs/security/openclaw-2026.7.1-dependency-review.md`, `docs/changelog/2026-07-24.mdx`: Record reviewed npm audit exception enforcement. - [#7340](#7340) -> `docs/network-policy/customize-network-policy.mdx`, `docs/changelog/2026-07-24.mdx`: Record the repaired CLI-reference route. - [#7334](#7334) -> `docs/get-started/dgx-station-preparation.mdx`, `docs/changelog/2026-07-24.mdx`: Record the qualified OTA metadata fallback and narrowed override wording. - [#7322](#7322) -> `docs/changelog/2026-07-24.mdx`: Reconcile the gateway source tag added to plugin registration banners. - [#7284](#7284) -> `docs/manage-sandboxes/update-sandboxes.mdx`, `docs/changelog/2026-07-24.mdx`: Record read-only `upgrade-sandboxes --check` behavior and recorded-gateway selection. - [#7277](#7277) -> `docs/changelog/2026-07-24.mdx`: Reconcile deterministic gateway TCP refusal coverage. - [#7234](#7234) -> `docs/reference/troubleshooting.mdx`, `docs/changelog/2026-07-24.mdx`: Record preserved DGX Spark managed vLLM Express intent on resume. - [#7185](#7185) -> `docs/reference/troubleshooting.mdx`, `docs/changelog/2026-07-24.mdx`: Record IPv4 fallback DNS selection and exact resolver probing. - [#6820](#6820) -> `docs/reference/commands.mdx`, `docs/changelog/2026-07-24.mdx`: Record the versioned, redacted `--events=jsonl` onboarding stream. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: `npx vitest run test/changelog-docs.test.ts` passed 6/6 tests. - [ ] Tests not applicable — justification: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: `docs/changelog/2026-07-24.mdx`; the writing rules, documentation style, exact release range, skip terms, published routes, and product scope were reviewed; the changelog test passed 6/6; `npm run docs` passed with route checking OK, zero errors, and two existing warnings. - Agent: Codex Desktop <!-- docs-review-head-sha: 65368f9 --> <!-- docs-review-agents-blob-sha: 9c9b36d --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable - Station profile/scenario: Not applicable - Result: Not applicable - Supporting evidence: Not applicable. This PR does not change `scripts/prepare-dgx-station-host.sh`. ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — `npx vitest run test/changelog-docs.test.ts` passed 6/6 tests. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not applicable to the dated changelog entry. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only). The build passed with zero errors and two existing Fern warnings. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only). Native dated changelog entries use the required parser-safe MDX SPDX comment and no frontmatter. --- Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added the v0.0.94 release changelog. * Documented improvements to sandbox snapshot and restore behavior. * Added updates for gateway selection, policy comparisons, onboarding event output, and DGX recovery workflows. * Documented enhanced diagnostics redaction, npm audit provenance, image assembly performance, and validation stability improvements. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Summary
Add an opt-in
nemoclaw onboard --events=jsonlobserver for automation consumers such as the Brev onboarding UI. The mode emits versioned, redacted events from the existing onboarding FSM while keeping normal human output on stderr; default onboarding behavior is unchanged.Related Issue
Refs #6403
Changes
onboardcommand and document schema evolution, redaction, and non-goals.Type of Change
Quality Gates
Verification
Verifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablevitest run src/lib/onboard/machine/events.test.ts src/lib/onboard/machine/jsonl-events.test.ts src/lib/onboard/command-support.test.ts test/cli/onboard-compatibility.test.ts test/stdout-guard.test.ts(31 passed)npm run typecheck:clinpm run docsbuilds without warnings (doc changes only)Signed-off-by: Ho Lim subhoya@gmail.com
Summary by CodeRabbit
New Features
--events=jsonltonemoclaw onboard.Documentation
schemaVersionenvelope, forward-compatibility expectations, and payload redaction rules.Tests
setupalias rejects--events=jsonl, and added stream/backpressure/pipe-disconnect coverage.