create-quiver 0.15.4 → 0.17.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/.github/pull_request_template.md +17 -0
- package/.github/workflows/ci.yml +76 -0
- package/.markdown-link-check.json +15 -0
- package/.markdownlint.json +11 -0
- package/ARCHITECTURE.md +133 -0
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +174 -9
- package/README.md +17 -2
- package/README_FOR_AI.md +4 -1
- package/ROADMAP.md +4 -0
- package/SECURITY.md +9 -2
- package/docs/AI_CONTEXT.md.es.template +3 -1
- package/docs/AI_CONTEXT.md.template +3 -1
- package/docs/CLI_UX_GUIDE.md +20 -1
- package/docs/COMMANDS.md.template +20 -6
- package/docs/GITFLOW_PR_GUIDE.md +73 -11
- package/docs/GITFLOW_PR_GUIDE.md.es.template +61 -2
- package/docs/GITFLOW_PR_GUIDE.md.template +72 -10
- package/docs/INDEX.md +6 -1
- package/docs/QUICK.md.template +2 -1
- package/docs/STANDARD.md.template +2 -1
- package/docs/WORKFLOW.md.es.template +3 -1
- package/docs/WORKFLOW.md.template +6 -4
- package/docs/getting-started/installation.md +7 -0
- package/docs/reference/commands.md +138 -6
- package/docs/reference/slice-schema.md +37 -0
- package/docs/schema/slice.schema.json +221 -0
- package/docs/specs/01-spec/01-slice/01-slice.json +36 -0
- package/docs/specs/01-spec/01-slice/01-slice.md +106 -0
- package/docs/specs/01-spec/01-slice/CLOSURE_BRIEF.md +80 -0
- package/docs/specs/01-spec/01-slice/EXECUTION_BRIEF.md +39 -0
- package/docs/specs/01-spec/02-slice/02-slice.json +36 -0
- package/docs/specs/01-spec/02-slice/02-slice.md +108 -0
- package/docs/specs/01-spec/02-slice/CLOSURE_BRIEF.md +88 -0
- package/docs/specs/01-spec/02-slice/EXECUTION_BRIEF.md +40 -0
- package/docs/specs/01-spec/03-slice/03-slice.json +36 -0
- package/docs/specs/01-spec/03-slice/03-slice.md +103 -0
- package/docs/specs/01-spec/03-slice/CLOSURE_BRIEF.md +54 -0
- package/docs/specs/01-spec/03-slice/EXECUTION_BRIEF.md +39 -0
- package/docs/specs/01-spec/04-slice/04-slice.json +36 -0
- package/docs/specs/01-spec/04-slice/04-slice.md +107 -0
- package/docs/specs/01-spec/04-slice/CLOSURE_BRIEF.md +46 -0
- package/docs/specs/01-spec/04-slice/EXECUTION_BRIEF.md +39 -0
- package/docs/specs/01-spec/05-slice/05-slice.json +36 -0
- package/docs/specs/01-spec/05-slice/05-slice.md +106 -0
- package/docs/specs/01-spec/05-slice/CLOSURE_BRIEF.md +84 -0
- package/docs/specs/01-spec/05-slice/EXECUTION_BRIEF.md +109 -0
- package/docs/specs/01-spec/06-slice/06-slice.json +36 -0
- package/docs/specs/01-spec/06-slice/06-slice.md +107 -0
- package/docs/specs/01-spec/06-slice/CLOSURE_BRIEF.md +67 -0
- package/docs/specs/01-spec/06-slice/EXECUTION_BRIEF.md +39 -0
- package/docs/specs/01-spec/07-slice/07-slice.json +36 -0
- package/docs/specs/01-spec/07-slice/07-slice.md +105 -0
- package/docs/specs/01-spec/07-slice/CLOSURE_BRIEF.md +71 -0
- package/docs/specs/01-spec/07-slice/EXECUTION_BRIEF.md +39 -0
- package/docs/specs/01-spec/08-slice/08-slice.json +36 -0
- package/docs/specs/01-spec/08-slice/08-slice.md +105 -0
- package/docs/specs/01-spec/08-slice/CLOSURE_BRIEF.md +114 -0
- package/docs/specs/01-spec/08-slice/EXECUTION_BRIEF.md +39 -0
- package/docs/specs/01-spec/CLOSURE_BRIEF.md +87 -0
- package/docs/specs/01-spec/spec.md +197 -0
- package/docs/workflows/full-ai-spec-to-pr.md +46 -3
- package/i18n/es/docs/GITFLOW_PR_GUIDE.md.template +38 -1
- package/package.json +27 -1
- package/scripts/package-quiver.sh +82 -2
- package/scripts/release-quiver.sh +14 -3
- package/specs/[project-name]/slices/pr.md.template +19 -0
- package/specs/quiver-v43-cli-i18n-audit-release-readiness/command-language-mode-matrix.json +122 -1
- package/specs/quiver-v46-deep-project-analysis/EVIDENCE_REPORT.md +94 -0
- package/specs/quiver-v46-deep-project-analysis/EXECUTION_PLAN.md +26 -0
- package/specs/quiver-v46-deep-project-analysis/SPEC.md +157 -0
- package/specs/quiver-v46-deep-project-analysis/STATUS.md +26 -0
- package/specs/quiver-v46-deep-project-analysis/pr.md +131 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-00-analysis-contract-foundation/CLOSURE_BRIEF.md +14 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-00-analysis-contract-foundation/EXECUTION_BRIEF.md +41 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-00-analysis-contract-foundation/slice.json +61 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-01-stack-agnostic-discovery-sampling/CLOSURE_BRIEF.md +22 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-01-stack-agnostic-discovery-sampling/EXECUTION_BRIEF.md +33 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-01-stack-agnostic-discovery-sampling/slice.json +80 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-02-provider-analysis-json-contract/CLOSURE_BRIEF.md +21 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-02-provider-analysis-json-contract/EXECUTION_BRIEF.md +34 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-02-provider-analysis-json-contract/slice.json +79 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-03-doc-proposal-review-safe-writes/CLOSURE_BRIEF.md +19 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-03-doc-proposal-review-safe-writes/EXECUTION_BRIEF.md +33 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-03-doc-proposal-review-safe-writes/slice.json +79 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-04-validation-docs-release-readiness/CLOSURE_BRIEF.md +20 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-04-validation-docs-release-readiness/EXECUTION_BRIEF.md +32 -0
- package/specs/quiver-v46-deep-project-analysis/slices/slice-04-validation-docs-release-readiness/slice.json +85 -0
- package/specs/quiver-v50-audit-trust-foundation/EVIDENCE_REPORT.md +151 -0
- package/specs/quiver-v50-audit-trust-foundation/EXECUTION_PLAN.md +34 -0
- package/specs/quiver-v50-audit-trust-foundation/SPEC.md +113 -0
- package/specs/quiver-v50-audit-trust-foundation/STATUS.md +26 -0
- package/specs/quiver-v50-audit-trust-foundation/pr.md +120 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-00-audit-baseline-and-resolved-findings/CLOSURE_BRIEF.md +20 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-00-audit-baseline-and-resolved-findings/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-00-audit-baseline-and-resolved-findings/slice.json +57 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-01-runtime-minimum-and-package-metadata/CLOSURE_BRIEF.md +24 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-01-runtime-minimum-and-package-metadata/EXECUTION_BRIEF.md +67 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-01-runtime-minimum-and-package-metadata/slice.json +71 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-02-migrate-write-safety-contract/CLOSURE_BRIEF.md +24 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-02-migrate-write-safety-contract/EXECUTION_BRIEF.md +71 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-02-migrate-write-safety-contract/slice.json +81 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-03-security-reporting-channel/CLOSURE_BRIEF.md +22 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-03-security-reporting-channel/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-03-security-reporting-channel/slice.json +56 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-04-user-facing-i18n-error-coverage/CLOSURE_BRIEF.md +23 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-04-user-facing-i18n-error-coverage/EXECUTION_BRIEF.md +68 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-04-user-facing-i18n-error-coverage/slice.json +84 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-05-init-analyze-progress-and-summaries/CLOSURE_BRIEF.md +25 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-05-init-analyze-progress-and-summaries/EXECUTION_BRIEF.md +73 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-05-init-analyze-progress-and-summaries/slice.json +72 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-06-contributor-and-architecture-docs/CLOSURE_BRIEF.md +22 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-06-contributor-and-architecture-docs/EXECUTION_BRIEF.md +66 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-06-contributor-and-architecture-docs/slice.json +74 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-07-ci-and-documentation-lint-baseline/CLOSURE_BRIEF.md +29 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-07-ci-and-documentation-lint-baseline/EXECUTION_BRIEF.md +74 -0
- package/specs/quiver-v50-audit-trust-foundation/slices/slice-07-ci-and-documentation-lint-baseline/slice.json +81 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/EVIDENCE_REPORT.md +145 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/EXECUTION_PLAN.md +32 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/SPEC.md +109 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/STATUS.md +25 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/pr.md +69 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-00-cli-contract-baseline/CLOSURE_BRIEF.md +20 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-00-cli-contract-baseline/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-00-cli-contract-baseline/slice.json +56 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-01-flow-json-compatibility/CLOSURE_BRIEF.md +21 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-01-flow-json-compatibility/EXECUTION_BRIEF.md +61 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-01-flow-json-compatibility/slice.json +68 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-02-dashboard-section-validation-i18n/CLOSURE_BRIEF.md +25 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-02-dashboard-section-validation-i18n/EXECUTION_BRIEF.md +65 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-02-dashboard-section-validation-i18n/pr.md +134 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-02-dashboard-section-validation-i18n/slice.json +80 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-03-base-branch-resolution-policy/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-03-base-branch-resolution-policy/EXECUTION_BRIEF.md +80 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-03-base-branch-resolution-policy/pr.md +159 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-03-base-branch-resolution-policy/slice.json +102 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-04-next-plan-graph-ux-edge-cases/CLOSURE_BRIEF.md +25 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-04-next-plan-graph-ux-edge-cases/EXECUTION_BRIEF.md +74 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-04-next-plan-graph-ux-edge-cases/pr.md +147 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-04-next-plan-graph-ux-edge-cases/slice.json +91 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-05-evidence-robustness-path-safety/CLOSURE_BRIEF.md +28 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-05-evidence-robustness-path-safety/EXECUTION_BRIEF.md +73 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-05-evidence-robustness-path-safety/pr.md +146 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-05-evidence-robustness-path-safety/slice.json +100 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-06-namespace-compatibility-windows-scripts/CLOSURE_BRIEF.md +36 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-06-namespace-compatibility-windows-scripts/EXECUTION_BRIEF.md +76 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-06-namespace-compatibility-windows-scripts/pr.md +155 -0
- package/specs/quiver-v51-cli-ergonomics-automation-contracts/slices/slice-06-namespace-compatibility-windows-scripts/slice.json +111 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/EVIDENCE_REPORT.md +95 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/EXECUTION_PLAN.md +31 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/SPEC.md +107 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/STATUS.md +22 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/pr.md +69 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-00-schema-docs-release-baseline/CLOSURE_BRIEF.md +21 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-00-schema-docs-release-baseline/EXECUTION_BRIEF.md +60 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-00-schema-docs-release-baseline/slice.json +62 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-01-json-schema-for-slice-json/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-01-json-schema-for-slice-json/EXECUTION_BRIEF.md +71 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-01-json-schema-for-slice-json/pr.md +146 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-01-json-schema-for-slice-json/slice.json +106 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-02-generated-cli-reference/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-02-generated-cli-reference/EXECUTION_BRIEF.md +67 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-02-generated-cli-reference/pr.md +144 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-02-generated-cli-reference/slice.json +86 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-03-changelog-package-release-smoke-hygiene/CLOSURE_BRIEF.md +38 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-03-changelog-package-release-smoke-hygiene/EXECUTION_BRIEF.md +75 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-03-changelog-package-release-smoke-hygiene/pr.md +159 -0
- package/specs/quiver-v52-schema-docs-release-hygiene/slices/slice-03-changelog-package-release-smoke-hygiene/slice.json +105 -0
- package/src/create-quiver/commands/ai.js +521 -0
- package/src/create-quiver/commands/changelog.js +93 -0
- package/src/create-quiver/commands/config.js +16 -5
- package/src/create-quiver/commands/evidence.js +33 -2
- package/src/create-quiver/commands/flow.js +1 -0
- package/src/create-quiver/commands/graph.js +8 -2
- package/src/create-quiver/commands/plan.js +6 -0
- package/src/create-quiver/commands/spec.js +28 -13
- package/src/create-quiver/index.js +408 -98
- package/src/create-quiver/lib/ai/analyze-project-discovery.js +387 -0
- package/src/create-quiver/lib/ai/analyze-project-docs.js +364 -0
- package/src/create-quiver/lib/ai/analyze-project-parser.js +277 -0
- package/src/create-quiver/lib/ai/analyze-project-prompts.js +214 -0
- package/src/create-quiver/lib/ai/analyze-project-review.js +99 -0
- package/src/create-quiver/lib/ai/analyze-project-sampling.js +402 -0
- package/src/create-quiver/lib/ai/analyze-project-schema.js +92 -0
- package/src/create-quiver/lib/ai/analyze-project-validation.js +309 -0
- package/src/create-quiver/lib/ai/artifacts.js +4 -1
- package/src/create-quiver/lib/ai/github.js +5 -2
- package/src/create-quiver/lib/ai/spec-templates.js +19 -0
- package/src/create-quiver/lib/cli/command-registry.js +72 -0
- package/src/create-quiver/lib/cli/parser.js +14 -0
- package/src/create-quiver/lib/evidence.js +161 -6
- package/src/create-quiver/lib/git.js +99 -0
- package/src/create-quiver/lib/i18n/messages/en.js +52 -7
- package/src/create-quiver/lib/i18n/messages/es.js +54 -9
- package/src/create-quiver/lib/init-docs.js +1 -1
- package/src/create-quiver/lib/init-layout.js +9 -8
- package/src/create-quiver/lib/lifecycle.js +24 -26
- package/src/create-quiver/lib/readiness.js +67 -56
- package/src/create-quiver/lib/spec-worktrees.js +16 -34
|
@@ -10,6 +10,7 @@ const {
|
|
|
10
10
|
writeGlobalLanguageConfig,
|
|
11
11
|
writeProjectLanguageConfig,
|
|
12
12
|
} = require('../lib/i18n/language');
|
|
13
|
+
const { createTranslator } = require('../lib/i18n/catalog');
|
|
13
14
|
|
|
14
15
|
function formatError(message) {
|
|
15
16
|
return `create-quiver: ${message}`;
|
|
@@ -29,10 +30,14 @@ function formatProjectRelativePath(repoRoot, filePath) {
|
|
|
29
30
|
return path.relative(repoRoot, filePath).split(path.sep).join('/') || '.';
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
function validateLanguageForSet(language) {
|
|
33
|
+
function validateLanguageForSet(language, translator = createTranslator()) {
|
|
33
34
|
const normalized = normalizeLanguage(language);
|
|
34
35
|
if (!normalized || normalized !== String(language || '').trim().toLowerCase()) {
|
|
35
|
-
throw new Error(formatError(
|
|
36
|
+
throw new Error(formatError(translator.t('config.error.unsupported_language', {
|
|
37
|
+
fallback: DEFAULT_LANGUAGE,
|
|
38
|
+
language: language || '<missing>',
|
|
39
|
+
supported: SUPPORTED_LANGUAGES.join(', '),
|
|
40
|
+
})));
|
|
36
41
|
}
|
|
37
42
|
return normalized;
|
|
38
43
|
}
|
|
@@ -69,7 +74,8 @@ function runLanguageShow(repoRoot, options = {}) {
|
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
function runLanguageSet(repoRoot, options = {}) {
|
|
72
|
-
const
|
|
77
|
+
const translator = createTranslator(options.language);
|
|
78
|
+
const language = validateLanguageForSet(options.value, translator);
|
|
73
79
|
const global = options.global === true;
|
|
74
80
|
const configPath = global ? globalLanguageConfigPath() : projectLanguageConfigPath(repoRoot);
|
|
75
81
|
|
|
@@ -102,8 +108,11 @@ function runLanguageSet(repoRoot, options = {}) {
|
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
function runConfig(repoRoot, options = {}) {
|
|
111
|
+
const translator = createTranslator(options.language);
|
|
105
112
|
if (options.section !== 'language') {
|
|
106
|
-
throw new Error(formatError(
|
|
113
|
+
throw new Error(formatError(translator.t('config.error.unsupported_section', {
|
|
114
|
+
section: options.section || '(missing)',
|
|
115
|
+
})));
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
if (options.command === 'show') {
|
|
@@ -116,7 +125,9 @@ function runConfig(repoRoot, options = {}) {
|
|
|
116
125
|
return;
|
|
117
126
|
}
|
|
118
127
|
|
|
119
|
-
throw new Error(formatError(
|
|
128
|
+
throw new Error(formatError(translator.t('config.error.unsupported_language_command', {
|
|
129
|
+
command: options.command || '(missing)',
|
|
130
|
+
})));
|
|
120
131
|
}
|
|
121
132
|
|
|
122
133
|
module.exports = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const { runEvidenceCommand } = require('../lib/evidence');
|
|
2
|
+
const { listEvidenceFiles, runEvidenceCommand, showEvidenceFile } = require('../lib/evidence');
|
|
3
3
|
const { createTranslator } = require('../lib/i18n/catalog');
|
|
4
4
|
|
|
5
5
|
function formatOutputPath(repoRoot, outputPath) {
|
|
@@ -14,11 +14,42 @@ function formatOutputPath(repoRoot, outputPath) {
|
|
|
14
14
|
function runEvidence(repoRoot, options = {}) {
|
|
15
15
|
const translator = createTranslator(options.language);
|
|
16
16
|
const command = options.command || '';
|
|
17
|
+
if (options.subcommand === 'list') {
|
|
18
|
+
const evidence = listEvidenceFiles(repoRoot);
|
|
19
|
+
if (options.json) {
|
|
20
|
+
process.stdout.write(`${JSON.stringify({ evidence }, null, 2)}\n`);
|
|
21
|
+
return { evidence, exitCode: 0 };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log(translator.t('evidence.list.title'));
|
|
25
|
+
if (evidence.length === 0) {
|
|
26
|
+
console.log(translator.t('evidence.list.empty'));
|
|
27
|
+
return { evidence, exitCode: 0 };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (const item of evidence) {
|
|
31
|
+
console.log(`- ${item.path} (${translator.t('evidence.exit_code', { code: item.exit_code ?? '-' })})`);
|
|
32
|
+
}
|
|
33
|
+
return { evidence, exitCode: 0 };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (options.subcommand === 'show') {
|
|
37
|
+
const evidence = showEvidenceFile(repoRoot, options.target);
|
|
38
|
+
if (options.json) {
|
|
39
|
+
process.stdout.write(`${JSON.stringify(evidence, null, 2)}\n`);
|
|
40
|
+
return { evidence, exitCode: 0 };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
process.stdout.write(evidence.content);
|
|
44
|
+
return { evidence, exitCode: 0 };
|
|
45
|
+
}
|
|
46
|
+
|
|
17
47
|
if (options.subcommand !== 'run') {
|
|
18
|
-
throw new Error(
|
|
48
|
+
throw new Error(`create-quiver: ${translator.t('evidence.error.missing_subcommand')}`);
|
|
19
49
|
}
|
|
20
50
|
|
|
21
51
|
const result = runEvidenceCommand(repoRoot, command, {
|
|
52
|
+
missingCommandMessage: `create-quiver: ${translator.t('evidence.error.missing_command')}`,
|
|
22
53
|
maxOutput: options.maxOutput,
|
|
23
54
|
outputPath: options.output,
|
|
24
55
|
spawnSync: options.spawnSync,
|
|
@@ -3,6 +3,7 @@ const { computeLevels, detectFileConflicts } = require('../lib/slice-graph');
|
|
|
3
3
|
const { renderDotGraph } = require('../lib/renderers/dot');
|
|
4
4
|
const { renderMermaidGraph } = require('../lib/renderers/mermaid');
|
|
5
5
|
const { renderTreeGraph, isUnicodeEnabled } = require('../lib/renderers/tree');
|
|
6
|
+
const { createTranslator } = require('../lib/i18n/catalog');
|
|
6
7
|
|
|
7
8
|
function toGraphNode(node) {
|
|
8
9
|
return {
|
|
@@ -69,7 +70,11 @@ function collectGraph(repoRoot, options = {}) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
function formatHumanGraph(report, options = {}) {
|
|
73
|
+
const translator = createTranslator(options.language);
|
|
72
74
|
const format = options.format || 'tree';
|
|
75
|
+
if (format === 'tree' && typeof options.level === 'number' && (!Array.isArray(report.levels) || report.levels.length === 0)) {
|
|
76
|
+
return `${translator.t('graph.empty.level', { level: options.level })}\n`;
|
|
77
|
+
}
|
|
73
78
|
const sharedOptions = {
|
|
74
79
|
showConflicts: options.showConflicts === true,
|
|
75
80
|
language: options.language,
|
|
@@ -88,12 +93,13 @@ function formatHumanGraph(report, options = {}) {
|
|
|
88
93
|
return renderDotGraph(report, sharedOptions);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
throw new Error(`create-quiver:
|
|
96
|
+
throw new Error(`create-quiver: ${translator.t('graph.error.unsupported_format', { format })}`);
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
function runGraph(repoRoot, options = {}) {
|
|
100
|
+
const translator = createTranslator(options.language);
|
|
95
101
|
if (options.format && !['tree', 'mermaid', 'dot'].includes(options.format)) {
|
|
96
|
-
throw new Error(`create-quiver:
|
|
102
|
+
throw new Error(`create-quiver: ${translator.t('graph.error.unsupported_format', { format: options.format })}`);
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
const report = collectGraph(repoRoot, options);
|
|
@@ -195,6 +195,12 @@ function formatHumanPlan(report, options = {}) {
|
|
|
195
195
|
lines.push(row.map((value, index) => value.padEnd(widths[index])).join(' '));
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
const missingEstimateCount = report.plan.filter((item) => Number(item.hours) <= 0).length;
|
|
199
|
+
if (missingEstimateCount > 0) {
|
|
200
|
+
lines.push('');
|
|
201
|
+
lines.push(translator.t('plan.missing_estimates_note', { count: missingEstimateCount }));
|
|
202
|
+
}
|
|
203
|
+
|
|
198
204
|
return `${lines.join('\n')}\n`;
|
|
199
205
|
}
|
|
200
206
|
|
|
@@ -24,18 +24,22 @@ function toRelativePosix(root, filePath) {
|
|
|
24
24
|
return path.relative(root, filePath).split(path.sep).join('/');
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function readInputText(repoRoot, inputPath) {
|
|
27
|
+
function readInputText(repoRoot, inputPath, options = {}) {
|
|
28
|
+
const translator = createTranslator(options.language);
|
|
28
29
|
const resolved = path.resolve(repoRoot, inputPath || '');
|
|
29
30
|
if (!inputPath || !fs.existsSync(resolved)) {
|
|
30
|
-
throw new Error(formatError(
|
|
31
|
+
throw new Error(formatError(translator.t('spec.error.missing_approved_plan_input', {
|
|
32
|
+
path: inputPath || '<default>',
|
|
33
|
+
})));
|
|
31
34
|
}
|
|
32
35
|
return fs.readFileSync(resolved, 'utf8');
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
function resolveSpecDir(repoRoot, specInput) {
|
|
38
|
+
function resolveSpecDir(repoRoot, specInput, options = {}) {
|
|
39
|
+
const translator = createTranslator(options.language);
|
|
36
40
|
const value = String(specInput || '').trim();
|
|
37
41
|
if (!value) {
|
|
38
|
-
throw new Error(formatError('
|
|
42
|
+
throw new Error(formatError(translator.t('spec.error.missing_directory_validate')));
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
const candidates = [
|
|
@@ -51,7 +55,7 @@ function resolveSpecDir(repoRoot, specInput) {
|
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
throw new Error(formatError(
|
|
58
|
+
throw new Error(formatError(translator.t('spec.error.directory_not_found', { path: value })));
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
function findSliceJsonFiles(specDir) {
|
|
@@ -142,7 +146,7 @@ function missingGitFields(git) {
|
|
|
142
146
|
|
|
143
147
|
function buildSpecValidationReport(repoRoot, specInput, options = {}) {
|
|
144
148
|
const strict = options.strict === true;
|
|
145
|
-
const specDir = resolveSpecDir(repoRoot, specInput);
|
|
149
|
+
const specDir = resolveSpecDir(repoRoot, specInput, options);
|
|
146
150
|
const relativeSpecDir = toRelativePosix(repoRoot, specDir);
|
|
147
151
|
const specSlug = path.basename(specDir);
|
|
148
152
|
const errors = [];
|
|
@@ -310,7 +314,10 @@ function runValidateSpec(repoRoot, specInput, options = {}) {
|
|
|
310
314
|
process.stdout.write(formatSpecValidationReport(report, options));
|
|
311
315
|
|
|
312
316
|
if (!report.ok) {
|
|
313
|
-
const
|
|
317
|
+
const translator = createTranslator(options.language);
|
|
318
|
+
const error = new Error(formatError(translator.t('spec.error.validate_failed', {
|
|
319
|
+
path: report.specDir,
|
|
320
|
+
})));
|
|
314
321
|
error.code = 'SPEC_VALIDATE_FAILED';
|
|
315
322
|
error.details = report;
|
|
316
323
|
throw error;
|
|
@@ -322,7 +329,7 @@ function runValidateSpec(repoRoot, specInput, options = {}) {
|
|
|
322
329
|
function buildSpecCreatePreview(repoRoot, options = {}) {
|
|
323
330
|
const resolved = resolveReviewedTechnicalPlanInput(repoRoot, options.input || undefined);
|
|
324
331
|
const inputPath = resolved.inputPath;
|
|
325
|
-
const inputText = readInputText(repoRoot, inputPath);
|
|
332
|
+
const inputText = readInputText(repoRoot, inputPath, options);
|
|
326
333
|
const manifest = buildSpecGenerationManifest({
|
|
327
334
|
inputPath,
|
|
328
335
|
inputText,
|
|
@@ -333,7 +340,9 @@ function buildSpecCreatePreview(repoRoot, options = {}) {
|
|
|
333
340
|
const relativeSpecDir = toRelativePosix(repoRoot, preview.specDir);
|
|
334
341
|
|
|
335
342
|
if (fs.existsSync(preview.specDir)) {
|
|
336
|
-
throw new Error(formatError(
|
|
343
|
+
throw new Error(formatError(createTranslator(options.language).t('spec.error.directory_already_exists', {
|
|
344
|
+
path: relativeSpecDir,
|
|
345
|
+
})));
|
|
337
346
|
}
|
|
338
347
|
|
|
339
348
|
return {
|
|
@@ -433,7 +442,7 @@ async function resolveInteractiveSpecCreateOptions(repoRoot, preview, options =
|
|
|
433
442
|
});
|
|
434
443
|
|
|
435
444
|
if (!ux.mode.usePrompts) {
|
|
436
|
-
throw new Error(formatError('
|
|
445
|
+
throw new Error(formatError(translator.t('spec_create.error.interactive_tty_required')));
|
|
437
446
|
}
|
|
438
447
|
|
|
439
448
|
const selectorOptions = {
|
|
@@ -528,7 +537,7 @@ async function confirmSpecCreate(message, options = {}) {
|
|
|
528
537
|
});
|
|
529
538
|
const confirmed = await ux.promptConfirm(message, { initialValue: false });
|
|
530
539
|
if (!confirmed) {
|
|
531
|
-
throw new Error(formatError('
|
|
540
|
+
throw new Error(formatError(createTranslator(options.language).t('spec_create.error.approval_declined')));
|
|
532
541
|
}
|
|
533
542
|
}
|
|
534
543
|
|
|
@@ -542,7 +551,9 @@ async function reviewSpecCreatePreview(repoRoot, preview, options = {}) {
|
|
|
542
551
|
const canOpenEditor = hasEditorRunner || options.stdinIsTTY === true || (options.stdinIsTTY !== false && Boolean(process.stdin.isTTY));
|
|
543
552
|
|
|
544
553
|
if (!canOpenEditor) {
|
|
545
|
-
throw new Error(formatError(
|
|
554
|
+
throw new Error(formatError(createTranslator(options.language).t('spec_create.error.review_tty_required', {
|
|
555
|
+
path: reviewPath,
|
|
556
|
+
})));
|
|
546
557
|
}
|
|
547
558
|
|
|
548
559
|
const editorResult = hasEditorRunner
|
|
@@ -550,7 +561,11 @@ async function reviewSpecCreatePreview(repoRoot, preview, options = {}) {
|
|
|
550
561
|
: openEditor(reviewPath, { cwd: repoRoot, env: options.env || process.env });
|
|
551
562
|
|
|
552
563
|
if (!editorResult || editorResult.ok !== true) {
|
|
553
|
-
|
|
564
|
+
const translator = createTranslator(options.language);
|
|
565
|
+
throw new Error(formatError(translator.t('spec_create.error.review_canceled', {
|
|
566
|
+
path: reviewPath,
|
|
567
|
+
reason: editorResult?.reason || translator.t('spec_create.error.review_canceled.default_reason'),
|
|
568
|
+
})));
|
|
554
569
|
}
|
|
555
570
|
|
|
556
571
|
return reviewPath;
|