Rebuild the typed Persona projection
This commit is contained in:
parent
7e4564a34f
commit
6544562389
11 changed files with 779 additions and 135 deletions
|
|
@ -66,6 +66,68 @@ const SEALED_DIRECT_THOUGHT_KEYS: &[&str] = &[
|
|||
];
|
||||
const SEALED_LONG_TEXT_KEYS: &[&str] = &["note"];
|
||||
const MAX_OPERATOR_TEXT_CHARS: usize = 1200;
|
||||
const PERSONA_SURFACE_SCHEMA_VERSION: &str = "epiphany.persona_surface.v0";
|
||||
|
||||
#[derive(Clone, Copy, Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
enum PersonaArtifactKind {
|
||||
Bubble,
|
||||
DiscordChat,
|
||||
RedditPost,
|
||||
OtherRequest,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
enum PersonaArtifactLifecycle {
|
||||
Projected,
|
||||
Draft,
|
||||
Blocked,
|
||||
Posted,
|
||||
DraftCandidate,
|
||||
CrossingRequested,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct PersonaArtifactRef {
|
||||
kind: PersonaArtifactKind,
|
||||
schema_version: String,
|
||||
path: String,
|
||||
lifecycle: PersonaArtifactLifecycle,
|
||||
modified_at: Option<String>,
|
||||
target: Option<String>,
|
||||
private_state_exposed: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct PersonaActionRef {
|
||||
action_id: &'static str,
|
||||
intent_schema_version: &'static str,
|
||||
consequence_owner: &'static str,
|
||||
surface_owns_consequence: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
enum PersonaSurfaceStatus {
|
||||
Loaded,
|
||||
Attention,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct PersonaSurface {
|
||||
schema_version: &'static str,
|
||||
status: PersonaSurfaceStatus,
|
||||
artifact_dir: String,
|
||||
artifacts: Vec<PersonaArtifactRef>,
|
||||
rejected_artifact_count: usize,
|
||||
source_error_count: usize,
|
||||
available_actions: Vec<PersonaActionRef>,
|
||||
private_state_exposed: bool,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse()?;
|
||||
|
|
@ -528,31 +590,70 @@ fn native_auxiliary_status(root: &Path) -> Result<NativeAuxiliaryStatus> {
|
|||
.unwrap_or_else(
|
||||
|error| json!({"status": "error", "error": error.to_string(), "latestArtifacts": []}),
|
||||
);
|
||||
let mut latest_artifacts = latest_discord_persona
|
||||
.get("latestArtifacts")
|
||||
.and_then(Value::as_array)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
latest_artifacts.extend(
|
||||
latest_reddit_persona
|
||||
let mut rejected_artifact_count = 0_usize;
|
||||
let mut source_error_count = 0_usize;
|
||||
let mut artifacts = Vec::new();
|
||||
for (source, readback) in [
|
||||
("discord", &latest_discord_persona),
|
||||
("reddit", &latest_reddit_persona),
|
||||
("other", &latest_other_persona),
|
||||
] {
|
||||
if readback.get("status").and_then(Value::as_str) == Some("error") {
|
||||
source_error_count += 1;
|
||||
continue;
|
||||
}
|
||||
for artifact in readback
|
||||
.get("latestArtifacts")
|
||||
.and_then(Value::as_array)
|
||||
.cloned()
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
latest_artifacts.extend(
|
||||
latest_other_persona
|
||||
.get("latestArtifacts")
|
||||
.and_then(Value::as_array)
|
||||
.cloned()
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
let persona = json!({
|
||||
"status": "loaded",
|
||||
"artifactDir": persona_dir,
|
||||
"latestArtifacts": latest_artifacts,
|
||||
"availableActions": ["personaBubble", "characterTurn", "discordPersonaPost", "redditPersonaPost", "otherWorldPersonaRequest"],
|
||||
});
|
||||
.into_iter()
|
||||
.flatten()
|
||||
{
|
||||
if let Some(artifact) = persona_artifact_ref(source, artifact) {
|
||||
artifacts.push(artifact);
|
||||
} else {
|
||||
rejected_artifact_count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
let persona = serde_json::to_value(PersonaSurface {
|
||||
schema_version: PERSONA_SURFACE_SCHEMA_VERSION,
|
||||
status: if rejected_artifact_count == 0 && source_error_count == 0 {
|
||||
PersonaSurfaceStatus::Loaded
|
||||
} else {
|
||||
PersonaSurfaceStatus::Attention
|
||||
},
|
||||
artifact_dir: persona_dir.to_string_lossy().into_owned(),
|
||||
artifacts,
|
||||
rejected_artifact_count,
|
||||
source_error_count,
|
||||
available_actions: vec![
|
||||
PersonaActionRef {
|
||||
action_id: "personaBubble",
|
||||
intent_schema_version: "epiphany.persona_bubble_intent.v0",
|
||||
consequence_owner: "persona-mouth-projection",
|
||||
surface_owns_consequence: false,
|
||||
},
|
||||
PersonaActionRef {
|
||||
action_id: "characterTurn",
|
||||
intent_schema_version: "epiphany.character_turn_intent.v0",
|
||||
consequence_owner: "character-loop",
|
||||
surface_owns_consequence: false,
|
||||
},
|
||||
PersonaActionRef {
|
||||
action_id: "discordPersonaPost",
|
||||
intent_schema_version: "epiphany.discord_persona_post_intent.v0",
|
||||
consequence_owner: "Bifrost",
|
||||
surface_owns_consequence: false,
|
||||
},
|
||||
PersonaActionRef {
|
||||
action_id: "redditPersonaPost",
|
||||
intent_schema_version: "epiphany.reddit_persona_post_intent.v0",
|
||||
consequence_owner: "Bifrost",
|
||||
surface_owns_consequence: false,
|
||||
},
|
||||
],
|
||||
private_state_exposed: false,
|
||||
})?;
|
||||
let bifrost_bridge = bifrost_bridge_readiness(root);
|
||||
let void_memory = native_json(
|
||||
"epiphany-void-memory",
|
||||
|
|
@ -568,6 +669,64 @@ fn native_auxiliary_status(root: &Path) -> Result<NativeAuxiliaryStatus> {
|
|||
})
|
||||
}
|
||||
|
||||
fn persona_artifact_ref(source: &str, artifact: &Value) -> Option<PersonaArtifactRef> {
|
||||
let schema_version = artifact.get("schemaVersion")?.as_str()?;
|
||||
let (kind, expected_schema) = match (source, schema_version) {
|
||||
("discord", "epiphany.persona_bubble.v0") => {
|
||||
(PersonaArtifactKind::Bubble, "epiphany.persona_bubble.v0")
|
||||
}
|
||||
("discord", "epiphany.persona_chat.v0") => {
|
||||
(PersonaArtifactKind::DiscordChat, "epiphany.persona_chat.v0")
|
||||
}
|
||||
("reddit", "epiphany.persona_reddit_post.v0") => (
|
||||
PersonaArtifactKind::RedditPost,
|
||||
"epiphany.persona_reddit_post.v0",
|
||||
),
|
||||
("other", "epiphany.persona_other_request.v0") => (
|
||||
PersonaArtifactKind::OtherRequest,
|
||||
"epiphany.persona_other_request.v0",
|
||||
),
|
||||
_ => return None,
|
||||
};
|
||||
let lifecycle = match artifact
|
||||
.get("lifecycle")
|
||||
.or_else(|| artifact.get("status"))?
|
||||
.as_str()?
|
||||
{
|
||||
"projected" => PersonaArtifactLifecycle::Projected,
|
||||
"draft" => PersonaArtifactLifecycle::Draft,
|
||||
"blocked" => PersonaArtifactLifecycle::Blocked,
|
||||
"posted" => PersonaArtifactLifecycle::Posted,
|
||||
"draft-candidate" => PersonaArtifactLifecycle::DraftCandidate,
|
||||
"crossing-requested" => PersonaArtifactLifecycle::CrossingRequested,
|
||||
_ => return None,
|
||||
};
|
||||
let target = match kind {
|
||||
PersonaArtifactKind::Bubble => Some("aquarium".to_string()),
|
||||
PersonaArtifactKind::DiscordChat => None,
|
||||
PersonaArtifactKind::RedditPost => artifact
|
||||
.get("subreddit")
|
||||
.and_then(Value::as_str)
|
||||
.map(str::to_string),
|
||||
PersonaArtifactKind::OtherRequest => artifact
|
||||
.get("targetLocator")
|
||||
.and_then(Value::as_str)
|
||||
.map(str::to_string),
|
||||
};
|
||||
Some(PersonaArtifactRef {
|
||||
kind,
|
||||
schema_version: expected_schema.to_string(),
|
||||
path: artifact.get("path")?.as_str()?.to_string(),
|
||||
lifecycle,
|
||||
modified_at: artifact
|
||||
.get("modifiedAt")
|
||||
.and_then(Value::as_str)
|
||||
.map(str::to_string),
|
||||
target,
|
||||
private_state_exposed: false,
|
||||
})
|
||||
}
|
||||
|
||||
fn bifrost_bridge_readiness(root: &Path) -> Value {
|
||||
let bifrost_root = root
|
||||
.parent()
|
||||
|
|
@ -1086,7 +1245,7 @@ pub fn render_status(status: &Value) -> String {
|
|||
let planning_summary = &planning_response["summary"];
|
||||
let checkpoint = &scene["investigationCheckpoint"];
|
||||
let latest_heartbeat = heartbeat["latestEvent"].clone();
|
||||
let latest_persona = persona["latestArtifacts"]
|
||||
let latest_persona = persona["artifacts"]
|
||||
.as_array()
|
||||
.and_then(|items| items.first())
|
||||
.cloned()
|
||||
|
|
@ -1150,12 +1309,13 @@ pub fn render_status(status: &Value) -> String {
|
|||
String::new(),
|
||||
"Persona".to_string(),
|
||||
format!(
|
||||
"- latest artifact: {}",
|
||||
maybe(&latest_persona["name"], "none")
|
||||
"- latest artifact: {} / {}",
|
||||
maybe(&latest_persona["kind"], "none"),
|
||||
maybe(&latest_persona["lifecycle"], "none")
|
||||
),
|
||||
format!(
|
||||
"- latest content: {}",
|
||||
maybe(&latest_persona["content"], "none")
|
||||
"- artifact path: {}",
|
||||
maybe(&latest_persona["path"], "none")
|
||||
),
|
||||
format!(
|
||||
"- Bifrost bridge: {} ({}/{})",
|
||||
|
|
|
|||
|
|
@ -32,9 +32,8 @@ struct PersonaOtherConfig {
|
|||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||
struct PersonaSpeechAudit {
|
||||
#[serde(rename = "schema_version")]
|
||||
schema_version: String,
|
||||
audit_id: String,
|
||||
created_at: String,
|
||||
|
|
@ -53,6 +52,60 @@ struct PersonaSpeechAudit {
|
|||
audit_path: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
enum PersonaOtherLifecycle {
|
||||
DraftCandidate,
|
||||
Blocked,
|
||||
CrossingRequested,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||
struct BifrostOtherRequestProvenance {
|
||||
bifrost_identity: String,
|
||||
source_kind: String,
|
||||
source_id: String,
|
||||
authority_reference: String,
|
||||
epiphany_run_id: String,
|
||||
epiphany_lane_id: String,
|
||||
epiphany_agent_identity: String,
|
||||
heimdall_capability_ref: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||
struct BifrostOtherRequestReceipt {
|
||||
action: String,
|
||||
ok: bool,
|
||||
surface_name: String,
|
||||
target_locator: String,
|
||||
title: String,
|
||||
content: String,
|
||||
bridge_action_id: String,
|
||||
receipt_url: String,
|
||||
provenance: BifrostOtherRequestProvenance,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||||
struct PersonaOtherRequestArtifact {
|
||||
schema_version: String,
|
||||
lifecycle: PersonaOtherLifecycle,
|
||||
reason: String,
|
||||
created_at: String,
|
||||
surface_name: String,
|
||||
target_locator: String,
|
||||
title: String,
|
||||
persona_name: String,
|
||||
content: String,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
speech_audit: Option<PersonaSpeechAudit>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
bifrost_request_receipt: Option<BifrostOtherRequestReceipt>,
|
||||
private_state_exposed: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct RecentPersonaSpeech {
|
||||
opening_key: String,
|
||||
|
|
@ -168,7 +221,7 @@ fn run_draft(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"draft",
|
||||
PersonaOtherLifecycle::DraftCandidate,
|
||||
"drafted without crossing Bifrost",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -213,7 +266,7 @@ fn run_request(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaOtherLifecycle::Blocked,
|
||||
&format!("speech audit blocked: {}", audit.reasons.join("; ")),
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -233,7 +286,7 @@ fn run_request(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaOtherLifecycle::Blocked,
|
||||
"missing Bifrost bridge CLI for outside-world Persona request",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -253,7 +306,7 @@ fn run_request(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaOtherLifecycle::Blocked,
|
||||
"missing Bifrost identity for outside-world Persona request",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -273,7 +326,7 @@ fn run_request(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaOtherLifecycle::Blocked,
|
||||
"missing Heimdall-backed capability/account reference for outside-world Persona request",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -293,7 +346,7 @@ fn run_request(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaOtherLifecycle::Blocked,
|
||||
&format!(
|
||||
"Heimdall reference must be shaped for {} public Persona crossings: heimdall:{}:*",
|
||||
target.surface_name, target.surface_name
|
||||
|
|
@ -327,7 +380,7 @@ fn run_request(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"requested",
|
||||
PersonaOtherLifecycle::CrossingRequested,
|
||||
"recorded through Bifrost other-request",
|
||||
Some(&audit),
|
||||
Some(&receipt),
|
||||
|
|
@ -356,7 +409,7 @@ fn request_bifrost_other(
|
|||
title: Option<&str>,
|
||||
persona_name: Option<&str>,
|
||||
audit: &PersonaSpeechAudit,
|
||||
) -> Result<Value> {
|
||||
) -> Result<BifrostOtherRequestReceipt> {
|
||||
let title = title
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
|
|
@ -424,7 +477,25 @@ fn request_bifrost_other(
|
|||
));
|
||||
}
|
||||
let stdout = String::from_utf8(output.stdout).context("Bifrost bridge stdout was not UTF-8")?;
|
||||
serde_json::from_str(strip_bom(&stdout)).context("Bifrost bridge stdout was not JSON")
|
||||
let receipt: BifrostOtherRequestReceipt = serde_json::from_str(strip_bom(&stdout))
|
||||
.context("Bifrost bridge stdout was not a typed other-request receipt")?;
|
||||
if !receipt.ok
|
||||
|| receipt.action != "other-request"
|
||||
|| receipt.surface_name != target.surface_name
|
||||
|| receipt.target_locator != target.target_locator
|
||||
|| receipt.provenance.bifrost_identity != bifrost_identity
|
||||
|| receipt.provenance.source_id != audit.audit_id
|
||||
|| receipt.provenance.heimdall_capability_ref != heimdall_capability_ref
|
||||
|| receipt.provenance.epiphany_lane_id != "Persona"
|
||||
|| receipt.provenance.epiphany_agent_identity != "epiphany.Persona"
|
||||
|| receipt.bridge_action_id.trim().is_empty()
|
||||
|| receipt.receipt_url.trim().is_empty()
|
||||
{
|
||||
return Err(anyhow!(
|
||||
"Bifrost other-request receipt did not bind the requested crossing"
|
||||
));
|
||||
}
|
||||
Ok(receipt)
|
||||
}
|
||||
|
||||
fn audit_persona_speech(
|
||||
|
|
@ -655,14 +726,14 @@ console.log(JSON.stringify({
|
|||
Some("Smoke future surface".to_string()),
|
||||
None,
|
||||
)?;
|
||||
seed_posted_artifact(
|
||||
seed_requested_artifact(
|
||||
"Repeated future surface rite",
|
||||
&config,
|
||||
&temp_dir,
|
||||
&cultmesh_store,
|
||||
runtime_id,
|
||||
)?;
|
||||
seed_posted_artifact(
|
||||
seed_requested_artifact(
|
||||
"Repeated future surface rite",
|
||||
&config,
|
||||
&temp_dir,
|
||||
|
|
@ -683,7 +754,46 @@ console.log(JSON.stringify({
|
|||
let latest_cultmesh_audit =
|
||||
load_latest_epiphany_cultmesh_persona_speech_audit(&cultmesh_store, runtime_id)?
|
||||
.context("Persona other smoke expected latest CultMesh audit")?;
|
||||
let draft_artifact = read_artifact(&draft["draftPath"])?;
|
||||
let bridged_artifact = read_artifact(&bridged["artifactPath"])?;
|
||||
let blocked_artifact = read_artifact(&missing_bridge["artifactPath"])?;
|
||||
let base_keys = [
|
||||
"schemaVersion",
|
||||
"lifecycle",
|
||||
"reason",
|
||||
"createdAt",
|
||||
"surfaceName",
|
||||
"targetLocator",
|
||||
"title",
|
||||
"personaName",
|
||||
"content",
|
||||
"speechAudit",
|
||||
"privateStateExposed",
|
||||
];
|
||||
let requested_keys = [
|
||||
"schemaVersion",
|
||||
"lifecycle",
|
||||
"reason",
|
||||
"createdAt",
|
||||
"surfaceName",
|
||||
"targetLocator",
|
||||
"title",
|
||||
"personaName",
|
||||
"content",
|
||||
"speechAudit",
|
||||
"bifrostRequestReceipt",
|
||||
"privateStateExposed",
|
||||
];
|
||||
let ok = draft["ok"] == true
|
||||
&& exact_root_keys(&draft_artifact, &base_keys)
|
||||
&& draft_artifact["lifecycle"] == "draft-candidate"
|
||||
&& exact_root_keys(&blocked_artifact, &base_keys)
|
||||
&& blocked_artifact["lifecycle"] == "blocked"
|
||||
&& exact_root_keys(&bridged_artifact, &requested_keys)
|
||||
&& bridged_artifact["lifecycle"] == "crossing-requested"
|
||||
&& bridged_artifact.get("status").is_none()
|
||||
&& bridged_artifact.get("published").is_none()
|
||||
&& bridged_artifact["bifrostRequestReceipt"]["action"] == "other-request"
|
||||
&& missing_bridge["ok"] == false
|
||||
&& missing_bridge["blocked"] == "missing-bifrost-bridge"
|
||||
&& missing_capability["ok"] == false
|
||||
|
|
@ -718,7 +828,22 @@ console.log(JSON.stringify({
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
fn seed_posted_artifact(
|
||||
fn read_artifact(path: &Value) -> Result<Value> {
|
||||
let path = path
|
||||
.as_str()
|
||||
.context("smoke result omitted artifact path")?;
|
||||
serde_json::from_str(&fs::read_to_string(path)?)
|
||||
.with_context(|| format!("failed to decode smoke artifact {path}"))
|
||||
}
|
||||
|
||||
fn exact_root_keys(value: &Value, expected: &[&str]) -> bool {
|
||||
let Some(object) = value.as_object() else {
|
||||
return false;
|
||||
};
|
||||
object.len() == expected.len() && expected.iter().all(|key| object.contains_key(*key))
|
||||
}
|
||||
|
||||
fn seed_requested_artifact(
|
||||
content: &str,
|
||||
config: &PersonaOtherConfig,
|
||||
artifact_dir: &Path,
|
||||
|
|
@ -740,7 +865,7 @@ fn seed_posted_artifact(
|
|||
config,
|
||||
&target,
|
||||
artifact_dir,
|
||||
"requested",
|
||||
PersonaOtherLifecycle::CrossingRequested,
|
||||
"seed prior future-surface request for speech-audit smoke",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -756,10 +881,10 @@ fn write_request_artifact(
|
|||
config: &PersonaOtherConfig,
|
||||
target: &ResolvedTarget,
|
||||
artifact_dir: &Path,
|
||||
status: &str,
|
||||
lifecycle: PersonaOtherLifecycle,
|
||||
reason: &str,
|
||||
speech_audit: Option<&PersonaSpeechAudit>,
|
||||
bridge_receipt: Option<&Value>,
|
||||
bridge_receipt: Option<&BifrostOtherRequestReceipt>,
|
||||
title: Option<&str>,
|
||||
persona_name: Option<&str>,
|
||||
) -> Result<PathBuf> {
|
||||
|
|
@ -769,21 +894,23 @@ fn write_request_artifact(
|
|||
let persona_name = persona_name
|
||||
.or(config.persona_name.as_deref())
|
||||
.unwrap_or("Epiphany Persona");
|
||||
let payload = serde_json::json!({
|
||||
"schemaVersion": "epiphany.persona_other_request.v0",
|
||||
"status": status,
|
||||
"reason": reason,
|
||||
"createdAt": now_iso(),
|
||||
"surfaceName": target.surface_name,
|
||||
"targetLocator": target.target_locator,
|
||||
"title": title.unwrap_or("Persona outside-world bridge request"),
|
||||
"personaName": persona_name,
|
||||
"content": content,
|
||||
"speechAudit": speech_audit,
|
||||
"bifrostBridgeReceipt": bridge_receipt,
|
||||
"privateStateExposed": false,
|
||||
});
|
||||
write_json(&path, &payload)?;
|
||||
let payload = PersonaOtherRequestArtifact {
|
||||
schema_version: "epiphany.persona_other_request.v0".to_string(),
|
||||
lifecycle,
|
||||
reason: reason.to_string(),
|
||||
created_at: now_iso(),
|
||||
surface_name: target.surface_name.clone(),
|
||||
target_locator: target.target_locator.clone(),
|
||||
title: title
|
||||
.unwrap_or("Persona outside-world bridge request")
|
||||
.to_string(),
|
||||
persona_name: persona_name.to_string(),
|
||||
content: content.to_string(),
|
||||
speech_audit: speech_audit.cloned(),
|
||||
bifrost_request_receipt: bridge_receipt.cloned(),
|
||||
private_state_exposed: false,
|
||||
};
|
||||
write_json(&path, &serde_json::to_value(payload)?)?;
|
||||
Ok(path)
|
||||
}
|
||||
|
||||
|
|
@ -813,7 +940,7 @@ fn latest_persona_artifacts(artifact_dir: &Path, limit: usize) -> Vec<Value> {
|
|||
let payload: Value = serde_json::from_str(&raw).ok()?;
|
||||
Some(serde_json::json!({
|
||||
"path": path,
|
||||
"status": payload.get("status"),
|
||||
"lifecycle": payload.get("lifecycle").or_else(|| payload.get("status")),
|
||||
"surfaceName": payload.get("surfaceName"),
|
||||
"targetLocator": payload.get("targetLocator"),
|
||||
"privateStateExposed": payload.get("privateStateExposed"),
|
||||
|
|
@ -851,7 +978,8 @@ fn recent_persona_speech(artifact_dir: &Path, limit: usize) -> Vec<RecentPersona
|
|||
opening_key: audit["openingKey"].as_str().unwrap_or_default().to_string(),
|
||||
topic_key: audit["topicKey"].as_str().unwrap_or_default().to_string(),
|
||||
target: audit["requestedPublicTarget"].as_str().map(str::to_string),
|
||||
crossing_recorded: payload["status"].as_str() == Some("requested"),
|
||||
crossing_recorded: payload["lifecycle"].as_str() == Some("crossing-requested")
|
||||
|| payload["status"].as_str() == Some("requested"),
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ struct PersonaRedditConfig {
|
|||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct PersonaSpeechAudit {
|
||||
#[serde(rename = "schema_version")]
|
||||
#[serde(alias = "schema_version")]
|
||||
schema_version: String,
|
||||
audit_id: String,
|
||||
created_at: String,
|
||||
|
|
@ -54,6 +54,60 @@ struct PersonaSpeechAudit {
|
|||
audit_path: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
enum PersonaRedditPostStatus {
|
||||
Draft,
|
||||
Blocked,
|
||||
Posted,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct BifrostRedditPublicationProvenance {
|
||||
bifrost_identity: String,
|
||||
source_kind: String,
|
||||
source_id: String,
|
||||
authority_reference: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
epiphany_run_id: Option<String>,
|
||||
epiphany_lane_id: String,
|
||||
epiphany_agent_identity: String,
|
||||
heimdall_capability_ref: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct BifrostRedditPublicationReceipt {
|
||||
action: String,
|
||||
ok: bool,
|
||||
subreddit: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
thing_id: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
url: Option<String>,
|
||||
crossing_receipt_id: String,
|
||||
provenance: BifrostRedditPublicationProvenance,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct PersonaRedditPostArtifact {
|
||||
schema_version: String,
|
||||
created_at: String,
|
||||
status: PersonaRedditPostStatus,
|
||||
reason: String,
|
||||
subreddit: String,
|
||||
persona_name: Option<String>,
|
||||
persona_flair_id: Option<String>,
|
||||
persona_flair_text: Option<String>,
|
||||
title: String,
|
||||
content: String,
|
||||
speech_audit: Option<PersonaSpeechAudit>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
bifrost_bridge_receipt: Option<BifrostRedditPublicationReceipt>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct RecentPersonaSpeech {
|
||||
opening_key: String,
|
||||
|
|
@ -112,8 +166,6 @@ fn main() -> Result<()> {
|
|||
&artifact_dir,
|
||||
&cultmesh_store,
|
||||
&runtime_id,
|
||||
"draft",
|
||||
"drafted without posting",
|
||||
)?
|
||||
}
|
||||
"post" => {
|
||||
|
|
@ -156,8 +208,6 @@ fn run_draft(
|
|||
artifact_dir: &Path,
|
||||
cultmesh_store: &Path,
|
||||
runtime_id: &str,
|
||||
status: &str,
|
||||
reason: &str,
|
||||
) -> Result<Value> {
|
||||
ensure_post(title, content)?;
|
||||
let audit = audit_persona_speech(
|
||||
|
|
@ -174,13 +224,13 @@ fn run_draft(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
status,
|
||||
reason,
|
||||
PersonaRedditPostStatus::Draft,
|
||||
"drafted without posting",
|
||||
Some(&audit),
|
||||
None,
|
||||
)?;
|
||||
Ok(serde_json::json!({
|
||||
"ok": status != "blocked",
|
||||
"ok": true,
|
||||
"posted": false,
|
||||
"draftPath": path,
|
||||
"speechAudit": audit,
|
||||
|
|
@ -216,7 +266,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaRedditPostStatus::Blocked,
|
||||
&format!("speech audit blocked: {}", audit.reasons.join("; ")),
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -235,7 +285,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaRedditPostStatus::Blocked,
|
||||
"missing Bifrost-owned subreddit",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -254,7 +304,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaRedditPostStatus::Blocked,
|
||||
"missing Bifrost bridge CLI path",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -273,7 +323,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaRedditPostStatus::Blocked,
|
||||
"missing Bifrost identity for public Persona crossing",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -292,7 +342,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaRedditPostStatus::Blocked,
|
||||
"missing Heimdall-backed Reddit capability/account reference for public Persona crossing; register the Bifrost identity, link it to Heimdall, and provide a heimdall:reddit:* reference",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -311,7 +361,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"blocked",
|
||||
PersonaRedditPostStatus::Blocked,
|
||||
"Heimdall reference must be shaped for Reddit public Persona crossings: heimdall:reddit:*",
|
||||
Some(&audit),
|
||||
None,
|
||||
|
|
@ -342,7 +392,7 @@ fn run_post(
|
|||
content,
|
||||
config,
|
||||
artifact_dir,
|
||||
"posted",
|
||||
PersonaRedditPostStatus::Posted,
|
||||
"posted through Bifrost reddit-post",
|
||||
Some(&audit),
|
||||
Some(&receipt),
|
||||
|
|
@ -352,8 +402,8 @@ fn run_post(
|
|||
"posted": true,
|
||||
"transport": "bifrost.reddit-post",
|
||||
"subreddit": target_subreddit,
|
||||
"thingId": receipt["thingId"].as_str().or_else(|| receipt["externalReceiptId"].as_str()),
|
||||
"url": receipt["url"].as_str(),
|
||||
"thingId": receipt.thing_id.as_deref(),
|
||||
"url": receipt.url.as_deref(),
|
||||
"bifrostBridgeReceipt": receipt,
|
||||
"draftPath": path,
|
||||
"speechAudit": audit,
|
||||
|
|
@ -372,7 +422,7 @@ fn post_bifrost_reddit_thread(
|
|||
persona_flair_id: Option<&str>,
|
||||
persona_flair_text: Option<&str>,
|
||||
audit: &PersonaSpeechAudit,
|
||||
) -> Result<Value> {
|
||||
) -> Result<BifrostRedditPublicationReceipt> {
|
||||
let persona_name = persona_name
|
||||
.or(config.persona_name.as_deref())
|
||||
.unwrap_or("Epiphany Persona");
|
||||
|
|
@ -453,7 +503,8 @@ fn post_bifrost_reddit_thread(
|
|||
subreddit,
|
||||
audit,
|
||||
)?;
|
||||
Ok(receipt)
|
||||
serde_json::from_value(receipt)
|
||||
.context("Bifrost bridge receipt did not match the typed Reddit publication contract")
|
||||
}
|
||||
|
||||
fn validate_reddit_publication_receipt(
|
||||
|
|
@ -724,8 +775,6 @@ console.log(JSON.stringify({
|
|||
&temp_dir,
|
||||
&cultmesh_store,
|
||||
runtime_id,
|
||||
"draft",
|
||||
"drafted without posting",
|
||||
)?;
|
||||
let missing_bridge = run_post(
|
||||
"Epiphany missing bridge",
|
||||
|
|
@ -802,7 +851,7 @@ console.log(JSON.stringify({
|
|||
"Modeling and Soul keep circling the same public proof seam.",
|
||||
&config,
|
||||
&temp_dir,
|
||||
"posted",
|
||||
PersonaRedditPostStatus::Posted,
|
||||
"seed prior Reddit post for speech-audit smoke",
|
||||
Some(&seed),
|
||||
None,
|
||||
|
|
@ -816,7 +865,7 @@ console.log(JSON.stringify({
|
|||
"Modeling and Soul keep circling the same public proof seam.",
|
||||
&config,
|
||||
&temp_dir,
|
||||
"posted",
|
||||
PersonaRedditPostStatus::Posted,
|
||||
"seed second prior Reddit post for speech-audit smoke",
|
||||
Some(&seed),
|
||||
None,
|
||||
|
|
@ -836,7 +885,22 @@ console.log(JSON.stringify({
|
|||
let latest_cultmesh_audit =
|
||||
load_latest_epiphany_cultmesh_persona_speech_audit(&cultmesh_store, runtime_id)?
|
||||
.context("Persona Reddit smoke expected latest CultMesh audit")?;
|
||||
let draft_artifact: Value = serde_json::from_str(&fs::read_to_string(
|
||||
draft["draftPath"]
|
||||
.as_str()
|
||||
.context("Reddit smoke draft path was missing")?,
|
||||
)?)?;
|
||||
let posted_artifact: Value = serde_json::from_str(&fs::read_to_string(
|
||||
bridged["draftPath"]
|
||||
.as_str()
|
||||
.context("Reddit smoke posted path was missing")?,
|
||||
)?)?;
|
||||
let ok = draft["ok"] == true
|
||||
&& reddit_artifact_has_contract(&draft_artifact, false)
|
||||
&& reddit_artifact_has_contract(&posted_artifact, true)
|
||||
&& posted_artifact["status"] == "posted"
|
||||
&& posted_artifact["bifrostBridgeReceipt"]["crossingReceiptId"]
|
||||
== "crossing_smoke-reddit-post"
|
||||
&& missing_bridge["ok"] == false
|
||||
&& missing_bridge["blocked"] == "missing-bifrost-bridge"
|
||||
&& missing_capability["ok"] == false
|
||||
|
|
@ -868,6 +932,8 @@ console.log(JSON.stringify({
|
|||
"verifiedPostCount": verified_post_count,
|
||||
"repeatedSpeech": repeated,
|
||||
"latestCultMeshSpeechAudit": latest_cultmesh_audit,
|
||||
"draftArtifactContractExact": reddit_artifact_has_contract(&draft_artifact, false),
|
||||
"postedArtifactContractExact": reddit_artifact_has_contract(&posted_artifact, true),
|
||||
});
|
||||
let _ = fs::remove_dir_all(&temp_dir);
|
||||
Ok(result)
|
||||
|
|
@ -878,31 +944,31 @@ fn write_post_artifact(
|
|||
content: &str,
|
||||
config: &PersonaRedditConfig,
|
||||
artifact_dir: &Path,
|
||||
status: &str,
|
||||
status: PersonaRedditPostStatus,
|
||||
reason: &str,
|
||||
speech_audit: Option<&PersonaSpeechAudit>,
|
||||
bridge_receipt: Option<&Value>,
|
||||
bridge_receipt: Option<&BifrostRedditPublicationReceipt>,
|
||||
) -> Result<PathBuf> {
|
||||
let payload = serde_json::json!({
|
||||
"schema_version": POST_SCHEMA_VERSION,
|
||||
"created_at": now_iso(),
|
||||
"status": status,
|
||||
"reason": reason,
|
||||
"subreddit": config.subreddit,
|
||||
"persona_name": config.persona_name,
|
||||
"persona_flair_id": config.persona_flair_id,
|
||||
"persona_flair_text": config.persona_flair_text,
|
||||
"title": title.trim(),
|
||||
"content": content.trim(),
|
||||
"speechAudit": speech_audit,
|
||||
"bifrostBridgeReceipt": bridge_receipt,
|
||||
});
|
||||
let payload = PersonaRedditPostArtifact {
|
||||
schema_version: POST_SCHEMA_VERSION.to_string(),
|
||||
created_at: now_iso(),
|
||||
status,
|
||||
reason: reason.to_string(),
|
||||
subreddit: config.subreddit.clone(),
|
||||
persona_name: config.persona_name.clone(),
|
||||
persona_flair_id: config.persona_flair_id.clone(),
|
||||
persona_flair_text: config.persona_flair_text.clone(),
|
||||
title: title.trim().to_string(),
|
||||
content: content.trim().to_string(),
|
||||
speech_audit: speech_audit.cloned(),
|
||||
bifrost_bridge_receipt: bridge_receipt.cloned(),
|
||||
};
|
||||
let path = artifact_dir.join(format!(
|
||||
"Persona-reddit-{}-{}.json",
|
||||
now_stamp(),
|
||||
short_id()
|
||||
));
|
||||
write_json(&path, &payload)?;
|
||||
write_json(&path, &serde_json::to_value(payload)?)?;
|
||||
Ok(path)
|
||||
}
|
||||
|
||||
|
|
@ -931,7 +997,7 @@ fn latest_persona_artifacts(artifact_dir: &Path, limit: usize) -> Vec<Value> {
|
|||
"path": path,
|
||||
"name": path.file_name().and_then(|name| name.to_str()),
|
||||
"modifiedAt": modified_at.to_rfc3339_opts(SecondsFormat::Secs, true),
|
||||
"schemaVersion": payload.get("schema_version"),
|
||||
"schemaVersion": payload.get("schemaVersion").or_else(|| payload.get("schema_version")),
|
||||
"status": payload.get("status"),
|
||||
"reason": payload.get("reason"),
|
||||
"title": payload.get("title"),
|
||||
|
|
@ -989,6 +1055,31 @@ fn has_bound_reddit_publication(payload: &Value) -> bool {
|
|||
&& receipt["provenance"]["sourceId"].as_str() == Some(audit_id)
|
||||
}
|
||||
|
||||
fn reddit_artifact_has_contract(payload: &Value, expects_receipt: bool) -> bool {
|
||||
const REQUIRED: [&str; 11] = [
|
||||
"content",
|
||||
"createdAt",
|
||||
"personaFlairId",
|
||||
"personaFlairText",
|
||||
"personaName",
|
||||
"reason",
|
||||
"schemaVersion",
|
||||
"speechAudit",
|
||||
"status",
|
||||
"subreddit",
|
||||
"title",
|
||||
];
|
||||
payload.as_object().is_some_and(|object| {
|
||||
object.len() == REQUIRED.len() + usize::from(expects_receipt)
|
||||
&& REQUIRED.iter().all(|key| object.contains_key(*key))
|
||||
&& object.contains_key("bifrostBridgeReceipt") == expects_receipt
|
||||
&& matches!(
|
||||
payload["status"].as_str(),
|
||||
Some("draft" | "blocked" | "posted")
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn ensure_post(title: &str, content: &str) -> Result<()> {
|
||||
if title.trim().is_empty() {
|
||||
return Err(anyhow!("Persona Reddit title is empty"));
|
||||
|
|
|
|||
|
|
@ -3828,9 +3828,12 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
|
|||
"epiphany.persona_bubble.v0",
|
||||
"epiphany.persona_chat.v0",
|
||||
"epiphany.character_turn_packet.v0",
|
||||
"epiphany.persona_reddit_post.v0",
|
||||
"epiphany.persona_other_request.v0",
|
||||
],
|
||||
vec![
|
||||
"Persona bubble, draft, Discord, and Reddit public mouth affordances are projected from typed Persona and character-loop artifacts; public crossings route through Bifrost.",
|
||||
"Persona bubble, Discord chat, Reddit post, and Other crossing-request artifacts are projected as discriminated typed references; public crossings route through Bifrost.",
|
||||
"The Persona surface owns read projection only. It does not own speech eligibility, Mind admission, Bifrost request acceptance, publication, or provider delivery.",
|
||||
"Humans talk to Persona; sealed inner thoughts stay behind the projection boundary.",
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -31,11 +31,19 @@ The next artifact-contract audit then cut `epiphany.persona_chat.v0`: its live
|
|||
writer and catalog had disagreed on field vocabulary, evidence fields, and
|
||||
lifecycle closure. The writer is now typed Rust with closed
|
||||
draft/blocked/posted status, the schema is strict and complete, and legacy
|
||||
snake_case survives only on read. Proprioception identified the next larger
|
||||
frontier: `epiphany.surface.persona.v0` has no real schema-versioned producer and
|
||||
types almost nothing, while Reddit and Other emit real artifacts absent from
|
||||
the catalog. Rebuild that surface around discriminated typed artifact refs or
|
||||
delete the false advertisement.
|
||||
snake_case survives only on read. Proprioception then identified and Hands
|
||||
rebuilt the larger false surface. `epiphany.persona_surface.v0` is now a strict,
|
||||
content-free projection of discriminated artifact and consequence-owner action
|
||||
references. It reports rejected rows and source failures as attention, while
|
||||
owning neither speech eligibility nor Mind/Bifrost/provider consequences.
|
||||
Reddit and Other now have strict typed Rust artifacts and registered schemas;
|
||||
Other ends at a crossing request and can never claim publication. Its surface
|
||||
action remains absent until a typed intent contract actually exists.
|
||||
|
||||
This reinforces the Aetheria lesson: Modeling found the catalog fiction, Hands
|
||||
cut the producer boundaries, and Soul-shaped negative checks caught content
|
||||
leakage and false consequence ownership. Persistent anatomy lets the next Hands
|
||||
pass start at the wound instead of ceremonially rediscovering the body.
|
||||
|
||||
Epiphany is in an authority-provenance purification pass. The live question is not whether a command can produce a plausible document; it is whether the subsystem writing that document owns the fact it asserts.
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.persona_other_request.v0.schema.json",
|
||||
"title": "Epiphany Persona Other-Surface Crossing Request",
|
||||
"description": "A Persona speech candidate or Bifrost crossing request. This document never proves publication.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"schemaVersion": { "const": "epiphany.persona_other_request.v0" },
|
||||
"lifecycle": { "enum": ["draft-candidate", "blocked", "crossing-requested"] },
|
||||
"reason": { "type": "string" },
|
||||
"createdAt": { "type": "string" },
|
||||
"surfaceName": { "type": "string", "minLength": 1 },
|
||||
"targetLocator": { "type": "string", "minLength": 1 },
|
||||
"title": { "type": "string" },
|
||||
"personaName": { "type": "string", "minLength": 1 },
|
||||
"content": { "type": "string" },
|
||||
"speechAudit": { "$ref": "#/definitions/speechAudit" },
|
||||
"bifrostRequestReceipt": { "$ref": "#/definitions/bifrostRequestReceipt" },
|
||||
"privateStateExposed": { "const": false }
|
||||
},
|
||||
"required": [
|
||||
"schemaVersion", "lifecycle", "reason", "createdAt", "surfaceName",
|
||||
"targetLocator", "title", "personaName", "content", "privateStateExposed"
|
||||
],
|
||||
"definitions": {
|
||||
"speechAudit": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"schemaVersion": { "const": "epiphany.persona_speech_audit.v0" },
|
||||
"auditId": { "type": "string" },
|
||||
"createdAt": { "type": "string" },
|
||||
"actionKind": { "enum": ["draft", "post"] },
|
||||
"decision": { "enum": ["eligible", "blocked"] },
|
||||
"reasons": { "type": "array", "items": { "type": "string" } },
|
||||
"contentFingerprint": { "type": "string" },
|
||||
"openingKey": { "type": "string" },
|
||||
"topicKey": { "type": "string" },
|
||||
"requestedPublicTarget": { "type": ["string", "null"] },
|
||||
"recentWindowCount": { "type": "integer", "minimum": 0 },
|
||||
"repeatedOpeningCount": { "type": "integer", "minimum": 0 },
|
||||
"repeatedTopicCount": { "type": "integer", "minimum": 0 },
|
||||
"sameTargetPostCount": { "type": "integer", "minimum": 0 },
|
||||
"auditPath": { "type": "string" }
|
||||
},
|
||||
"required": ["schemaVersion", "auditId", "createdAt", "actionKind", "decision", "reasons", "contentFingerprint", "openingKey", "topicKey", "requestedPublicTarget", "recentWindowCount", "repeatedOpeningCount", "repeatedTopicCount", "sameTargetPostCount", "auditPath"]
|
||||
},
|
||||
"bifrostRequestReceipt": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"action": { "const": "other-request" },
|
||||
"ok": { "const": true },
|
||||
"surfaceName": { "type": "string" },
|
||||
"targetLocator": { "type": "string" },
|
||||
"title": { "type": "string" },
|
||||
"content": { "type": "string" },
|
||||
"bridgeActionId": { "type": "string", "minLength": 1 },
|
||||
"receiptUrl": { "type": "string", "minLength": 1 },
|
||||
"provenance": { "$ref": "#/definitions/provenance" }
|
||||
},
|
||||
"required": ["action", "ok", "surfaceName", "targetLocator", "title", "content", "bridgeActionId", "receiptUrl", "provenance"]
|
||||
},
|
||||
"provenance": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"bifrostIdentity": { "type": "string" },
|
||||
"sourceKind": { "type": "string" },
|
||||
"sourceId": { "type": "string" },
|
||||
"authorityReference": { "type": "string" },
|
||||
"epiphanyRunId": { "type": "string" },
|
||||
"epiphanyLaneId": { "const": "Persona" },
|
||||
"epiphanyAgentIdentity": { "const": "epiphany.Persona" },
|
||||
"heimdallCapabilityRef": { "type": "string" }
|
||||
},
|
||||
"required": ["bifrostIdentity", "sourceKind", "sourceId", "authorityReference", "epiphanyRunId", "epiphanyLaneId", "epiphanyAgentIdentity", "heimdallCapabilityRef"]
|
||||
}
|
||||
}
|
||||
}
|
||||
92
schemas/cultnet/epiphany.persona_reddit_post.v0.schema.json
Normal file
92
schemas/cultnet/epiphany.persona_reddit_post.v0.schema.json
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.persona_reddit_post.v0.schema.json",
|
||||
"title": "Epiphany Persona Reddit Post Artifact",
|
||||
"description": "Typed local Persona Reddit draft, block, or Bifrost-bound publication evidence.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"schemaVersion": { "const": "epiphany.persona_reddit_post.v0" },
|
||||
"createdAt": { "type": "string" },
|
||||
"status": { "type": "string", "enum": ["draft", "blocked", "posted"] },
|
||||
"reason": { "type": "string" },
|
||||
"subreddit": { "type": "string" },
|
||||
"personaName": { "type": ["string", "null"] },
|
||||
"personaFlairId": { "type": ["string", "null"] },
|
||||
"personaFlairText": { "type": ["string", "null"] },
|
||||
"title": { "type": "string" },
|
||||
"content": { "type": "string" },
|
||||
"speechAudit": {
|
||||
"anyOf": [
|
||||
{ "type": "null" },
|
||||
{ "$ref": "#/definitions/speechAudit" }
|
||||
]
|
||||
},
|
||||
"bifrostBridgeReceipt": { "$ref": "#/definitions/bifrostReceipt" }
|
||||
},
|
||||
"required": [
|
||||
"schemaVersion", "createdAt", "status", "reason", "subreddit",
|
||||
"personaName", "personaFlairId", "personaFlairText", "title", "content", "speechAudit"
|
||||
],
|
||||
"definitions": {
|
||||
"speechAudit": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"schemaVersion": { "const": "epiphany.persona_speech_audit.v0" },
|
||||
"auditId": { "type": "string" },
|
||||
"createdAt": { "type": "string" },
|
||||
"actionKind": { "type": "string" },
|
||||
"decision": { "type": "string" },
|
||||
"reasons": { "type": "array", "items": { "type": "string" } },
|
||||
"contentFingerprint": { "type": "string" },
|
||||
"openingKey": { "type": "string" },
|
||||
"topicKey": { "type": "string" },
|
||||
"requestedPublicTarget": { "type": ["string", "null"] },
|
||||
"recentWindowCount": { "type": "integer", "minimum": 0 },
|
||||
"repeatedOpeningCount": { "type": "integer", "minimum": 0 },
|
||||
"repeatedTopicCount": { "type": "integer", "minimum": 0 },
|
||||
"sameTargetPostCount": { "type": "integer", "minimum": 0 },
|
||||
"auditPath": { "type": "string" }
|
||||
},
|
||||
"required": [
|
||||
"schemaVersion", "auditId", "createdAt", "actionKind", "decision", "reasons",
|
||||
"contentFingerprint", "openingKey", "topicKey", "requestedPublicTarget",
|
||||
"recentWindowCount", "repeatedOpeningCount", "repeatedTopicCount",
|
||||
"sameTargetPostCount", "auditPath"
|
||||
]
|
||||
},
|
||||
"bifrostReceipt": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"action": { "const": "reddit-post" },
|
||||
"ok": { "const": true },
|
||||
"subreddit": { "type": "string" },
|
||||
"thingId": { "type": "string" },
|
||||
"url": { "type": "string" },
|
||||
"crossingReceiptId": { "type": "string" },
|
||||
"provenance": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"bifrostIdentity": { "type": "string" },
|
||||
"sourceKind": { "type": "string" },
|
||||
"sourceId": { "type": "string" },
|
||||
"authorityReference": { "type": "string" },
|
||||
"epiphanyRunId": { "type": "string" },
|
||||
"epiphanyLaneId": { "const": "Persona" },
|
||||
"epiphanyAgentIdentity": { "const": "epiphany.Persona" },
|
||||
"heimdallCapabilityRef": { "type": "string" }
|
||||
},
|
||||
"required": [
|
||||
"bifrostIdentity", "sourceKind", "sourceId", "authorityReference",
|
||||
"epiphanyLaneId", "epiphanyAgentIdentity", "heimdallCapabilityRef"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["action", "ok", "subreddit", "crossingReceiptId", "provenance"],
|
||||
"anyOf": [{ "required": ["thingId"] }, { "required": ["url"] }]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +1,109 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.surface.persona.schema.json",
|
||||
"title": "Epiphany Persona",
|
||||
"description": "Operator-safe Persona bubble/draft/post surface over typed Persona and character-loop artifacts.",
|
||||
"title": "Epiphany Persona Surface",
|
||||
"description": "Operator-safe read projection over typed Persona mouth artifacts. It owns no speech eligibility, Mind admission, public crossing, or provider delivery.",
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"ok": {
|
||||
"type": "boolean"
|
||||
"schemaVersion": {
|
||||
"const": "epiphany.persona_surface.v0"
|
||||
},
|
||||
"status": {
|
||||
"enum": ["loaded", "attention"]
|
||||
},
|
||||
"artifactDir": {
|
||||
"type": "string"
|
||||
},
|
||||
"latestArtifacts": {
|
||||
"artifacts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"kind": {
|
||||
"enum": ["bubble", "discord-chat", "reddit-post", "other-request"]
|
||||
},
|
||||
"schemaVersion": {
|
||||
"enum": [
|
||||
"epiphany.persona_bubble.v0",
|
||||
"epiphany.persona_chat.v0",
|
||||
"epiphany.persona_reddit_post.v0",
|
||||
"epiphany.persona_other_request.v0"
|
||||
]
|
||||
},
|
||||
"path": { "type": "string" },
|
||||
"lifecycle": {
|
||||
"enum": [
|
||||
"projected",
|
||||
"draft",
|
||||
"blocked",
|
||||
"posted",
|
||||
"draft-candidate",
|
||||
"crossing-requested"
|
||||
]
|
||||
},
|
||||
"modifiedAt": { "type": ["string", "null"] },
|
||||
"target": { "type": ["string", "null"] },
|
||||
"privateStateExposed": { "const": false }
|
||||
},
|
||||
"required": [
|
||||
"kind",
|
||||
"schemaVersion",
|
||||
"path",
|
||||
"lifecycle",
|
||||
"modifiedAt",
|
||||
"target",
|
||||
"privateStateExposed"
|
||||
]
|
||||
}
|
||||
},
|
||||
"bubbles": {
|
||||
"rejectedArtifactCount": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"sourceErrorCount": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"availableActions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"actionId": {
|
||||
"enum": [
|
||||
"personaBubble",
|
||||
"characterTurn",
|
||||
"discordPersonaPost",
|
||||
"redditPersonaPost"
|
||||
]
|
||||
},
|
||||
"intentSchemaVersion": { "type": "string" },
|
||||
"consequenceOwner": {
|
||||
"enum": ["persona-mouth-projection", "character-loop", "Bifrost"]
|
||||
},
|
||||
"surfaceOwnsConsequence": { "const": false }
|
||||
},
|
||||
"required": [
|
||||
"actionId",
|
||||
"intentSchemaVersion",
|
||||
"consequenceOwner",
|
||||
"surfaceOwnsConsequence"
|
||||
]
|
||||
}
|
||||
},
|
||||
"drafts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"posts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
}
|
||||
"privateStateExposed": { "const": false }
|
||||
},
|
||||
"required": [
|
||||
"ok"
|
||||
"schemaVersion",
|
||||
"status",
|
||||
"artifactDir",
|
||||
"artifacts",
|
||||
"rejectedArtifactCount",
|
||||
"sourceErrorCount",
|
||||
"availableActions",
|
||||
"privateStateExposed"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -859,6 +859,28 @@
|
|||
"title": "Epiphany Character Turn Packet",
|
||||
"path": "epiphany.character-turn-packet.schema.json"
|
||||
},
|
||||
{
|
||||
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.persona_reddit_post.v0.schema.json",
|
||||
"kind": "document_payload",
|
||||
"wireContracts": [
|
||||
"cultnet.schema.v0"
|
||||
],
|
||||
"schemaVersion": "epiphany.persona_reddit_post.v0",
|
||||
"documentType": "epiphany.persona_reddit_post.v0",
|
||||
"title": "Epiphany Persona Reddit Post Artifact",
|
||||
"path": "epiphany.persona_reddit_post.v0.schema.json"
|
||||
},
|
||||
{
|
||||
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.persona_other_request.v0.schema.json",
|
||||
"kind": "document_payload",
|
||||
"wireContracts": [
|
||||
"cultnet.schema.v0"
|
||||
],
|
||||
"schemaVersion": "epiphany.persona_other_request.v0",
|
||||
"documentType": "epiphany.persona_other_request.v0",
|
||||
"title": "Epiphany Persona Other-Surface Crossing Request",
|
||||
"path": "epiphany.persona_other_request.v0.schema.json"
|
||||
},
|
||||
{
|
||||
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.repo-personality-artifacts.schema.json",
|
||||
"kind": "document_payload",
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -661,4 +661,4 @@ current_status:
|
|||
- Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass.
|
||||
- `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure.
|
||||
last_completed_repo_swarm_cut: Huginn live-fire has crossed the first real repo Body from Persona pressure to branch-local Hands commit and Soul/Mind closure, and now has repeatable closure and redacted-public-proof mouths. On `E:\Projects\Huginn` branch `epiphany/huginn/first-awakening`, `tools/epiphany_local_run.ps1 -Mode repo-persona-intake` accepted item `huginn-inspection-readback-livefire`, Weksa/Persona intake remained sealed, and `epiphany-work derive-plan` lowered it to model-authored safe family `repo.status_section` for `README.md` only. `tools/epiphany_local_run.ps1 -Mode repo-swarm-run` advanced four bounded pulses: run-from-plan, adopt-from-plan, execute-from-plan, and close-from-execute. Huginn commit `e9b07c38fceabbdc89ea35c2156326c80c0393a2` updated only `README.md`; closure receipt `.epiphany\work\work-close-huginn-inspection-readback-livefire.json` records status `closed`, Soul verdict `passed`, Mind state commit `repo-work-close-huginn-inspection-readback-livefire-mind-commit`, safe family `repo.status_section`, path scope `README.md`, Bifrost publication gate, and `privateStateExposed=false`. Verification also ran Huginn's TypeScript compiler through concrete Node path: `C:\Program Files\nodejs\node.exe E:\Projects\Huginn\node_modules\typescript\bin\tsc -p tsconfig.json` passed. Native verifier `epiphany-repo-livefire-closure-smoke --workspace E:\Projects\Huginn --item huginn-inspection-readback-livefire --expected-path README.md --expected-family repo.status_section --expected-gate awaiting-publication --expected-blocker bifrost-publication-missing` checks closure receipt, Mind map entry, overview gate/blocker, authority seals, and `git show` changed paths, returning `status=ok`, `soulVerdict=passed`, `publicationGate=Bifrost`, and `privateStateExposed=false`. Wrapper `tools/epiphany_local_run.ps1 -Mode repo-livefire-closure -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exposes the same read-only proof through the local operator mouth; artifact `local-20260621-190156-803-2f85ba15` printed commit, path, gate, blocker, Soul verdict, Mind commit receipt, and `privateStateExposed=False` without push, merge, publication, or target mutation. New wrapper `tools/epiphany_local_run.ps1 -Mode repo-work-public-proof -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exports the redacted proof bundle and repo-local Verse index without publishing; artifact `local-20260621-190645-345-4555b1dc` wrote `.epiphany\public\proof-bundles\repo-work-public-proof-huginn-inspection-readback-livefire.json`, proof id `repo-work-public-proof-huginn-inspection-readback-livefire`, SHA-256 `857545b199f3e37eb06c2e757e5cfc201958e46667bb1f8403fd333a22620f63`, nine artifact rows, zero publication rows, and `privateStateExposed=False`. swarm overview readback `local-20260621-190701-140-b9519ec6` sees the `REPO-WORK-PUBLIC-PROOF` row and action row from Huginn's repo-local Verse with the same SHA-256 while Bifrost publication remains missing. Launcher compact modes are now named compact operator-context modes instead of read-only modes, and `bifrost-public-proof` summaries print item, target public Verse, room, proof SHA-256, review receipts, and credit receipts so publication receipts are auditable without claiming upstream sync.
|
||||
next_action: Continue the observation-to-consequence audit using live organ-shaped prompt probes. Preserve the Aetheria dogfood lesson: Modeling's typed persistent anatomy/freshness/frontier/index knowledgebase is the targeting organ for Hands. Bubble, character, and Persona chat artifacts now match strict registered contracts; chat lifecycle is a closed typed producer decision and legacy snake_case is read-only. Next rebuild or delete the fictional `epiphany.surface.persona.v0` advertisement: it has no schema-versioned producer and untyped artifact arrays, while real Reddit and Other outputs lack registered contracts. The coherent surface should carry discriminated typed artifact references without gaining mouth eligibility, Mind admission, Bifrost publication, or provider-delivery authority. Keep closure's zero-substring invariant.
|
||||
next_action: Continue the observation-to-consequence audit using live organ-shaped prompt probes. Preserve the Aetheria dogfood lesson: Modeling's typed persistent anatomy, freshness, frontier, and semantic-index knowledgebase is the targeting organ for Hands, not a transient prelude. The Persona surface fiction is cut: native status emits strict content-free discriminated artifact references, exposes upstream read failures, and names consequence owners without owning consequences; Reddit and Other artifacts now have strict registered typed producers, and Other can only request a crossing. Model the next live frontier before cutting it. A concrete remaining seam is the intentionally absent Other-world surface action: add it only after a typed intent contract and real command owner exist, never by advertising a wish. Keep closure's zero-substring invariant.
|
||||
|
|
|
|||
Reference in a new issue