mirror of
https://github.com/SHOGGOTH-SECTOR/sica-fondt.git
synced 2026-09-30 01:15:10 +00:00
Add SOUL.md frontloader + wire all drivers and tarot into the input slot
SOUL.md: YAML frontloader prepended to every other input -- name slot, version (Gen.03), first-commit unix epoch, and base-7 encoded references to vital file paths (each path's UTF-8 bytes as a big-endian integer in base 7). drive_box.R: drive_box_input_slot() implements the hub topology -- Energy, PS+, Ethical Integrity, ETR, AND the tarot spread each write their signal into one input slot (the Ada Medium Phase_Enrich injection), headed by the SOUL frontloader, with the raw user input appended. Not a chain; every subsystem wires to the input. Endocrine suite now 120 assertions, all green.
This commit is contained in:
@@ -107,3 +107,52 @@ drive_box_commit <- function(state, evaluation, alignment_tags = character(0)) {
|
||||
}
|
||||
state
|
||||
}
|
||||
|
||||
# --- The Input Slot (hub topology) ---
|
||||
# All four drivers AND the tarot spread wire into ONE place: the input slot --
|
||||
# the enriched context prepended to every model input (the Ada Medium's
|
||||
# Phase_Enrich injection point). This is a hub, not a chain: each subsystem
|
||||
# writes its own signal into the slot rather than feeding the next driver. The
|
||||
# SOUL.md frontloader heads the slot and is included every other input.
|
||||
#
|
||||
# Returns:
|
||||
# slot : the assembled injection block (drivers + tarot + soul ref)
|
||||
# input : slot followed by the raw user input_text
|
||||
# components : the individual signal lines (for testing / inspection)
|
||||
drive_box_input_slot <- function(state, input_text = "",
|
||||
tarot_spread = character(0),
|
||||
soul_ref = "SOUL.md") {
|
||||
snap <- drive_snapshot(state)
|
||||
lines <- character(0)
|
||||
|
||||
# SOUL frontloader reference (included every other input)
|
||||
if (nzchar(soul_ref)) {
|
||||
lines <- c(lines, sprintf("[SOUL: %s]", soul_ref))
|
||||
}
|
||||
# Energy driver -> slot
|
||||
lines <- c(lines, sprintf("[E ratio=%.2f locked=%s alive=%s]",
|
||||
snap$energy_ratio,
|
||||
tolower(as.character(snap$tool_locked)),
|
||||
tolower(as.character(snap$alive))))
|
||||
# PS+ driver -> slot (visceral / systemic-heat / prior arguments)
|
||||
for (a in snap$arguments) {
|
||||
lines <- c(lines, sprintf("[PS+ %s]", a))
|
||||
}
|
||||
# Ethical Integrity driver -> slot (principle posture)
|
||||
for (p in state$ethics$principles) {
|
||||
lines <- c(lines, sprintf("[ETH %s conviction=%.2f]", p$id, p$conviction))
|
||||
}
|
||||
# ETR driver -> slot (temporal-coherence regime)
|
||||
lines <- c(lines, sprintf("[ETR status=%s path=%s]", snap$etr_status, snap$update_path))
|
||||
# Tarot spread -> slot (each drawn card token)
|
||||
for (card in tarot_spread) {
|
||||
lines <- c(lines, sprintf("[CC %s]", card))
|
||||
}
|
||||
|
||||
slot <- paste(lines, collapse = "\n")
|
||||
list(
|
||||
slot = slot,
|
||||
input = if (nzchar(input_text)) paste0(slot, "\n\n", input_text) else slot,
|
||||
components = lines
|
||||
)
|
||||
}
|
||||
|
||||
@@ -89,4 +89,29 @@ test_case("commit on a denied action is a no-op on energy", function() {
|
||||
expect_equal(db$energy$current_energy, before, label = "no consumption when denied")
|
||||
})
|
||||
|
||||
test_case("input slot: every driver + tarot + soul wire into one slot", function() {
|
||||
db <- prime()
|
||||
spread <- c("THE_FOOL", "THE_MAGICIAN")
|
||||
res <- drive_box_input_slot(db, input_text = "who are you",
|
||||
tarot_spread = spread, soul_ref = "SOUL.md")
|
||||
expect_true(grepl("[SOUL: SOUL.md]", res$slot, fixed = TRUE), "soul frontloader wired")
|
||||
expect_true(grepl("[E ratio=", res$slot, fixed = TRUE), "energy wired")
|
||||
expect_true(any(grepl("^\\[PS\\+ ", res$components)), "ps+ wired")
|
||||
expect_true(grepl("[ETH honesty conviction=", res$slot, fixed = TRUE), "eth-int wired")
|
||||
expect_true(grepl("[ETR status=", res$slot, fixed = TRUE), "etr wired")
|
||||
expect_true(grepl("[CC THE_FOOL]", res$slot, fixed = TRUE), "tarot card 1 wired")
|
||||
expect_true(grepl("[CC THE_MAGICIAN]", res$slot, fixed = TRUE), "tarot card 2 wired")
|
||||
# the raw input is appended after the slot
|
||||
expect_true(grepl("who are you$", res$input), "user input appended after slot")
|
||||
})
|
||||
|
||||
test_case("input slot: empty body still emits driver + soul signals", function() {
|
||||
db <- init_drive_box()
|
||||
res <- drive_box_input_slot(db, input_text = "", tarot_spread = character(0))
|
||||
expect_true(grepl("[SOUL: SOUL.md]", res$slot, fixed = TRUE), "soul present")
|
||||
expect_true(grepl("[E ratio=1.00", res$slot, fixed = TRUE), "energy present at full")
|
||||
expect_true(grepl("[ETR status=DISASTROUS", res$slot, fixed = TRUE), "etr present")
|
||||
expect_equal(res$input, res$slot, label = "no input_text -> input == slot")
|
||||
})
|
||||
|
||||
test_summary()
|
||||
|
||||
Reference in New Issue
Block a user