Documentation
¶
Overview ¶
Package projectid resolves the canonical identity of the project a prosa session ran in. See INTENT.md §5 for the contract:
- `git remote get-url origin` on the session's cwd → canonical URL. Stable cross-device: two clones of the same repo on two machines end up with the same project_remote.
- .prosa.yaml in cwd or any ancestor, with `project: <name>` → marker. Explicit override for repos without a shared remote (private vendor drops, monorepos with per-subdir projects, …).
- cwd itself, marked "unscoped" — last fallback. Visible in the timeline but never the basis of auto-filter.
Resolve fails soft: missing git binary, unreadable .prosa.yaml, or a path that simply isn't a repo all yield Identity{Path: cwd} with no error. Callers only have to inspect the populated pointers to decide which dimension matched.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Identity ¶
type Identity struct {
// Remote is the canonical `git remote get-url origin` URL when the
// session's cwd resolves as a git repo. nil otherwise.
Remote *string
// Marker is the `project:` value from the nearest .prosa.yaml. nil
// when no marker file is reachable.
Marker *string
// Path is the session's cwd, normalized (filepath.Clean) — useful as
// the universal fallback for display and the legacy substring filter.
Path string
}
Identity is the resolved triple. At least Path is always populated.
Click to show internal directories.
Click to hide internal directories.