Repository navigation
Closed
Labels
area: coreTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected
Description
Problem
@Project should come from the manifest of the project a file belongs to. Today each file-type detector hard-codes which manifest it looks for (src/detectors/*.mjs markers + parseProjectName), so a file gets the right name only when its type happens to match the project's ecosystem:
- CSS / HTML only know
package.json(since fix: take the CSS and HTML @Project from the project's package.json #72) — in a PHP (composer.json), Python (pyproject.toml) or Rust (Cargo.toml) project they fall back to the folder name. - YAML and JSON only know
package.json— a workflow.ymlor a.jsonconfig in a Python repo gets the folder name. - A
.mjsbuild script in a Python project looks only forpackage.jsonand missespyproject.toml.
Expected
Separate "which project does this file belong to" from "which comment syntax does this file type use":
- Walk up from the file; at each folder check for every known manifest:
package.json,pyproject.toml(plus the name insetup.cfg/setup.pywhere present),composer.json,Cargo.toml,go.mod. The nearest folder containing any manifest is the project root. - The name comes from that manifest's parser (
name,[project].name/[tool.poetry].name,[package].name,module, …); the folder name only when the manifest yields none. - Tie-break when one folder holds several manifests: the manifest of the file's own language wins (
.py→pyproject.toml,.js/.mjs/.ts→package.json,.php→composer.json,.rs→Cargo.toml,.go→go.mod); language-neutral files (CSS, HTML, YAML, JSON, Markdown, …) use the fixed orderpackage.json,pyproject.toml,composer.json,Cargo.toml,go.mod. - Comment syntax / preserved prefixes stay per file type, unchanged.
projectName/--project-namestill override everything.
Tests
Every file type × every manifest type (CSS in a composer/pyproject/Cargo/go project, YAML/JSON in a Python project, .mjs in a Python project, …); nearest-folder wins over a farther manifest; same-folder tie-break by language and the fixed order for neutral files; manifests without a name fall back to the folder; malformed manifests; projectName override.
Metadata
Metadata
Assignees
Labels
area: coreTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected
Activity
Shinrai commentedon Sep 29, 2026
Design update: resolve project data through one driver per ecosystem, rather than a single winning manifest.
detect(dir), which checks whether the folder is a valid project of that kind, andread(), which returns the data its manifest provides (at leastname).nameand a second driver also claims the folder, the name comes from the second. The folder name is used only when no claiming driver has one.projectName, …) still win, and comment syntax stays per file type.Shinrai commentedon Sep 29, 2026
Refinement: when no driver claiming the nearest folder provides a field, resolution keeps climbing.
@Filenameuse, stays the nearest claimed folder. Only field values climb.Shinrai commentedon Sep 29, 2026
@Filenameis the file's path relative to the folder of the manifest detected for that file, the nearest claimed folder. This holds even when@Projectclimbs to a parent's manifest: the name comes from the parent, the path from the nearest manifest. It's already how the header template builds it (relative(projectRoot, file)), and #74 keeps it that way and adds tests.Shinrai commentedon Sep 29, 2026
A
.gitfolder is a repository boundary, and it stays a hard stop for both the project-root search and the field climb. A file belongs, at most, to the repository it lives in, so a nested repository or submodule is its own project and its history comes from its own git. As implemented in #75.release: v2.0.0 - re-cut the release notes as v2.0.0
cldmv-bot commentedon Sep 29, 2026
Closed in v2.0.0 — resolved by #75.