planfile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package planfile manages Ralph's fix_plan.md scratchpad.

fix_plan.md is the running TODO list the assistant maintains across iterations. The default location is `<working-dir>/.ralph/fix_plan.md`. The directory is created lazily on first write.

Index

Constants

View Source
const DefaultRelPath = ".ralph/fix_plan.md"

DefaultRelPath is the default location of the plan file relative to the loop's working directory.

Variables

This section is empty.

Functions

func Changed

func Changed(prev, next Snapshot) bool

Changed reports whether two snapshots differ in existence or content.

func EnsureDir

func EnsureDir(absPath string) error

EnsureDir creates the parent directory of absPath if it does not exist.

func Read

func Read(absPath string) (string, error)

Read returns the current contents of the plan file. A missing file is reported as ("", nil) so callers can treat "not yet written" the same as "empty plan".

func Resolve

func Resolve(workingDir, path string) string

Resolve returns an absolute path for the plan file, defaulting to `<workingDir>/.ralph/fix_plan.md` when path is empty or relative.

Types

type Snapshot

type Snapshot struct {
	Path    string
	Content string
	Exists  bool
}

Snapshot is a stable representation of the plan file at one point in time. It is used to detect changes between iterations.

func Take

func Take(absPath string) (Snapshot, error)

Take captures the current plan file state. A missing file is recorded as Exists=false with empty content.

Jump to

Keyboard shortcuts

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