Record Class GoalBehavior
java.lang.Object
java.lang.Record
network.ike.plugin.ws.GoalBehavior
- Record Components:
treePreflight- the entry precondition on the working tree- 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
FieldsModifier and TypeFieldDescriptionstatic final GoalBehaviorThe commit goal itself (ws:commit-publish).static final GoalBehaviorCoordinating 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 GoalBehaviorThe*-draftpreview goals: warn on an uncommitted tree but do not block; they write a.gitignore'd.mdreport and author no tracked commit.static final GoalBehaviorNo clean-tree preflight, but commits its own changes in isolation:release-publish(honors interrupted-release roll-forward) andswitch-publish(auto-stashes WIP, commits the manifest switch).static final GoalBehaviorPure read-only goals:graph,overview,report,release-status,help,lint,check-branch,verify-convergence, and thecommit-draftpreview (which must run against uncommitted changes).static final GoalBehaviorVCS-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
ConstructorsConstructorDescriptionGoalBehavior(TreePreflight treePreflight, AuthoredCommit authoredCommit) Creates an instance of aGoalBehaviorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthoredCommitrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thetreePreflightrecord component.
-
Field Details
-
READ_ONLY
Pure read-only goals:graph,overview,report,release-status,help,lint,check-branch,verify-convergence, and thecommit-draftpreview (which must run against uncommitted changes). No preflight, nothing authored. -
DRAFT
The*-draftpreview goals: warn on an uncommitted tree but do not block; they write a.gitignore'd.mdreport and author no tracked commit. -
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
The commit goal itself (ws:commit-publish). -
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
No clean-tree preflight, but commits its own changes in isolation:release-publish(honors interrupted-release roll-forward) andswitch-publish(auto-stashes WIP, commits the manifest switch).
-
-
Constructor Details
-
GoalBehavior
Creates an instance of aGoalBehaviorrecord class.- Parameters:
treePreflight- the value for thetreePreflightrecord componentauthoredCommit- the value for theauthoredCommitrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
treePreflight
Returns the value of thetreePreflightrecord component.- Returns:
- the value of the
treePreflightrecord component
-
authoredCommit
Returns the value of theauthoredCommitrecord component.- Returns:
- the value of the
authoredCommitrecord component
-