refactor(naming): A1 — ente→arje, vista→revista, pluma→fana
Rename batch de la Fase A del PLAN_MACRO: - 25 crates ente-* → arje-* (protocol/init/runtime/compat). El linaje arje (init Linux) queda con prefijo coherente. - vista → revista (revista-core + revista-web). - pluma → fana (fana-md + fana-md-reader-web). fana absorbe el linaje markdown de pluma; será el writer DAG editor (prioridad alta). Cambios: - git mv de 29 crate dirs + 2 SDDs - package/lib/bin names + path refs + imports .rs reescritos - workspace Cargo.toml + comentarios de sección - SDDs de init/runtime/compat/protocol actualizados a arje- - SDD de revista + SDD de fana (reescrito: writer DAG editor) - docs/STATUS.md, ROADMAP.md, PLAN_MACRO.md, arje-boot.md, arje-replace-systemd.md actualizados - docs/changelog/akasha.md → chasqui.md scripts/rename-fase-a.py idempotente (--dry-run soportado). cargo check --workspace verde. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//! Constantes públicas del Ente echo. Lib aparte del bin para que `busctl`
|
||||
//! y otros consumidores puedan importar el InterfaceId sin enlazar el binario.
|
||||
|
||||
use arje_card::{Capability, InterfaceId};
|
||||
|
||||
/// UUID estable del interface "echo". Genera nuevo por sed si forkeas.
|
||||
pub const ECHO_IFACE: InterfaceId = InterfaceId([
|
||||
0xec, 0x40, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x80, 0x00, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe,
|
||||
]);
|
||||
pub const ECHO_VERSION: u16 = 1;
|
||||
|
||||
pub fn echo_capability() -> Capability {
|
||||
Capability::Endpoint {
|
||||
interface: ECHO_IFACE,
|
||||
version: ECHO_VERSION,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
//! ente-echo: Ente proveedor mínimo. Anuncia Capability::Endpoint(ECHO) y
|
||||
//! responde a invokes echando el blob recibido. Vehículo para validar el
|
||||
//! forwarding bus → proveedor → bus → originator.
|
||||
|
||||
use arje_bus::{BusResponse, BusServer, InvokeHandler};
|
||||
use arje_card::Capability;
|
||||
use arje_echo::{echo_capability, ECHO_IFACE, ECHO_VERSION};
|
||||
use tracing::{info, warn};
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
struct EchoHandler;
|
||||
|
||||
impl InvokeHandler for EchoHandler {
|
||||
fn handle(&mut self, cap: Capability, blob: Vec<u8>) -> BusResponse {
|
||||
match cap {
|
||||
Capability::Endpoint { interface, version }
|
||||
if interface == ECHO_IFACE && version == ECHO_VERSION =>
|
||||
{
|
||||
let preview = String::from_utf8_lossy(&blob).into_owned();
|
||||
info!(text = %preview, len = blob.len(), "echo invoke");
|
||||
BusResponse::Invoked { result: blob }
|
||||
}
|
||||
other => {
|
||||
warn!(?other, "ente-echo: capacidad no soportada");
|
||||
BusResponse::Error("ente-echo solo maneja ECHO_IFACE".into())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let filter = EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| EnvFilter::new("arje_echo=info"));
|
||||
tracing_subscriber::fmt().with_env_filter(filter).with_target(true).init();
|
||||
|
||||
info!("ente-echo arrancando");
|
||||
let mut server = BusServer::from_env().await?;
|
||||
server.announce(vec![echo_capability()]).await?;
|
||||
info!("Announce OK, sirviendo invokes");
|
||||
|
||||
if let Err(e) = server.serve(EchoHandler).await {
|
||||
warn!(?e, "serve terminó");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user