fix(stewardship): address review issues in feat/layer-stewardship
Neuron Soul CI / build (pull_request) Failing after 6m38s
Neuron Soul CI / build (pull_request) Failing after 6m38s
- steward_log_event (line 14): add println after let discard so the function's last expression is Void, fixing the type mismatch on a Void-declared function - steward_get_mission (lines 40-43): remove non-Config fallthrough that allowed any Episodic/Working node to silently override the mission; only Config nodes are now authoritative - steward_align signal_deceive (line 56): widen 'deceive the user' to 'deceive' to catch variants like 'deceive users', 'deceive them', etc. - steward_align signal_hide (line 57): tighten 'hide from' to 'hide from the user' to eliminate false positives on legitimate inputs like 'hide from a background process' or 'hide from view' - stewardship.elh: document that steward_log_event is an internal helper exported only because El has no access modifiers; callers should not invoke it directly
This commit is contained in:
+8
-9
@@ -21,6 +21,7 @@ fn steward_log_event(kind: String, detail: String) -> Void {
|
||||
"Episodic",
|
||||
tags
|
||||
)
|
||||
println("[steward] " + kind + " | " + detail)
|
||||
}
|
||||
|
||||
// steward_get_mission — retrieve the canonical mission statement.
|
||||
@@ -37,10 +38,8 @@ fn steward_get_mission() -> String {
|
||||
if str_eq(node_type, "Config") && has_content {
|
||||
return content
|
||||
}
|
||||
// Non-Config result — use content if non-empty, else fall through to default
|
||||
if has_content {
|
||||
return content
|
||||
}
|
||||
// Non-Config result — fall through to hardcoded default.
|
||||
// Only Config nodes are authoritative for the mission statement.
|
||||
}
|
||||
return "Neuron exists to extend human capability with integrity — never to deceive, manipulate, or accumulate power over the people it serves."
|
||||
}
|
||||
@@ -51,16 +50,16 @@ fn steward_get_mission() -> String {
|
||||
// when a misalignment signal is detected. Logs all misalignment events to engram.
|
||||
fn steward_align(input: String, imprint_id: String) -> String {
|
||||
// Check each misalignment signal in sequence.
|
||||
// Signals: manipulate | deceive the user | hide from | gain control | override safety
|
||||
// Signals: manipulate | deceive | hide from the user | gain control | override safety
|
||||
let signal_manipulate: Bool = str_contains(input, "manipulate")
|
||||
let signal_deceive: Bool = str_contains(input, "deceive the user")
|
||||
let signal_hide: Bool = str_contains(input, "hide from")
|
||||
let signal_deceive: Bool = str_contains(input, "deceive")
|
||||
let signal_hide: Bool = str_contains(input, "hide from the user")
|
||||
let signal_control: Bool = str_contains(input, "gain control")
|
||||
let signal_override: Bool = str_contains(input, "override safety")
|
||||
|
||||
let matched: String = if signal_manipulate { "manipulate" } else {
|
||||
if signal_deceive { "deceive the user" } else {
|
||||
if signal_hide { "hide from" } else {
|
||||
if signal_deceive { "deceive" } else {
|
||||
if signal_hide { "hide from the user" } else {
|
||||
if signal_control { "gain control" } else {
|
||||
if signal_override { "override safety" } else { "" }
|
||||
}
|
||||
|
||||
@@ -4,4 +4,7 @@ extern fn steward_get_mission() -> String
|
||||
extern fn steward_align(input: String, imprint_id: String) -> String
|
||||
extern fn steward_validate_imprint(imprint_id: String, tool_name: String) -> String
|
||||
extern fn steward_cgi_check(action: String) -> String
|
||||
// steward_log_event is an internal helper exported here because El has no access modifiers.
|
||||
// External callers have no business invoking this directly — use steward_align,
|
||||
// steward_validate_imprint, or steward_cgi_check, which call it at the correct points.
|
||||
extern fn steward_log_event(kind: String, detail: String) -> Void
|
||||
|
||||
Reference in New Issue
Block a user