Tighten role result typed boundary
This commit is contained in:
parent
4d14ff0721
commit
5acf9de263
6 changed files with 18 additions and 17 deletions
|
|
@ -273,7 +273,6 @@ pub use surfaces::recommend_crrc_action;
|
|||
pub use surfaces::recommend_reorientation;
|
||||
pub use surfaces::render_role_board_note;
|
||||
pub use surfaces::reorientation_role_status;
|
||||
pub use surfaces::review_role_self_patch;
|
||||
pub use surfaces::review_role_self_patch_document;
|
||||
pub use surfaces::role_board_job_status_to_role_status;
|
||||
pub use surfaces::role_self_memory_target;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ pub use role_result::imagination_role_state_patch_policy_errors;
|
|||
pub use role_result::interpret_runtime_reorient_worker_result;
|
||||
pub use role_result::interpret_runtime_role_worker_result;
|
||||
pub use role_result::modeling_role_state_patch_policy_errors;
|
||||
pub use role_result::review_role_self_patch;
|
||||
pub use role_result::review_role_self_patch_document;
|
||||
pub use role_result::role_self_memory_target;
|
||||
pub use scene::EpiphanyScene;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ fn interpret_role_finding(
|
|||
EpiphanyRoleResultRoleId::Imagination => merge_item_error(
|
||||
item_error,
|
||||
imagination_role_state_patch_error(
|
||||
raw_result,
|
||||
raw_result.get("statePatch").is_some(),
|
||||
state_patch.as_ref(),
|
||||
state_patch_parse_error,
|
||||
),
|
||||
|
|
@ -140,7 +140,7 @@ fn interpret_role_finding(
|
|||
EpiphanyRoleResultRoleId::Modeling => merge_item_error(
|
||||
item_error,
|
||||
modeling_role_state_patch_error(
|
||||
raw_result,
|
||||
raw_result.get("statePatch").is_some(),
|
||||
state_patch.as_ref(),
|
||||
state_patch_parse_error,
|
||||
),
|
||||
|
|
@ -242,7 +242,7 @@ pub fn interpret_runtime_role_worker_result(
|
|||
EpiphanyRoleResultRoleId::Modeling => merge_item_error(
|
||||
item_error,
|
||||
modeling_role_state_patch_error(
|
||||
&serde_json::Value::Null,
|
||||
result.state_patch_msgpack.is_some(),
|
||||
state_patch.as_ref(),
|
||||
None,
|
||||
),
|
||||
|
|
@ -250,7 +250,7 @@ pub fn interpret_runtime_role_worker_result(
|
|||
EpiphanyRoleResultRoleId::Imagination => merge_item_error(
|
||||
item_error,
|
||||
imagination_role_state_patch_error(
|
||||
&serde_json::Value::Null,
|
||||
result.state_patch_msgpack.is_some(),
|
||||
state_patch.as_ref(),
|
||||
None,
|
||||
),
|
||||
|
|
@ -448,7 +448,8 @@ pub fn role_label(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, Str
|
|||
}
|
||||
}
|
||||
|
||||
pub fn review_role_self_patch(
|
||||
#[cfg(test)]
|
||||
fn review_role_self_patch(
|
||||
role_id: EpiphanyRoleResultRoleId,
|
||||
patch: &serde_json::Value,
|
||||
) -> EpiphanyRoleSelfPersistenceReview {
|
||||
|
|
@ -646,11 +647,11 @@ pub fn imagination_role_state_patch_policy_errors(
|
|||
}
|
||||
|
||||
fn modeling_role_state_patch_error(
|
||||
raw_result: &serde_json::Value,
|
||||
state_patch_present: bool,
|
||||
state_patch: Option<&EpiphanyRoleStatePatchDocument>,
|
||||
parse_error: Option<String>,
|
||||
) -> Option<String> {
|
||||
if raw_result.get("statePatch").is_none() {
|
||||
if !state_patch_present {
|
||||
return Some("modeling result is not reviewable: missing required statePatch".to_string());
|
||||
};
|
||||
if let Some(error) = parse_error {
|
||||
|
|
@ -673,11 +674,11 @@ fn modeling_role_state_patch_error(
|
|||
}
|
||||
|
||||
fn imagination_role_state_patch_error(
|
||||
raw_result: &serde_json::Value,
|
||||
state_patch_present: bool,
|
||||
state_patch: Option<&EpiphanyRoleStatePatchDocument>,
|
||||
parse_error: Option<String>,
|
||||
) -> Option<String> {
|
||||
if raw_result.get("statePatch").is_none() {
|
||||
if !state_patch_present {
|
||||
return Some(
|
||||
"imagination result is not reviewable: missing required statePatch".to_string(),
|
||||
);
|
||||
|
|
@ -1199,6 +1200,7 @@ mod tests {
|
|||
}
|
||||
use super::state_patch::EpiphanyRoleStatePatchDocument;
|
||||
use crate::agent_memory::AgentSelfPatch;
|
||||
#[cfg(test)]
|
||||
use crate::agent_memory::decode_agent_self_patch;
|
||||
use crate::agent_memory::review_agent_self_patch_contract;
|
||||
use epiphany_state_model::EpiphanyAcceptanceReceipt;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ remembers doctrine; the branch remembers the blade.
|
|||
- `notes/codex-auth-spine-inventory.md` is the source-grounded keeper list for that reliquary. Corrected compliance invariant: Codex-compatible auth identity stays anchored in vendored Codex-derived auth machinery. `epiphany-openai-auth-spine` is now a thin Epiphany-named boundary over `codex-login`, not a clean-room clone of credential storage or token refresh. Codex apps, skills, marketplace, plugin UX, broad app-server workflow, and JSON-RPC sprawl remain cuttable because they are not subscription-auth legitimacy.
|
||||
- Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced.
|
||||
- `epiphany-openai-runtime` worker result ingress now parses assistant output directly into typed role/reorient ingress structs selected from the durable launch document, stores nested `statePatch` and `selfPatch` as typed MessagePack in `EpiphanyRuntimeRoleWorkerResult`, and no longer passes worker result data through generic `serde_json::Value`. JSON survives there only as the OpenAI text-output edge before typed deserialization.
|
||||
- Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. JSON-value selfPatch functions are compatibility wrappers for CLI/artifact ingress; native callers should parse once at the edge and then call `review_agent_self_patch_document` / `apply_agent_self_patch_document`.
|
||||
- Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. JSON-value selfPatch functions are compatibility wrappers for CLI/artifact ingress; native callers should parse once at the edge and then call `review_agent_self_patch_document` / `apply_agent_self_patch_document`. Role-result self-persistence no longer exports a JSON-value reviewer; the live API is `review_role_self_patch_document`.
|
||||
- `epiphany-openai-codex-spine` no longer uses Codex's Responses client, model-provider layer, `codex-api`, `codex-model-provider`, `codex-model-provider-info`, or `codex-protocol` for outbound model requests. It reaches `codex-login` only through `epiphany-openai-auth-spine` so credential loading/refresh stays Codex-compatible while request/status/event/runtime surfaces stay typed Epiphany documents.
|
||||
- Durable Epiphany state types now live in root crate `epiphany-state-model`. `codex-protocol` re-exports them only so old rollout/API callers keep compiling; do not add new durable `Epiphany*` state structs under `vendor/codex`. `epiphany-core` imports the native model directly and no longer depends on `codex-protocol`. Pressure derives from native `EpiphanyTokenUsageSnapshot`; Codex token telemetry is mapped at the bridge. Codex rollout/event reconstruction now lives in `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types belong. Exact retrieval path matching is native to `epiphany-core`, so `epiphany-core` has no direct vendored Codex crate dependency.
|
||||
- State-update contract proof and job launch/interrupt DTO ownership now live in native `epiphany-core`. The old giant `codex_thread.rs` Epiphany state-update test fixture was cut, and `epiphany-codex-bridge` no longer imports Epiphany job launch request types from `codex_core`; vendored `CodexThread` may call the native mutation/launch law for compatibility, but it must not regain ownership of state-update semantics, heartbeat launch-plan policy, or Epiphany DTOs.
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in a new issue