Record Class CaptureTeamPolicy
java.lang.Object
java.lang.Record
com.shaft.capture.runtime.CaptureTeamPolicy
public record CaptureTeamPolicy(Optional<Boolean> headless, String outputDirectory, String browser)
extends Record
Team recorder policy checked into the repository at
.shaft/recorder-policy.json
(issue #3425 C4). When present, every recording started against that workspace — from the
IntelliJ plugin, an agent CLI, or a raw MCP call — honors the same team defaults, so recordings
land in a consistent place with consistent privacy/browser settings across the whole team.
Schema (all fields optional):
{
"headless": false, // lock recordings to headed/headless
"outputDirectory": "recordings", // workspace-relative directory every recording lands in
"browser": "Chrome" // default browser when a request does not name one
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWorkspace-relative location of the policy file. -
Constructor Summary
ConstructorsConstructorDescriptionCaptureTeamPolicy(Optional<Boolean> headless, String outputDirectory, String browser) Creates an immutable policy. -
Method Summary
Modifier and TypeMethodDescriptionapplyOutputDirectory(String requestedOutputPath, String defaultFileName) Re-roots a requested output path into the policy's output directory, preserving the requested file name.browser()Returns the value of thebrowserrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headless()Returns the value of theheadlessrecord component.static CaptureTeamPolicyLoads the policy for a workspace root; an absent or unreadable file yields the empty policy so recording never breaks because of a malformed policy — it just falls back to defaults.Returns the value of theoutputDirectoryrecord component.booleanpresent()Whether the policy file declared anything at all.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
POLICY_PATH
-
-
Constructor Details
-
CaptureTeamPolicy
-
-
Method Details
-
load
Loads the policy for a workspace root; an absent or unreadable file yields the empty policy so recording never breaks because of a malformed policy — it just falls back to defaults.- Parameters:
workspaceRoot- workspace root directory- Returns:
- the parsed policy, or an empty policy
-
present
public boolean present()Whether the policy file declared anything at all.- Returns:
- true when at least one field is set
-
applyOutputDirectory
Re-roots a requested output path into the policy's output directory, preserving the requested file name. Blank requests get a caller-supplied default file name.- Parameters:
requestedOutputPath- the caller's output path, possibly blankdefaultFileName- file name used when the request is blank- Returns:
- workspace-relative output path honoring the policy directory, or the original request when the policy declares no directory
-
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). -
headless
-
outputDirectory
Returns the value of theoutputDirectoryrecord component.- Returns:
- the value of the
outputDirectoryrecord component
-
browser
Returns the value of thebrowserrecord component.- Returns:
- the value of the
browserrecord component
-