@dotdotgod/cli 0.6.2 → 0.6.4
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/package.json +1 -1
- package/src/commands/config.mjs +0 -1
- package/src/memory/config.mjs +7 -16
package/package.json
CHANGED
package/src/commands/config.mjs
CHANGED
|
@@ -54,7 +54,6 @@ function formatConfigOutput(payload) {
|
|
|
54
54
|
lines.push(`- load pinned paths: ${(payload.config.load?.pinnedPaths ?? []).join(', ') || 'none'}`);
|
|
55
55
|
lines.push(`- load pinned bodies: ${(payload.config.load?.pinnedBodies ?? []).join(', ') || 'none'}`);
|
|
56
56
|
lines.push(`- load documentation summary exclude: ${(payload.config.load?.documentationSummary?.exclude ?? []).join(', ') || 'none'}`);
|
|
57
|
-
lines.push(`- plan mode writable paths: ${(payload.config.planMode?.writablePaths ?? []).join(', ') || 'none'}`);
|
|
58
57
|
const lowSignal = payload.config.referenceExpansion?.fuzzy?.lowSignal ?? { terms: [], add: [], remove: [] };
|
|
59
58
|
lines.push(`- fuzzy low-signal terms: ${(lowSignal.terms ?? []).join(', ') || 'none'} (add: ${(lowSignal.add ?? []).join(', ') || 'none'}; remove: ${(lowSignal.remove ?? []).join(', ') || 'none'})`);
|
|
60
59
|
if (errors.length > 0) {
|
package/src/memory/config.mjs
CHANGED
|
@@ -37,9 +37,7 @@ export const DEFAULT_LOAD_POLICY = {
|
|
|
37
37
|
exclude: ['docs/plan', 'docs/archive'],
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
|
-
export const DEFAULT_PLAN_MODE_POLICY = {
|
|
41
|
-
writablePaths: ['docs/plan/**', 'docs/archive/**'],
|
|
42
|
-
};
|
|
40
|
+
export const DEFAULT_PLAN_MODE_POLICY = {};
|
|
43
41
|
export const DEFAULT_IMPACT_RANKING_POLICY = {
|
|
44
42
|
connectionCap: 80,
|
|
45
43
|
memoryCap: 20,
|
|
@@ -199,8 +197,8 @@ export function cloneLoadPolicy(policy = DEFAULT_LOAD_POLICY) {
|
|
|
199
197
|
};
|
|
200
198
|
}
|
|
201
199
|
|
|
202
|
-
export function clonePlanModePolicy(
|
|
203
|
-
return {
|
|
200
|
+
export function clonePlanModePolicy() {
|
|
201
|
+
return {};
|
|
204
202
|
}
|
|
205
203
|
|
|
206
204
|
export function normalizeDocumentationRoot(value = DEFAULT_DOCUMENTATION_ROOT) {
|
|
@@ -215,7 +213,7 @@ export function isValidDocumentationRoot(value) {
|
|
|
215
213
|
}
|
|
216
214
|
export function defaultMemoryConfig({ documentationRoot = DEFAULT_DOCUMENTATION_ROOT } = {}) {
|
|
217
215
|
const root = normalizeDocumentationRoot(documentationRoot);
|
|
218
|
-
return { source: 'default', documentation: { root }, areas: memoryAreasForRoot(root).map(cloneArea), traceability: cloneTraceabilityPolicy({ ...DEFAULT_TRACEABILITY_POLICY, required: [`${root}/spec/**`] }), validation: cloneValidationPolicy(), impactRanking: cloneImpactRankingPolicy(), referenceExpansion: cloneReferenceExpansionPolicy(), load: cloneLoadPolicy({ ...DEFAULT_LOAD_POLICY, documentationSummary: { exclude: [`${root}/plan`, `${root}/archive`] } }), planMode: clonePlanModePolicy(
|
|
216
|
+
return { source: 'default', documentation: { root }, areas: memoryAreasForRoot(root).map(cloneArea), traceability: cloneTraceabilityPolicy({ ...DEFAULT_TRACEABILITY_POLICY, required: [`${root}/spec/**`] }), validation: cloneValidationPolicy(), impactRanking: cloneImpactRankingPolicy(), referenceExpansion: cloneReferenceExpansionPolicy(), load: cloneLoadPolicy({ ...DEFAULT_LOAD_POLICY, documentationSummary: { exclude: [`${root}/plan`, `${root}/archive`] } }), planMode: clonePlanModePolicy() };
|
|
219
217
|
}
|
|
220
218
|
|
|
221
219
|
export function normalizePathPattern(value = '') {
|
|
@@ -289,12 +287,9 @@ export function isSecretLikePathPattern(value = '') {
|
|
|
289
287
|
return /(^|\/)(\.env|\.npmrc|\.pypirc|id_rsa|id_dsa|id_ed25519|credentials?|secrets?)(\.|\/|$)/i.test(normalized);
|
|
290
288
|
}
|
|
291
289
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
? DEFAULT_PLAN_MODE_POLICY.writablePaths
|
|
296
|
-
: [...new Set((Array.isArray(raw.writablePaths) ? raw.writablePaths : []).map(normalizePathPattern))];
|
|
297
|
-
return clonePlanModePolicy({ writablePaths });
|
|
290
|
+
// Legacy planMode.writablePaths is accepted but discarded on normalization.
|
|
291
|
+
function normalizePlanModePolicy(_raw) {
|
|
292
|
+
return clonePlanModePolicy();
|
|
298
293
|
}
|
|
299
294
|
|
|
300
295
|
function normalizeLoadPolicy(raw) {
|
|
@@ -437,10 +432,6 @@ export function validateMemoryConfigData(data, root = '.', file = 'dotdotgod.con
|
|
|
437
432
|
if (planMode !== undefined) {
|
|
438
433
|
if (!planMode || typeof planMode !== 'object' || Array.isArray(planMode)) {
|
|
439
434
|
add('PLAN_MODE_CONFIG_INVALID', 'planMode', 'Expected an object.');
|
|
440
|
-
} else if (planMode.writablePaths !== undefined) {
|
|
441
|
-
const paths = planMode.writablePaths;
|
|
442
|
-
if (!Array.isArray(paths)) add('PLAN_MODE_CONFIG_INVALID_WRITABLE_PATHS', 'planMode.writablePaths', 'Expected an array of documentation path strings.');
|
|
443
|
-
else if (paths.some((value) => !isValidPathPattern(value) || typeof value !== 'string' || value.trim().startsWith('/') || (!normalizePathPattern(value).startsWith(`${normalizeDocumentationRoot(data.documentation?.root ?? DEFAULT_DOCUMENTATION_ROOT)}/`)) || normalizePathPattern(value).startsWith(`${normalizeDocumentationRoot(data.documentation?.root ?? DEFAULT_DOCUMENTATION_ROOT)}/.`) || isSecretLikePathPattern(value))) add('PLAN_MODE_CONFIG_INVALID_WRITABLE_PATHS', 'planMode.writablePaths', 'Expected safe repository-relative paths under documentation.root using exact paths or /** subtree patterns.');
|
|
444
435
|
}
|
|
445
436
|
}
|
|
446
437
|
const referenceExpansion = data.referenceExpansion;
|