Repository navigation
Feature mapping: package-less nested TypeScript sources under packages/* can be unowned #243
Description
Summary
ClawPatch v0.8.2's default deterministic mapper can skip a package-less TypeScript project under packages/* whose implementation lives directly in a nested folder rather than src// lib/. This leaves the file outside all ownedFiles feature records.
This may be an intentional boundary rather than a bug; raising a reproducible upstream-first mapping coverage gap rather than implementing a competing mapper.
Minimal synthetic reproduction (no private source)
mkdir -p feature-map-repro/packages/core/governance
cd feature-map-repro
printf '%s\n' '{"name":"portable-mapping-fixture","private":true,"type":"module"}' > package.json
printf '%s\n' 'packages:' " - 'packages/*'" > pnpm-workspace.yaml
printf '%s\n' 'export type Policy = { enabled: boolean };' > packages/core/governance/types.ts
git init && git add .
clawpatch init
clawpatch map --source heuristicInspect .clawpatch/features/*.json and look for ownedFiles[].path === "packages/core/governance/types.ts".
Observed: the map completed successfully with 2 feature records, but none owns that path. Node 24, clawpatch@0.8.2, no provider/model calls. The fixture was exercised in a clean Linux GitHub Actions job with an exact npm version.
Expected / question
Ideally, the package-less project root should produce a bounded generic TypeScript source feature (or source-group feature) for the nested implementation, even when there is no nested package.json, project.json, or conventional src directory. Alternatively, document that this structure is intentionally unsupported and the recommended native configuration for adding coverage.
The Feature Mapping documentation describes package-less Node/TypeScript project roots and bounded source-group discovery, so this is a meaningful gap to clarify.
Constraints
- Keep deterministic mapping fast and bounded; no model invocation to make basic source inventory complete.
- Respect excludes, generated paths, symlinks, and existing package/project owners.
- Add a synthetic mapper test proving the new coverage, with false-positive guards.
- Prefer upstream correction rather than a ClawPatch-specific fork or downstream feature mapper.
No private source, credentials or customer data included.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Oct 20, 2026
Codex review: this still needs some work.
Summary
This issue remains unresolved: current main omits the reported layout, and the supported automatic-discovery boundary still needs a maintainer decision.
Reproducibility: Current source establishes the omission and the metadata ownership path; this review did not execute the fixture, and the reporter's external CI artifacts were unavailable.
Maintainer decision needed
Next step
Choose the discovery boundary, then document the validated sourceRoot example or specify bounded automatic coverage and its ownership guards.
Review details
Best possible solution:
Document the existing project.json sourceRoot workaround with an ownership regression and an explicit statement of the supported discovery boundary.
Do we have a high-confidence way to reproduce the issue?
Current source establishes the omission and the metadata ownership path; this review did not execute the fixture, and the reporter's external CI artifacts were unavailable.
Is this the best way to solve the issue?
Documenting existing sourceRoot metadata is the smallest supported solution; automatic discovery would require coordinated changes to project discovery and source-root selection.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against f4eb220dd82e.
Label changes
Label changes:
No label changes.
Label justifications:
P2: A concrete layout loses deterministic review coverage, but mapping completes and explicit project metadata provides a workaround.impact:other: Unowned TypeScript files are omitted from feature-based review coverage.Evidence reviewed
Acceptance criteria:
What I checked:
src/mappers/projects.ts:733, f4eb220dd82e)src/mappers/node.ts:378, f4eb220dd82e)docs/feature-mapping.md:34, f4eb220dd82e)src/mappers/projects.ts:764, 16e91bc8a689)src/mapper.test.ts:1484, f4eb220dd82e)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed October 21, 2026, 1:59 AM ET / 05:59 UTC.
ptahdunbar commentedon Oct 20, 2026
Verified configuration-first workaround (synthetic GitHub Actions repro)
Thanks for the review. I exercised the recommended native
project.jsonroute against unmodifiedclawpatch@0.8.2, using the same public-safe synthetic workspace as the issue (Node 24, Linux, no Nx package installed, no model calls).Before:
packages/core/governance/types.tsis unowned; default heuristic mapper emits 2 features, neither with that file inownedFiles.Change: create
packages/core/project.jsonwith:{"name":"governance-synthetic","sourceRoot":"packages/core/governance","projectType":"library"}After:
clawpatch map --source heuristicemits a native feature withownedFiles[].path === "packages/core/governance/types.ts". The CI check asserts this and passed, observing 1 owning feature slice.Evidence: agencyftw/agents PR #574; GitHub Actions run 39365416017.
This validates the maintainer/reviewer suggestion that explicit native metadata can solve the documented package-less mapping case without broadening heuristics or maintaining a fork. Suggest documenting this as the recommended workaround in feature-mapping guidance, with a regression example. I am treating the automated discovery-boundary question as separate; the user still needs to decide whether new project metadata should be required for arbitrary layouts.
No customer code or private findings included.
17 remaining items
steipete commentedon Oct 21, 2026
Fixed in #246 and released in v0.8.4, now npm
latest.Your synthetic reproduction now assigns
packages/core/governance/types.tsexactly one deterministic owner. Nested explicit manifests still win, including whenpackages/*workspace discovery does not enumerate them. Regression tests also cover excludes, symlinks, bounded groups, and stable remapping.Exact-head CI and the release pipeline passed. The published registry tarball passed SHA-512 integrity verification and an installed-CLI smoke of the reproduction. Thanks @ptahdunbar for the report.
fix(mapper): own package-less nested TypeScript sources (openclaw#246)