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 still needs a maintainer decision: current main skips the reported layout, and the working metadata workaround has not been documented as the supported alternative.
Reproducibility: Current source establishes why packages/core/governance/types.ts is omitted; the reporter supplies a v0.8.2 reproduction and successful metadata workaround, but this review did not execute the fixture or independently verify the linked CI run.
Maintainer decision needed
Next step
Choose whether unconventional folders require project.json metadata, then document the validated sourceRoot example or define bounded discovery and ownership changes.
Review details
Best possible solution:
Document the existing project.json sourceRoot route with the reported fixture and an ownership regression, subject to maintainer agreement on the discovery boundary.
Do we have a high-confidence way to reproduce the issue?
Current source establishes why packages/core/governance/types.ts is omitted; the reporter supplies a v0.8.2 reproduction and successful metadata workaround, but this review did not execute the fixture or independently verify the linked CI run.
Is this the best way to solve the issue?
The existing sourceRoot route solves ownership without expanding heuristic discovery; documenting it is the smallest supported path, while automatic coverage requires a deliberate change to both 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 12edc2ac692a.
Label changes
Label changes:
No label changes.
Label justifications:
P2: A concrete repository layout loses deterministic feature coverage, but mapping completes and explicit project metadata provides a workaround.impact:other: Unowned TypeScript files reduce the coverage available to feature-based review.Evidence reviewed
Acceptance criteria:
What I checked:
src/mappers/projects.ts:733, 12edc2ac692a)src/mappers/node.ts:378, 12edc2ac692a)src/mappers/projects.ts:81, 12edc2ac692a)docs/feature-mapping.md:34, 12edc2ac692a)src/mappers/projects.ts:764, 16e91bc8a689)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 20, 2026, 4:47 PM ET / 20:47 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.
4 remaining items