@takagaki/cortex-decisions-viewer 0.12.94 → 0.12.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,7 +50,7 @@ exports.ENGAGEMENT_LEDGER_VERSION = 1;
50
50
  /** 半減期(日)。engine `weights.mjs` の `HALF_LIFE_DAYS`(正本 6-B「半減期 90 日固定」) */
51
51
  exports.HALF_LIFE_DAYS = 90;
52
52
  /**
53
- * 行為 1 件の重み。engine `weights.mjs` の `WEIGHTS` の写し(24 値・**表に無い `kind` は 0**)。
53
+ * 行為 1 件の重み。engine `weights.mjs` の `WEIGHTS` の写し(25 値・**表に無い `kind` は 0**)。
54
54
  *
55
55
  * 🔴 契約の表(fixture)は `message.posted` しか使っていないので、**ここの写し間違いは表では
56
56
  * 捕まらない**。重みの番人は `test/member-engagement-parity.test.mjs` の `[重み]` が持つ。
@@ -66,6 +66,8 @@ exports.WEIGHTS = Object.freeze({
66
66
  "issue.created": 1.5,
67
67
  "issue.updated": 0.3,
68
68
  "issue.closed": 1.0,
69
+ // 課題の削除(engine #889・#699 F9g PR2-4a)。削除は数えないので 0
70
+ "issue.deleted": 0,
69
71
  "page.revised": 1.5,
70
72
  "page.deleted": 0,
71
73
  "commit.pushed": 1.0,
package/dist/render.js CHANGED
@@ -3380,7 +3380,7 @@ function ingestFailureText(f) {
3380
3380
  * @param registered `LIVE_REGISTERED[regKey]`(配列でなければ「読めていない」)
3381
3381
  * @param rows 接続状態ストアの行(`LIVE_STATE`)
3382
3382
  * @returns `null`(従来どおり「登録状況を確認中です」)/`{ kind: "ok", at }`/
3383
- * `{ kind: "bad", rows: [{ status, ref, workspace, type, at }] }`(登録順)
3383
+ * `{ kind: "bad", rows: [{ status, ref, workspace, type, at, detail }] }`(登録順)
3384
3384
  *
3385
3385
  * **クロージャを持たない純関数に保つこと**(`.toString()` でクライアントへ渡す。
3386
3386
  * `registeredRefKeys` / `stateRefKey` / `BAD_STATE_STATUSES` はこれより前に流し込んである)。
@@ -3425,6 +3425,8 @@ function derivePendingTile(regKey, registered, rows) {
3425
3425
  workspace: String(hit.workspace == null ? (reg.workspace == null ? "" : reg.workspace) : hit.workspace),
3426
3426
  type: String(reg.type || ""),
3427
3427
  at: String(hit.at || ""),
3428
+ // 語の言い換えに要る(GitHub のテナント外の断り・#841。行と同じ dsGateOf に渡す)
3429
+ detail: String(hit.detail || ""),
3428
3430
  });
3429
3431
  }
3430
3432
  // **優先順: 失敗 > 未測定 > OK。** 失敗は測った事実なので、未測定の行が混ざっていても
@@ -9491,7 +9493,21 @@ ${calendarAddUrl.toString()}
9491
9493
  text: "App が未インストール",
9492
9494
  cls: "ds-gate-muted",
9493
9495
  },
9496
+ /* GitHub で、案件のテナントに無い組織を窓口が断った回(#841)。gate は同じ no_token でも
9497
+ * 「App が未インストール」と言うと、利用者が導入を探しに行く(窓口は導入・リポの有無を
9498
+ * 明かさないので、入っているかどうかは誰にも分からない)。見分けは githubOrgRefused。
9499
+ * **help は付けない。** 次の一手(担当者へ)はサーバの needed の 1 文が持つ */
9500
+ githubRefused: {
9501
+ text: "確かめられません",
9502
+ cls: "ds-gate-muted",
9503
+ },
9494
9504
  };
9505
+ /** 窓口がテナント外の組織として断った印(Intake の応答の reason・ストアの行の detail。#841) */
9506
+ var GITHUB_ORG_NOT_IN_TENANT = "org_not_in_tenant";
9507
+ /** GitHub の no_token が「テナント外の断り」か。押した直後は reason、読み直した後は detail が持つ */
9508
+ function githubOrgRefused(s) {
9509
+ return !!s && (s.reason === GITHUB_ORG_NOT_IN_TENANT || s.detail === GITHUB_ORG_NOT_IN_TENANT);
9510
+ }
9495
9511
  /**
9496
9512
  * 休止状態の行に、状態の語に添えて**押す前から**出す定型の補足(#346)と、
9497
9513
  * 「接続を確認」を押した結果に添える定型の1文(#356)。
@@ -9632,13 +9648,16 @@ ${calendarAddUrl.toString()}
9632
9648
  * - 状態がある(未測定の行には出すものが無い)
9633
9649
  * - ok でない
9634
9650
  * - missing_scope でない(スコープ名の札 .ds-probe-scope が既に持つ)
9635
- * - no_token でない(GitHub は組織の帯が導線を1つだけ持つ設計・Slack は DS_GATE_NO_TOKEN の help)
9651
+ * - no_token でない(GitHub は組織の帯が導線を1つだけ持つ設計・Slack は DS_GATE_NO_TOKEN の help)。
9652
+ * **ただし GitHub のテナント外の断り(#841)は出す**——帯は出ない(導入状態が分からない)ので、
9653
+ * 「担当者へ」の 1 文(needed)を持つのはこの行だけ
9636
9654
  * - not_in_channel でない(help は無いが、**状態の語そのものが操作の指示**
9637
9655
  * 「Slackで招待してください」。その下に夜間の「読めませんでした: not_in_channel」を
9638
9656
  * 並べても情報が増えず、招待という具体的な指示を薄める。help の有無とは別の軸)
9639
9657
  * - dsGateOf(s).help が無い(あれば DS_GATE の固定文が次の一手を持っている)
9640
9658
  */
9641
9659
  function showsRestingReason(s) {
9660
+ if (s.gate === "no_token" && String(s.type || "").indexOf("github") === 0 && githubOrgRefused(s)) return true;
9642
9661
  if (!s.gate || s.gate === "ok" || s.gate === "missing_scope" || s.gate === "no_token" || s.gate === "not_in_channel") return false;
9643
9662
  return !dsGateOf(s).help;
9644
9663
  }
@@ -9676,6 +9695,7 @@ ${calendarAddUrl.toString()}
9676
9695
  * | slack(社内) | 中央 Bot の鍵が無い。**画面から設定できない** | 管理者の設定が必要です |
9677
9696
  * | slack(顧客) | お客様のワークスペースが未接続。接続で直せる | トークン未設定 |
9678
9697
  * | github | 読む鍵が1本も無かった=**この組織に App が入っていない** | App が未インストール |
9698
+ * | github(テナント外の断り・#841) | 案件のテナントに無い組織。有無は明かされない | 確かめられません |
9679
9699
  *
9680
9700
  * **ここを通さずに語を書き写さないこと。** 行バッジ・能力タイルの要約・
9681
9701
  * 「接続を確認」の結果が同じ関数を通るので、片方だけ古くなることが構造的に起きない
@@ -9687,7 +9707,9 @@ ${calendarAddUrl.toString()}
9687
9707
  return isInternalSlack(s) ? DS_GATE_NO_TOKEN.internal : DS_GATE_NO_TOKEN.customer;
9688
9708
  }
9689
9709
  // github-issues / github-discussions のどちらも同じ原因(組織単位の App)
9690
- if (String(s.type || "").indexOf("github") === 0) return DS_GATE_NO_TOKEN.github;
9710
+ if (String(s.type || "").indexOf("github") === 0) {
9711
+ return githubOrgRefused(s) ? DS_GATE_NO_TOKEN.githubRefused : DS_GATE_NO_TOKEN.github;
9712
+ }
9691
9713
  }
9692
9714
  // 🔴 **状態が無い行を「不明」に落とさない(段階1)。** 「不明」は実測して分からなかった
9693
9715
  // という意味で、まだ測っていない行に出すと嘘になる。**知らない値は従来どおり「不明」**
@@ -10855,8 +10877,12 @@ ${calendarAddUrl.toString()}
10855
10877
  * **文書化されている形だけを使う。** target_id に組織のログイン名を渡す形は GitHub の
10856
10878
  * 文書に無く、未ログインだとログイン画面へ転送されて 200 が返るので、効いているかを
10857
10879
  * 外から確かめられない。**確かめられないものを顧客に押させない。**
10880
+ *
10881
+ * **窓口の読む App(R)と同じ App を指す**(cortex-engine #769)。正本は infra の
10882
+ * githubBrokerSettings.apps.R.slug。R を切り替える・戻す便でここも一緒に直す
10883
+ * (食い違いは infra/test/github-broker-stack.test.ts の二重持ちの番人が落とす)。
10858
10884
  */
10859
- var GITHUB_APP_INSTALL_URL = "https://github.com/apps/classmethod-cortex-app/installations/new";
10885
+ var GITHUB_APP_INSTALL_URL = "https://github.com/apps/classmethod-cortex-reader/installations/new";
10860
10886
 
10861
10887
  /**
10862
10888
  * GitHub App のインストールへ行くリンク(2026-08-20 に部品化)。
@@ -11304,8 +11330,8 @@ ${calendarAddUrl.toString()}
11304
11330
  * (「pendingCountDelta」 / 「refKeysOf」 と同じ材料。一覧と同じものを見る)。update
11305
11331
  * (通知先トグル等)は判定を止めない
11306
11332
  * - 語は**行と同じ関数**から引く(写経しない): チャット・開発は 「dsGateOf」(社内の
11307
- * no_token →「管理者の設定が必要です」・GitHub の no_token →「App が未インストール」の
11308
- * 言い換え込み)、取り込む能力は 「dsGateForCap」(Drive の unreachable →「フォルダを
11333
+ * no_token →「管理者の設定が必要です」・GitHub の no_token →「App が未インストール」、
11334
+ * テナント外の断り(#841)→「確かめられません」の言い換え込み。だから dev には detail も渡す)、取り込む能力は 「dsGateForCap」(Drive の unreachable →「フォルダを
11309
11335
  * 開けません」等)。OK は「● 接続OK ◯分前に確認」(行の 「rtAgo」 と同じ語・時刻は
11310
11336
  * ストアの最新)。失敗が複数で語が違っても**登録順で最初の 1 語**(タイルは 1 行。
11311
11337
  * 内訳はモーダルの行が持つ)
@@ -11351,7 +11377,7 @@ ${calendarAddUrl.toString()}
11351
11377
  var gate;
11352
11378
  if (regKey === "chat") gate = dsGateOf({ type: "slack", workspace: first.workspace, gate: first.status });
11353
11379
  else if (regKey === "google-chat") gate = dsGateOf({ type: "google-chat", gate: first.status });
11354
- else if (regKey === "dev") gate = dsGateOf({ type: first.type || "github-issues", gate: first.status });
11380
+ else if (regKey === "dev") gate = dsGateOf({ type: first.type || "github-issues", gate: first.status, detail: first.detail });
11355
11381
  else gate = dsGateForCap(regKey, first.status);
11356
11382
  // 行と同じ見た目: warn の語にだけ ⚠️ を前置(muted の語=「管理者の設定が必要です」等には付けない)
11357
11383
  return { text: (gate.cls === "ds-gate-warn" ? CAP_STATE_MARK.warn : "") + gate.text, cls: gate.cls };
@@ -13327,7 +13353,8 @@ ${calendarAddUrl.toString()}
13327
13353
  * 接続へ吸い込まれる(2026-08-18 の不具合そのもの)。
13328
13354
  */
13329
13355
  function probeVerdict(s, r) {
13330
- return dsGateOf({ type: s.type, workspace: s.workspace, gate: r.gate });
13356
+ // reason は GitHub のテナント外の断り(#841)。無ければ従来どおり
13357
+ return dsGateOf({ type: s.type, workspace: s.workspace, gate: r.gate, reason: r.reason });
13331
13358
  }
13332
13359
 
13333
13360
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takagaki/cortex-decisions-viewer",
3
- "version": "0.12.94",
3
+ "version": "0.12.96",
4
4
  "description": "Cortexの意思決定記録(Decisions/*.md)を静的サイトにビルドして閲覧する。各レコードに「Edit on GitHub」リンクを付与する。",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,