Repository navigation
fix(tooling): diagnose declaration escapes into ancestor installs - #139766
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: blocked before merge. Reviewed September 6, 2026, 1:45 AM ET / 05:45 UTC. ClawSweeper reviewWhat this changesThe PR explains declaration-build failures caused by ancestor dependency installations, tests both diagnostic branches, and updates a Gateway test fixture to use current projection fields. Merge readiness⛔ Blocked before merge - 1 item remains The PR remains useful and has no actionable findings. The earlier migration-proof blocker was a false positive: no persisted data model changes. The supplied before/after output adequately proves the diagnostic improvement. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's declaration tooling checks compiler inputs before accepting generated type declarations. Inputs outside the checkout are rejected; this change gives operators more specific guidance about the installation that supplied them. flowchart TD
A[Declaration build] --> B[Resolved compiler input]
B --> C{Inside checkout?}
C -->|Yes| D[Continue existing build flow]
C -->|No| E{Ancestor dependency install?}
E -->|Yes| F[Reject with installation guidance]
E -->|No| G[Reject with external dependency guidance]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +23, Other +20. Total +43 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep declaration inputs confined to the checkout while explaining ancestor-install contamination at the existing rejection boundary. Do we have a high-confidence way to reproduce the issue? Yes: pinned main gives generic reinstall advice when a declaration input resolves into an ancestor installation, and the supplied live transcript demonstrates that trigger. This review verified the source path without executing target code. Is this the best way to solve the issue? Yes: diagnosis belongs in the existing shared rejection boundary, and the patch preserves its acceptance rules while using the repository's documented installation layout. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cbd94188df13. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Addressing the one Before merge item — Add data-model compatibility proof — with a stated skip rather than a proof, because there is no data model here to be compatible with. The finding cites Evidence that nothing persistent changed:
I am deliberately not rewording the message to avoid the keyword. The word "repair" is the correct operator instruction here, and editing code to satisfy a classifier would be the wrong fix. Everything else in the review was clean: no findings, no security issues, no rank-up moves. |
3c552bf to
ec81849
Compare
#139753 renamed the projection result's streamErrorFallbackPending and streamErrorFallbackRepaired to assistantErrorPending and assistantErrorRecoveryObserved, but one call site in this test kept the old names, leaving main red on check-test-types-core-2. Its targeted PR CI never selected this shard, so the break first appeared on a full main run.
ec81849 to
e3f0921
Compare
|
Merged via squash.
|
Explain ancestor manifest probes despite a complete local install and checkout-local final resolution. Direct validation to a physically isolated checkout without changing input membership or fail-closed containment. Add native regression coverage for manifest-only probes, standalone receipt reuse, and consumed-manifest invalidation. Related: #139766
…enclaw#139766) * fix(tooling): diagnose declaration escapes into ancestor installs * fix(gateway): use current projection fields in session history test openclaw#139753 renamed the projection result's streamErrorFallbackPending and streamErrorFallbackRepaired to assistantErrorPending and assistantErrorRecoveryObserved, but one call site in this test kept the old names, leaving main red on check-test-types-core-2. Its targeted PR CI never selected this shard, so the break first appeared on a full main run.
…w#140617) Explain ancestor manifest probes despite a complete local install and checkout-local final resolution. Direct validation to a physically isolated checkout without changing input membership or fail-closed containment. Add native regression coverage for manifest-only probes, standalone receipt reuse, and consumed-manifest invalidation. Related: openclaw#139766
What Problem This Solves
Fixes an issue where maintainers running the declaration package-boundary lane in a nested checkout were told to install a dependency that was already correctly installed. The failure came from resolution reaching the parent checkout's install, so following the old advice could not repair it.
Why This Change Was Made
The diagnostic now identifies the ancestor
node_modulesthat supplied the escaped input and explains how to avoid it: run in a checkout outside another install, or repair the ancestor install to the repository'snodeLinker: isolatedlayout inpnpm-workspace.yaml. The existing guard, rejection conditions, and message prefix remain unchanged; unrelated escapes retain the original advice, and both branches identify undeclared imports as the boundary violation to investigate when nesting is absent.User Impact
Maintainers get an actionable explanation of the actual install topology instead of being sent back to reinstall a package that is already present. This only changes failure diagnostics; contaminated declaration inputs still fail and cannot be accepted.
Evidence
Before (local paths anonymized):
After (local paths anonymized):
Both live runs used
node --import ./scripts/tsx.mjs scripts/prepare-extension-package-boundary-artifacts.mtsand exited 1 on the same ancestorpunycode/package.json, as required.The four requested suites passed: 59 tests passed, 8 platform-specific tests skipped. The two new message assertions first failed against the original implementation.
oxfmton both touched files andgit diff --checkpassed.pnpm install --frozen-lockfileandpnpm check:changedpassed in an independent checkout outside the parent repository, using isolatedOPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATH. The copied patch was verified byte-for-byte against the candidate.Codex autoreview of the local candidate and committed branch returned
scoped-cleanwith no accepted/actionable findings at the helper's default P0 threshold.Also fixes red
mainWhile this PR was in review,
mainwent red oncheck-test-types-core-2:#139753 renamed that projection result's
streamErrorFallbackPendingandstreamErrorFallbackRepairedtoassistantErrorPendingandassistantErrorRecoveryObserved, but one call site insrc/gateway/session-history-state.test.tskept the old names. They were the only two stale references left in the repository. That PR's targeted CI plan never selected this shard, so the break first surfaced on a fullmainrun rather than on the PR.Repo policy is to fix a red
mainin the landing PR rather than wait it out, so the rename is applied here as a separate commit. No fix was open for it. Verified: the owning shard typechecks (exit 0),src/gateway/session-history-state.test.tspasses, and no reference to either old name remains.