Documentation
¶
Overview ¶
Package layout defines the PDLC layout contract: where every product-definition artifact belongs in a project repository, how to recognize a misplaced one, and what each project profile requires.
Go types are the source of truth; JSON Schema is generated from them.
Index ¶
- Variables
- type Artifact
- type Authority
- type Confidence
- type Detect
- type Domain
- type Entry
- type Inventory
- type Level
- type Manifest
- func (m *Manifest) Artifact(id string) (Artifact, bool)
- func (m *Manifest) ArtifactsInDomain(id string) []Artifact
- func (m *Manifest) Classify(root string) (Inventory, error)
- func (m *Manifest) Domain(id string) (Domain, bool)
- func (m *Manifest) IsIgnored(relPath string) bool
- func (m *Manifest) IsImmovable(relPath string) bool
- func (m *Manifest) Validate() error
- type Profile
Constants ¶
This section is empty.
Variables ¶
var Profiles = []Profile{ProfileMinimal, ProfileStandard, ProfileFull}
Profiles lists the built-in profiles in increasing breadth.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
// ID uniquely identifies the artifact kind.
ID string `json:"id" yaml:"id" jsonschema:"required"`
// Domain is the evaluation domain this artifact belongs to.
Domain string `json:"domain" yaml:"domain" jsonschema:"required"`
// Canonical is the repository-relative path where the artifact belongs.
Canonical string `json:"canonical" yaml:"canonical" jsonschema:"required"`
// Authority is how binding the artifact is after handoff.
Authority Authority `json:"authority" yaml:"authority"`
// Profiles sets the requirement level per profile.
Profiles map[Profile]Level `json:"profiles" yaml:"profiles"`
// Detect holds heuristics for recognizing a misplaced instance.
Detect Detect `json:"detect,omitempty" yaml:"detect,omitempty"`
}
Artifact is one kind of product-definition artifact.
type Authority ¶
type Authority string
Authority is how binding an artifact is on the builder after handoff.
const ( // AuthorityNormative is a binding requirement. AuthorityNormative Authority = "normative" // AuthorityInformative is context and rationale. AuthorityInformative Authority = "informative" // AuthorityAdvisory is a recommended approach the builder may replace. AuthorityAdvisory Authority = "advisory" // AuthorityEvidence is machine-written proof, not a requirement. AuthorityEvidence Authority = "evidence" )
type Confidence ¶
type Confidence string
Confidence expresses how strongly an inventory entry matched an artifact kind.
const ( // ConfidenceHigh comes from an exact filename match or an already-canonical path. ConfidenceHigh Confidence = "high" // ConfidenceMedium comes from a directory-name or content match. ConfidenceMedium Confidence = "medium" // ConfidenceLow means the match is a guess and needs human confirmation. ConfidenceLow Confidence = "low" )
type Detect ¶
type Detect struct {
// Filenames are base names that identify the artifact (case-insensitive).
Filenames []string `json:"filenames,omitempty" yaml:"filenames,omitempty"`
// Dirnames are directory base names that identify the artifact.
Dirnames []string `json:"dirnames,omitempty" yaml:"dirnames,omitempty"`
// Content are substrings whose presence identifies the artifact.
Content []string `json:"content,omitempty" yaml:"content,omitempty"`
// Under restricts matches to paths containing one of these segments.
Under []string `json:"under,omitempty" yaml:"under,omitempty"`
// NotUnder rejects matches under any of these segments.
NotUnder []string `json:"notUnder,omitempty" yaml:"not_under,omitempty"`
}
Detect holds heuristics for classifying an existing file or directory as an artifact kind. Rules are additive: any match proposes the artifact, while Under and NotUnder constrain where a match is credible.
type Domain ¶
type Domain struct {
// ID is the domain identifier, used as the readiness category name.
ID string `json:"id" yaml:"id" jsonschema:"required"`
// Title is the human-readable name.
Title string `json:"title,omitempty" yaml:"title,omitempty"`
// QualityOnly marks a domain that has no canonical artifacts and exists
// only as an evaluation (for example accessibility or consistency).
QualityOnly bool `json:"qualityOnly,omitempty" yaml:"qualityOnly,omitempty"`
// LeafReports are repository-relative paths holding this domain's
// tool-produced evaluation evidence.
LeafReports []string `json:"leafReports,omitempty" yaml:"leafReports,omitempty"`
// Profiles sets the requirement level per profile. Used for quality-only
// domains; artifact-backed domains derive their level from artifacts.
Profiles map[Profile]Level `json:"profiles,omitempty" yaml:"profiles,omitempty"`
}
Domain groups artifacts into an evaluation category.
type Entry ¶
type Entry struct {
// Path is the repository-relative path found on disk.
Path string `json:"path"`
// ArtifactID is the matched artifact kind, empty when unclassified.
ArtifactID string `json:"artifactId,omitempty"`
// Canonical is where the artifact belongs, empty when unclassified.
Canonical string `json:"canonical,omitempty"`
// Confidence is the strength of the classification.
Confidence Confidence `json:"confidence,omitempty"`
// Conformant reports whether Path is already at its canonical location.
Conformant bool `json:"conformant"`
// Reason explains why the classification matched.
Reason string `json:"reason,omitempty"`
// Alternatives are other artifact kinds that also matched. A non-empty
// list means the classification is ambiguous and needs human resolution.
Alternatives []string `json:"alternatives,omitempty"`
// Conflicts are other paths that classified to the same canonical
// location. Only one file can occupy a canonical path, so a conflict
// always requires a human to choose.
Conflicts []string `json:"conflicts,omitempty"`
}
Entry is one classified path in a project repository.
type Inventory ¶
type Inventory struct {
// Root is the absolute path of the scanned repository.
Root string `json:"root"`
// Entries are the classified paths, sorted by path.
Entries []Entry `json:"entries"`
}
Inventory is the classification of a project repository.
func (Inventory) Ambiguities ¶
Ambiguities returns entries a human must decide between: those matching more than one artifact kind, or contesting a canonical path with another file.
type Level ¶
type Level string
Level is how strongly a profile expects an artifact or domain.
const ( // LevelRequired means a stage gate fails when the artifact is absent. LevelRequired Level = "required" // LevelRecommended means the gate reports absence but does not fail. LevelRecommended Level = "recommended" // LevelOptional means the artifact is evaluated only when present. LevelOptional Level = "optional" // LevelExcluded means the domain is out of scope; it is reported as // excluded rather than as a failure. LevelExcluded Level = "excluded" )
func ApplyOverride ¶
ApplyOverride combines a profile-derived level with a project override.
An override of excluded removes the artifact from scope. An override of required promotes anything still in scope. A weaker override demotes, so a project can keep a domain in scope without letting it block a gate. An artifact excluded by the profile stays excluded: an override adjusts emphasis, it does not introduce artifacts the profile does not define.
type Manifest ¶
type Manifest struct {
// APIVersion identifies the contract version.
APIVersion string `json:"apiVersion" yaml:"apiVersion" jsonschema:"required"`
// Kind is always "LayoutManifest".
Kind string `json:"kind" yaml:"kind" jsonschema:"required"`
// Version is the manifest revision.
Version int `json:"version" yaml:"version"`
// Immovable lists repository-relative directories that must never be
// moved, reorganized, or written to. These are tool-native contracts
// (AWS AI-DLC, Spec Kit, VisionSpec working state) plus machine-written
// projections.
Immovable []string `json:"immovable" yaml:"immovable"`
// Ignore lists directory base names that never hold a project's own
// product artifacts, such as templates, examples, and test fixtures.
// Classification skips them entirely.
Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"`
// Domains are the evaluation groupings. The readiness report emits one
// category per non-excluded domain.
Domains []Domain `json:"domains" yaml:"domains"`
// Artifacts are the artifact kinds with their canonical locations.
Artifacts []Artifact `json:"artifacts" yaml:"artifacts"`
}
Manifest is the complete layout contract.
func (*Manifest) ArtifactsInDomain ¶
ArtifactsInDomain returns every artifact belonging to domain id.
func (*Manifest) Classify ¶
Classify walks root and classifies every file and directory against the manifest's artifact kinds. Immovable directories are skipped entirely, so their contents can never appear in a move plan.
func (*Manifest) IsIgnored ¶
IsIgnored reports whether any segment of the repository-relative path is an ignored directory name, meaning the path cannot hold a product artifact.
func (*Manifest) IsImmovable ¶
IsImmovable reports whether the repository-relative path lies within a directory that must never be moved or written to.
type Profile ¶
type Profile string
Profile names the breadth of product-definition work a project carries. The layout contract is identical at every profile; profiles select which domains are in scope.
const ( // ProfileMinimal is specs, API, and baseline only. ProfileMinimal Profile = "minimal" // ProfileStandard adds prototype, guides, and descriptive requirements. ProfileStandard Profile = "standard" // ProfileFull is the reference practice: every domain including // localization, personas, and narrative artifacts. ProfileFull Profile = "full" // ProfileCustom relies entirely on per-domain overrides. ProfileCustom Profile = "custom" )