From 63968cd2248330c3f25c145b88991a2c25a38d44 Mon Sep 17 00:00:00 2001 From: "will.anderson" Date: Thu, 11 Jun 2026 11:46:56 -0500 Subject: [PATCH] fix(stewardship): address review issues in feat/layer-stewardship - 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 --- stewardship.el | 17 ++++++++--------- stewardship.elh | 3 +++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/stewardship.el b/stewardship.el index 9d80e3e..6d96a00 100644 --- a/stewardship.el +++ b/stewardship.el @@ -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 { "" } } diff --git a/stewardship.elh b/stewardship.elh index 3b04d2d..d5d0fda 100644 --- a/stewardship.elh +++ b/stewardship.elh @@ -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