Record Class GoalBehavior

java.lang.Object
java.lang.Record
network.ike.plugin.ws.GoalBehavior
Record Components:
treePreflight - the entry precondition on the working tree
authoredCommit - how the goal commits what it writes

public record GoalBehavior(TreePreflight treePreflight, AuthoredCommit authoredCommit) extends Record
A goal's declared working-tree contract: how it treats an uncommitted tree on entry (TreePreflight) and how it commits the changes it authors (AuthoredCommit). Declared per WsGoal constant so the policy is compiler-visible and test-enforced rather than decided ad hoc per mojo (IKE-Network/ike-issues#780).

The named constants are the taxonomy clusters; a goal that does not fit a cluster constructs its own pair.

Status: these declarations are the locked target contract from #780. Runtime enforcement is being brought up to them goal-by-goal — some goals (the #780 "laggards": scaffold-publish, align-publish, stignore, add, remove, …) do not yet honor their declared behavior at runtime. The exhaustiveness test asserts every goal declares a behavior and the structural invariants; the per-goal declared-equals-observed enforcement lands with the migration slice.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final GoalBehavior
    The commit goal itself (ws:commit-publish).
    static final GoalBehavior
    Coordinating structural mutations (scaffold-publish, align-publish, stignore, checkpoint-publish, feature-start*/feature-finish*/feature-abandon-publish, post-release, update-feature-publish, add, remove, reconcile-branches-publish): require an unmodified tree (escapable with -Dallow-uncommitted) and commit authored changes in isolation.
    static final GoalBehavior
    The *-draft preview goals: warn on an uncommitted tree but do not block; they write a .gitignore'd .md report and author no tracked commit.
    static final GoalBehavior
    No clean-tree preflight, but commits its own changes in isolation: release-publish (honors interrupted-release roll-forward) and switch-publish (auto-stashes WIP, commits the manifest switch).
    static final GoalBehavior
    Pure read-only goals: graph, overview, report, release-status, help, lint, check-branch, verify-convergence, and the commit-draft preview (which must run against uncommitted changes).
    static final GoalBehavior
    VCS-state sync goals (pull, sync, push, refresh-main, cleanup-publish, scaffold-init): uncommitted input is expected — they auto-stash in-flight WIP where needed rather than refuse — and they author no tracked commit.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GoalBehavior(TreePreflight treePreflight, AuthoredCommit authoredCommit)
    Creates an instance of a GoalBehavior record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the authoredCommit record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    Returns the value of the treePreflight record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • READ_ONLY

      public static final GoalBehavior READ_ONLY
      Pure read-only goals: graph, overview, report, release-status, help, lint, check-branch, verify-convergence, and the commit-draft preview (which must run against uncommitted changes). No preflight, nothing authored.
    • DRAFT

      public static final GoalBehavior DRAFT
      The *-draft preview goals: warn on an uncommitted tree but do not block; they write a .gitignore'd .md report and author no tracked commit.
    • COORDINATING

      public static final GoalBehavior COORDINATING
      Coordinating structural mutations (scaffold-publish, align-publish, stignore, checkpoint-publish, feature-start*/feature-finish*/feature-abandon-publish, post-release, update-feature-publish, add, remove, reconcile-branches-publish): require an unmodified tree (escapable with -Dallow-uncommitted) and commit authored changes in isolation.
    • COMMIT

      public static final GoalBehavior COMMIT
      The commit goal itself (ws:commit-publish).
    • SYNC

      public static final GoalBehavior SYNC
      VCS-state sync goals (pull, sync, push, refresh-main, cleanup-publish, scaffold-init): uncommitted input is expected — they auto-stash in-flight WIP where needed rather than refuse — and they author no tracked commit.
    • NO_PREFLIGHT_COMMIT

      public static final GoalBehavior NO_PREFLIGHT_COMMIT
      No clean-tree preflight, but commits its own changes in isolation: release-publish (honors interrupted-release roll-forward) and switch-publish (auto-stashes WIP, commits the manifest switch).
  • Constructor Details

    • GoalBehavior

      public GoalBehavior(TreePreflight treePreflight, AuthoredCommit authoredCommit)
      Creates an instance of a GoalBehavior record class.
      Parameters:
      treePreflight - the value for the treePreflight record component
      authoredCommit - the value for the authoredCommit record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • treePreflight

      public TreePreflight treePreflight()
      Returns the value of the treePreflight record component.
      Returns:
      the value of the treePreflight record component
    • authoredCommit

      public AuthoredCommit authoredCommit()
      Returns the value of the authoredCommit record component.
      Returns:
      the value of the authoredCommit record component