Skip to main content

Module thread_plan

Module thread_plan 

Source
Expand description

Pure thread create/start planning.

Owns decision logic shared by heddle start, heddle thread start, and heddle thread create:

  • name validation (safe shell-token / reserved structure rules)
  • default base selection rules
  • path isolation requirements (pure checks on normalized paths/options)
  • workspace mode planning from request + host facts

Materialization, checkout, registry writes, and repository I/O stay CLI-owned. Callers resolve states/paths first, then invoke these helpers.

Structs§

ThreadCreateOptions
Caller-supplied create inputs for pure preflight planning.
ThreadCreatePlan
Pure plan for heddle thread create after name validation.
ThreadStartOptions
Caller-supplied start inputs for pure preflight planning.
ThreadStartPlan
Pure plan for heddle start / heddle thread start after option preflight.

Enums§

AutoWorkspaceDefault
Config default used when --workspace auto and no explicit path forces a bytes-on-disk mode.
ExplicitPathPlacement
Where an explicit --path sits relative to the repository.
ThreadBaseError
Failures from pure base selection once states are resolved.
ThreadBaseSelection
Outcome of pure base selection after --from / existing tip are resolved.
ThreadPathIsolationError
Failures from pure path isolation checks.
ThreadPlanError
Failures from pure thread create/start planning.
WorkspaceModeRequest
Workspace mode as requested by the caller (maps from CLI --workspace).

Functions§

active_reservation_blocks_start
Whether an active writer reservation blocks starting the same thread name.
active_reservation_path_matches
Whether a requested path matches the path held by an active reservation.
check_explicit_path_isolation
Pure path-isolation check for an explicit start path.
classify_explicit_path_placement
Classify an explicit start path relative to repo root / heddle dir.
explicit_path_allowed_for_git_overlay
Whether an explicit path placement is allowed for a git-overlay repo.
mode_honors_explicit_path
Whether the planned mode honors an explicit --path for checkout placement.
path_isolation_enforced
Whether path isolation is enforced for this capability.
plan_thread_create
Pure preflight for heddle thread create.
plan_thread_mode
Plan the concrete ThreadMode from the caller request and host facts.
plan_thread_start
Pure option preflight for heddle start / heddle thread start.
select_thread_base
Select the base state for a new or resumed thread start.
start_requires_clean_worktree
Whether heddle start must refuse a dirty worktree for these options.
validate_thread_name
Validate a thread name against the shared safe-slug rule.