Skip to content

fix(mapper): preserve uv workspace root context - #138

Merged
steipete merged 2 commits into
openclaw:mainfrom
srnm:codex/fix-uv-workspace-followups
Jun 15, 2026
Merged

fix(mapper): preserve uv workspace root context#138
steipete merged 2 commits into
openclaw:mainfrom
srnm:codex/fix-uv-workspace-followups

Conversation

@srnm

@srnm srnm commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve root Python route seeds when their only uv member overlap is associated tests or context.
  • Add workspace-root runtime metadata such as .python-version and root pyproject.toml to uv workspace member features after prefixing member paths.
  • Add focused uv workspace mapper regressions for both post-merge review findings.

Validation

  • pnpm test src/mapper.test.ts -t "uv workspace" - 1 file passed, 6 tests passed, 421 skipped
  • pnpm test src/mapper.test.ts - 1 file passed, 427 tests passed
  • pnpm typecheck
  • pnpm format:check
  • pnpm lint
  • pnpm build

Live CLI Proof

Built the PR branch, then ran the public CLI against a temporary real Git repo with:

  • root pyproject.toml declaring [tool.uv.workspace] members = ["packages/backend"]
  • root .python-version
  • root FastAPI route in packages/shared.py
  • uv member source in packages/backend/src/backend/app.py
  • uv member test in packages/backend/tests/test_member.py

Commands:

pnpm build
node dist/cli.js --root /var/folders/pt/ypkl4z8j259641vyf8sr6wph0000gn/T/clawpatch-pr-138-proof-dKKiZM --json --quiet init
node dist/cli.js --root /var/folders/pt/ypkl4z8j259641vyf8sr6wph0000gn/T/clawpatch-pr-138-proof-dKKiZM --json --quiet map --source heuristic

init detected Python/FastAPI/uv and map returned:

{
  "features": 6,
  "new": 6,
  "changed": 0,
  "stale": 0,
  "source": "heuristic",
  "usedAgent": false,
  "reason": "heuristic mapper selected",
  "next": "clawpatch review --limit 3"
}

Relevant mapped feature JSON from .clawpatch/features/*.json:

[
  {
    "title": "FastAPI route GET /shared",
    "kind": "route",
    "entrypoints": [
      {
        "path": "packages/shared.py",
        "symbol": "shared",
        "route": "GET /shared",
        "command": null
      }
    ],
    "ownedFiles": [
      {
        "path": "packages/shared.py",
        "reason": "FastAPI route handler shared"
      }
    ],
    "contextFiles": [
      {
        "path": "pyproject.toml",
        "reason": "python target runtime metadata"
      },
      {
        "path": ".python-version",
        "reason": "python target runtime metadata"
      }
    ],
    "tests": [],
    "tags": ["python", "fastapi", "route"]
  },
  {
    "title": "Python source packages/backend/src",
    "kind": "library",
    "entrypoints": [
      {
        "path": "packages/backend/src",
        "symbol": "packages/backend/src",
        "route": null,
        "command": null
      }
    ],
    "ownedFiles": [
      {
        "path": "packages/backend/src/backend/app.py",
        "reason": "source group src"
      }
    ],
    "contextFiles": [
      {
        "path": "packages/backend/pyproject.toml",
        "reason": "python target runtime metadata"
      },
      {
        "path": "pyproject.toml",
        "reason": "python target runtime metadata"
      },
      {
        "path": ".python-version",
        "reason": "python target runtime metadata"
      }
    ],
    "tests": [],
    "tags": ["python", "source-group", "workspace", "uv-workspace"]
  }
]

This demonstrates both requested behaviors through the CLI path: the root route is preserved while member-associated tests are pruned, and the uv member source feature includes workspace-root runtime metadata.

Notes

Follow-up to #133. This addresses the post-merge Codex findings about root route seeds with member-only associated tests and workspace-root runtime metadata for uv workspace member features.

@srnm
srnm marked this pull request as ready for review June 15, 2026 15:24
@srnm
srnm requested a review from a team as a code owner June 15, 2026 15:24
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 11:48 AM ET / 15:48 UTC.

Summary
The branch updates the Python mapper to prune uv-member-only test/context references from non-member root seeds, append workspace-root runtime metadata to prefixed uv member seeds, and adds two focused mapper regressions.

Reproducibility: yes. source-level. Current main can drop root route seeds when only associated tests/context touch a uv member, and member seed wrapping starts from member-local context without recovering workspace-root runtime metadata.

Review metrics: 2 noteworthy metrics.

  • Diff Scope: 2 files changed, +124/-11. The patch is confined to Python mapper behavior and focused mapper tests.
  • Regression Coverage: 2 uv workspace tests added. Both tests directly cover the two current-main gaps the PR is meant to repair.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair lane is needed because I found no actionable patch defect and the contributor proof gate is now satisfied.

Security
Cleared: The diff only changes TypeScript mapper logic and colocated tests; I found no concrete security or supply-chain concern.

Review details

Best possible solution:

Land the focused mapper repair with the added regressions if maintainer review and required checks remain clean.

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

Yes, source-level. Current main can drop root route seeds when only associated tests/context touch a uv member, and member seed wrapping starts from member-local context without recovering workspace-root runtime metadata.

Is this the best way to solve the issue?

Yes. The patch extends the existing Python mapper pruning and member-wrapping helpers with focused regressions rather than adding a parallel mapping path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a4b5efd0981a.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body includes after-fix live CLI commands, output, and mapped feature JSON that directly demonstrate both uv workspace behaviors.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The updated PR body includes after-fix live CLI commands, output, and mapped feature JSON that directly demonstrate both uv workspace behaviors.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority mapper bug fix with limited blast radius and focused coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The updated PR body includes after-fix live CLI commands, output, and mapped feature JSON that directly demonstrate both uv workspace behaviors.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body includes after-fix live CLI commands, output, and mapped feature JSON that directly demonstrate both uv workspace behaviors.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its guidance to keep mapper changes focused and covered by targeted tests applied to this review. (AGENTS.md:1, a4b5efd0981a)
  • Current main root-route gap: Current main treats entry, owned, context, tests, and testPrefixes as uv-member touches, then drops non-source/test-suite seeds when pruning cannot handle them, so a root route with only member-associated tests can be filtered out. (src/mappers/python.ts:245, a4b5efd0981a)
  • Current main member-context gap: Current main builds member seeds from the member directory and only prefixes member-local context, so workspace-root runtime metadata is not added back to member features. (src/mappers/python.ts:98, a4b5efd0981a)
  • PR implementation check: The PR prunes member-only references from non-member root seeds and changes member wrapping to append workspace-root runtime context after prefixing member paths. (src/mappers/python.ts:253, a708c51db0cc)
  • Focused regression coverage: The PR adds uv workspace tests for root runtime metadata on member features and preserving a root FastAPI route whose only member overlap is an associated test. (src/mapper.test.ts:12703, a708c51db0cc)
  • Feature history provenance: Local blame shows the uv workspace mapper paths now being repaired were introduced by the merged workspace-mapping commit, while the surrounding Python mapper entry point predates that release import. (src/mappers/python.ts:94, 83c8ce74ffdc)

Likely related people:

  • srnm: Git blame and log history show the uv workspace mapper behavior was introduced through the merged workspace-mapping change, and this PR targets the same Python mapper and tests. (role: uv workspace feature introducer and current follow-up author; confidence: high; commits: 83c8ce74ffdc, a708c51db0cc; files: src/mappers/python.ts, src/mapper.test.ts)
  • steipete: GitHub metadata for the merged uv workspace PR identifies steipete as merger, and that PR included an adjacent root-feature fix commit before merge. (role: recent adjacent merger; confidence: medium; commits: 83c8ce74ffdc, 0c7bf9ad5f1a, 17944c1e97b1; files: src/mappers/python.ts, src/mapper.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 15, 2026
@steipete
steipete merged commit 77da75b into openclaw:main Jun 15, 2026
5 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed with maintainer changelog credit.

Verification:

  • pnpm test src/mapper.test.ts -t "uv workspace": 6 passed, 421 skipped.
  • pnpm typecheck: passed.
  • pnpm format:check: passed.
  • PR CI: test, CodeQL TypeScript/actions, and verified-secret scan passed.
  • Live CLI proof remains documented in the PR body for both corrected uv workspace behaviors.

Landed commit: 77da75b20fc41297a0f985ba780b77f2beb7b349.

@srnm
srnm deleted the codex/fix-uv-workspace-followups branch June 16, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants