project

package
v0.1.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package project resolves which directory a coop session is anchored to.

Index

Constants

View Source
const VolumeSep = "--"

VolumeSep separates a coop's name from a volume suffix. Container names cannot contain "--" (Name collapses hyphen runs), so <name>-- prefix matching cannot cross into another coop's volumes.

Variables

This section is empty.

Functions

func Name

func Name(projectRoot string) string

Name derives the container name for a (canonical) project path.

Anatomy: coop-<slug>-<hash16>. The 64-bit path hash disambiguates same-basename projects (work/api vs personal/api must never share a container or volumes). The slug collapses hyphen runs so "--" can never appear in a name — VolumeSep exploits that as an unambiguous owner/suffix boundary for volume cleanup.

func Resolve

func Resolve(dir string) (string, error)

Resolve determines the project root for a coop, walking up from dir.

Resolution order:

  1. coop.toml marker (nearest ancestor) — explicit pin, e.g. for pseudo-monorepos where the org root is the sandbox unit
  2. bare+worktree layout — git toplevel whose parent contains .bare/ resolves to that parent (the whole project incl. all worktrees)
  3. git toplevel
  4. dir itself

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL