create-quiver 0.17.1 → 0.17.2
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 +4 -0
- package/auditoria-ux-ui-performance-documentacion.md +705 -0
- package/copys-landing-page.md +244 -0
- package/docs/TROUBLESHOOTING.md +53 -0
- package/docs/reference/commands.md +42 -0
- package/docs/workflows/existing-project-ai-quiver-setup.md +552 -0
- package/docs/workflows/existing-project.md +21 -0
- package/package.json +1 -1
- package/specs/quiver-v43-cli-i18n-audit-release-readiness/command-language-mode-matrix.json +1 -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/src/create-quiver/commands/ai.js +353 -70
- package/src/create-quiver/index.js +3 -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-parser.js +1 -0
- package/src/create-quiver/lib/ai/analyze-project-prompts.js +130 -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 +168 -0
- package/src/create-quiver/lib/ai/artifacts.js +83 -2
- package/src/create-quiver/lib/doctor.js +107 -12
- package/src/create-quiver/lib/i18n/messages/en.js +5 -0
- package/src/create-quiver/lib/i18n/messages/es.js +5 -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,
|
|
@@ -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'));
|
|
@@ -282,10 +282,15 @@ module.exports = {
|
|
|
282
282
|
'ai.planner.progress.reading_base_docs': 'Reading base docs',
|
|
283
283
|
'ai.planner.progress.reading_input': 'Reading input',
|
|
284
284
|
'ai.planner.progress.reading_technical_plan': 'Reading technical plan',
|
|
285
|
+
'ai.planner.progress.repairing_schema': 'Repairing schema drift',
|
|
285
286
|
'ai.planner.progress.repair_plan': 'Running plan repair',
|
|
287
|
+
'ai.planner.progress.retrying_agent': 'Retrying agent',
|
|
286
288
|
'ai.planner.progress.review_plan': 'Running plan review',
|
|
287
289
|
'ai.planner.progress.running_agent': 'Running agent...',
|
|
290
|
+
'ai.planner.progress.selecting_sample': 'Selecting sample',
|
|
288
291
|
'ai.planner.progress.title': '{action} with {profile}',
|
|
292
|
+
'ai.planner.progress.validating_schema': 'Validating schema',
|
|
293
|
+
'ai.planner.progress.writing_artifacts': 'Writing artifacts',
|
|
289
294
|
'ai.repair_plan.original_preserved': 'Original approved artifact: preserved',
|
|
290
295
|
'ai.repair_plan.saved': 'AI technical-plan repair draft saved',
|
|
291
296
|
'ai.repair_plan.source_approved_artifact': 'Source approved artifact',
|
|
@@ -397,10 +397,15 @@ module.exports = {
|
|
|
397
397
|
'ai.planner.progress.reading_base_docs': 'Leyendo docs base',
|
|
398
398
|
'ai.planner.progress.reading_input': 'Leyendo entrada',
|
|
399
399
|
'ai.planner.progress.reading_technical_plan': 'Leyendo plan tecnico',
|
|
400
|
+
'ai.planner.progress.repairing_schema': 'Reparando drift de schema',
|
|
400
401
|
'ai.planner.progress.repair_plan': 'Ejecutando reparacion del plan',
|
|
402
|
+
'ai.planner.progress.retrying_agent': 'Reintentando agente',
|
|
401
403
|
'ai.planner.progress.review_plan': 'Ejecutando revision del plan',
|
|
402
404
|
'ai.planner.progress.running_agent': 'Ejecutando agente...',
|
|
405
|
+
'ai.planner.progress.selecting_sample': 'Seleccionando muestra',
|
|
403
406
|
'ai.planner.progress.title': '{action} con {profile}',
|
|
407
|
+
'ai.planner.progress.validating_schema': 'Validando schema',
|
|
408
|
+
'ai.planner.progress.writing_artifacts': 'Escribiendo artifacts',
|
|
404
409
|
'ai.repair_plan.original_preserved': 'Artefacto aprobado original: preservado',
|
|
405
410
|
'ai.repair_plan.saved': 'Draft de reparacion de technical-plan guardado',
|
|
406
411
|
'ai.repair_plan.source_approved_artifact': 'Artefacto aprobado fuente',
|