Accepting a proposal in Pulse returns ok, but CENSVS refuses the move and the two records stay apart

Abierto
#3,149 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 5 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bun, typescript
Área
api, backend

Línea de trabajo

Start with PULSE/modules/upgrades.ts around line 175 and CENSVS/genera.ts around line 258, then inspect TOOLS/Upgrades.ts and the upgrade transition tests. Reproduce the supplied Bun command from LifeOS/install/LIFEOS to see where the refusal is lost. Done when a refused accept leaves both records unchanged and the refusal is returned to the caller, including when initiated from the principal's terminal.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What happens: PULSE/modules/upgrades.ts:175 accepts a proposal through setStatus. The store file becomes accepted and the route returns 200 {"ok":true}. The CENSVS move is refused, because CENSVS/genera.ts:258 allows proposed>accepted only from the principal's interactive session. The later move to applied is refused too, since CENSVS still reads proposed.

Run in LifeOS/install/LIFEOS:

T=$(mktemp -d); env -i PATH="$PATH" HOME="$T" STATVS_DIR="$T/statvs" LIFEOS_UPGRADES_DIR="$T/upgrades" bun -e '
const U = await import("./TOOLS/Upgrades.ts"), P = await import("./PULSE/modules/upgrades.ts");
const { id } = U.addUpgrade({ source: "manual", claim: "Example claim", recommendation: "x", current_state: "y", confidence: 0.5, target_surface: "skill" });
const path = `/api/upgrades/${id}/accept`;
const res = await P.handleRequest(new Request("http://localhost" + path, { method: "POST" }), path);
console.log(res.status, await res.text(), U.getUpgrade(id).status, U.resDualWrite.last);
console.log(U.setStatus(id, "applied", { ledger_id: "L-1" }), U.getUpgrade(id).status, U.resDualWrite.last);
'
Fix

Four architecture faults combine here: the move rule has no single source of truth (CENSVS/genera.ts says it mirrors TRANSITIONS in TOOLS/Upgrades.ts, but only genera.ts requires the principal), setStatus bypasses that invariant by writing the store first, the refusal is lost at the seam between the store and CENSVS, and the interface of setStatus returns ok and documents a by argument that does not exist. Have setStatus ask the CENSVS rule before it writes, return the refusal, and drop both TRANSITIONS and the by comment, so the rule lives only in genera.ts and a refused accept leaves both records unchanged and can still be made from the principal's terminal.

Lenguaje dominante
TypeScript
Estrellas
20.7k
Forks
2.6k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de danielmiessler/LifeOS

Todos los issues de danielmiessler/LifeOS

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.