diff --git a/openspec/schemas/wealth-ledger-sdd-lab/check.cjs b/openspec/schemas/wealth-ledger-sdd-lab/check.cjs deleted file mode 100644 index 834874a..0000000 --- a/openspec/schemas/wealth-ledger-sdd-lab/check.cjs +++ /dev/null @@ -1,294 +0,0 @@ -#!/usr/bin/env node -// Deterministic checks for wealth-ledger-sdd-lab changes. OpenSpec CLI 1.13.1 has no conditional -// artifacts, gate records or archive policy, so this file covers only what the CLI cannot. -// It is the single source for profile, ordering, gate and readiness rules; schema.yaml points here. -// Semantic quality (contradictions, invented facts, design fit) stays with reviewers. -// -// Usage: node check.cjs [--root ] -// plan — artifact consistency while planning; missing gates are notes, not errors. -// apply — plan + every apply blocker is an error. -// archive — apply + all tasks done, G4 approved, lab retrospective. -// Exit: 0 ok, 1 violations, 2 invocation/environment error. -"use strict"; -const fs = require("node:fs"); -const path = require("node:path"); - -const SA_MODULES = ["data-mapping", "failure-model", "nfr", "observability"]; -// Primary file of each conditional artifact, relative to the change directory. -const PRIMARY = { - research: "research.md", - "ux-design": "ux-design.md", - "system-analysis": "system-analysis/system-analysis.md", - "data-mapping": "system-analysis/data-mapping.md", - "failure-model": "system-analysis/failure-model.md", - nfr: "system-analysis/nfr.md", - observability: "system-analysis/observability.md", - "security-analysis": "security-analysis.md", - "test-cases": "test-cases", - "docs-impact": "docs-impact.md", -}; -const CONDITIONAL = Object.keys(PRIMARY); -// A selected conditional input must exist before any of these files is written. -const BEFORE_SOLUTION = ["design.md", "qa-analysis.md", "tasks.md"]; -const DOWNSTREAM = { - research: ["specs", ...BEFORE_SOLUTION], - "ux-design": BEFORE_SOLUTION, - "system-analysis": BEFORE_SOLUTION, - ...Object.fromEntries(SA_MODULES.map((id) => [id, BEFORE_SOLUTION])), - "security-analysis": BEFORE_SOLUTION, - "test-cases": ["tasks.md"], - "docs-impact": ["tasks.md"], -}; -// Gate that may approve each artifact. Complex changes approve system analysis at G2 (contract-first). -const SA_IDS = ["system-analysis", ...SA_MODULES]; -const allowedGates = (id, complex, hasG2) => { - if (id === "proposal") return ["G1"]; - if (id === "change-profile") return ["G1", "G2", "G3"]; // later profile changes need a recorded decision - if (id === "specs") return hasG2 ? ["G2"] : ["G3"]; - if (SA_IDS.includes(id)) return complex ? ["G2"] : hasG2 ? ["G2", "G3"] : ["G3"]; - return ["G3"]; -}; -const NOT_APPROVED = new Set(["research", "process-record"]); // input context / the log itself -const REF = /`([a-z0-9][a-z0-9/-]*)`\s*[—–-]\s*`([^`]+)`/g; - -const fail = (msg) => { console.error(msg); process.exit(2); }; -const args = process.argv.slice(2); -const [mode, changeName] = args; -if (!["plan", "apply", "archive"].includes(mode) || !changeName) { - fail("Usage: node check.cjs [--root ]"); -} -const rootIdx = args.indexOf("--root"); -if (rootIdx > 0 && !args[rootIdx + 1]) fail("--root needs a path"); -const root = path.resolve(rootIdx > 0 ? args[rootIdx + 1] : path.join(__dirname, "..", "..")); -const changeDir = path.join(root, "changes", changeName); -if (!fs.existsSync(changeDir)) fail(`Change directory not found: ${changeDir}`); - -const errors = []; -const warnings = []; -const notes = []; -const rel = (p) => path.relative(changeDir, p); -const read = (p) => fs.readFileSync(p, "utf8"); -const at = (p) => path.join(changeDir, p); -const walk = (dir) => fs.existsSync(dir) - ? fs.readdirSync(dir, { withFileTypes: true }).flatMap((e) => - e.isDirectory() ? walk(path.join(dir, e.name)) : [path.join(dir, e.name)]) - : []; -const present = (p) => p === "test-cases" || p === "specs" - ? walk(at(p)).some((f) => f.endsWith(".md")) - : fs.existsSync(at(p)); -const mdFiles = walk(changeDir).filter((f) => f.endsWith(".md")); -const strip = (s) => (s ?? "").replace(/`/g, "").trim(); -// Columns: fixed count, the last cell keeps any `|` it contains. -const tableRows = (text, heading, columns) => { - const section = text.split(/^## /m).find((s) => s.startsWith(heading)); - if (!section) return null; - return section.split("\n").filter((l) => /^\|/.test(l)).slice(2).map((l) => { - const parts = l.replace(/^\|/, "").replace(/\|\s*$/, "").split("|"); - return [...parts.slice(0, columns - 1), parts.slice(columns - 1).join("|")].map((c) => c.trim()); - }); -}; - -finishIfMissing(); -const record = read(at("process-record.md")); - -// 1. Unfilled templates. -for (const f of mdFiles) { - if (read(f).includes(" + ## Source and Target -| Mapping | Source (owner) | Target (owner) | Direction | Trigger | +| Mapping | Источник (владелец) | Цель (владелец) | Направление | Trigger | | --- | --- | --- | --- | --- | ## Field Mapping -| Target field | Source field(s) | Transformation | Unit / currency / scale | Nullability | Default | Validation | On failure | +| Поле цели | Поля источника | Преобразование | Единица / валюта / scale | Nullability | Default | Валидация | При ошибке | | --- | --- | --- | --- | --- | --- | --- | --- | ## Invariants - + ## Double-counting and Classification Risks - + ## Transformation Errors diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/design.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/design.md index 0ba5533..091adbf 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/design.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/design.md @@ -1,22 +1,22 @@ # Engineering Design - + ## Inputs - + ## Architecture Drivers - + ## Technical Goals / Non-Goals ## Implementation Impact Map -| Area | Affected | Outcome or N/A reason | +| Область | Затронута | Результат или причина N/A | | --- | --- | --- | | main | | | | frontend | | | @@ -24,8 +24,8 @@ ## Decisions - + ## Components and Responsibilities @@ -33,16 +33,16 @@ ## Contract Implementation - + ## Cross-cutting Implementation ## UI Implementation - + ## Developer Verification Strategy @@ -50,8 +50,8 @@ ## Solution Assessment - + ## Risks / Trade-offs diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/docs-impact.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/docs-impact.md index 715218d..eeeca15 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/docs-impact.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/docs-impact.md @@ -1,12 +1,12 @@ # Documentation Impact - + ## Summary ## Documentation Changes -| Action | Target | Category | Resulting AS-IS | Source | Verification | +| Action | Target | Category | Итоговое AS-IS | Source | Verification | | --- | --- | --- | --- | --- | --- | ## Diagram Promotion diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/failure-model.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/failure-model.md index fb0e81e..3992ace 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/failure-model.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/failure-model.md @@ -1,19 +1,18 @@ # Failure Model - + ## Failure Scenarios -| ID | Boundary / step | Failure | Detection | Required system behavior | Observable result | Requirement | +| ID | Граница / шаг | Отказ | Обнаружение | Требуемое поведение системы | Наблюдаемый результат | Requirement | | --- | --- | --- | --- | --- | --- | --- | ## Timeouts and Retries ## Idempotency and Duplicate Handling - + ## Ordering and Concurrency diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/nfr.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/nfr.md index 586c35b..6d37f60 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/nfr.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/nfr.md @@ -1,14 +1,13 @@ # Non-Functional Requirements - + -| ID | Category | Requirement | Threshold | Measurement / evidence | Rationale / source | +| ID | Категория | Требование | Порог | Измерение / evidence | Обоснование / источник | | --- | --- | --- | --- | --- | --- | ## Constraints Without Thresholds - + ## Open Questions diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/observability.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/observability.md index e328a2f..40ea561 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/observability.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/observability.md @@ -1,11 +1,10 @@ # Observability - + ## Semantic Events -| Event | Trigger | Required attributes | Consumer / purpose | +| Событие | Trigger | Обязательные атрибуты | Потребитель / назначение | | --- | --- | --- | --- | ## Logs, Metrics and Traces @@ -14,11 +13,11 @@ ## SLI and Alert Conditions -| SLI | Definition | Target | Alert condition | +| SLI | Определение | Цель | Условие алерта | | --- | --- | --- | --- | ## Diagnostic Scenarios - + ## Open Questions diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/process-record.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/process-record.md index 28617c4..138a5fb 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/process-record.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/process-record.md @@ -1,17 +1,21 @@ # Process Record -**Mode:** -**Class:** -**Issue:** +**Mode:** +**Class:** +**Issue:** ## Change Profile - + -| Artifact | Selected | Reason | +| Артефакт | Выбран | Причина | | --- | --- | --- | | research | | | | ux-design | | | @@ -26,32 +30,38 @@ ## Gate Log - + -| Gate | Date | Scope | Validation | Findings | Decision | +| Gate | Дата | Scope | Validation | Findings | Decision | | --- | --- | --- | --- | --- | --- | ## Descoped Work - + -| Task | Reason | Gate | +| Task | Причина | Gate | | --- | --- | --- | ## Lab Journal - + -| Stage | Role / subagent | Unique findings | Decisions | Risks found / excluded | Handoff issues | Skills | Cost | Transferable | +| Стадия | Роль / сабагент | Уникальные находки | Решения | Риски найдены / исключены | Проблемы передачи | Skills | Стоимость | Переносимо | | --- | --- | --- | --- | --- | --- | --- | --- | --- | ## Retrospective - + diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/proposal.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/proposal.md index 8dc2c74..099715e 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/proposal.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/proposal.md @@ -1,7 +1,6 @@ # Proposal - + ## Why @@ -23,14 +22,16 @@ ## Success Criteria + + ## Evidence - + ## Assumptions / Dependencies ## Open Decisions - + diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/qa-analysis.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/qa-analysis.md index 3ef55db..32bf794 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/qa-analysis.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/qa-analysis.md @@ -1,20 +1,24 @@ # QA Analysis - + ## Risk Assessment -| Risk | Affected requirements | Likelihood | Impact | Verification depth | +| Риск | Затронутые требования | Вероятность | Ущерб | Глубина проверки | | --- | --- | --- | --- | --- | ## Coverage Matrix - + -| Requirement | Check | Level | Test cases | +| Requirement | Проверка | Уровень | Test cases | | --- | --- | --- | --- | ## Negative and Boundary Focus @@ -30,5 +34,3 @@ ## Regression Impact ## Gaps / Blockers - - diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/research.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/research.md index 0bd7c2d..8e0b3ed 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/research.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/research.md @@ -1,7 +1,7 @@ # Product Research - + ## Problem Statement @@ -11,7 +11,7 @@ ## Existing Solutions and Alternatives -| Option | What it does | Strengths | Weaknesses | Source | +| Вариант | Что делает | Сильные стороны | Слабые стороны | Источник | | --- | --- | --- | --- | --- | ## Evidence & Sources @@ -24,5 +24,5 @@ ## Recommendation - + diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/security-analysis.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/security-analysis.md index 6c39a93..fe789de 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/security-analysis.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/security-analysis.md @@ -1,7 +1,7 @@ # Security Analysis - + ## Scope @@ -11,16 +11,16 @@ ## Threats -| ID | Threat (STRIDE) | Attack scenario | Asset / boundary | Existing control | Likelihood / impact | +| ID | Угроза (STRIDE) | Сценарий атаки | Актив / граница | Существующий контроль | Вероятность / ущерб | | --- | --- | --- | --- | --- | --- | ## Recommended Mitigations -| Threat | Mitigation | Owner artifact (specs / system-analysis / design) | +| Угроза | Mitigation | Артефакт-владелец (specs / system-analysis / design) | | --- | --- | --- | ## Residual Risks ## Validation Requirements - + diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/spec.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/spec.md index b838743..ecaad36 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/spec.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/spec.md @@ -1,18 +1,32 @@ diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/system-analysis.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/system-analysis.md index 0467d0c..5680f63 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/system-analysis.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/system-analysis.md @@ -1,12 +1,11 @@ # System Analysis - + ## Requirement Coverage -| Requirement | Flow / contract | Module | +| Requirement | Flow / контракт | Модуль | | --- | --- | --- | ## System Context and Boundaries @@ -19,32 +18,32 @@ ## Data Ownership -| Data | Source of truth | Writers | Readers | +| Данные | Источник истины | Пишут | Читают | | --- | --- | --- | --- | ## Interaction Flows - + ## Contracts - + -| Contract | Producer → Consumer | File | Compatibility | Published source | +| Контракт | Producer → Consumer | Файл | Совместимость | Опубликованный источник | | --- | --- | --- | --- | --- | ## Error Semantics - + ## Compatibility / Migration ## Detailed Modules - + ## Open Questions diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/tasks.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/tasks.md index 9402737..708b685 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/tasks.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/tasks.md @@ -1,18 +1,24 @@ # Tasks - +Independent Review, QA Verification, Verification. +Пример: +- [ ] 2.1 [backend] Implementation: пропускать операции, чей внешний id уже сохранён + - **Covers:** `portfolio/holdings` — `Итог портфеля не учитывает дубли операций` + - **Source:** design.md Decisions D2; analysis/failure-model.md F3 + - **Verification:** `npm run verify` в backend; повторный импорт fixture оставляет итог 100.00 + - **Depends on:** 1.1 +Плохо: «Verification: проверить, что работает»; Covers с heading, которого нет в specs. --> -## 1. +## 1. ## Docs Impact - + diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/test-cases.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/test-cases.md index 4e8b8ae..e679190 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/test-cases.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/test-cases.md @@ -1,10 +1,10 @@ -# Test Cases — +# Test Cases — - + -### TC- +### TC- - **Verifies:** `capability` — `Requirement heading` / Scenario - **Risk / Priority:** @@ -13,4 +13,4 @@ - **Steps:** 1. - **Expected Results:** -- **Automation Candidate:** +- **Automation Candidate:** diff --git a/openspec/schemas/wealth-ledger-sdd-lab/templates/ux-design.md b/openspec/schemas/wealth-ledger-sdd-lab/templates/ux-design.md index 8dc07de..7142f18 100644 --- a/openspec/schemas/wealth-ledger-sdd-lab/templates/ux-design.md +++ b/openspec/schemas/wealth-ledger-sdd-lab/templates/ux-design.md @@ -1,15 +1,14 @@ # UX Design - + ## User Goals ## User Flows - + ## Information Architecture and Screen Structure @@ -17,7 +16,7 @@ ## UI States -| Screen / region | Loading | Empty | Error | Success | Partial / stale | +| Экран / область | Loading | Empty | Error | Success | Partial / stale | | --- | --- | --- | --- | --- | --- | ## Validation Feedback @@ -26,15 +25,15 @@ ## Accessibility - + ## Design System Reuse ## Materials - + -| Material ID | Relative path / reference | Screen/state and purpose | SHA-256 | +| ID материала | Относительный путь / ссылка | Экран/состояние и назначение | SHA-256 | | --- | --- | --- | --- | ## Open UX Questions