Skip to content

refactor(paths): keep identity lookup imports passive - #200203

Merged
vincentkoc merged 2 commits into
mainfrom
fix/passive-path-identity-imports-20261117
Nov 16, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/passive-path-identity-imports-20261117

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Path-identity and shared-state lookups import broad filesystem-operation code even though they only need ancestor resolution and existing path helpers.

User Impact

No intended user-visible behavior change. Symlink identity, missing-path handling, Windows path behavior, and the existing Bun caller-lifetime workaround remain unchanged. No configuration, schema, or public SDK changes are included.

Why This Change Was Made

Move the two unchanged identity resolvers into the existing path-existence owner and migrate their internal consumers. Shared-main and state-database paths now import their existing home/state helpers directly. The old internal identity exports are removed; the broader boundary resolver remains in its current owner. The async ancestor probe is now private because its sole caller lives in the same file.

Existing identity tests move with the implementation. Caller mocks follow the canonical owner, and the existing source import-boundary test covers the three passive roots. Production changes add four net lines from import formatting; tests/support add 19. No cache, wrapper, or new runtime module is introduced.

Evidence

  • Frozen base: 3c512c5830183db9d4754f3a46a82248351a8138; signed candidate: ce26d9003bac855029b5d28fa56600a13c0ba2d5.

  • Both resolver implementations are byte-identical after relocation. Review of all internal consumers found no stale imports; the existing public SDK exports are unchanged. Independent owner/caller review found no source blocker. Formatting, commit-hook checks, and git diff --check passed.

  • Native source review at P0–P3 completed for the original owner move: two caller assignments and the integration assignment report no findings. The integration completion covers all 57 original patches, the complete three-root source closure, and pinned dependency source. A separate exact-commit review of the subsequent unused-export correction is also complete with no findings. These are static source reviews, not executed runtime proof.

  • The first Node CI attempt selected source 36b74b20da86ea7385bb88669b593e6cede3820f with separate trusted harness 4940240568f12255fb7e392357f5b741b742311c, Node 24.22.1, and Node test policy. It exposed the unused async-probe export, which is corrected in the current head. Relevant type graphs and its dist build step passed, but the attempt was superseded and finished cancelled; unfinished jobs were intentionally cancelled and are not counted as passing. Its other recorded failures are retained for attribution, not waived.

  • Local dependencies are unqualified, and an earlier native allocation still has unresolved settlement. No replacement native allocation or local dependency reconciliation is being made. The repository's authorized draft/exact-SHA CI route supplies the new head's required proof.

  • The replacement Node CI attempt verified selected source ce26d9003bac855029b5d28fa56600a13c0ba2d5, separate trusted harness 54cb172fb2adf6f77c936c80e3a7ee82cb74e135, Node 24.22.1, and Node test policy. All other workflow inputs retain their defaults. This follows the export correction; it is not a retry of the unchanged earlier candidate.

  • Current-head production, test, script, and tooling type checks passed: 38 native typecheck leaves, with every planned leaf completed. The build-artifacts job passed pnpm build:ci-artifacts, generated-asset/schema checks, CLI help/status smoke checks, native-host checks, and built artifact tests. A separate exact-head scripts/build-all.mts run completed the full build and cache-miss unified declarations. Its later npm pack --ignore-scripts step timed out after 900,000 ms, so packaging and Docker remain failed with cause UNKNOWN. Observed warnings remain explicit: largest CSS gzip exceeded its ceiling by 844 bytes; gateway watch used 12,000 ms CPU in a 10,000 ms window against an 8,000 ms threshold. Neither warning is attributed as a change caused by this PR.

  • The exact-head runtime archive confirms the three shared passive entry chunks resolve to 22 emitted files, 44,774 bytes, 25 source regions, and 56 static imports. Their closure excludes boundary-path, the broad config/path and utils entries, fs-safe/advanced, and active auth/database loaders. The only non-builtin external is the pinned fs-safe/path entry. This is static dependency proof, not executed lifetime or RSS evidence; separate standalone build groups are outside this closure.

  • Current-head focused proof passed: agent-dir-registry.test.ts 8 cases, path-existence.test.ts 14, service-installation policy 25, server-import-boundary.test.ts 39 including the three new passive roots, and operation-admission 49. The built boundary suite also passed 126 cases across 11 files, including the changed lexical-fallback case and home/path siblings. The mapped jobs completed successfully; no Windows or actual Bun execution is inferred from Node results.

  • This manual run is not green. Recorded failures include fixture/expectation and tooling failures with source or earlier-run evidence. Unresolved cases include the source session-history benchmark 60-second deadline, npm CLI recovery 240-second deadline, retained-pool synchronous-I/O observations, goal continuation ordering, and transport logging host/context state. The isolated Gateway registry-change and a separate config.apply timeout also remain UNKNOWN. The local-socket failure has a concrete existing fixture-length cause. These remain UNKNOWN where causality is unproved; no blanket inherited-failure waiver is claimed.

  • Native preparation completed on unchanged ce26 without rebasing. The ordinary PR CI attempt tested merge 3cd6bd6e642b2d6c4c7db4d5ce15045f98466611 with ordered parents 091a90e567c19d1dd2e3bcd8f5a35d479fd9d3e9 and ce26d9003bac855029b5d28fa56600a13c0ba2d5. All 147 jobs are terminal: 120 passed, 25 skipped, one FaceTime test-import failure and its aggregate failed. Security-fast, build, and all PostgreSQL jobs passed. The FaceTime test supplies a spawn-only child-process mock; its existing SDK test-helper import reaches promisify(execFile) introduced before this branch, so the missing export fails collection. All eight inspected failure inputs are identical between the tested main parent and merge. This is concrete source/history attribution, not a claimed earlier matching test run. The supported native exception is being reviewed for that sole current failure; the accepted squash auto-merge request remains gated and the PR is not yet merged. Earlier manual packaging and UNKNOWN failures retain their original failed status.

  • The exact-head ClawSweeper review found no actionable source issue. Its Rank-up request for candidate validation and emitted-boundary inspection is addressed by the focused, type, build, declaration, and compiled-closure evidence above. The sole ordinary-PR failure is attributed above and proposed for the supported native exception. The earlier manual-run UNKNOWN cases and packaging failure remain unresolved and are not relabeled as inherited or passing.

No RSS reduction, whole-Gateway memory improvement, or executed compiled-lifetime result is claimed.

@vincentkoc vincentkoc self-assigned this Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling size: M labels Nov 16, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves unchanged path-identity resolvers into the existing path-existence module and updates consumers to import narrow helper owners.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is focused and appears correct; incomplete candidate validation limits confidence in readiness.
Proof confidence 🦐 gold shrimp (3/6) No shipped-entry-point demonstration is required for this internal refactor; candidate test completion, emitted dependency-boundary inspection, and CI failure attribution remain unverified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Path lookup imports pull in broader filesystem-operation dependencies than their responsibility requires.
Reason: The maintainer-authored direction reduces dependency coupling through a mechanical cutover while preserving existing behavior and public surfaces.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused import-boundary improvement without an identified correctness regression; it remains a draft with unfinished validation.

Priority: P3
Reviewed head: ce26d9003bac855029b5d28fa56600a13c0ba2d5

Before merge

None.

Findings

None.

Agent review details

How this fits together

Agent, session, CLI, and database owners pass filesystem paths into shared identity helpers, which return canonical ancestor-based identities or absolute lexical fallbacks.

flowchart TD
  A[Agent and session callers] --> C[Path existence owner]
  B[CLI and database callers] --> C
  C --> D[Native filesystem probes]
  D --> E[Canonical identity or lexical fallback]
  F[Boundary operations] --> G[Existing fs safe boundary owner]
Loading

Technical review

Best possible solution:

Retain the focused owner move and complete validation of the reviewed candidate before taking this PR out of draft.

Do we have a high-confidence way to reproduce the issue?

Source inspection establishes the broad imports on the base and their replacement with narrow owners; no runtime reproduction was run for this behavior-preserving refactor.

Is this the best way to solve the issue?

The change uses existing owners, preserves resolver semantics, removes superseded internal exports, and migrates callers without introducing parallel machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ec025eba2df1.

Provenance checked

  • Identity canonicalization and async ancestor probing keeps the original intent (fix(paths): preserve identity across realpath failures #130516: Aliases must converge despite missing descendants or intermediate realpath failures; later shared-owner and async changes retained that contract.)
  • Shared filesystem ancestor owner keeps the original intent (5f69b18: Consolidate repeated runtime filesystem fallback behavior under existing shared owners.)
  • Boundary resolver caller lifetime keeps the original intent (fix(plugins): release the first source capture caller #195762: Use the existing detached async context so a process-lived Bun callback does not retain the first caller.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5f69b18 adds src/infra/path-existence.ts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5f69b18f458c; files: src/infra/path-existence.ts)

PR surface

Source +4, Tests +19. Total +23 across 57 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 46 74 70 +4
Tests 11 77 58 +19
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 57 151 128 +23

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal import-boundary refactor with unchanged intended behavior and no demonstrated urgent user failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Finish candidate validation, inspect the emitted import boundary, and establish attribution for the failed checks.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 16, 2026, 1:37 PM ET / 18:37 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 16, 2026 19:00
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: ce26d9003bac855029b5d28fa56600a13c0ba2d5
  • Maintainer: @vincentkoc
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/shared-main-dir.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/store-update-commit.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/plugin-model-catalog-credentials.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/sandbox/file-mutation-identity.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/fs-bridge-path-safety.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/state-owner-path.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@vincentkoc
vincentkoc enabled auto-merge (squash) November 16, 2026 19:06
@vincentkoc
vincentkoc disabled auto-merge November 16, 2026 19:36
@vincentkoc
vincentkoc merged commit 9e66164 into main Nov 16, 2026
337 of 341 checks passed
@vincentkoc
vincentkoc deleted the fix/passive-path-identity-imports-20261117 branch November 16, 2026 19:41
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

fuller-stack-dev added a commit that referenced this pull request Nov 16, 2026
…200242)

#200203 moved resolveIdentityPathViaExistingAncestor from
src/infra/boundary-path.ts to src/infra/path-existence.ts. #200192, merged
just before it, added a new import of that function from boundary-path.js in
oauth-refresh-peers.ts, so main has failed to typecheck and bundle since
9e66164. Import it from path-existence.js, as #200203 did for the other
callers.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
* fix(paths): keep identity lookup imports passive

* fix(paths): keep ancestor probe private after owner move
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…penclaw#200242)

openclaw#200203 moved resolveIdentityPathViaExistingAncestor from
src/infra/boundary-path.ts to src/infra/path-existence.ts. openclaw#200192, merged
just before it, added a new import of that function from boundary-path.js in
oauth-refresh-peers.ts, so main has failed to typecheck and bundle since
8ecc0fc. Import it from path-existence.js, as openclaw#200203 did for the other
callers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant