Documentation
¶
Index ¶
Constants ¶
const ( DefaultMaxDepth = 10 DefaultMaxResources = 50 )
Variables ¶
This section is empty.
Functions ¶
func ResolveRelativeURL ¶ added in v0.15.0
ResolveRelativeURL resolves a relative reference against a parent URL using RFC 3986 semantics. Absolute URLs are returned unchanged. The caller must validate the resolved URL against allowed prefixes.
Types ¶
type Dependency ¶
type Dependency struct {
URL string
LocalPath string
SHA256 string
FetchedAt time.Time
CacheHit bool
}
Dependency records a single URL that was resolved to a local cache path.
func ResolveHarness ¶
func ResolveHarness(ctx context.Context, h *harness.Harness, opts ResolveOpts) ([]Dependency, error)
ResolveHarness resolves URL-referenced declarative fields (Agent, Policy, Skills) in the harness to local cache paths. Local paths are left unchanged. The harness is modified in place: URL fields are replaced with cache paths, and h.Skills may grow to include transitively resolved skill dependencies. Returns the deduplicated list of resolved dependencies.
Skills with dependencies: frontmatter are recursively resolved up to MaxDepth levels. Diamond dependencies are deduplicated; cycles are rejected. Set MaxDepth to 0 to disable transitive resolution. Negative values use DefaultMaxDepth (10).
Trusting a skill means trusting its entire transitive dependency closure: a skill's frontmatter can declare relative references that resolve to different paths on the same allowed domain. All transitive deps are still validated against allowed_remote_resources and SHA256 integrity hashes.
The default limits (depth=10, resources=50) bound worst-case resolution. CI environments with untrusted harnesses should set tighter limits.
type ResolveOpts ¶
type ResolveOpts struct {
WorkspaceRoot string
FetchPolicy fetch.FetchPolicy
TraceID string
AuditLogPath string
// MaxDepth controls transitive dependency resolution depth.
// 0 disables transitive resolution (Phase 1 behavior).
// <0 uses DefaultMaxDepth (10).
//
// MaxResources uses different semantics: <=0 always uses
// DefaultMaxResources (50). The asymmetry exists because MaxDepth=0
// is a meaningful "disable" value, while MaxResources=0 ("allow zero
// resources") would prevent even non-transitive URL resolution.
MaxDepth int
MaxResources int
}
ResolveOpts controls how URL-referenced resources are resolved.