assemble

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package assemble is the context compiler. It does NOT retrieve memories — it *compiles* a structured ContextPack the way a human orients before touching code: which subsystem, what it depends on, the goals in play, recent activity, the files worth reading. The pack is a typed object (with provenance on every item) so the future agent runtime consumes the same thing the CLI renders.

v1 is fully deterministic: topology + objectives + git recency + a Go-native content search. No model calls, no embeddings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Budget

type Budget struct {
	Limit     int  `json:"limit"`
	Estimated int  `json:"estimated"`
	Truncated bool `json:"truncated"`
}

Budget reports the rough token cost of the recommended reads.

type ContextPack

type ContextPack struct {
	Target           string   `json:"target"`
	Subsystem        string   `json:"subsystem,omitempty"`
	Ecosystem        string   `json:"ecosystem,omitempty"`
	Objectives       []Item   `json:"objectives"`
	Dependencies     []Item   `json:"dependencies"`
	RelevantFiles    []Item   `json:"relevant_files"`
	RecentEvents     []Item   `json:"recent_events"`
	Constraints      []Item   `json:"constraints"`
	RecommendedReads []Item   `json:"recommended_reads"`
	RankingReasons   []string `json:"ranking_reasons"`
	TokenBudget      Budget   `json:"token_budget"`
}

ContextPack is the structured output of the compiler — consumed by both the CLI renderer and (later) the agent's orient step.

func Context

func Context(ctx context.Context, st store.Store, root, target string) (ContextPack, error)

Context compiles a ContextPack for a target, which may be a path (file or directory) or a free-text query.

type Item

type Item struct {
	Ref    string `json:"ref"`             // path / subsystem key / objective id / commit hash
	Label  string `json:"label,omitempty"` // human text (title, commit subject, …)
	Reason string `json:"reason"`          // provenance: why this was included
	Score  int    `json:"score,omitempty"` // ranking score (higher = more relevant)
}

Item is one included piece of context, always carrying the reason it's here.

Jump to

Keyboard shortcuts

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