Documentation
¶
Index ¶
- type ReviewAction
- type ReviewComposition
- type ReviewFile
- func RenderBinaryReviewFile(beforePath, afterPath string, beforeSize, afterSize int64, ...) ReviewFile
- func RenderIncompleteReviewFile(beforePath, afterPath, reason string) ReviewFile
- func RenderReviewFile(beforePath, afterPath, before, after string) ReviewFile
- func RenderReviewPreviewFile(beforePath, afterPath, before, after string) ReviewFile
- func RenderUnbasedReviewFile(path, after, reason string) ReviewFile
- func (file ReviewFile) Action() ReviewAction
- func (file ReviewFile) Hunks() ([]ReviewHunk, error)
- func (file ReviewFile) LineCounts() (added, removed int)
- func (file ReviewFile) Merge(current string, reverse bool, label string) (ReviewMerge, error)
- func (file ReviewFile) UnifiedDiff() string
- func (file ReviewFile) UnifiedDiffForWorkspace(workspace string) string
- type ReviewHighlightedFile
- type ReviewHunk
- type ReviewMerge
- type ReviewRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReviewAction ¶
type ReviewAction string
ReviewAction classifies a committed before/after file identity. Renderers use this one classification instead of inferring operation labels independently.
const ( ReviewAdd ReviewAction = "add" ReviewUpdate ReviewAction = "update" ReviewDelete ReviewAction = "delete" ReviewMove ReviewAction = "move" )
func (ReviewAction) Title ¶
func (action ReviewAction) Title() string
Title returns the user-facing operation name for reports and commentary.
type ReviewComposition ¶
type ReviewComposition struct {
// contains filtered or unexported fields
}
ReviewComposition composes one file's ordered, applied review captures. It retains only captured lines, not source files. Its zero value is ready to use. Hidden captures hide their regions without discarding the original baseline.
func (*ReviewComposition) ApplyWithHighlight ¶
func (c *ReviewComposition) ApplyWithHighlight(file ReviewFile, hidden, highlighted bool) error
ApplyWithHighlight also marks touched net regions for auxiliary display. It validates the captured chain before publishing any new composition. The hidden flag prevents a late receipt from reviving already hidden content. Highlights follow source regions through composition, not rendered line numbers. Hidden captures cannot introduce highlights; a full revert removes them.
func (*ReviewComposition) Consistent ¶
func (c *ReviewComposition) Consistent(content string) bool
Consistent reports whether content agrees with every source line the composition has learned at its current positions. An edit made outside the composed captures breaks this, even when no captured hunk would touch it.
func (*ReviewComposition) FilesWithHighlights ¶
func (c *ReviewComposition) FilesWithHighlights() []ReviewHighlightedFile
FilesWithHighlights returns visible unhidden original-to-latest regions, with highlights introduced by ApplyWithHighlight. Matching captured context is included when available; unknown source is never synthesized. Path-only changes mark their header projection.
type ReviewFile ¶
type ReviewFile struct {
BeforePath string
AfterPath string
Diff string
// Incomplete describes unavailable content; it is not an empty-file diff.
Incomplete string `json:",omitzero"`
// Directory is a metadata-only directory change. Its contents and descendant
// paths are not retained and cannot be composed, reverted or reapplied.
Directory bool `json:",omitzero"`
// Binary marks intact non-text content, reviewed by size and hash only.
Binary bool `json:",omitzero"`
// Link marks a symbolic link on either side; its rows are link targets,
// not file content.
Link bool `json:",omitzero"`
// CopyFrom names an unchanged source whose content an added file copies.
CopyFrom string `json:",omitzero"`
// Origin labels the tool that chose this file or its content. Empty means
// the agent chose both.
Origin string `json:",omitzero"`
OriginNote string `json:",omitzero"`
}
ReviewFile is an immutable original-to-final review projection. Unlike the executor patch it includes deleted content and preserves line-ending changes. Paths are empty on the absent side of an addition or deletion.
func RenderBinaryReviewFile ¶
func RenderBinaryReviewFile(beforePath, afterPath string, beforeSize, afterSize int64, beforeHash, afterHash string) ReviewFile
RenderBinaryReviewFile reviews intact non-text content without source rows, in the spirit of git's "Binary files differ".
func RenderIncompleteReviewFile ¶
func RenderIncompleteReviewFile(beforePath, afterPath, reason string) ReviewFile
RenderIncompleteReviewFile retains an applied operation's identity without inventing source rows when its contents could not be captured.
func RenderReviewFile ¶
func RenderReviewFile(beforePath, afterPath, before, after string) ReviewFile
RenderReviewFile captures an operation-owned before/after pair using the same diff semantics as engine edits. An empty path denotes an absent side. Pure moves may supply empty contents on both sides without reading the source.
func RenderReviewPreviewFile ¶
func RenderReviewPreviewFile(beforePath, afterPath, before, after string) ReviewFile
RenderReviewPreviewFile projects provisional before/after content with compact context. It is display-only, not completed historical capture evidence.
func RenderUnbasedReviewFile ¶
func RenderUnbasedReviewFile(path, after, reason string) ReviewFile
RenderUnbasedReviewFile shows a file's current content when its prior content is unknown. The rows are context for review, not a diff against an empty file, so line counts stay unavailable.
func (ReviewFile) Action ¶
func (file ReviewFile) Action() ReviewAction
Action classifies the committed file operation from its captured identities.
func (ReviewFile) Hunks ¶
func (file ReviewFile) Hunks() ([]ReviewHunk, error)
Hunks exposes captured geometry without reading files or duplicating the engine's diff parser in viewers. Path-only changes return no hunks.
func (ReviewFile) LineCounts ¶
func (file ReviewFile) LineCounts() (added, removed int)
LineCounts counts added and removed source rows in a captured review projection. File headers, context, and missing-final-newline markers are not source changes. Incomplete captures return -1 for both counts.
func (ReviewFile) Merge ¶
func (file ReviewFile) Merge(current string, reverse bool, label string) (ReviewMerge, error)
Merge applies the captured hunks to current content: forward replays the recorded change and reverse undoes it. A hunk is located exactly near its recorded position first. Otherwise its surrounding context anchors a region that is merged three ways, leaving conflict markers where the region and the requested side both changed. A hunk without locatable context is rejected instead of guessed. Captures hold only hunk context, so no file is read.
func (ReviewFile) UnifiedDiff ¶
func (file ReviewFile) UnifiedDiff() string
UnifiedDiff omits the redundant operation header when unified headers already describe the file. Header-only changes (empty files and pure moves) retain it. Rendering captured records here also keeps historical reads consistent.
func (ReviewFile) UnifiedDiffForWorkspace ¶
func (file ReviewFile) UnifiedDiffForWorkspace(workspace string) string
UnifiedDiffForWorkspace shortens display headers without changing retained paths or source rows. Composition and filesystem operations use the originals.
type ReviewHighlightedFile ¶
type ReviewHighlightedFile struct {
ReviewFile
Highlighted bool
}
ReviewHighlightedFile pairs a composed projection with process-local display metadata. Highlights are not part of immutable captured ReviewFile records.
type ReviewHunk ¶
ReviewHunk is one validated captured hunk with zero-based source coordinates. ChangedStart excludes leading context; deletions use their anchor. Rows exposes source content without diff framing.
type ReviewMerge ¶
type ReviewMerge struct {
Content string
// Conflicts counts regions written with git-style conflict markers.
Conflicts int
// Satisfied counts hunks whose requested side was already present.
Satisfied int
// Rejected holds captured hunks, in review format, that could not be located.
Rejected []string
}
ReviewMerge is the result of replaying or undoing one captured review against current content. Rejected hunks are left out of Content.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package capturer observes the router's existing client and provider seams without adding a listener or changing request and response bytes.
|
Package capturer observes the router's existing client and provider seams without adding a listener or changing request and response bytes. |
|
cmd
|
|
|
mekugi
command
|
|
|
mekugi-exec
command
Command mekugi-exec tracks the segments of one Codex command script.
|
Command mekugi-exec tracks the segments of one Codex command script. |
|
internal
|
|
|
appserver
Package appserver owns the Codex stdio RPC connection and its child process.
|
Package appserver owns the Codex stdio RPC connection and its child process. |
|
chat
Package chat classifies Chat Completions wire facts.
|
Package chat classifies Chat Completions wire facts. |
|
commentaryid
Package commentaryid owns the reserved IDs used for router-generated messages.
|
Package commentaryid owns the reserved IDs used for router-generated messages. |
|
execscope
Package execscope derives bounded write scopes without executing the user's program.
|
Package execscope derives bounded write scopes without executing the user's program. |
|
execsegment
Package execsegment splits a Codex command script into its top-level segments and instruments them for per-segment tracking.
|
Package execsegment splits a Codex command script into its top-level segments and instruments them for per-segment tracking. |
|
gooutline
Package gooutline supplies declaration boundaries from the host Go grammar.
|
Package gooutline supplies declaration boundaries from the host Go grammar. |
|
outputdedupe
Package outputdedupe finds repeated line runs in earlier visible text.
|
Package outputdedupe finds repeated line runs in earlier visible text. |
|
persistence
Package persistence owns application-write accounting and atomic publication.
|
Package persistence owns application-write accounting and atomic publication. |
|
responses
Package responses owns wire-level Responses event facts, not feature policy, transport lifetimes, or execution.
|
Package responses owns wire-level Responses event facts, not feature policy, transport lifetimes, or execution. |
|
sharedwasm
command
|
|
|
sourceparse
Package sourceparse shares read-only source input and syntax between classifiers and literal previews.
|
Package sourceparse shares read-only source input and syntax between classifiers and literal previews. |
|
sudoask
Package sudoask owns invocation-local sudo askpass setup.
|
Package sudoask owns invocation-local sudo askpass setup. |
|
tokenizer
Source: github.com/tiktoken-go/tokenizer/codec/codec.go@v0.8.1 The splitting and byte-pair merge algorithm is retained verbatim; long pieces use an equivalent heap merge, and vocabulary storage is owned by tokenizer.go.
|
Source: github.com/tiktoken-go/tokenizer/codec/codec.go@v0.8.1 The splitting and byte-pair merge algorithm is retained verbatim; long pieces use an equivalent heap merge, and vocabulary storage is owned by tokenizer.go. |
|
tokenizer/regex
Package codec registers the pinned upstream generated regex engines.
|
Package codec registers the pinned upstream generated regex engines. |
|
ui/activity
Package activity renders display-only activity blocks, Markdown, and journal result layouts.
|
Package activity renders display-only activity blocks, Markdown, and journal result layouts. |
|
ui/diffview
Package diffview presents captured diff navigation and provisional live cards.
|
Package diffview presents captured diff navigation and provisional live cards. |
|
ui/mermaid
Package mermaid renders an extended bounded Codex flowchart subset without I/O. Source: codex-rs/mermaid/src/parse.rs:15:217@[687a119f0fcaace47e1f1abcc77cec6c813fd6da] parse Source: codex-rs/mermaid/src/syntax.rs:9:105@[687a119f0fcaace47e1f1abcc77cec6c813fd6da] statements
|
Package mermaid renders an extended bounded Codex flowchart subset without I/O. Source: codex-rs/mermaid/src/parse.rs:15:217@[687a119f0fcaace47e1f1abcc77cec6c813fd6da] parse Source: codex-rs/mermaid/src/syntax.rs:9:105@[687a119f0fcaace47e1f1abcc77cec6c813fd6da] statements |
|
ui/terminal
Package terminal provides terminal input, scrolling, and raw-mode lifecycle primitives independently of router state and pane composition.
|
Package terminal provides terminal input, scrolling, and raw-mode lifecycle primitives independently of router state and pane composition. |
|
uisnapshot
Package uisnapshot supports rendered UI regression fixtures in tests.
|
Package uisnapshot supports rendered UI regression fixtures in tests. |
|
vcsguard
Package vcsguard decides which version-control invocations publish to a remote, and defines the approval channel between a guarded command and the router.
|
Package vcsguard decides which version-control invocations publish to a remote, and defines the approval channel between a guarded command and the router. |