feat: stage guest diagnostics - #50
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 4:01 PM ET / 20:01 UTC (Revision 30). ClawSweeper reviewWhat this changesAdds a guest helper mode and launcher protocol that copy selected agent-profile diagnostics into the shared workspace and report per-file outcomes. Merge readiness✅ Ready for maintainer review This collaborator-authored PR remains distinct from current main. The earlier containment blockers are addressed, and no new blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Windows launcher uses a helper inside the isolated agent account to access diagnostics that the host cannot read directly. Host-specified sources and exclusions enter the helper; staged files and collection results return through the shared workspace. flowchart LR
A[Host collection request] --> B[Isolated guest helper]
C[Agent profile files] --> B
B --> D[Validate paths and exclusions]
D --> E[Create protected staging files]
E --> F[Shared workspace]
F --> G[Launcher reads collection result]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep staging as a bounded internal operation, with sanitization and safe bundle export owned by the follow-on diagnostics layer. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds an internal capability rather than reporting a current-main bug; Windows regression tests were inspected but not run. Is this the best way to solve the issue? Yes: guest-side staging addresses the account-access boundary while keeping redaction and operator-facing export outside this layer. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 685ee93b7ebb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (29 earlier review cycles; latest 8 shown)
|
ee92f03 to
3a4f5f0
Compare
3a4f5f0 to
022698d
Compare
022698d to
b1af8e0
Compare
b1af8e0 to
77ce5dc
Compare
77ce5dc to
798ca53
Compare
|
CodeQL aggregate check is stale: it failed at 00:25:25Z, before matching C# analyses completed successfully at 00:26:15Z and 00:26:42Z. The remediation commit is 1fbd7e5; CodeQL rerun is disabled for this workflow. Repo code-scanning reports no open alerts on this branch (the remaining six are on main). |
1fbd7e5 to
2ec8cd9
Compare
2ec8cd9 to
4199058
Compare
4199058 to
d5a211b
Compare
d5a211b to
6c4711d
Compare
6c4711d to
99a3cdc
Compare
99a3cdc to
51cc4e6
Compare
728849c to
e01726d
Compare
e01726d to
982e79a
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
What Problem This Solves
Later support workflows need a guest-side staging boundary without prematurely presenting a collection command as complete.
User Impact
This change only adds guest diagnostic staging. It does not expose a completed operator-facing diagnostics workflow.
Scope
The implementation stages the guest diagnostic material needed by a later layer. It intentionally defers all of the following:
clawctl collect-logscommand integration;Why This Change Was Made
Keeping staging separate makes its guest-boundary contract reviewable without claiming that collection, sanitization, or packaging is available. Those capabilities belong to the follow-on diagnostics layer.
Current validation
Latest hosted follow-up: CodeQL traced diagnostic source operations to .NET's environment-sensitive profile lookup. The guest collector now resolves the Windows user profile known folder directly with
SHGetKnownFolderPath; 16 focused collector tests, the static-analysis quality gate, the full 628-test suite, and an x64 NativeAOT session-host publish pass.Latest review hardening: diagnostic collection opens guest sources and staging destinations by handle, rejects reparse redirection, verifies final paths remain under their trusted roots, and applies exclusions to the opened source object. Source-link and destination-link adversarial tests pass.
Latest authority-chain follow-up: host helper staging and guest diagnostic output now create directories and files relative to validated parent handles with
NtCreateFile, so ancestor replacement cannot redirect a destructive create or truncate an outside sentinel. Automatic direct fallback validates any saved ownership first, and unlaunchable existing Node executables are treated as repairable. Focused authority/runtime/routing tests pass; integrated static analysis is warning-free and the full suite passes 642/642.Final-effect containment follow-up: destination root and descendant handles now request share-enforced read/list access without delete sharing and remain open through file creation and copying, preventing same-volume relocation of the validated tree. Output files use create-new semantics rather than overwrite-or-create, so a pre-existing hard link cannot truncate its outside target. Focused Windows tests cover a populated directory relocation attempt and a hard-linked sentinel; 20/20 collector tests pass.
Current layer head:
a6fe3ed09ad5f310572c3b02f247f0ddaa409fef. This layer is included in the final integrated stack tipcce2b02f3acd5791654b7a6b1a5a9c27db5ff63brebased onto685ee93b7ebbec1e784205a3544c460bea740e11.Integrated local gates: exact .NET SDK 10.0.100;
Test-DotNetQuality.ps1with 0 warnings/errors; full solution tests 642/642; NativeAOT x64 and ARM64 publishes for both launcher and session host; NativeAOT CLI, deployment, MXC, signing, runtime-input, release-identity, bundle, isolation-plugin, and packaging-relevance policy suites.Live x64 MXC evidence: final-tip Developer Mode deployment registered
OpenClaw.Gateway_0.1.2451.40134_x64__kaa03rpbbqef6from workflow payload run 35191206689;openclaw --versionreturnedOpenClaw 2026.9.4 (3a9d69d);clawctl statusconfirmed the isolated session was running. Earlier final-tip validation also exercised setup, Node.js 24.20.0 reuse, package-qualified activation, detached gateway launch, and redacted diagnostics collection.Signed package evidence: local NativeAOT x64 and ARM64 packages and a multi-architecture bundle were composed and test-signed. Elevated upgrade validation passed all four proof-release transitions (
v0.0.0.0andv0.0.0.1, standalone and bundle), retained package-family LocalState in every transition, and accepted fresh standalone and bundle installs. The temporary certificate and test package were removed, then the Developer Mode registration was restored.Layer 8 of 12. Parent: #49 - feat/session-logon-recovery. Child: #51 - fix/session-lifecycle-recovery