dsh-perm-gate 5.3.3 → 5.4.0
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.
- package/CHANGELOG.ja.md +6 -0
- package/CHANGELOG.ko.md +6 -0
- package/CHANGELOG.md +8 -0
- package/README.ja.md +25 -1
- package/README.ko.md +25 -1
- package/README.md +43 -1
- package/README.zh.md +31 -1
- package/dsh.plugin.json +4 -4
- package/lib/client.js +319 -0
- package/lib/client.js.map +1 -1
- package/lib/config.d.ts +40 -1
- package/lib/config.js +7 -1
- package/lib/cred-families.d.ts +22 -0
- package/lib/cred-families.js +63 -0
- package/lib/engine.js +36 -3
- package/lib/evaluate.d.ts +8 -0
- package/lib/events.d.ts +19 -0
- package/lib/events.js +99 -4
- package/lib/index.js +39 -4
- package/lib/preset-rules.d.ts +33 -1
- package/lib/preset-rules.js +137 -0
- package/lib/runtime.d.ts +22 -0
- package/lib/runtime.js +23 -1
- package/package.json +11 -11
package/lib/client.js
CHANGED
|
@@ -40,6 +40,19 @@ window.__ModuleLoader__.load({
|
|
|
40
40
|
"card.yoloHint": "命中不可逆 / 不可沉淀 / 读不懂的载荷,或模型报硬风险时拦截,并把理由以「工具审核意见」回喂主模型;其余照常执行。没有可用模型时只靠确定性规则网拦截。",
|
|
41
41
|
"card.rulesFallback": "无模型时降级成规则闸门(cc-safety-net 级)",
|
|
42
42
|
"card.rulesFallbackHint": "只在审查模型未配置、或模型未能给出裁决时生效:按确定性规则拦危险、放行其余,不再把调用挂在没人应答的确认框上。模型正常回答时行为与之前完全一致。",
|
|
43
|
+
"card.allowProtectedBranchPush": "允许强推保护分支(默认关=保留地板)",
|
|
44
|
+
"card.allowProtectedBranchPushHint": "默认用 P0 地板拦下针对 main/master/production/release/stable 的 git push --force/--force-with-lease/--delete(模型不可降级)。开启后地板让位,并豁免黑名单里三条扁平 push 词;调用落到预设的 git.push-force 规则——它仍会问人,除非你撤销该条或加白名单。不放宽任何其他面:删除、重定向、凭据地板照常。",
|
|
45
|
+
"card.credFamily": "凭据类型阶梯",
|
|
46
|
+
"card.credFamilyHint": "每类凭据一个档位:deny=读写全拦;ask=读需人工确认(默认);readonly=读放行、写删仍被 P0 硬拦;readwrite=本族内置路径的凭据 store 写判据退让(npm login 类工作流),其余地板(根盘、受保护路径、.dsh、外发)任何档位都不让。档位状态存在规则文档条目与写豁免清单两处,由本卡成对写回。",
|
|
47
|
+
"card.credFamilyLoading": "正在读取凭据档位…",
|
|
48
|
+
"card.credFamilyFootnote": "无人值守档(机械直通/YOLO)会把 ask 残局放行;需要硬挡请选 deny。自定义 credentialPaths 不参与写豁免;readwrite 不影响任何非凭据判据。",
|
|
49
|
+
"card.credReadwriteConfirm": "readwrite 将放行对该类凭据文件的写入/修改(如重写 ~/.npmrc);这是唯一会退让部分 P0 的档位。确认?",
|
|
50
|
+
"card.credConfirmYes": "确认",
|
|
51
|
+
"card.credConfirmNo": "取消",
|
|
52
|
+
"card.credRung.deny": "拦截",
|
|
53
|
+
"card.credRung.ask": "确认",
|
|
54
|
+
"card.credRung.readonly": "只读",
|
|
55
|
+
"card.credRung.readwrite": "读写",
|
|
43
56
|
"card.scriptReview": "脚本正文随审查一并送审(默认开)",
|
|
44
57
|
"card.scriptReviewHint": "调用运行脚本文件时读取它的正文:审查模型与人看的是同一份代码,规则层也按正文判定不可逆(文件名看不出危险的删除正是这么漏掉的)。正文出境前脱敏并截断;关掉它就不会让文件内容离开本机,代价是工作区外的脚本回到「看不清」档位。",
|
|
45
58
|
"card.credentialPaths": "自定义凭据路径(长尾)",
|
|
@@ -226,6 +239,19 @@ window.__ModuleLoader__.load({
|
|
|
226
239
|
"card.yoloHint": "Blocks an irreversible / unlearnable / unreadable payload, or a hard-risk verdict from the model, and feeds the reason back to the main LLM as a 工具审核意见 message; everything else executes. With no reviewer available only the deterministic nets catch anything.",
|
|
227
240
|
"card.rulesFallback": "Degrade to a rule-only gate when there is no model (cc-safety-net class)",
|
|
228
241
|
"card.rulesFallbackHint": "Takes effect only when the risk reviewer is not configured or gave no verdict: the deterministic nets block what they can name and let the rest through, instead of parking the call on a popup nobody will answer. While a reviewer answers, behaviour is unchanged.",
|
|
242
|
+
"card.allowProtectedBranchPush": "Allow force-pushing protected branches (default off = floor stands)",
|
|
243
|
+
"card.allowProtectedBranchPushHint": "By default the P0 floor hard-blocks git push --force/--force-with-lease/--delete aimed at main/master/production/release/stable (not downgradable by any model). Turning it on steps the floor aside and exempts the three flat push keywords in the blacklist; the call then falls to the seeded git.push-force rule, which still asks a person unless you revoke that entry or allowlist it. Nothing else widens: wipes, redirects and the credential floor stay armed.",
|
|
244
|
+
"card.credFamily": "Credential family ladder",
|
|
245
|
+
"card.credFamilyHint": "One rung per family: deny = block reads and writes; ask = reads need a person (default); readonly = reads pass, writes stay hard-blocked by P0; readwrite = the credential-store WRITE clause steps aside for that family's built-in paths (npm-login style) — every other floor (roots, protected paths, .dsh, exfil) stays armed at any rung. The rung lives in the rules-document row plus the paired write-exemption list; this card writes both together.",
|
|
246
|
+
"card.credFamilyLoading": "Loading credential rungs…",
|
|
247
|
+
"card.credFamilyFootnote": "Unattended tiers (mechanical pass / YOLO) let ask residuals run — pick deny to hard-block. Custom credentialPaths never join the write exemption; readwrite changes nothing outside credential stores.",
|
|
248
|
+
"card.credReadwriteConfirm": "readwrite lets tools WRITE/modify this family's credential files (e.g. rewrite ~/.npmrc). This is the only rung that steps a piece of P0 aside. Confirm?",
|
|
249
|
+
"card.credConfirmYes": "Confirm",
|
|
250
|
+
"card.credConfirmNo": "Cancel",
|
|
251
|
+
"card.credRung.deny": "deny",
|
|
252
|
+
"card.credRung.ask": "ask",
|
|
253
|
+
"card.credRung.readonly": "readonly",
|
|
254
|
+
"card.credRung.readwrite": "readwrite",
|
|
229
255
|
"card.scriptReview": "Attach script bodies to the review (on by default)",
|
|
230
256
|
"card.scriptReviewHint": "When a call runs a script file, its body is read and given to the risk model and the human alike, and the deterministic nets grade the body too (a delete that only shows up inside the file is exactly what used to slip through). Bodies are redacted and length-capped before leaving the host; switching this off keeps file contents local at the cost of sending out-of-workspace scripts back to the unreadable tier.",
|
|
231
257
|
"card.credentialPaths": "Custom credential paths (the long tail)",
|
|
@@ -412,6 +438,19 @@ window.__ModuleLoader__.load({
|
|
|
412
438
|
"card.yoloHint": "復元不能 / 学習不能 / 読解不能なペイロード、またはモデルの重リスク判定を遮断し、理由を「工具審核意見」メッセージでメイン LLM に返します。それ以外は実行されます。レビューモデルが無い場合は決定論的ネットのみが機能します。",
|
|
413
439
|
"card.rulesFallback": "モデル不在時はルールゲートへ劣化(cc-safety-net 級)",
|
|
414
440
|
"card.rulesFallbackHint": "レビューモデルが未設定、または判定を返せなかったときだけ発効します。決定論的ルールが名指しできる危険を遮断し、残りは通します。誰も答えない確認画面で処理を止めないためです。モデルが答えている間は挙動は変わりません。",
|
|
441
|
+
"card.allowProtectedBranchPush": "保護ブランチへの force push を許可(既定オフ=床を維持)",
|
|
442
|
+
"card.allowProtectedBranchPushHint": "既定では main/master/production/release/stable を狙った git push --force/--force-with-lease/--delete を P0 床で確定遮断します(モデルで降格不可)。オンにすると床が退き、ブラックリストの3つの扁平 push 語も免除されます。呼び出しはプリセット git.push-force(人間確認が必要)に落ち、該当エントリを取り消すか許可リストに入れるまで毎回確認します。他の面は広がりません:削除・リダイレクト・認証情報の床はそのまま。",
|
|
443
|
+
"card.credFamily": "認証情報ファミリーの階段",
|
|
444
|
+
"card.credFamilyHint": "ファミリーごとに1段:deny=読み書きとも遮断;ask=読みは人間確認(既定);readonly=読み通過、書き/削除はP0で確定遮断のまま;readwrite=このファミリーの認証情報ストア書き込み判据のみ退く(npm login 系)。その他の床(ルートディスク・保護パス・.dsh・外部送信)はどの段でも動かさない。段の状態はルール文書の条目と書き込み免除リストの2箇所に置かれ、本カードが対で書き戻す。",
|
|
445
|
+
"card.credFamilyLoading": "認証情報の段を読み込み中…",
|
|
446
|
+
"card.credFamilyFootnote": "無人運用モード(機械直通/YOLO)では確認残局がそのまま通ります。硬く止めるには deny を選択してください。カスタム credentialPaths は書き込み免除に参加しません。",
|
|
447
|
+
"card.credReadwriteConfirm": "readwrite はこの種の認証情報ファイルへの書き込み/変更を許可します(~/.npmrc の上書きなど)。P0 の一部を退かす唯一の段です。確認しますか?",
|
|
448
|
+
"card.credConfirmYes": "確認",
|
|
449
|
+
"card.credConfirmNo": "キャンセル",
|
|
450
|
+
"card.credRung.deny": "遮断",
|
|
451
|
+
"card.credRung.ask": "確認",
|
|
452
|
+
"card.credRung.readonly": "読取のみ",
|
|
453
|
+
"card.credRung.readwrite": "読み書き",
|
|
415
454
|
"card.scriptReview": "スクリプト本文をレビューに添付(既定はオン)",
|
|
416
455
|
"card.scriptReviewHint": "呼び出しがスクリプトファイルを実行するとき、その本文を読み取り、レビューモデルと人が同じコードを見ます。決定論的ネットも本文を評価します(ファイル名からは見えない削除がまさに通過していた箇所)。送出前に秘匿化と長さ制限を実施。オフにするとファイル内容が外部へ出ませんが、ワークスペース外のスクリプトは「読解不能」ティアに戻ります。",
|
|
417
456
|
"card.credentialPaths": "カスタム認証情報パス(長尾)",
|
|
@@ -598,6 +637,19 @@ window.__ModuleLoader__.load({
|
|
|
598
637
|
"card.yoloHint": "복구 불가 / 학습 불가 / 해석 불가 페이로드, 또는 모델이 위험 판정을 내리면 차단하고 이유를 「工具审核意见」 메시지로 메인 LLM에 알려합니다. 나머지는 그대로 실행됩니다. 검토 모델이 없으면 결정론적 규칙망만 작동합니다.",
|
|
599
638
|
"card.rulesFallback": "모델이 없을 때 규칙 게이트로 강등 (cc-safety-net 급)",
|
|
600
639
|
"card.rulesFallbackHint": "검토 모델이 설정되지 않았거나 판정을 내리지 못했을 때만 발동합니다. 결정론적 규칙이 식별한 위험은 차단하고 나머지는 통과시켜, 아무도 응답하지 않는 확인 창에 호출을 대기시키지 않습니다. 모델이 정상 응답하는 동안에는 동작이 변하지 않습니다.",
|
|
640
|
+
"card.allowProtectedBranchPush": "보호 브랜치 force push 허용 (기본 꺼짐 = 바닥 유지)",
|
|
641
|
+
"card.allowProtectedBranchPushHint": "기본에서 main/master/production/release/stable 을 노린 git push --force/--force-with-lease/--delete 를 P0 바닥으로 확정 차단합니다(모델로 강등 불가). 켜면 바닥이 물러나고 블랙리스트의 세 평면 push 키워드도 면제됩니다. 호출은 프리셋 git.push-force(사람 확인 필요) 규칙으로 떨어져, 해당 항목을 취소하거나 허용 목록에 넣기 전엔 매번 확인합니다. 다른 면은 넓어지지 않습니다: 삭제·리다이렉트·자격증명 바닥은 그대로.",
|
|
642
|
+
"card.credFamily": "자격증명 계열 사다리",
|
|
643
|
+
"card.credFamilyHint": "계열별 한 칸: deny=읽기·쓰기 모두 차단; ask=읽기 사람 확인(기본); readonly=읽기 통과, 쓰기·삭제는 P0 확정 차단 유지; readwrite=해당 계열의 자격증명 store 쓰기 판정만 물러남(npm login 계열). 그 외 바닥(루트·보호 경로·.dsh·유출)은 어떤 칸에서도 움직이지 않습니다. 상태는 규칙 문서 항목과 쓰기 면제 목록 두 곳에 저장되며 이 카드가 한 쌍으로 함께 씁니다.",
|
|
644
|
+
"card.credFamilyLoading": "자격증명 단계 로딩 중…",
|
|
645
|
+
"card.credFamilyFootnote": "무인 등급(기계 직통/YOLO)에서는 ask 잔여가 통과합니다. 단단히 막으려면 deny를 선택하세요. 사용자 지정 credentialPaths는 쓰기 면제에 참여하지 않습니다.",
|
|
646
|
+
"card.credReadwriteConfirm": "readwrite는 이 종 자격증명 파일의 쓰기/수정을 허용합니다(~/.npmrc 재작성 등). P0의 일부를 퇴각시키는 유일한 칸입니다. 확인하시겠습니까?",
|
|
647
|
+
"card.credConfirmYes": "확인",
|
|
648
|
+
"card.credConfirmNo": "취소",
|
|
649
|
+
"card.credRung.deny": "차단",
|
|
650
|
+
"card.credRung.ask": "확인",
|
|
651
|
+
"card.credRung.readonly": "읽기 전용",
|
|
652
|
+
"card.credRung.readwrite": "읽기쓰기",
|
|
601
653
|
"card.scriptReview": "스크립트 본문 검토 함께 전송 (기본 켜짐)",
|
|
602
654
|
"card.scriptReviewHint": "호출이 스크립트 파일을 실행하면 본문을 읽어 검토 모델과 사람이 같은 코드를 보게 하고, 결정론적 규칙도 본문을 평가합니다 (파일명으로는 위험이 보이지 않는 삭제가 바로 그 통과 지점이었습니다). 전송 전 마스킹과 길이 제한을 적용합니다. 끄면 파일 내용이 외부로 나가지 않지만, 작업 공간 외부 스크립트는 다시 해석 불가 등급이 됩니다.",
|
|
603
655
|
"card.credentialPaths": "사용자 정의 자격증명 경로 (롱테일)",
|
|
@@ -784,6 +836,19 @@ window.__ModuleLoader__.load({
|
|
|
784
836
|
"card.yoloHint": "Bloque une charge irréversible / inapprenable / illisible, ou un verdict à risque dur du modèle, et renvoie la raison au LLM principal dans un message 工具审核意见 ; tout le reste s'exécute. Sans modèle disponible, seules les filets déterministes bloquent.",
|
|
785
837
|
"card.rulesFallback": "Dégrader vers une porte à règles quand il n'y a pas de modèle (classe cc-safety-net)",
|
|
786
838
|
"card.rulesFallbackHint": "Ne s'applique que lorsque le relecteur de risque n'est pas configuré ou n'a pas rendu de verdict : les filets déterministes bloquent ce qu'ils peuvent nommer et laissent passer le reste, au lieu de immobiliser l'appel sur une popup que personne ne répondra. Tant qu'un relecteur répond, le comportement est inchangé.",
|
|
839
|
+
"card.allowProtectedBranchPush": "Autoriser le force-push sur les branches protégées (par défaut inactif = plancher maintenu)",
|
|
840
|
+
"card.allowProtectedBranchPushHint": "Par défaut, le plancher P0 bloque git push --force/--force-with-lease/--delete visant main/master/production/release/stable (non rétrogradable par un modèle). L'activer écarte le plancher et exempte les trois mots-clés push de la liste noire ; l'appel retombe sur la règle git.push-force intégrée, qui demande toujours un humain sauf si vous révoquez cette entrée ou l'ajoutez en allowlist. Rien d'autre ne s'élargit : suppressions, redirections et le plancher d'identifiants restent armés.",
|
|
841
|
+
"card.credFamily": "Escalier des familles de secrets",
|
|
842
|
+
"card.credFamilyHint": "Un cran par famille : deny = lectures et écritures bloquées ; ask = lecture avec validation humaine (défaut) ; readonly = lectures libres, écritures toujours refusées par le plancher P0 ; readwrite = la clause d'écriture du store de credentials se retire pour cette famille (cas npm login). Les autres planchers (racines, chemins protégés, .dsh, exfiltration) restent armés à tout cran. L'état vit dans la ligne du document de règles plus la liste d'exemption ; la carte écrit les deux ensemble.",
|
|
843
|
+
"card.credFamilyLoading": "Chargement des crans…",
|
|
844
|
+
"card.credFamilyFootnote": "Les paliers sans humain (passage mécanique / YOLO) laissent passer le reliquat des ask — choisir deny pour bloquer. Les credentialPaths personnalisés ne bénéficient jamais de l'exemption d'écriture.",
|
|
845
|
+
"card.credReadwriteConfirm": "readwrite autorise l'écriture/modification des fichiers de secrets de cette famille (réécriture de ~/.npmrc). Seul cran qui écarte une part du P0. Confirmer ?",
|
|
846
|
+
"card.credConfirmYes": "Confirmer",
|
|
847
|
+
"card.credConfirmNo": "Annuler",
|
|
848
|
+
"card.credRung.deny": "bloquer",
|
|
849
|
+
"card.credRung.ask": "demander",
|
|
850
|
+
"card.credRung.readonly": "lecture seule",
|
|
851
|
+
"card.credRung.readwrite": "lecture écriture",
|
|
787
852
|
"card.scriptReview": "Joindre le contenu des scripts à la revue (activé par défaut)",
|
|
788
853
|
"card.scriptReviewHint": "Quand un appel exécute un fichier script, son corps est lu et donné au modèle de risque comme à l'humain, et les filets déterministes évaluent aussi ce corps (une suppression invisible dans le nom de fichier est précisément ce qui passait). Le corps est masqué et borné avant sortie ; le désactiver garde le contenu des fichiers en local, au prix de renvoyer les scripts hors espace de travail dans le palier « illisible ».",
|
|
789
854
|
"card.credentialPaths": "Chemins de credentials personnalisés (la longue traîne)",
|
|
@@ -970,6 +1035,19 @@ window.__ModuleLoader__.load({
|
|
|
970
1035
|
"card.yoloHint": "Blockiert eine unwiderrufliche / nicht lernbare / unlesbare Last oder ein Hartrisiko-Urteil des Modells und meldet den Grund dem Haupt-LLM als 工具审核意见-Nachricht; alles andere läuft. Ohne erreichbares Review-Modell fangen nur die deterministischen Netze.",
|
|
971
1036
|
"card.rulesFallback": "Ohne Modell zu einem Regel-Gate degradieren (cc-safety-net-Klasse)",
|
|
972
1037
|
"card.rulesFallbackHint": "Greift nur, wenn das Review-Modell nicht konfiguriert ist oder kein Urteil geliefert hat: die deterministischen Netze blockieren, was sie benennen können, und lassen den Rest durch, statt den Aufruf in einem Popup warten zu lassen, das niemand beantwortet. Solange ein Modell antwortet, bleibt das Verhalten unverändert.",
|
|
1038
|
+
"card.allowProtectedBranchPush": "Force-Push auf geschützte Branches erlauben (Standard aus = Boden bleibt)",
|
|
1039
|
+
"card.allowProtectedBranchPushHint": "Standardmäßig blockiert der P0-Boden git push --force/--force-with-lease/--delete auf main/master/production/release/stable (per Modell nicht herabstufbar). Beim Einschalten weicht der Boden und die drei flachen push-Schlüsselwörter der Blacklist werden ausgenommen; der Aufruf fällt auf die eingepasste Regel git.push-force, die weiterhin eine Person fragt — solange Sie den Eintrag nicht widerrufen oder auf die Allowlist setzen. Nichts anderes weitet sich: Löschen, Redirects und der Credential-Boden bleiben scharf.",
|
|
1040
|
+
"card.credFamily": "Credential-Familien-Stufenleiter",
|
|
1041
|
+
"card.credFamilyHint": "Eine Stufe pro Familie: deny = Lesen und Schreiben blockiert; ask = Lesen mit Bestätigung (Standard); readonly = Lesen frei, Schreiben bleibt P0-hart blockiert; readwrite = die Credential-Store-Schreibklausel weicht für diese Familie (npm-login-Fall). Alle anderen Böden (Roots, geschützte Pfade, .dsh, Exfiltration) bleiben in jeder Stufe scharf. Der Zustand lebt in der Regelzeile plus der Schreibausnahme-Liste; diese Karte schreibt beide gepaart zurück.",
|
|
1042
|
+
"card.credFamilyLoading": "Stufen werden geladen…",
|
|
1043
|
+
"card.credFamilyFootnote": "Unbeaufsichtigte Stufen (mechanischer Durchlass / YOLO) lassen ask-Reste durch — für harte Blockierung deny wählen. Eigene credentialPaths nehmen nie an der Schreibausnahme teil.",
|
|
1044
|
+
"card.credReadwriteConfirm": "readwrite erlaubt Schreiben/Ändern der Credential-Datei dieser Familie (z. B. ~/.npmrc überschreiben). Die einzige Stufe, die einen Teil von P0 zurücktritt. Bestätigen?",
|
|
1045
|
+
"card.credConfirmYes": "Bestätigen",
|
|
1046
|
+
"card.credConfirmNo": "Abbrechen",
|
|
1047
|
+
"card.credRung.deny": "blockieren",
|
|
1048
|
+
"card.credRung.ask": "fragen",
|
|
1049
|
+
"card.credRung.readonly": "nur Lesen",
|
|
1050
|
+
"card.credRung.readwrite": "Lesen+Schreiben",
|
|
973
1051
|
"card.scriptReview": "Skriptinhalte der Prüfung beifügen (standardmäßig an)",
|
|
974
1052
|
"card.scriptReviewHint": "Führt ein Aufruf eine Skriptdatei aus, wird ihr Inhalt gelesen und dem Risikomodell wie dem Menschen gezeigt, und die deterministischen Netze bewerten ebenfalls den Inhalt (ein Löschen, das nur in der Datei sichtbar ist, war genau das, was durchrutschte). Inhalte werden vor dem Verlassen des Rechners maskiert und begrenzt; abschalten hält Dateiinhalte lokal, kostet aber, dass Skripte außerhalb des Arbeitsbereichs wieder als „unlesbar“ gelten.",
|
|
975
1053
|
"card.credentialPaths": "Eigene Credential-Pfade (der lange Schwanz)",
|
|
@@ -1156,6 +1234,19 @@ window.__ModuleLoader__.load({
|
|
|
1156
1234
|
"card.yoloHint": "Blocca un carico irreversibile / non apprendibile / illeggibile, o un verdetto a rischio duro del modello, e restituisce il motivo al LLM principale come messaggio 工具审核意见; tutto il resto viene eseguito. Senza un modello disponibile, solo le reti deterministiche intercettano.",
|
|
1157
1235
|
"card.rulesFallback": "Degradare a una porta a regole quando non c’è modello (classe cc-safety-net)",
|
|
1158
1236
|
"card.rulesFallbackHint": "Agisce solo quando il revisore di rischio non è configurato o non ha dato un verdetto: le reti deterministiche bloccano ciò che sanno nominare e lasciano passare il resto, invece di parcheggiare la chiamata su un popup che nessuno risponderà. Finché un modello risponde, il comportamento resta invariato.",
|
|
1237
|
+
"card.allowProtectedBranchPush": "Consenti force-push su branch protetti (default off = pavimento attivo)",
|
|
1238
|
+
"card.allowProtectedBranchPushHint": "Di default il pavimento P0 blocca git push --force/--force-with-lease/--delete verso main/master/production/release/stable (non declassabile dal modello). Attivandolo il pavimento si fa da parte e le tre parole push piatte della blacklist vengono escluse; la chiamata ricade nella regola git.push-force predefinita, che chiede comunque una persona finché non revochi la voce o la aggiungi all'allowlist. Nient'altro si allarga: cancellazioni, redirect e il pavimento credenziali restano armati.",
|
|
1239
|
+
"card.credFamily": "Gradini delle famiglie di credenziali",
|
|
1240
|
+
"card.credFamilyHint": "Un gradino per famiglia: deny = lettura e scrittura bloccate; ask = lettura con conferma umana (predefinito); readonly = lettura libera, scrittura ancora bloccata dal pavimento P0; readwrite = la clausola di scrittura del credential store si ritira per questa famiglia (caso npm login). Gli altri pavimenti (root, percorsi protetti, .dsh, esfiltrazione) restano armati a ogni gradino. Lo stato vive nella riga del documento regole più la lista di esenzione; questa scheda scrive entrambe insieme.",
|
|
1241
|
+
"card.credFamilyLoading": "Caricamento gradini…",
|
|
1242
|
+
"card.credFamilyFootnote": "I livelli senza umano (passaggio meccanico / YOLO) lasciano passare il residuo degli ask — scegliere deny per bloccare. I credentialPaths personalizzati non partecipano mai all'esenzione di scrittura.",
|
|
1243
|
+
"card.credReadwriteConfirm": "readwrite consente di scrivere/modificare i file di credenziali di questa famiglia (sovrascrittura di ~/.npmrc). È l’unico gradino che ritira parte del P0. Confermare?",
|
|
1244
|
+
"card.credConfirmYes": "Conferma",
|
|
1245
|
+
"card.credConfirmNo": "Annulla",
|
|
1246
|
+
"card.credRung.deny": "blocca",
|
|
1247
|
+
"card.credRung.ask": "chiedi",
|
|
1248
|
+
"card.credRung.readonly": "sola lettura",
|
|
1249
|
+
"card.credRung.readwrite": "lettura scrittura",
|
|
1159
1250
|
"card.scriptReview": "Allega il contenuto degli script alla revisione (attivo per impostazione predefinita)",
|
|
1160
1251
|
"card.scriptReviewHint": "Quando una chiamata esegue uno script, il suo corpo viene letto e mostrato al modello di rischio come all’umano, e le reti deterministiche valutano anch’esse il corpo (un’eliminazione visibile solo dentro il file è esattamente ciò che passava). I corpi sono oscurati e limitati prima di lasciare l’host; disattivarli tiene il contenuto dei file in locale, al prezzo di rimandare gli script fuori dal workspace nel livello «illeggibile».",
|
|
1161
1252
|
"card.credentialPaths": "Percorsi di credenziali personalizzati (la coda lunga)",
|
|
@@ -1342,6 +1433,19 @@ window.__ModuleLoader__.load({
|
|
|
1342
1433
|
"card.yoloHint": "Блокирует необратимую / необучаемую / неразбираемую нагрузку или жёсткий вердикт модели и возвращает причину основной LLM сообщением 工具审核意见; остальное выполняется. Когда доступной модели нет, срабатывают только детерминированные сети.",
|
|
1343
1434
|
"card.rulesFallback": "Деградировать в шлюз по правилам, когда модели нет (класс cc-safety-net)",
|
|
1344
1435
|
"card.rulesFallbackHint": "Действует только когда проверяющая модель не настроена или не дала вердикта: детерминированные сети блокируют то, что могут назвать, и пропускают остальное, вместо того чтобы вешать вызов на окно, которое никто не ответит. Пока модель отвечает, поведение не меняется.",
|
|
1436
|
+
"card.allowProtectedBranchPush": "Разрешить force-push в защищённые ветки (по умолчанию выкл = пол стоит)",
|
|
1437
|
+
"card.allowProtectedBranchPushHint": "По умолчанию пол P0 блокирует git push --force/--force-with-lease/--delete в main/master/production/release/stable (модель не может понизить). При включении пол отступает и три плоских push-ключа из чёрного списка освобождаются; вызов попадает в правило git.push-force, которое всё равно спрашивает человека, пока вы не отзовете запись или не добавите его в allowlist. Ничего другое не расширяется: удаления, редиректы и пол учётных данных остаются взведены.",
|
|
1438
|
+
"card.credFamily": "Ступени семей учётных данных",
|
|
1439
|
+
"card.credFamilyHint": "Одна ступень на семейство: deny = блокирует чтение и запись; ask = чтение с подтверждением человека (по умолчанию); readonly = чтение свободно, запись по-прежнему твёрдо блокируется полом P0; readwrite = клауза записи credential-store отступает для этого семейства (случай npm login). Остальные полы (корни, защищённые пути, .dsh, эксфильтрация) взведены на любой ступени. Состояние живёт в строке документа правил и в списке изъятий записи; карта пишет оба вместе.",
|
|
1440
|
+
"card.credFamilyLoading": "Загрузка ступеней…",
|
|
1441
|
+
"card.credFamilyFootnote": "Безчеловечные уровни (механический пропуск / YOLO) пропускают остаток ask — для жёсткой блокировки выберите deny. Свои credentialPaths никогда не участвуют в изъятии записи.",
|
|
1442
|
+
"card.credReadwriteConfirm": "readwrite разрешает запись/изменение файлов учётных данных этого семейства (перезапись ~/.npmrc). Единственная ступень, отступающая часть P0. Подтвердить?",
|
|
1443
|
+
"card.credConfirmYes": "Подтвердить",
|
|
1444
|
+
"card.credConfirmNo": "Отмена",
|
|
1445
|
+
"card.credRung.deny": "блок",
|
|
1446
|
+
"card.credRung.ask": "спрос",
|
|
1447
|
+
"card.credRung.readonly": "только чтение",
|
|
1448
|
+
"card.credRung.readwrite": "чтение запись",
|
|
1345
1449
|
"card.scriptReview": "Прилагать содержимое скриптов к проверке (по умолчанию включено)",
|
|
1346
1450
|
"card.scriptReviewHint": "Когда вызов запускает скрипт-файл, его тело читается и даётся модели риска и человеку, и детерминированные сети тоже оценивают тело (удаление, видимое только внутри файла, — ровно то, что пропускалось). Тела маскируются и ограничиваются по длине до отправки; отключение оставляет содержимое файлов локально, ценой возврата скриптов вне рабочей области в уровень «неразбираемо».",
|
|
1347
1451
|
"card.credentialPaths": "Свои пути к учётным данным (длинный хвост)",
|
|
@@ -1528,6 +1632,19 @@ window.__ModuleLoader__.load({
|
|
|
1528
1632
|
"card.yoloHint": "Bloquea una carga irreversible / no aprendible / ilegible, o un veredicto de riesgo duro del modelo, y devuelve la razón al LLM principal como mensaje 工具审核意见; todo lo demás se ejecuta. Sin un modelo disponible, solo las redes deterministas interceptan.",
|
|
1529
1633
|
"card.rulesFallback": "Degradar a una compuerta de reglas cuando no hay modelo (clase cc-safety-net)",
|
|
1530
1634
|
"card.rulesFallbackHint": "Solo actúa cuando el revisor de riesgo no está configurado o no dio veredicto: las redes deterministas bloquean lo que saben nombrar y dejan pasar el resto, en lugar de dejar la llamada colgada en un emergente que nadie responderá. Mientras un modelo responde, el comportamiento no cambia.",
|
|
1635
|
+
"card.allowProtectedBranchPush": "Permitir force-push a ramas protegidas (por defecto off = suelo activo)",
|
|
1636
|
+
"card.allowProtectedBranchPushHint": "Por defecto el suelo P0 bloquea git push --force/--force-with-lease/--delete hacia main/master/production/release/stable (no degradable por el modelo). Al activarlo el suelo se aparta y se eximen las tres palabras push planas de la lista negra; la llamada cae en la regla git.push-force integrada, que aún pregunta a una persona salvo que revoques esa entrada o la añada a la allowlist. Nada más se amplía: borrados, redirecciones y el suelo de credenciales siguen armados.",
|
|
1637
|
+
"card.credFamily": "Escalón por familia de credenciales",
|
|
1638
|
+
"card.credFamilyHint": "Un escalón por familia: deny = lectura y escritura bloqueadas; ask = lectura con validación humana (predeterminado); readonly = lectura libre, la escritura sigue bloqueada por el suelo P0; readwrite = la cláusula de escritura del credential store se aparta para esta familia (caso npm login). Los demás suelos (raíces, rutas protegidas, .dsh, exfiltración) siguen armados en cualquier escalón. El estado vive en la fila del documento de reglas más la lista de exención; esta tarjeta escribe ambas juntas.",
|
|
1639
|
+
"card.credFamilyLoading": "Cargando escalones…",
|
|
1640
|
+
"card.credFamilyFootnote": "Los niveles sin humano (paso mecánico / YOLO) dejan pasar el residuo de los ask — elige deny para bloquear duro. Los credentialPaths personalizados nunca participan en la exención de escritura.",
|
|
1641
|
+
"card.credReadwriteConfirm": "readwrite permite escribir/modificar los archivos de credenciales de esta familia (reescribir ~/.npmrc). Es el único escalón que aparta parte del P0. ¿Confirmar?",
|
|
1642
|
+
"card.credConfirmYes": "Confirmar",
|
|
1643
|
+
"card.credConfirmNo": "Cancelar",
|
|
1644
|
+
"card.credRung.deny": "bloquear",
|
|
1645
|
+
"card.credRung.ask": "preguntar",
|
|
1646
|
+
"card.credRung.readonly": "solo lectura",
|
|
1647
|
+
"card.credRung.readwrite": "lectura escritura",
|
|
1531
1648
|
"card.scriptReview": "Adjuntar el contenido de los scripts a la revisión (activado por defecto)",
|
|
1532
1649
|
"card.scriptReviewHint": "Cuando una llamada ejecuta un archivo script, su cuerpo se lee y se da al modelo de riesgo y al humano por igual, y las redes deterministas también evalúan el cuerpo (un borrado que solo se ve dentro del archivo es justo lo que se escapaba). Los cuerpos se redactan y limitan antes de salir del host; desactivarlo mantiene el contenido de archivos local, al costo de devolver los scripts fuera del espacio de trabajo al nivel «ilegible».",
|
|
1533
1650
|
"card.credentialPaths": "Rutas de credenciales personalizadas (la cola larga)",
|
|
@@ -2180,6 +2297,187 @@ window.__ModuleLoader__.load({
|
|
|
2180
2297
|
* the preset cannot know — and they should not each grow their own copy of the row
|
|
2181
2298
|
* markup the deny blacklist already has.
|
|
2182
2299
|
*/
|
|
2300
|
+
/**
|
|
2301
|
+
* cred family ladder — server-backed rows (`GET/POST /api/dsh-perm-gate/cred`).
|
|
2302
|
+
* The rung state lives in TWO stores the plugin owns — the family's row inside the
|
|
2303
|
+
* rules document (section + enabled) and the paired `credWriteExemptFamilies` list —
|
|
2304
|
+
* so the card must not keep a local mirror; it reads and writes through the route,
|
|
2305
|
+
* which applies both stores in one settings update. `readwrite` asks for an inline
|
|
2306
|
+
* confirmation: it is the only rung that steps a piece of P0 aside.
|
|
2307
|
+
*/
|
|
2308
|
+
const CRED_FAMILIES_UI = [
|
|
2309
|
+
["ssh", "SSH (~/.ssh)"],
|
|
2310
|
+
["cloud", "Cloud (.aws/.gcloud/.azure)"],
|
|
2311
|
+
["package", "Registry (.npmrc/.pypirc/.netrc)"],
|
|
2312
|
+
["gitcreds", "Git store (.git-credentials)"],
|
|
2313
|
+
["env", "Project (.env)"],
|
|
2314
|
+
["cli", "Coding CLI (~/.claude/.codex/gh)"],
|
|
2315
|
+
["db", "Database (.pgpass/.my.cnf)"]
|
|
2316
|
+
];
|
|
2317
|
+
const CRED_RUNGS_UI = [
|
|
2318
|
+
"deny",
|
|
2319
|
+
"ask",
|
|
2320
|
+
"readonly",
|
|
2321
|
+
"readwrite"
|
|
2322
|
+
];
|
|
2323
|
+
const CRED_RUNG_LABEL_KEY = {
|
|
2324
|
+
deny: "card.credRung.deny",
|
|
2325
|
+
ask: "card.credRung.ask",
|
|
2326
|
+
readonly: "card.credRung.readonly",
|
|
2327
|
+
readwrite: "card.credRung.readwrite"
|
|
2328
|
+
};
|
|
2329
|
+
function CredLadderSection(props) {
|
|
2330
|
+
const { t, readonly } = props;
|
|
2331
|
+
const [rungs, setRungs] = (0, react.useState)(null);
|
|
2332
|
+
const [confirm, setConfirm] = (0, react.useState)(null);
|
|
2333
|
+
const [busy, setBusy] = (0, react.useState)(null);
|
|
2334
|
+
const [rowError, setRowError] = (0, react.useState)(null);
|
|
2335
|
+
(0, react.useEffect)(() => {
|
|
2336
|
+
let alive = true;
|
|
2337
|
+
fetch("/api/dsh-perm-gate/cred", { headers: { "cache-control": "no-cache" } }).then((r) => r.json()).then((b) => {
|
|
2338
|
+
if (alive && b?.rungs !== void 0) setRungs(b.rungs);
|
|
2339
|
+
}).catch(() => {});
|
|
2340
|
+
return () => {
|
|
2341
|
+
alive = false;
|
|
2342
|
+
};
|
|
2343
|
+
}, []);
|
|
2344
|
+
const apply = (family, rung) => {
|
|
2345
|
+
setBusy(family);
|
|
2346
|
+
setRowError(null);
|
|
2347
|
+
const abort = new AbortController();
|
|
2348
|
+
const timer = setTimeout(() => {
|
|
2349
|
+
abort.abort();
|
|
2350
|
+
}, 1e4);
|
|
2351
|
+
fetch("/api/dsh-perm-gate/cred", {
|
|
2352
|
+
method: "POST",
|
|
2353
|
+
headers: { "content-type": "application/json" },
|
|
2354
|
+
body: JSON.stringify({
|
|
2355
|
+
family,
|
|
2356
|
+
rung
|
|
2357
|
+
}),
|
|
2358
|
+
signal: abort.signal
|
|
2359
|
+
}).then((r) => r.json()).then((b) => {
|
|
2360
|
+
if (b?.ok === true && b.rungs !== void 0) setRungs(b.rungs);
|
|
2361
|
+
else setRowError({
|
|
2362
|
+
family,
|
|
2363
|
+
msg: String(b?.error ?? "failed")
|
|
2364
|
+
});
|
|
2365
|
+
}).catch((e) => {
|
|
2366
|
+
const msg = String(e?.name ?? e) === "AbortError" ? "timeout (10s)" : String(e);
|
|
2367
|
+
setRowError({
|
|
2368
|
+
family,
|
|
2369
|
+
msg
|
|
2370
|
+
});
|
|
2371
|
+
}).finally(() => {
|
|
2372
|
+
clearTimeout(timer);
|
|
2373
|
+
setBusy(null);
|
|
2374
|
+
setConfirm(null);
|
|
2375
|
+
});
|
|
2376
|
+
};
|
|
2377
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2378
|
+
style: sectionStyle,
|
|
2379
|
+
children: [
|
|
2380
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2381
|
+
style: labelStyle,
|
|
2382
|
+
children: t("card.credFamily")
|
|
2383
|
+
}),
|
|
2384
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2385
|
+
style: hintStyle,
|
|
2386
|
+
children: t("card.credFamilyHint")
|
|
2387
|
+
}),
|
|
2388
|
+
rungs === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2389
|
+
style: hintStyle,
|
|
2390
|
+
children: t("card.credFamilyLoading")
|
|
2391
|
+
}) : CRED_FAMILIES_UI.map(([family, display]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2392
|
+
style: {
|
|
2393
|
+
...rowStyle,
|
|
2394
|
+
flexWrap: "wrap"
|
|
2395
|
+
},
|
|
2396
|
+
children: [
|
|
2397
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2398
|
+
style: {
|
|
2399
|
+
fontSize: "12px",
|
|
2400
|
+
color: "var(--dsw-alias-label-primary)"
|
|
2401
|
+
},
|
|
2402
|
+
children: display
|
|
2403
|
+
}),
|
|
2404
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2405
|
+
style: {
|
|
2406
|
+
display: "inline-flex",
|
|
2407
|
+
gap: "4px"
|
|
2408
|
+
},
|
|
2409
|
+
children: CRED_RUNGS_UI.map((rung) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2410
|
+
type: "button",
|
|
2411
|
+
disabled: readonly || busy === family,
|
|
2412
|
+
style: {
|
|
2413
|
+
fontSize: "11px",
|
|
2414
|
+
padding: "2px 8px",
|
|
2415
|
+
cursor: "pointer",
|
|
2416
|
+
borderRadius: "10px",
|
|
2417
|
+
border: rungs[family] === rung ? "1px solid var(--dsw-alias-primary, #4a90d9)" : "1px solid transparent",
|
|
2418
|
+
background: rungs[family] === rung ? "rgba(74, 144, 217, 0.15)" : "transparent"
|
|
2419
|
+
},
|
|
2420
|
+
onClick: () => {
|
|
2421
|
+
if (rung === "readwrite" && confirm !== family) {
|
|
2422
|
+
setConfirm(family);
|
|
2423
|
+
return;
|
|
2424
|
+
}
|
|
2425
|
+
setConfirm(null);
|
|
2426
|
+
apply(family, rung);
|
|
2427
|
+
},
|
|
2428
|
+
children: t(CRED_RUNG_LABEL_KEY[rung])
|
|
2429
|
+
}, rung))
|
|
2430
|
+
}),
|
|
2431
|
+
confirm === family && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2432
|
+
style: {
|
|
2433
|
+
width: "100%",
|
|
2434
|
+
fontSize: "12px",
|
|
2435
|
+
color: "var(--dsw-alias-label-secondary)"
|
|
2436
|
+
},
|
|
2437
|
+
children: [
|
|
2438
|
+
t("card.credReadwriteConfirm"),
|
|
2439
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2440
|
+
type: "button",
|
|
2441
|
+
disabled: busy === family,
|
|
2442
|
+
style: {
|
|
2443
|
+
fontSize: "11px",
|
|
2444
|
+
marginLeft: "6px"
|
|
2445
|
+
},
|
|
2446
|
+
onClick: () => apply(family, "readwrite"),
|
|
2447
|
+
children: t("card.credConfirmYes")
|
|
2448
|
+
}),
|
|
2449
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2450
|
+
type: "button",
|
|
2451
|
+
style: {
|
|
2452
|
+
fontSize: "11px",
|
|
2453
|
+
marginLeft: "4px"
|
|
2454
|
+
},
|
|
2455
|
+
onClick: () => setConfirm(null),
|
|
2456
|
+
children: t("card.credConfirmNo")
|
|
2457
|
+
})
|
|
2458
|
+
]
|
|
2459
|
+
}),
|
|
2460
|
+
rowError !== null && rowError.family === family && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2461
|
+
style: {
|
|
2462
|
+
width: "100%",
|
|
2463
|
+
fontSize: "11px",
|
|
2464
|
+
color: "var(--dsw-alias-danger, #c0392b)"
|
|
2465
|
+
},
|
|
2466
|
+
children: [
|
|
2467
|
+
family,
|
|
2468
|
+
": ",
|
|
2469
|
+
rowError.msg
|
|
2470
|
+
]
|
|
2471
|
+
})
|
|
2472
|
+
]
|
|
2473
|
+
}, family)),
|
|
2474
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2475
|
+
style: hintStyle,
|
|
2476
|
+
children: t("card.credFamilyFootnote")
|
|
2477
|
+
})
|
|
2478
|
+
]
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2183
2481
|
function StringListField(props) {
|
|
2184
2482
|
const [draft, setDraft] = (0, react.useState)("");
|
|
2185
2483
|
const add = () => {
|
|
@@ -2597,6 +2895,23 @@ window.__ModuleLoader__.load({
|
|
|
2597
2895
|
style: hintStyle,
|
|
2598
2896
|
children: t("card.rulesFallbackHint")
|
|
2599
2897
|
}),
|
|
2898
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2899
|
+
style: rowStyle,
|
|
2900
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
2901
|
+
htmlFor: "plugin-config-perm-gate-allow-protected-push",
|
|
2902
|
+
style: { fontSize: "12px" },
|
|
2903
|
+
children: t("card.allowProtectedBranchPush")
|
|
2904
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillSwitch, {
|
|
2905
|
+
id: "plugin-config-perm-gate-allow-protected-push",
|
|
2906
|
+
checked: value.allowProtectedBranchPush === true,
|
|
2907
|
+
disabled: readonly,
|
|
2908
|
+
onCommit: (next) => scope.set("allowProtectedBranchPush", next)
|
|
2909
|
+
})]
|
|
2910
|
+
}),
|
|
2911
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2912
|
+
style: hintStyle,
|
|
2913
|
+
children: t("card.allowProtectedBranchPushHint")
|
|
2914
|
+
}),
|
|
2600
2915
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2601
2916
|
style: rowStyle,
|
|
2602
2917
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
@@ -3572,6 +3887,10 @@ window.__ModuleLoader__.load({
|
|
|
3572
3887
|
})
|
|
3573
3888
|
]
|
|
3574
3889
|
}),
|
|
3890
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CredLadderSection, {
|
|
3891
|
+
t,
|
|
3892
|
+
readonly
|
|
3893
|
+
}),
|
|
3575
3894
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3576
3895
|
style: sectionStyle,
|
|
3577
3896
|
children: [
|