onboard

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package onboard analyzes a codebase that has few or no CANARY tokens and produces the agent hand-off needed to begin adoption: a language histogram, top-level directory layout, best-effort entry-point detection, any existing CANARY tokens, pre-seeded CANARY:MIGRATE guidance, the configured requirement-ID sources, the next available flatfile ID, and a next_steps checklist. Read-only — onboard never writes to the target repo. CANARY: REQ=CP-276; FEATURE="Onboard"; ASPECT=CLI; STATUS=TESTED; TEST=TestCANARY_CBIN_303_Analyze,TestCANARY_CBIN_303_Analyze_LimitBounds,TestCANARY_CBIN_303_Analyze_DefaultRootAndLimit,TestCANARY_CBIN_303_CreateOnboardCommand_JSON,TestCANARY_CBIN_303_CreateOnboardCommand_Human; UPDATED=2026-08-29

Index

Constants

View Source
const DefaultLimit = 20

DefaultLimit bounds every list section by default; agents raise it with --limit when they need more.

Variables

This section is empty.

Functions

func CreateOnboardCommand

func CreateOnboardCommand() *cobra.Command

CreateOnboardCommand returns the `canary onboard` command.

Types

type DirCount

type DirCount struct {
	Path  string `json:"path"`
	Files int    `json:"files"`
}

DirCount is one top-level directory's recursive file count.

type LanguageCount

type LanguageCount struct {
	Ext   string `json:"ext"`
	Count int    `json:"count"`
}

LanguageCount is one file extension's share of the histogram.

type MigrateNote

type MigrateNote struct {
	File string `json:"file"`
	Line int    `json:"line"`
	Text string `json:"text"`
}

MigrateNote is one pre-seeded CANARY:MIGRATE guidance line.

type OnboardReport

type OnboardReport struct {
	Root              string          `json:"root"`
	Languages         []LanguageCount `json:"languages"`
	LanguagesTotal    int             `json:"languages_total"`
	Directories       []DirCount      `json:"directories"`
	DirectoriesTotal  int             `json:"directories_total"`
	EntryPoints       []string        `json:"entry_points"`
	EntryPointsTotal  int             `json:"entry_points_total"`
	TokenCount        int             `json:"token_count"`
	MigrateNotes      []MigrateNote   `json:"migrate_notes"`
	MigrateNotesTotal int             `json:"migrate_notes_total"`
	ProjectKey        string          `json:"project_key"`
	Sources           []SourceInfo    `json:"sources"`
	NextID            string          `json:"next_id"`
	NextSteps         []string        `json:"next_steps"`
}

OnboardReport is the full adoption-analysis answer for one codebase.

func Analyze

func Analyze(root string, limit int) (*OnboardReport, error)

Analyze walks root read-only and builds the adoption-analysis report. limit bounds every list section; <=0 uses DefaultLimit.

type SourceInfo

type SourceInfo struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Key  string `json:"key"`
}

SourceInfo is one configured requirement-ID source.

Jump to

Keyboard shortcuts

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