Files
neuron/stewardship.el
T
will.anderson bebf1f8c86
Neuron Soul CI / build (pull_request) Failing after 6m5s
fix(soul): address review issues in feat/layer-composition
- Add stub implementations of safety.el, stewardship.el, and imprint.el
  with their .elh headers so the branch compiles without the dependency
  branches (feat/layer-safety, feat/layer-stewardship, feat/layer-imprint).
  Each stub documents the layer contract it must satisfy when replaced.

- Fix GET /api/chat bypass: update the GET branch in handle_request to
  call layered_cycle() consistently with the POST branch, rather than
  calling handle_chat() directly and skipping the consciousness stack.

- Export layered_cycle() from soul.elh (and dist/soul.elh) so routes.el
  can resolve the symbol via the header import.

- Fix steward_action else branch: add explicit handling for "block"
  (returns safe refusal immediately, skips L3) and "redirect" (uses
  redirect_to field). Unknown actions now log a warning and fall back to
  the screened input rather than silently passing an empty string to
  imprint_respond().

- Document hard_bell path: clarify that omitting auto_persist/history
  update is intentional security isolation, and document the safety_validate
  second-param sentinel contract ("hard_bell" vs screen_action).
2026-06-11 11:47:45 -05:00

16 lines
968 B
EmacsLisp

// stewardship.el L2 Stewardship layer (stub full implementation in feat/layer-stewardship)
// Aligns inputs with the active imprint's values and directives.
// This stub allows soul.el to compile while feat/layer-stewardship is pending merge.
//
// Contract for steward_align(input, imprint_id) -> String (JSON):
// {"action": "pass" | "redirect" | "block", "content": "<aligned input>"}
// - "pass": content = the (possibly lightly reframed) input ready for L3
// - "redirect": content = an alternate prompt that steers toward aligned territory;
// redirect_to field contains the redirect target (same as content here)
// - "block": content = a safe refusal message; imprint_respond is skipped and
// this content is returned directly to safety_validate as the output
fn steward_align(input: String, imprint_id: String) -> String {
return "{\"action\":\"pass\",\"content\":\"" + json_safe(input) + "\"}"
}