create-quiver 0.17.1 → 0.17.3
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/ACTIVE_SLICES.md +43 -0
- package/CHANGELOG.md +8 -0
- package/auditoria-ux-ui-performance-documentacion.md +705 -0
- package/copys-landing-page.md +244 -0
- package/docs/CLI_UX_GUIDE.md +13 -3
- package/docs/TROUBLESHOOTING.md +94 -0
- package/docs/reference/commands.md +68 -4
- package/docs/workflows/existing-project-ai-quiver-setup.md +552 -0
- package/docs/workflows/existing-project.md +36 -0
- package/package.json +1 -1
- package/specs/quiver-v43-cli-i18n-audit-release-readiness/command-language-mode-matrix.json +5 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/EVIDENCE_REPORT.md +151 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/EXECUTION_PLAN.md +50 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/SPEC.md +207 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/STATUS.md +32 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/pr.md +73 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-00-analysis-run-contract/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-00-analysis-run-contract/EXECUTION_BRIEF.md +63 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-00-analysis-run-contract/slice.json +70 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-01-provider-fixture-harness/CLOSURE_BRIEF.md +38 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-01-provider-fixture-harness/EXECUTION_BRIEF.md +60 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-01-provider-fixture-harness/slice.json +74 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-02-safe-context-boundary/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-02-safe-context-boundary/EXECUTION_BRIEF.md +68 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-02-safe-context-boundary/slice.json +85 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-03-schema-error-grouping/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-03-schema-error-grouping/EXECUTION_BRIEF.md +65 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-03-schema-error-grouping/slice.json +80 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-04-safe-repair-layer/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-04-safe-repair-layer/EXECUTION_BRIEF.md +63 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-04-safe-repair-layer/slice.json +80 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-05-controlled-retry-layer/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-05-controlled-retry-layer/EXECUTION_BRIEF.md +65 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-05-controlled-retry-layer/slice.json +81 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-06-audit-review-transaction/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-06-audit-review-transaction/EXECUTION_BRIEF.md +71 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-06-audit-review-transaction/slice.json +88 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-07-semantic-validation-docs/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-07-semantic-validation-docs/EXECUTION_BRIEF.md +66 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-07-semantic-validation-docs/slice.json +86 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-08-structural-map-hardening/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-08-structural-map-hardening/EXECUTION_BRIEF.md +67 -0
- package/specs/quiver-v53-reliable-deep-project-analysis/slices/slice-08-structural-map-hardening/slice.json +81 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/EVIDENCE_REPORT.md +53 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/EXECUTION_PLAN.md +55 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/SPEC.md +184 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/STATUS.md +34 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-01-contract-regression-harness/CLOSURE_BRIEF.md +10 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-01-contract-regression-harness/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-01-contract-regression-harness/slice.json +72 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-02-safe-discovery-sampling/CLOSURE_BRIEF.md +11 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-02-safe-discovery-sampling/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-02-safe-discovery-sampling/slice.json +69 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-03-run-lifecycle-cli-io/CLOSURE_BRIEF.md +10 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-03-run-lifecycle-cli-io/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-03-run-lifecycle-cli-io/slice.json +69 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-04-artifact-store-redaction/CLOSURE_BRIEF.md +10 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-04-artifact-store-redaction/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-04-artifact-store-redaction/slice.json +73 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-05-path-aware-repair-engine/CLOSURE_BRIEF.md +10 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-05-path-aware-repair-engine/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-05-path-aware-repair-engine/slice.json +72 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-06-retry-controller/CLOSURE_BRIEF.md +9 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-06-retry-controller/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-06-retry-controller/slice.json +70 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-07-final-validation-review-write-gate/CLOSURE_BRIEF.md +10 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-07-final-validation-review-write-gate/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-07-final-validation-review-write-gate/slice.json +75 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-08-doctor-agents-guidance/CLOSURE_BRIEF.md +9 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-08-doctor-agents-guidance/EXECUTION_BRIEF.md +51 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-08-doctor-agents-guidance/slice.json +66 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-09-release-smoke-rollback-docs/CLOSURE_BRIEF.md +10 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-09-release-smoke-rollback-docs/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v54-deep-project-analysis-hardening/slices/slice-09-release-smoke-rollback-docs/slice.json +69 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/EVIDENCE_REPORT.md +209 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/EXECUTION_PLAN.md +49 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/SPEC.md +276 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/STATUS.md +29 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/CLOSURE_BRIEF.md +47 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/EXECUTION_BRIEF.md +67 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/pr.md +129 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/slice.json +82 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/CLOSURE_BRIEF.md +39 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/EXECUTION_BRIEF.md +61 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/pr.md +116 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/slice.json +69 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/CLOSURE_BRIEF.md +36 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/EXECUTION_BRIEF.md +62 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/pr.md +132 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/slice.json +76 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/CLOSURE_BRIEF.md +47 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/EXECUTION_BRIEF.md +70 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/pr.md +141 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/slice.json +72 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/CLOSURE_BRIEF.md +42 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/EXECUTION_BRIEF.md +61 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/pr.md +129 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/slice.json +67 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/CLOSURE_BRIEF.md +38 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/EXECUTION_BRIEF.md +64 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/pr.md +123 -0
- package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/slice.json +76 -0
- package/src/create-quiver/commands/ai.js +989 -136
- package/src/create-quiver/index.js +83 -1
- package/src/create-quiver/lib/ai/analyze-project-apply.js +269 -0
- package/src/create-quiver/lib/ai/analyze-project-discovery.js +213 -2
- package/src/create-quiver/lib/ai/analyze-project-docs.js +3 -1
- package/src/create-quiver/lib/ai/analyze-project-interactive.js +241 -0
- package/src/create-quiver/lib/ai/analyze-project-parser.js +1 -0
- package/src/create-quiver/lib/ai/analyze-project-prompts.js +130 -0
- package/src/create-quiver/lib/ai/analyze-project-proposal.js +582 -0
- package/src/create-quiver/lib/ai/analyze-project-repair.js +402 -0
- package/src/create-quiver/lib/ai/analyze-project-sampling.js +31 -4
- package/src/create-quiver/lib/ai/analyze-project-validation.js +178 -8
- package/src/create-quiver/lib/ai/artifacts.js +83 -2
- package/src/create-quiver/lib/cli/ux-flags.js +6 -0
- package/src/create-quiver/lib/doctor.js +107 -12
- package/src/create-quiver/lib/i18n/messages/en.js +33 -0
- package/src/create-quiver/lib/i18n/messages/es.js +34 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const fs = require('node:fs');
|
|
2
|
+
const crypto = require('node:crypto');
|
|
2
3
|
const os = require('node:os');
|
|
3
4
|
const path = require('node:path');
|
|
4
5
|
|
|
@@ -7,6 +8,7 @@ const { quiverInternalPaths } = require('../init-layout');
|
|
|
7
8
|
|
|
8
9
|
const RAW_ARTIFACT_SCHEMA_VERSION = 1;
|
|
9
10
|
const DEFAULT_MAX_PROVIDER_PROMPT_BYTES = 1024 * 1024;
|
|
11
|
+
const DEFAULT_MAX_RAW_PROVIDER_STREAM_BYTES = 64 * 1024;
|
|
10
12
|
const DEFAULT_MAX_REVISION_INPUT_BYTES = 400 * 1024;
|
|
11
13
|
const DEFAULT_COMPACTED_REVISION_INPUT_BYTES = 120 * 1024;
|
|
12
14
|
|
|
@@ -74,6 +76,71 @@ function normalizePositiveInteger(value, fallback) {
|
|
|
74
76
|
return Math.floor(parsed);
|
|
75
77
|
}
|
|
76
78
|
|
|
79
|
+
function sha256(value) {
|
|
80
|
+
return crypto.createHash('sha256').update(String(value || ''), 'utf8').digest('hex');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function sliceStartToByteLimit(text, maxBytes) {
|
|
84
|
+
let value = String(text || '');
|
|
85
|
+
while (byteLength(value) > maxBytes && value.length > 0) {
|
|
86
|
+
value = value.slice(0, Math.max(0, value.length - Math.ceil((byteLength(value) - maxBytes) / 2) - 8));
|
|
87
|
+
}
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function sliceEndToByteLimit(text, maxBytes) {
|
|
92
|
+
let value = String(text || '');
|
|
93
|
+
while (byteLength(value) > maxBytes && value.length > 0) {
|
|
94
|
+
value = value.slice(Math.min(value.length, Math.ceil((byteLength(value) - maxBytes) / 2) + 8));
|
|
95
|
+
}
|
|
96
|
+
return value;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function limitRawProviderStream(text, options = {}) {
|
|
100
|
+
const maxBytes = normalizePositiveInteger(
|
|
101
|
+
options.maxBytes ?? process.env.QUIVER_AI_MAX_RAW_PROVIDER_STREAM_BYTES,
|
|
102
|
+
DEFAULT_MAX_RAW_PROVIDER_STREAM_BYTES,
|
|
103
|
+
);
|
|
104
|
+
const value = normalizeText(text);
|
|
105
|
+
const originalBytes = byteLength(value);
|
|
106
|
+
const digest = sha256(value);
|
|
107
|
+
|
|
108
|
+
if (originalBytes <= maxBytes) {
|
|
109
|
+
return {
|
|
110
|
+
text: value,
|
|
111
|
+
metadata: {
|
|
112
|
+
bytes: originalBytes,
|
|
113
|
+
stored_bytes: originalBytes,
|
|
114
|
+
max_bytes: maxBytes,
|
|
115
|
+
truncated: false,
|
|
116
|
+
sha256: digest,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const marker = `\n[... Quiver truncated provider stream; original_bytes=${originalBytes}; sha256=${digest} ...]\n`;
|
|
122
|
+
const markerBytes = byteLength(marker);
|
|
123
|
+
const contentBudget = Math.max(0, maxBytes - markerBytes);
|
|
124
|
+
const headBudget = Math.floor(contentBudget * 0.6);
|
|
125
|
+
const tailBudget = contentBudget - headBudget;
|
|
126
|
+
const head = sliceStartToByteLimit(value, headBudget);
|
|
127
|
+
const tail = sliceEndToByteLimit(value, tailBudget);
|
|
128
|
+
const stored = `${head}${marker}${tail}`;
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
text: stored,
|
|
132
|
+
metadata: {
|
|
133
|
+
bytes: originalBytes,
|
|
134
|
+
stored_bytes: byteLength(stored),
|
|
135
|
+
max_bytes: maxBytes,
|
|
136
|
+
truncated: true,
|
|
137
|
+
sha256: digest,
|
|
138
|
+
head_bytes: byteLength(head),
|
|
139
|
+
tail_bytes: byteLength(tail),
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
77
144
|
function resolveAiArtifactLimits(options = {}) {
|
|
78
145
|
return {
|
|
79
146
|
maxProviderPromptBytes: normalizePositiveInteger(
|
|
@@ -185,6 +252,14 @@ function writeRawProviderArtifact(projectRoot, runId, scope, result, options = {
|
|
|
185
252
|
command: result.error.command || null,
|
|
186
253
|
}
|
|
187
254
|
: null;
|
|
255
|
+
const stdout = limitRawProviderStream(
|
|
256
|
+
redactSensitiveLocalValues(result?.stdout || '', { projectRoot }),
|
|
257
|
+
{ maxBytes: options.maxRawProviderStreamBytes },
|
|
258
|
+
);
|
|
259
|
+
const stderr = limitRawProviderStream(
|
|
260
|
+
redactSensitiveLocalValues(result?.stderr || '', { projectRoot }),
|
|
261
|
+
{ maxBytes: options.maxRawProviderStreamBytes },
|
|
262
|
+
);
|
|
188
263
|
const artifact = {
|
|
189
264
|
schema_version: RAW_ARTIFACT_SCHEMA_VERSION,
|
|
190
265
|
kind: 'provider-output',
|
|
@@ -200,8 +275,12 @@ function writeRawProviderArtifact(projectRoot, runId, scope, result, options = {
|
|
|
200
275
|
signal: result?.signal || null,
|
|
201
276
|
timeout_ms: typeof result?.timeoutMs === 'number' ? result.timeoutMs : null,
|
|
202
277
|
prompt_transport: result?.promptTransport || null,
|
|
203
|
-
stdout:
|
|
204
|
-
stderr:
|
|
278
|
+
stdout: stdout.text,
|
|
279
|
+
stderr: stderr.text,
|
|
280
|
+
streams: {
|
|
281
|
+
stdout: stdout.metadata,
|
|
282
|
+
stderr: stderr.metadata,
|
|
283
|
+
},
|
|
205
284
|
error: serializedError ? JSON.parse(redactSensitiveLocalValues(JSON.stringify(serializedError), { projectRoot })) : null,
|
|
206
285
|
metadata: options.metadata || {},
|
|
207
286
|
};
|
|
@@ -309,12 +388,14 @@ function assertProviderPromptWithinLimit(prompt, options = {}) {
|
|
|
309
388
|
module.exports = {
|
|
310
389
|
DEFAULT_COMPACTED_REVISION_INPUT_BYTES,
|
|
311
390
|
DEFAULT_MAX_PROVIDER_PROMPT_BYTES,
|
|
391
|
+
DEFAULT_MAX_RAW_PROVIDER_STREAM_BYTES,
|
|
312
392
|
DEFAULT_MAX_REVISION_INPUT_BYTES,
|
|
313
393
|
RAW_ARTIFACT_SCHEMA_VERSION,
|
|
314
394
|
assertProviderPromptWithinLimit,
|
|
315
395
|
byteLength,
|
|
316
396
|
compactRevisionInput,
|
|
317
397
|
extractCleanProviderOutput,
|
|
398
|
+
limitRawProviderStream,
|
|
318
399
|
redactSensitiveLocalValues,
|
|
319
400
|
resolveAiArtifactLimits,
|
|
320
401
|
writeRawProviderArtifact,
|
|
@@ -17,6 +17,12 @@ const UX_FLAG_MATRIX = Object.freeze({
|
|
|
17
17
|
review: true,
|
|
18
18
|
note: 'planner-assisted docs-only context preparation',
|
|
19
19
|
}),
|
|
20
|
+
'ai analyze-project': Object.freeze({
|
|
21
|
+
withPlanner: false,
|
|
22
|
+
interactive: false,
|
|
23
|
+
review: true,
|
|
24
|
+
note: 'deep project analysis and advanced proposal review',
|
|
25
|
+
}),
|
|
20
26
|
'ai plan': Object.freeze({
|
|
21
27
|
withPlanner: true,
|
|
22
28
|
interactive: true,
|
|
@@ -39,6 +39,75 @@ const ROOT_GITIGNORE_DEFAULTS = [
|
|
|
39
39
|
'coverage/',
|
|
40
40
|
];
|
|
41
41
|
|
|
42
|
+
const AGENTS_SECTION_DEFAULTS = [
|
|
43
|
+
{
|
|
44
|
+
label: 'Purpose',
|
|
45
|
+
pattern: /^Purpose$/m,
|
|
46
|
+
lines: [
|
|
47
|
+
'Purpose',
|
|
48
|
+
'',
|
|
49
|
+
'This file routes AI agents in this repository. Read it before loading broader project context.',
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'Reading Budget',
|
|
54
|
+
pattern: /^## Reading Budget$/m,
|
|
55
|
+
lines: [
|
|
56
|
+
'## Reading Budget',
|
|
57
|
+
'',
|
|
58
|
+
'- Planning: load only the docs needed for the current requirement.',
|
|
59
|
+
'- Execution: start from the active slice context before reading broad docs.',
|
|
60
|
+
'- Debug: gather the smallest reproducible evidence before proposing fixes.',
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Reading Order',
|
|
65
|
+
pattern: /^## Reading Order$/m,
|
|
66
|
+
lines: [
|
|
67
|
+
'## Reading Order',
|
|
68
|
+
'',
|
|
69
|
+
'1. README.md',
|
|
70
|
+
'2. docs/AI_CONTEXT.md',
|
|
71
|
+
'3. docs/PROJECT_MAP.md when architecture or structure facts are needed',
|
|
72
|
+
'4. Active spec/slice docs only when working on an approved slice',
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Output Policy',
|
|
77
|
+
pattern: /^## Output Policy$/m,
|
|
78
|
+
lines: [
|
|
79
|
+
'## Output Policy',
|
|
80
|
+
'',
|
|
81
|
+
'- Keep responses concise and actionable.',
|
|
82
|
+
'- Cite files or commands when reporting evidence.',
|
|
83
|
+
'- Do not claim unsupported project facts as confirmed.',
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'Slice Execution Rules',
|
|
88
|
+
pattern: /^## Slice Execution Rules$/m,
|
|
89
|
+
lines: [
|
|
90
|
+
'## Slice Execution Rules',
|
|
91
|
+
'',
|
|
92
|
+
'- Do not implement code before acceptance criteria and technical plan approval.',
|
|
93
|
+
'- Execute one approved slice at a time.',
|
|
94
|
+
'- Keep changes inside the slice scope unless the handoff explicitly allows expansion.',
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: 'Links',
|
|
99
|
+
pattern: /^## Links$/m,
|
|
100
|
+
lines: [
|
|
101
|
+
'## Links',
|
|
102
|
+
'',
|
|
103
|
+
'- AI Context: `./docs/AI_CONTEXT.md`',
|
|
104
|
+
'- Project Map: `./docs/PROJECT_MAP.md`',
|
|
105
|
+
'- Decisions: `./docs/DECISIONS.md`',
|
|
106
|
+
'- Workflow: `./docs/WORKFLOW.md`',
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
|
|
42
111
|
function readTextIfExists(filePath) {
|
|
43
112
|
if (!fs.existsSync(filePath)) {
|
|
44
113
|
return null;
|
|
@@ -152,21 +221,30 @@ function countAgentsSections(projectRoot) {
|
|
|
152
221
|
return ['AGENTS.md'];
|
|
153
222
|
}
|
|
154
223
|
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
[/^## Reading Order$/m, 'Reading Order'],
|
|
159
|
-
[/^## Output Policy$/m, 'Output Policy'],
|
|
160
|
-
[/^## Slice Execution Rules$/m, 'Slice Execution Rules'],
|
|
161
|
-
[/^## Links$/m, 'Links'],
|
|
162
|
-
];
|
|
163
|
-
|
|
164
|
-
const missing = requiredSections
|
|
165
|
-
.filter(([pattern]) => !pattern.test(text))
|
|
166
|
-
.map(([, label]) => label);
|
|
224
|
+
const missing = AGENTS_SECTION_DEFAULTS
|
|
225
|
+
.filter((section) => !section.pattern.test(text))
|
|
226
|
+
.map((section) => section.label);
|
|
167
227
|
return missing;
|
|
168
228
|
}
|
|
169
229
|
|
|
230
|
+
function buildAgentsContractText(sectionLabels = null) {
|
|
231
|
+
const labels = Array.isArray(sectionLabels) && sectionLabels.length > 0
|
|
232
|
+
? new Set(sectionLabels)
|
|
233
|
+
: null;
|
|
234
|
+
const selectedSections = AGENTS_SECTION_DEFAULTS.filter((section) => !labels || labels.has(section.label));
|
|
235
|
+
const lines = labels ? [] : ['# AGENTS Router', ''];
|
|
236
|
+
for (const [index, section] of selectedSections.entries()) {
|
|
237
|
+
if (lines.length > 0 && lines[lines.length - 1] !== '') {
|
|
238
|
+
lines.push('');
|
|
239
|
+
}
|
|
240
|
+
if (index > 0 && lines[lines.length - 1] !== '') {
|
|
241
|
+
lines.push('');
|
|
242
|
+
}
|
|
243
|
+
lines.push(...section.lines);
|
|
244
|
+
}
|
|
245
|
+
return `${lines.join('\n').replace(/\n{3,}/g, '\n\n')}\n`;
|
|
246
|
+
}
|
|
247
|
+
|
|
170
248
|
function countTieredPackSizeWarnings(projectRoot) {
|
|
171
249
|
const warnings = [];
|
|
172
250
|
|
|
@@ -522,6 +600,23 @@ function buildDoctorFixPlan(projectRoot) {
|
|
|
522
600
|
});
|
|
523
601
|
}
|
|
524
602
|
|
|
603
|
+
const agentsMissing = countAgentsSections(projectRoot);
|
|
604
|
+
if (agentsMissing.includes('AGENTS.md')) {
|
|
605
|
+
fixes.push({
|
|
606
|
+
type: 'write-json-or-text',
|
|
607
|
+
path: 'AGENTS.md',
|
|
608
|
+
description: 'Create missing AGENTS.md AI routing contract.',
|
|
609
|
+
content: buildAgentsContractText(),
|
|
610
|
+
});
|
|
611
|
+
} else if (agentsMissing.length > 0) {
|
|
612
|
+
fixes.push({
|
|
613
|
+
type: 'append-lines',
|
|
614
|
+
path: 'AGENTS.md',
|
|
615
|
+
description: `Append missing AGENTS.md contract sections: ${agentsMissing.join(', ')}.`,
|
|
616
|
+
lines: buildAgentsContractText(agentsMissing).trimEnd().split('\n'),
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
|
|
525
620
|
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
526
621
|
if (fs.existsSync(packageJsonPath)) {
|
|
527
622
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
@@ -15,6 +15,10 @@ module.exports = {
|
|
|
15
15
|
commandDescriptions: {},
|
|
16
16
|
optionDescriptions: {
|
|
17
17
|
'Show one human dashboard section': 'Show one human dashboard section (overview, specs, slices, blockers, warnings, agents, approvals, runs, active-slice, next-steps)',
|
|
18
|
+
'For ai analyze-project, apply validated documentation proposals through the safe docs workflow': 'For ai analyze-project, apply validated documentation proposals through the safe docs workflow',
|
|
19
|
+
'For ai analyze-project, save a validated documentation proposal without writing final docs': 'For ai analyze-project, save a validated documentation proposal without writing final docs',
|
|
20
|
+
'For ai analyze-project, show or save the proposed documentation diff': 'For ai analyze-project, show or save the proposed documentation diff',
|
|
21
|
+
'For ai analyze-project, allow dirty target docs checks where the safe apply workflow supports it': 'For ai analyze-project, allow dirty target docs checks where the safe apply workflow supports it',
|
|
18
22
|
},
|
|
19
23
|
},
|
|
20
24
|
'common.command.help': 'Run: npx create-quiver --help',
|
|
@@ -56,6 +60,30 @@ module.exports = {
|
|
|
56
60
|
'ai.actionable.fix': 'Fix',
|
|
57
61
|
'ai.actionable.impact': 'Impact',
|
|
58
62
|
'ai.actionable.next_command': 'Next command',
|
|
63
|
+
'ai.analyze_project.apply.after_diff_question': 'What do you want to do after reviewing the diff?',
|
|
64
|
+
'ai.analyze_project.apply.cancelled': 'AI analyze-project apply canceled',
|
|
65
|
+
'ai.analyze_project.apply.cancelled_writes': 'Writes: none (final docs were not modified)',
|
|
66
|
+
'ai.analyze_project.apply.completed': 'Analysis completed.',
|
|
67
|
+
'ai.analyze_project.apply.context_artifact': 'Selected context: {path}',
|
|
68
|
+
'ai.analyze_project.apply.counts': 'Changes: {changed}; dirty target docs: {dirty}',
|
|
69
|
+
'ai.analyze_project.apply.diff_title': 'Diff preview',
|
|
70
|
+
'ai.analyze_project.apply.diff_truncated': '[diff truncated; full diff saved in the artifact]',
|
|
71
|
+
'ai.analyze_project.apply.full_diff_artifact': 'Full diff artifact: {path}',
|
|
72
|
+
'ai.analyze_project.apply.generated': 'AI generated a documentation proposal from the project source code.',
|
|
73
|
+
'ai.analyze_project.apply.option.apply.hint': 'Writes proposed docs using safe merge and a prior snapshot.',
|
|
74
|
+
'ai.analyze_project.apply.option.apply.label': 'Apply documentation',
|
|
75
|
+
'ai.analyze_project.apply.option.cancel.hint': 'Does not write final documentation.',
|
|
76
|
+
'ai.analyze_project.apply.option.cancel.label': 'Cancel',
|
|
77
|
+
'ai.analyze_project.apply.option.edit.hint': 'Opens the proposal in your editor before applying.',
|
|
78
|
+
'ai.analyze_project.apply.option.edit.label': 'Edit proposal',
|
|
79
|
+
'ai.analyze_project.apply.option.save.hint': 'Saves the proposal under .quiver/runs without final docs writes.',
|
|
80
|
+
'ai.analyze_project.apply.option.save.label': 'Save proposal',
|
|
81
|
+
'ai.analyze_project.apply.option.view_diff.hint': 'Shows a bounded terminal diff before deciding.',
|
|
82
|
+
'ai.analyze_project.apply.option.view_diff.label': 'View diff',
|
|
83
|
+
'ai.analyze_project.apply.proposed_files': 'Proposed files:',
|
|
84
|
+
'ai.analyze_project.apply.question': 'What do you want to do?',
|
|
85
|
+
'ai.analyze_project.apply.recommended': 'recommended',
|
|
86
|
+
'ai.analyze_project.apply.repair': 'Repair manifest: {value}',
|
|
59
87
|
'ai.agent.choice.model_available': 'available',
|
|
60
88
|
'ai.agent.choice.model_custom': 'Custom',
|
|
61
89
|
'ai.agent.choice.model_recommended': 'recommended',
|
|
@@ -282,10 +310,15 @@ module.exports = {
|
|
|
282
310
|
'ai.planner.progress.reading_base_docs': 'Reading base docs',
|
|
283
311
|
'ai.planner.progress.reading_input': 'Reading input',
|
|
284
312
|
'ai.planner.progress.reading_technical_plan': 'Reading technical plan',
|
|
313
|
+
'ai.planner.progress.repairing_schema': 'Repairing schema drift',
|
|
285
314
|
'ai.planner.progress.repair_plan': 'Running plan repair',
|
|
315
|
+
'ai.planner.progress.retrying_agent': 'Retrying agent',
|
|
286
316
|
'ai.planner.progress.review_plan': 'Running plan review',
|
|
287
317
|
'ai.planner.progress.running_agent': 'Running agent...',
|
|
318
|
+
'ai.planner.progress.selecting_sample': 'Selecting sample',
|
|
288
319
|
'ai.planner.progress.title': '{action} with {profile}',
|
|
320
|
+
'ai.planner.progress.validating_schema': 'Validating schema',
|
|
321
|
+
'ai.planner.progress.writing_artifacts': 'Writing artifacts',
|
|
289
322
|
'ai.repair_plan.original_preserved': 'Original approved artifact: preserved',
|
|
290
323
|
'ai.repair_plan.saved': 'AI technical-plan repair draft saved',
|
|
291
324
|
'ai.repair_plan.source_approved_artifact': 'Source approved artifact',
|
|
@@ -37,6 +37,7 @@ module.exports = {
|
|
|
37
37
|
'ai active-slice status|reconcile': 'Inspecciona o simula reconciliar el estado local de active-slice desde todas las fuentes soportadas.',
|
|
38
38
|
'ai status': 'Muestra fase actual del ciclo de vida de IA, versiones aprobadas, bloqueos y proximo comando.',
|
|
39
39
|
'ai resume': 'Reanuda la guia desde la ultima fase valida del ciclo de vida sin memoria de chat.',
|
|
40
|
+
'ai analyze-project': 'Analiza una muestra acotada del proyecto y genera propuestas documentales auditadas.',
|
|
40
41
|
'ai onboard': 'Ejecuta o imprime el prompt de onboarding del planner con contexto optimizado por tokens.',
|
|
41
42
|
'ai prepare-context': 'Previsualiza o escribe actualizaciones docs-only del contexto de IA con supuestos y riesgos.',
|
|
42
43
|
'ai agent set|list|show|doctor|repair': 'Gestiona, diagnostica y simula reparaciones de perfiles planner, executor, reviewer y doctor sin secretos.',
|
|
@@ -108,6 +109,10 @@ module.exports = {
|
|
|
108
109
|
'Enable planner-assisted behavior on commands that explicitly support it': 'Activa comportamiento asistido por planner en comandos que lo soportan explicitamente',
|
|
109
110
|
'Enable prompts on commands that explicitly support interactive choices': 'Activa prompts en comandos que soportan elecciones interactivas explicitamente',
|
|
110
111
|
'Open or prepare human review before persistent writes where supported': 'Abre o prepara revision humana antes de escrituras persistentes donde este soportado',
|
|
112
|
+
'For ai analyze-project, apply validated documentation proposals through the safe docs workflow': 'En ai analyze-project, aplica propuestas de documentacion validadas mediante el flujo seguro de docs',
|
|
113
|
+
'For ai analyze-project, save a validated documentation proposal without writing final docs': 'En ai analyze-project, guarda una propuesta de documentacion validada sin escribir docs finales',
|
|
114
|
+
'For ai analyze-project, show or save the proposed documentation diff': 'En ai analyze-project, muestra o guarda el diff de documentacion propuesto',
|
|
115
|
+
'For ai analyze-project, allow dirty target docs checks where the safe apply workflow supports it': 'En ai analyze-project, permite checks de docs destino con cambios donde el flujo seguro lo soporte',
|
|
111
116
|
'Select methodology where supported (currently wdd-sdd)': 'Selecciona metodologia donde este soportado (actualmente wdd-sdd)',
|
|
112
117
|
'Disable ANSI colors in human output': 'Desactiva colores ANSI en la salida humana',
|
|
113
118
|
'For doctor, apply safe non-destructive repairs': 'En doctor, aplica reparaciones seguras no destructivas',
|
|
@@ -171,6 +176,30 @@ module.exports = {
|
|
|
171
176
|
'ai.actionable.fix': 'Arreglo',
|
|
172
177
|
'ai.actionable.impact': 'Impacto',
|
|
173
178
|
'ai.actionable.next_command': 'Siguiente comando',
|
|
179
|
+
'ai.analyze_project.apply.after_diff_question': 'Que queres hacer despues de revisar el diff?',
|
|
180
|
+
'ai.analyze_project.apply.cancelled': 'Aplicacion de analyze-project cancelada',
|
|
181
|
+
'ai.analyze_project.apply.cancelled_writes': 'Escrituras: ninguna (no se modificaron docs finales)',
|
|
182
|
+
'ai.analyze_project.apply.completed': 'Analisis completado.',
|
|
183
|
+
'ai.analyze_project.apply.context_artifact': 'Contexto seleccionado: {path}',
|
|
184
|
+
'ai.analyze_project.apply.counts': 'Cambios: {changed}; docs destino con contenido: {dirty}',
|
|
185
|
+
'ai.analyze_project.apply.diff_title': 'Vista previa del diff',
|
|
186
|
+
'ai.analyze_project.apply.diff_truncated': '[diff truncado; el diff completo se guardo en el artifact]',
|
|
187
|
+
'ai.analyze_project.apply.full_diff_artifact': 'Artifact de diff completo: {path}',
|
|
188
|
+
'ai.analyze_project.apply.generated': 'La IA genero una propuesta de documentacion basada en el codigo del proyecto.',
|
|
189
|
+
'ai.analyze_project.apply.option.apply.hint': 'Escribe los docs propuestos usando merge seguro y snapshot previo.',
|
|
190
|
+
'ai.analyze_project.apply.option.apply.label': 'Aplicar documentacion',
|
|
191
|
+
'ai.analyze_project.apply.option.cancel.hint': 'No escribe documentacion final.',
|
|
192
|
+
'ai.analyze_project.apply.option.cancel.label': 'Cancelar',
|
|
193
|
+
'ai.analyze_project.apply.option.edit.hint': 'Abre la propuesta en tu editor antes de aplicar.',
|
|
194
|
+
'ai.analyze_project.apply.option.edit.label': 'Editar propuesta',
|
|
195
|
+
'ai.analyze_project.apply.option.save.hint': 'Guarda la propuesta en .quiver/runs sin escribir docs finales.',
|
|
196
|
+
'ai.analyze_project.apply.option.save.label': 'Guardar propuesta',
|
|
197
|
+
'ai.analyze_project.apply.option.view_diff.hint': 'Muestra un diff acotado en terminal antes de decidir.',
|
|
198
|
+
'ai.analyze_project.apply.option.view_diff.label': 'Ver diff',
|
|
199
|
+
'ai.analyze_project.apply.proposed_files': 'Archivos propuestos:',
|
|
200
|
+
'ai.analyze_project.apply.question': 'Que queres hacer?',
|
|
201
|
+
'ai.analyze_project.apply.recommended': 'recomendado',
|
|
202
|
+
'ai.analyze_project.apply.repair': 'Manifest de reparacion: {value}',
|
|
174
203
|
'ai.agent.choice.model_available': 'disponible',
|
|
175
204
|
'ai.agent.choice.model_custom': 'Custom',
|
|
176
205
|
'ai.agent.choice.model_recommended': 'recomendado',
|
|
@@ -397,10 +426,15 @@ module.exports = {
|
|
|
397
426
|
'ai.planner.progress.reading_base_docs': 'Leyendo docs base',
|
|
398
427
|
'ai.planner.progress.reading_input': 'Leyendo entrada',
|
|
399
428
|
'ai.planner.progress.reading_technical_plan': 'Leyendo plan tecnico',
|
|
429
|
+
'ai.planner.progress.repairing_schema': 'Reparando drift de schema',
|
|
400
430
|
'ai.planner.progress.repair_plan': 'Ejecutando reparacion del plan',
|
|
431
|
+
'ai.planner.progress.retrying_agent': 'Reintentando agente',
|
|
401
432
|
'ai.planner.progress.review_plan': 'Ejecutando revision del plan',
|
|
402
433
|
'ai.planner.progress.running_agent': 'Ejecutando agente...',
|
|
434
|
+
'ai.planner.progress.selecting_sample': 'Seleccionando muestra',
|
|
403
435
|
'ai.planner.progress.title': '{action} con {profile}',
|
|
436
|
+
'ai.planner.progress.validating_schema': 'Validando schema',
|
|
437
|
+
'ai.planner.progress.writing_artifacts': 'Escribiendo artifacts',
|
|
404
438
|
'ai.repair_plan.original_preserved': 'Artefacto aprobado original: preservado',
|
|
405
439
|
'ai.repair_plan.saved': 'Draft de reparacion de technical-plan guardado',
|
|
406
440
|
'ai.repair_plan.source_approved_artifact': 'Artefacto aprobado fuente',
|