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

オープン
#3,149 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, typescript
領域
api, backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
20.7k
フォーク
2.6k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

danielmiessler/LifeOS のほかの issue

danielmiessler/LifeOS の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。