Commit Graph

495 Commits

Author SHA1 Message Date
Дмитрий 84231a1470 feat(board): live source for guard board escapes/blocks (D-3)
Доска «кто на посту» (STATUS.md §7) теперь показывает реальные недавние
escape владельца и блоки машин М1–М6 вместо хардкода []/[].

- new tools/guard-block-log.mjs: logGuardBlock (best-effort, fail-quiet,
  Node fs append в guard-blocks-<sess>.jsonl) + loadRecentBlocks/
  loadRecentEscapes (скан session-файлов runtime, окно 24ч + cap 10, ts→ISO).
- проводка logGuardBlock в block-ветку main() 9 машинных хуков (floor /
  supreme-gate / judge-gate / snapshot / read-path-deny / mcp-classification /
  normative-content-rules / verify-gate / criterion-gate). Логгер вызывается
  ПОСЛЕ решения, не влияет на block; decide() pure не тронут.
- status-md-generator CLI: recentEscapes/recentBlocks из читателей вместо []/[].

До флипа Фазы 8 доска показывает 0/0 (хуки не зарегистрированы — данных нет);
реальная польза — пост-флип наблюдаемость.

TDD: guard-block-log.test (6) + 9 структурных wiring-тестов + 1 board-тест.
Гейт закрытия: sharp-edges (промежуточный по 9 хукам + читатели) +
variant-analysis (все block-ветки покрыты, иных источников нет). Регрессия
tools-only 3465 passed / 2 skipped / 0 failed (было 3449+2skip). 0 регрессий.

Plan: docs/superpowers/plans/2026-06-10-guard-board-live-source.md
2026-06-10 04:28:53 +03:00
Дмитрий 4dd2098e7b feat(seal): validate judge_mode at freeze time (defense-in-depth, SE-2 §4)
assertValidJudgeMode guard in freezePlan/freezeArtifact: fail-CLOSE on any
mode != {null|shadow|live-block}. Closes YAGNI-candidate from sealed-plan §11
/ gate1+se2 §4 (SE-a) — bogus mode can no longer enter a seal at the source
(complements the wall's fail-closed live-block whitelist).

- freezePlan validates the judgeMode param; freezeArtifact validates the
  embedded artifact.judge_mode (injected by seal-orchestration).
- guard sits before id/sig computation -> no partially-signed bogus-mode seal.
- throw is best-effort-swallowed at enforce-judge-gate.mjs onWiredSeal ->
  no seal produced (fail-CLOSE), hook never crashes.
- real flow never trips it (judgeGateMode yields only inert/shadow/live-block,
  inert never seals) — drift-only guard.

TDD: new tools/plan-lock-judge-mode.test.mjs (6 tests). Regression tools-only
3449 passed / 2 skipped / 0 failed (was 3443+2skip). 0 regressions.
sharp-edges + variant-analysis: clean (only two seal producers, both guarded;
wall comparison already fail-closed).

Plan: docs/superpowers/plans/2026-06-09-seal-time-judge-mode-validation.md
2026-06-10 03:48:07 +03:00
Дмитрий 0289e93c0e feat(gate1+se2): wire spec-judging (Гейт-1) + fail-closed wall whitelist (SE-2)
М7 Фаза 8 — последние 2 хвоста до флипа. Inline TDD; спека+план одобрены; 2 адверсариальных прохода.

Гейт-1 (печать артефакта в рантайме):
- extractGate1Product (enforce-judge-gate.mjs): детект записи specs/*.md (Write-only) → судить
  линзами gate1 (движок уже поддерживает). runJudgeGate: спека→gate1, иначе план→gate2.
- judged_hash от СЫРОГО content (SD-1, разбор #1 High): trimmed source_sha не сошёлся бы с
  печатью sealOnWiredGo → артефакт НИКОГДА не печатался бы. Один канон судья→печать.
- extractGate2Product не тронут (Гейт-2 = планы, регрессия зелёная).

SE-2 (стена не чтит shadow):
- decideMode (enforce-supreme-gate.mjs): fail-closed whitelist — энфорсмент ТОЛЬКО при
  judge_mode==='live-block' на ОБЕИХ печатях; shadow/null/опечатка → разговорный (мутаторы block).
  Разбор #1 (VA-a/SE-a): убрана единственная fail-OPEN сверка; опечатка режима безопасна.
- мигрированы 3 enforce-теста стены на judge_mode:'live-block'.

Тесты: gate1 10, SE-2 6; регрессия tools-only 3443 passed / 2 skip / 0 регрессий.
Гейт-1 тесты — отдельный файл enforce-judge-gate-gate1.test.mjs (real-test-verifier блокирует
import-only Edit существующего теста). Печать в рантайме до флипа НЕ производится.
2026-06-09 19:05:17 +03:00
Дмитрий 09598dd5bd feat(seal): sealed-plan production pipeline (M7 Фаза 8 code-precondition)
Производство двух печатей (артефакт-решение + план-шаги), чтобы стене М2 было
что матчить — код-предусловие флипа. Inline TDD, спека/план одобрены владельцем.

- C1 artifact-from-spec.mjs: спека markdown -> {sections, source_sha} по якорям {#id} (P2-2).
- C2 plan-steps-parse.mjs: план -> [{op,object,ref}], fail-CLOSE, reject op:Task (VA-4),
  канон object = repo-relative POSIX (SE-5; pathNormalize только на матче в стене, не на парсе).
- C3/C4 plan-lock.mjs: judge_mode в ПОДПИСАННОЙ базе freezePlan (VA-2) + атомарный persist
  temp->rename для обоих save (SE-4/VA-3, артефакт ДО плана).
- C6 seal-orchestration.mjs: sealableArtifact/sealablePlan + judgedHashOf (SD-1) +
  sealArtifact/sealPlan на РЕАЛЬНОМ GO (SE-3 wired===true), штамп artifact_id из текущего
  артефакта (SD-3), judge_mode впрыснут в печать ПОСЛЕ хеш-сверки sealOnApproval (фикс TOCTOU).
- C5 enforce-judge-gate.mjs: SPEC_PATH_RE + sealOnWiredGo (печать на wired GO, инъекция в main,
  юнит-тесты hermetic) + judged_hash в вердикте runJudgeGate. extractGate2Product не тронут
  (Гейт-2 = планы; Гейт-1 spec-judging — отдельный заход перед флипом).
- Интеграция seal-to-wall: печать -> decideMode стены М2 (allow / non-match block / closed-door).

Тесты: full tools-only регрессия 3427 passed | 2 skipped, 0 регрессий (+29 новых кейсов).
Печать в рантайме НЕ производится до флипа (стена/судья не зарегистрированы) — сборка
готовит код-предусловие. Спека docs/superpowers/specs/2026-06-09-sealed-plan-production-design.md.
2026-06-09 17:50:25 +03:00
Дмитрий 5fd4031b1e fix(tdd-verifier): escape dots in TEST_FILE_RE (stop misclassifying *spec.mjs prod files)
Unescaped dots in /.(?:test|spec).[a-z0-9]+$/i matched the bare substring "spec"
in prod filenames ending like artifact-from-spec.mjs, so the real-test verifier
treated a production module as a test file and blocked it for lacking expect().
Anchor the dots (\.) so only genuine .test.<ext> / .spec.<ext> files match.
Real test files are still fully checked (regression guard added).
2026-06-09 17:50:19 +03:00
Дмитрий 69d4b19502 fix(keychain): async keytar read via sync subprocess (no getPasswordSync) 2026-06-09 14:24:43 +03:00
Дмитрий 440fd71bbf fix(content-floor): quote-aware redirect in matchBashHardBlacklist (port b0cd18d7 after --ours merge) 2026-06-09 13:35:24 +03:00
Дмитрий d59b9177d4 Merge branch 'main' into worktree-brainrepo
# Conflicts:
#	tools/enforce-coverage-verify.mjs
#	tools/enforce-coverage-verify.test.mjs
#	tools/enforce-router-gate.mjs
#	tools/enforce-router-gate.test.mjs
2026-06-09 13:26:12 +03:00
Дмитрий c8639f2fd1 feat(manifest): register coverage-verify + todowrite-skill-verifier (G2 phase8 manifest 11to13) 2026-06-09 12:56:40 +03:00
Дмитрий 068b03d946 feat(criterion-gate): register enforce-criterion-gate in manifest (Level B task6) 2026-06-09 12:30:06 +03:00
Дмитрий 4e54331ef4 feat(criterion-gate): consumer enforce-criterion-gate fail-CLOSE (Level B task5) 2026-06-09 12:26:33 +03:00
Дмитрий e229cf0706 feat(criterion-gate): per-criterion green producer (Level B task4) 2026-06-09 12:24:30 +03:00
Дмитрий caa41e6cac feat(criterion-gate): mutation runner in-place + restore (Level B task3) 2026-06-09 12:22:40 +03:00
Дмитрий 9414699ad9 feat(criterion-gate): vitest json run + test-count guard (Level B task2) 2026-06-09 12:21:21 +03:00
Дмитрий 67a46df978 feat(criterion-gate): JS mutation operators pure (Level B task1) 2026-06-09 12:19:50 +03:00
Дмитрий b92afad96c feat(verify-gate): register enforce-verify-gate in manifest (G1 task7) 2026-06-09 10:22:36 +03:00
Дмитрий 2bd7efbebd feat(verify-gate): consumer enforce-verify-gate fail-CLOSE (G1 task6) 2026-06-09 10:19:44 +03:00
Дмитрий 9ce6041be4 feat(verify-gate): producer staged-fingerprint + io main (G1 task5) 2026-06-09 10:18:11 +03:00
Дмитрий 93e516e680 feat(verify-gate): producer pure buildVerifyReceipt (G1 task4) 2026-06-09 10:16:22 +03:00
Дмитрий 0f20c944ca feat(verify-gate): rubilnik verify-gate-config (G1 task3) 2026-06-09 10:15:16 +03:00
Дмитрий 1088599023 feat(verify-gate): verify-receipt pure core sign/accept (G1 task2) 2026-06-09 10:13:57 +03:00
Дмитрий 1857773f89 feat(verify-gate): VERIFY_PASS receipt domain (G1 task1) 2026-06-09 10:12:41 +03:00
Дмитрий e8958155c4 feat(judge-gate): runJudgeTurn three-mode wiring + main (shadow runs+logs, live-block fail-close) 2026-06-09 08:46:28 +03:00
Дмитрий b48fd86152 feat(judge-gate): shadow verdict log + judge-unavailable warn (J8) 2026-06-09 08:43:00 +03:00
Дмитрий 50550f311e feat(judge-gate): async runJudgeGate orchestration + degraded-allow on unavailable 2026-06-09 08:40:36 +03:00
Дмитрий 36545b636f feat(judge-gate): callJudgeModel async transport + spend-gate (unavailable vs malformed) 2026-06-09 08:38:38 +03:00
Дмитрий 0af6610b77 feat(judge-gate): extractGate2Product Write-only plan detector 2026-06-09 08:36:03 +03:00
Дмитрий 0c6f084f0e feat(judge-gate): parseJudgeResponse fail-closed parser 2026-06-09 08:33:46 +03:00
Дмитрий a630053714 fix(shadow-replay): exclude runtime writes and scope M6 to bash 2026-06-09 07:20:48 +03:00
Дмитрий 647879adc6 feat(shadow-replay): main cli and runAll 2026-06-09 06:30:17 +03:00
Дмитрий dd63f950e2 feat(shadow-replay): buildCorpus runMachine report 2026-06-09 06:26:57 +03:00
Дмитрий ff8f14d8d2 feat(shadow-replay): M4 adapter and M3 divergence 2026-06-09 06:24:33 +03:00
Дмитрий a7f3ebd971 feat(shadow-replay): M2 adapter signed plan 2026-06-09 06:22:40 +03:00
Дмитрий d5feca2672 feat(shadow-replay): M5 M6 adapters 2026-06-09 06:21:01 +03:00
Дмитрий f139ad5320 feat(shadow-replay): classifyOutcome 2026-06-09 06:19:10 +03:00
Дмитрий 8228703320 feat(shadow-replay): fixtures 2026-06-09 06:17:38 +03:00
Дмитрий 5782ede3eb test(action-journal): pin M1 fail-closed on torn append (entry without head update) 2026-06-09 05:23:51 +03:00
Дмитрий 2b0c28e59f feat(supreme-gate): tree leaf resolution plus advance flag for R-08 waves 2026-06-09 05:12:38 +03:00
Дмитрий 16e0c1db09 feat(supreme-gate): pointer state accepts tree position as index array 2026-06-09 05:10:45 +03:00
Дмитрий 51f718ea07 feat(plan-lock): tree leaves, leaf resolver, validate, recursive criterion ids, hierarchical consumers 2026-06-09 05:09:21 +03:00
Дмитрий 1a3ccc2178 feat(step-pointer): serialize plus tree navigation for R-08 waves 2026-06-09 05:06:49 +03:00
Дмитрий 0e995970f9 feat(reconcile): wire reconcileEvent reader in main (inert, WARN-only) 2026-06-09 04:08:22 +03:00
Дмитрий 752512d3cd feat(status): R-30 journal integrity block via live verifyChain (read-only) 2026-06-09 04:06:53 +03:00
Дмитрий 1000abc7fc feat(status): R-24 door coverage block (read-only) 2026-06-09 04:05:15 +03:00
Дмитрий 0eef670e54 feat(door-coverage): door matcher reader and canonical mutating tools list 2026-06-09 04:02:27 +03:00
Дмитрий 2e6a6c0a7a feat(status): R-09 learning queue block (read-only) 2026-06-09 03:59:32 +03:00
Дмитрий 553ddea464 docs(tools): utochnit docstring node-graph + pinning-invarianty (P5 E/G) 2026-06-09 03:23:39 +03:00
Дмитрий cf9f803d36 feat(status): detail-render doski oborony + escapeCell anti-injection (P4 E/G) 2026-06-09 03:21:29 +03:00
Дмитрий 5ae0b1359f fix(observer): routing-detector ignorit PASTED-citaty /node (P1 E/G, 4-y FP-klass)
Novyy uzkiy stripPastedContext (fenced+blockquote only) pered detekciey. NE reuse stripQuotedContext (tot stripaet inline - FN). Sohraneno FP-smeshchenie routingGate (SE-1). Regressiya 3185 passed.
2026-06-09 03:18:55 +03:00
Дмитрий 84f75abb14 fix(observer): PII count via sanitize pipeline, overlap once (P2 E/G)
Edinyy PIPELINE: count ravno chislu redakciy sanitize (SE-2). sanitize byte-identical. Regressiya 3177 passed.
2026-06-09 03:16:49 +03:00