hive-lite 0.1.7 → 0.1.9
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/lib/context.js +13 -8
package/package.json
CHANGED
package/src/lib/context.js
CHANGED
|
@@ -308,7 +308,9 @@ function buildWritePlan(scope, intent, area) {
|
|
|
308
308
|
item.operations.includes('create_file') && capabilityMatchesIntent(item, hypothesis)
|
|
309
309
|
));
|
|
310
310
|
const genericExistingCapabilities = capabilities.filter((item) => (
|
|
311
|
-
!item.peerIdentity
|
|
311
|
+
!item.peerIdentity
|
|
312
|
+
&& !item.operations.includes('create_file')
|
|
313
|
+
&& item.source === 'writable_existing'
|
|
312
314
|
));
|
|
313
315
|
const referencePeers = capabilities.filter((item) => (
|
|
314
316
|
item.peerIdentity
|
|
@@ -677,9 +679,10 @@ function competingHighScoringAreas(scored) {
|
|
|
677
679
|
));
|
|
678
680
|
}
|
|
679
681
|
|
|
680
|
-
function decompositionSignals({ map, area, confidence, intent, relevant, scope, scored, validationPlan, constrainedAreaId }) {
|
|
682
|
+
function decompositionSignals({ map, area, confidence, intent, relevant, scope, selectedWritableDirect, scored, validationPlan, constrainedAreaId }) {
|
|
681
683
|
if (!area) return [];
|
|
682
684
|
const signals = [];
|
|
685
|
+
const writableDirectForIntent = selectedWritableDirect || scope.writableDirect || [];
|
|
683
686
|
const highAreas = highScoringAreas(scored)
|
|
684
687
|
.filter((item) => !constrainedAreaId || item.area.id === constrainedAreaId);
|
|
685
688
|
const competingAreas = competingHighScoringAreas(scored)
|
|
@@ -711,16 +714,16 @@ function decompositionSignals({ map, area, confidence, intent, relevant, scope,
|
|
|
711
714
|
}));
|
|
712
715
|
}
|
|
713
716
|
|
|
714
|
-
if (
|
|
717
|
+
if (writableDirectForIntent.length > DECOMPOSITION_LIMITS.writableFilesBlocking) {
|
|
715
718
|
signals.push(signal('TOO_MANY_WRITABLE_FILES', 'Direct writable files exceed the safe change boundary.', {
|
|
716
|
-
count:
|
|
719
|
+
count: writableDirectForIntent.length,
|
|
717
720
|
threshold: DECOMPOSITION_LIMITS.writableFilesBlocking,
|
|
718
721
|
}));
|
|
719
|
-
} else if (
|
|
722
|
+
} else if (writableDirectForIntent.length > DECOMPOSITION_LIMITS.writableFilesWarning) {
|
|
720
723
|
signals.push(signal('TOO_MANY_WRITABLE_FILES', 'Direct writable files are high for one Change Record.', {
|
|
721
724
|
severity: 'warning',
|
|
722
725
|
blocking: false,
|
|
723
|
-
count:
|
|
726
|
+
count: writableDirectForIntent.length,
|
|
724
727
|
threshold: DECOMPOSITION_LIMITS.writableFilesWarning,
|
|
725
728
|
}));
|
|
726
729
|
}
|
|
@@ -1115,9 +1118,9 @@ function hasBlockingMapGapWarning(warnings = []) {
|
|
|
1115
1118
|
|
|
1116
1119
|
function contextMode(area, selectedWritableDirect, validationPlan, relevant, decomposition = [], warnings = []) {
|
|
1117
1120
|
if (!area) return 'needs_map';
|
|
1118
|
-
if (decomposition.some((item) => item.blocking)) return 'needs_decomposition';
|
|
1119
1121
|
if (selectedWritableDirect.length === 0) return 'discovery_context';
|
|
1120
1122
|
if (hasBlockingMapGapWarning(warnings)) return 'discovery_context';
|
|
1123
|
+
if (decomposition.some((item) => item.blocking)) return 'needs_decomposition';
|
|
1121
1124
|
if (relevant.length === 0 || !relevant.some((file) => file.source === 'project_map')) return 'discovery_context';
|
|
1122
1125
|
if (validationPlan.length === 0) return 'discovery_context';
|
|
1123
1126
|
return 'edit_context';
|
|
@@ -1396,17 +1399,19 @@ function createContextPacket(root, intent, options = {}) {
|
|
|
1396
1399
|
}
|
|
1397
1400
|
const reviewGated = area ? reviewGatedNotices(scope) : [];
|
|
1398
1401
|
warnings.push(...splitRoutingWarnings(originSplit, phaseStatus, originPhaseAreaId, requestedArea));
|
|
1399
|
-
const
|
|
1402
|
+
const rawDecomposition = decompositionSignals({
|
|
1400
1403
|
map,
|
|
1401
1404
|
area,
|
|
1402
1405
|
confidence,
|
|
1403
1406
|
intent,
|
|
1404
1407
|
relevant,
|
|
1405
1408
|
scope,
|
|
1409
|
+
selectedWritableDirect: writePlan.selectedWritableDirect,
|
|
1406
1410
|
scored,
|
|
1407
1411
|
validationPlan,
|
|
1408
1412
|
constrainedAreaId,
|
|
1409
1413
|
});
|
|
1414
|
+
const decomposition = hasBlockingMapGapWarning(warnings) ? [] : rawDecomposition;
|
|
1410
1415
|
const phaseSeeds = decomposition.length > 0 ? candidatePhaseSeeds(scored, intent) : [];
|
|
1411
1416
|
let mode = contextMode(area, writePlan.selectedWritableDirect, validationPlan, relevant, decomposition, warnings);
|
|
1412
1417
|
if (missingSplitReference(phaseStatus) && mode === 'edit_context') mode = 'discovery_context';
|