server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeDiffURL

func CodeDiffURL(filePath, diffURI string) string

CodeDiffURL creates a stable, escaped URL for a focused file and optional exact/range diff selection. Paths and saga-diff URIs are never shortened.

func Listen

func Listen(ctx context.Context, root, sourceDir, addr string, openBrowser bool, out io.Writer) error

func ListenManaged added in v0.0.4

func ListenManaged(ctx context.Context, root, sourceDir, addr string, openBrowser bool, out io.Writer, options ManagedOptions) error

func OpenBrowser added in v0.0.4

func OpenBrowser(rawURL string) error

OpenBrowser opens a trusted loopback URL using the platform launcher. It is exported for the CLI's detached-server path, where readiness is observed in a different process from the server itself.

Types

type ChangedFileTreeNode

type ChangedFileTreeNode struct {
	Name          string
	Path          string
	Kind          string
	Depth         int
	Children      []*ChangedFileTreeNode
	File          *FileDiffView
	FileCount     int
	ReviewedCount int
	Added         int
	Deleted       int
	Selected      bool
	Expanded      bool
}

type ChangedFileTreeView

type ChangedFileTreeView struct {
	Nodes         []*ChangedFileTreeNode
	FileCount     int
	ReviewedCount int
	Added         int
	Deleted       int
}

type CodeReviewView

type CodeReviewView struct {
	Files              []*FileDiffView
	Tree               ChangedFileTreeView
	SelectedFile       *FileDiffView
	SelectedDiff       *diffAtomView
	SelectedDiffs      []*diffAtomView
	SelectedDiffURI    string
	RelatedSaga        []*RelatedSagaChapterView
	RelatedEmpty       string
	NarrativeOwnership []*FragmentOwnershipView
	ReviewedFiles      int
}

CodeReviewView is the complete template contract for the focused code view. Files remains flat for lookup and keyboard navigation; Tree is the nested presentation model and SelectedFile is the only file intended for rendering.

type CoverageManifestView

type CoverageManifestView struct {
	Complete     bool
	Total        int
	Covered      int
	Uncovered    int
	Overlapping  int
	Orphaned     int
	MappingCount int
	Files        []*ManifestFileView
	Tree         []*ManifestTreeNode
	Targets      []*ManifestTargetView
	Orphans      []*ManifestOrphanView
}

CoverageManifestView is the human-auditable, bidirectional projection of coverage.Report. Files prove code-to-narrative ownership; Targets prove the reverse narrative-to-code relationship from the same atom assignments.

type DiffLineView

type DiffLineView struct {
	Kind    string
	Path    string
	OldLine int
	NewLine int
	Content string
	Event   string
	OldPath string
	NewPath string
	Atom    *diffAtomView
	// Linked marks a row inside a whole-file diff as evidence for the narrative
	// target that requested it, so a drawer can distinguish the lines its
	// explanation covers from the surrounding file it shows for context.
	Linked bool
}

DiffLineView is presentation-only. Atom is populated for changed lines and events so existing fully-qualified comment and suggestion contracts remain attached to the same diff atom.

type FileDiffView

type FileDiffView struct {
	ID             string
	Name           string
	Path           string
	URI            string
	Href           string
	Atoms          []*diffAtomView
	Lines          []*DiffLineView
	Added          int
	Deleted        int
	Reviewed       bool
	Reviewer       string
	ReviewerDetail string
	Selected       bool
}

type FragmentOwnershipView

type FragmentOwnershipView struct {
	ChapterID    string
	ChapterTitle string
	FragmentID   string
	Title        string
	Target       string
	Anchor       string
	Href         string
	Diffs        []*NarrativeDiffView
}

FragmentOwnershipView is the forward fragment-to-diff half of the ownership contract. Unavailable links retain their original fully-qualified URI.

type ManagedOptions added in v0.0.4

type ManagedOptions struct {
	ShutdownToken string
	OnReady       func(string) error
}

ManagedOptions lets the CLI supervise a detached loopback server without weakening the ordinary foreground server. The shutdown token is random, stored only in the user's private runtime directory, and never rendered into saga content.

type ManifestChunkView

type ManifestChunkView struct {
	Label     string
	Kind      string
	Side      string
	Path      string
	Excerpt   string
	Href      string
	AtomCount int
	Covered   bool
	Owners    []*ManifestOwnerView
	// contains filtered or unexported fields
}

type ManifestFileView

type ManifestFileView struct {
	Path      string
	AtomCount int
	Added     int
	Deleted   int
	Events    int
	Covered   int
	Uncovered int
	Chunks    []*ManifestChunkView
	// HasDiff records that a body exists for this path without carrying it.
	// The coverage audit fetches each body from /api/file-diff when a reviewer
	// opens that file, so the page describes the whole comparison without
	// containing it.
	HasDiff bool
}

type ManifestOrphanView

type ManifestOrphanView struct {
	Owner  *ManifestOwnerView
	URI    string
	Reason string
}

type ManifestOwnerView

type ManifestOwnerView struct {
	Target  string
	Title   string
	Kind    string
	Chapter string
	Href    string
	Slide   *SlideReferenceView
}

type ManifestTargetFileView

type ManifestTargetFileView struct {
	Path      string
	AtomCount int
	Added     int
	Deleted   int
	Events    int
	Href      string
	Chunks    []*ManifestChunkView
	HasDiff   bool
}

type ManifestTargetView

type ManifestTargetView struct {
	ManifestOwnerView
	AtomCount int
	Chunks    []*ManifestChunkView
	Files     []*ManifestTargetFileView
}

type ManifestTreeNode

type ManifestTreeNode struct {
	Name      string
	Path      string
	Kind      string
	Depth     int
	Children  []*ManifestTreeNode
	File      *ManifestFileView
	AtomCount int
	Added     int
	Deleted   int
	Uncovered int
}

ManifestTreeNode presents coverage as the repository the reviewer already knows. The tree ships fully expanded so every changed file and its coverage state is visible without hunting, while folders remain collapsible.

type NarrativeDiffView

type NarrativeDiffView struct {
	URI         string
	Note        string
	Available   bool
	Reason      string
	FilePath    string
	Href        string
	MatchedURIs []string
}

type RelatedSagaChapterView

type RelatedSagaChapterView struct {
	ID          string
	Title       string
	Target      string
	Anchor      string
	Href        string
	SlideNative bool
	Fragments   []*RelatedSagaFragmentView
}

type RelatedSagaFragmentView

type RelatedSagaFragmentView struct {
	ID       string
	Title    string
	Target   string
	Excerpt  string
	Anchor   string
	Href     string
	DiffURIs []string
	Slide    *SlideReferenceView
}

type SlideReferenceView added in v0.1.0

type SlideReferenceView struct {
	ID          string
	Title       string
	Target      string
	Anchor      string
	Href        string
	URL         string
	MediaType   string
	ReviewState string
	ItemCount   int
}

SlideReferenceView is the common visual language for a slide referenced outside the presentation surface. Evidence remains owned by Items, while navigation rolls those references up to the slide a reviewer can recognize.

Jump to

Keyboard shortcuts

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