Class: RosettAi::Authorship::DisclosurePolicy
- Inherits:
-
Object
- Object
- RosettAi::Authorship::DisclosurePolicy
- Defined in:
- lib/rosett_ai/authorship/disclosure_policy.rb
Overview
Manages disclosure levels for AI authorship attribution.
Four levels control how much AI involvement metadata appears in compiled output and commit messages:
none: no authorship metadata emittedminimal: brief note that AI tools were usedstandard: AI Attribution section in compiled outputfull: per-file AI involvement summary
Disclosure level is read from .rosett-ai/config.yml under
authorship.disclosure, not from behaviour YAML.
Constant Summary collapse
- LEVELS =
Returns Supported level values.
['none', 'minimal', 'standard', 'full'].freeze
- DEFAULT_LEVEL =
Returns Default log level.
'standard'
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Class Method Summary collapse
-
.from_config(data) ⇒ DisclosurePolicy
Loads the disclosure level from a config data hash.
Instance Method Summary collapse
-
#disclose? ⇒ Boolean
True if any metadata should be emitted.
-
#include_attribution? ⇒ Boolean
True if compiled output should include attribution section.
-
#include_per_file? ⇒ Boolean
True if per-file AI involvement should be included.
-
#include_trailer_guidance? ⇒ Boolean
True if trailer guidance should be in compiled output.
-
#initialize(level: DEFAULT_LEVEL) ⇒ DisclosurePolicy
constructor
A new instance of DisclosurePolicy.
Constructor Details
#initialize(level: DEFAULT_LEVEL) ⇒ DisclosurePolicy
Returns a new instance of DisclosurePolicy.
33 34 35 36 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 33 def initialize(level: DEFAULT_LEVEL) validate_level!(level) @level = level.freeze end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
29 30 31 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 29 def level @level end |
Class Method Details
.from_config(data) ⇒ DisclosurePolicy
Loads the disclosure level from a config data hash.
42 43 44 45 46 47 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 42 def self.from_config(data) level = data.dig('authorship', 'disclosure') || DEFAULT_LEVEL new(level: level) rescue ArgumentError new(level: DEFAULT_LEVEL) end |
Instance Method Details
#disclose? ⇒ Boolean
Returns true if any metadata should be emitted.
50 51 52 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 50 def disclose? @level != 'none' end |
#include_attribution? ⇒ Boolean
Returns true if compiled output should include attribution section.
55 56 57 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 55 def include_attribution? at_least?('standard') end |
#include_per_file? ⇒ Boolean
Returns true if per-file AI involvement should be included.
60 61 62 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 60 def include_per_file? at_least?('full') end |
#include_trailer_guidance? ⇒ Boolean
Returns true if trailer guidance should be in compiled output.
65 66 67 |
# File 'lib/rosett_ai/authorship/disclosure_policy.rb', line 65 def include_trailer_guidance? at_least?('minimal') end |