contextpack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package contextpack compiles model-independent repository context.

Index

Constants

View Source
const (
	SchemaVersion = "deltacode.context.v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet struct {
	SchemaVersion      string                `json:"schema_version"`
	Objective          string                `json:"objective"`
	RepositoryName     string                `json:"repository_name"`
	RepositoryManifest string                `json:"repository_manifest_sha256"`
	Candidates         []discovery.Candidate `json:"candidates"`
	RelatedTests       []string              `json:"related_tests"`
	Slices             []Slice               `json:"slices"`
	OmittedCandidates  int                   `json:"omitted_candidates"`
	EstimatedTokens    int                   `json:"estimated_tokens"`
	ContextSHA256      string                `json:"context_sha256"`
}

Packet is an immutable, read-only context bundle for any coding model.

func Build

func Build(root, objective string, topK int) (*Packet, error)

Build discovers symbols and creates bounded AST slices for the best unique files. It performs no network, model, write, edit, or command operation.

type Slice

type Slice struct {
	Path             string   `json:"path"`
	Symbol           string   `json:"symbol"`
	Language         string   `json:"language"`
	OriginalBytes    int      `json:"original_bytes"`
	SlicedBytes      int      `json:"sliced_bytes"`
	ByteReduction    float64  `json:"byte_reduction_percent"`
	SourceSHA256     string   `json:"source_sha256"`
	SlicedSHA256     string   `json:"sliced_sha256"`
	RetainedEntities []string `json:"retained_entities"`
	Source           string   `json:"source"`
}

Slice binds a structural source excerpt to its repository-relative path.

Jump to

Keyboard shortcuts

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