MCPcopy Create free account
hub / github.com/github/gh-aw / effectiveStrictMode

Method effectiveStrictMode

pkg/workflow/compiler_yaml.go:24–36  ·  view source on GitHub ↗

effectiveStrictMode computes the effective strict mode for a workflow. Priority: CLI flag (c.strictMode) > frontmatter strict field > default (true). This should be used when emitting metadata/env vars to correctly reflect the workflow's strictness as inferred from the source (frontmatter).

(frontmatter map[string]any)

Source from the content-addressed store, hash-verified

22// This should be used when emitting metadata/env vars to correctly reflect the
23// workflow's strictness as inferred from the source (frontmatter).
24func (c *Compiler) effectiveStrictMode(frontmatter map[string]any) bool {
25 if c.strictMode {
26 // CLI flag takes precedence
27 return true
28 }
29 if strictVal, exists := frontmatter["strict"]; exists {
30 if strictBool, ok := strictVal.(bool); ok {
31 return strictBool
32 }
33 }
34 // Default: strict mode is on when no explicit setting
35 return true
36}
37
38// effectiveSafeUpdate returns true when safe update mode should be enforced for
39// the given workflow. Safe update mode is equivalent to strict mode: it is

Callers 6

TestEffectiveStrictModeFunction · 0.95
effectiveSafeUpdateMethod · 0.95
generateCreateAwInfoMethod · 0.95
buildActivationJobMethod · 0.95

Calls

no outgoing calls

Tested by 1

TestEffectiveStrictModeFunction · 0.76