@danmoisan/drm-copilot-mcp 1.0.24 → 1.0.26
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/out/mcp-server.js +504 -174
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/feature-review.md +5 -3
- package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +11 -4
- package/resources/claude-customizations/.claude/agents/parallel-planner.md +5 -2
- package/resources/claude-customizations/.claude/hooks/enforce-discovery-artifact-gate.ps1 +28 -8
- package/resources/claude-customizations/.claude/hooks/validate-discovery-artifact-gate.ps1 +28 -8
- package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +117 -46
- package/resources/claude-customizations/.claude/lib/bash/parallel-manifest-validate.sh +115 -3
- package/resources/claude-customizations/.claude/lib/codex-routing/CodexDeployment.psm1 +312 -0
- package/resources/claude-customizations/.claude/lib/codex-routing/CodexTopology.psm1 +392 -0
- package/resources/claude-customizations/.claude/lib/discovery-validation/DiscoveryValidation.psm1 +500 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorState.psm1 +58 -67
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCheckpointValue.psm1 +383 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCodexModelReceipts.psm1 +297 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCodexTopologyReceipts.psm1 +298 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletion.psm1 +232 -43
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletionChecks.psm1 +416 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateModelReceipts.psm1 +366 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateReceipts.psm1 +408 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRoutingContract.psm1 +428 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRoutingMatrix.psm1 +377 -0
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateUnconditional.psm1 +166 -0
- package/resources/claude-customizations/.claude/rules/general-unit-test.md +1 -1
- package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +28 -3
- package/resources/claude-customizations/.claude/rules/powershell.md +1 -1
- package/resources/claude-customizations/.claude/rules/quality-tiers.md +3 -3
- package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/parallel-add/SKILL.md +10 -5
- package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +108 -34
- package/resources/claude-customizations/.claude/skills/parallel-plan/SKILL.md +71 -9
- package/resources/claude-customizations/.claude/skills/parallel-remove/SKILL.md +7 -3
- package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +1 -1
- package/resources/claude-customizations/config/blast-radius.json +1 -3
- package/resources/claude-customizations/pack-manifests/core.json +12 -0
- package/resources/codex-and-agents-customizations/.agents/skills/general-unit-test/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/quality-tiers/SKILL.md +3 -3
- package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +21 -0
package/out/mcp-server.js
CHANGED
|
@@ -6904,12 +6904,12 @@ var require_dist = __commonJS({
|
|
|
6904
6904
|
throw new Error(`Unknown format "${name}"`);
|
|
6905
6905
|
return f;
|
|
6906
6906
|
};
|
|
6907
|
-
function addFormats(ajv, list,
|
|
6907
|
+
function addFormats(ajv, list, fs10, exportName) {
|
|
6908
6908
|
var _a3;
|
|
6909
6909
|
var _b;
|
|
6910
6910
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
6911
6911
|
for (const f of list)
|
|
6912
|
-
ajv.addFormat(f,
|
|
6912
|
+
ajv.addFormat(f, fs10[f]);
|
|
6913
6913
|
}
|
|
6914
6914
|
module2.exports = exports2 = formatsPlugin;
|
|
6915
6915
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -6932,7 +6932,7 @@ __export(mcp_server_exports, {
|
|
|
6932
6932
|
main: () => main
|
|
6933
6933
|
});
|
|
6934
6934
|
module.exports = __toCommonJS(mcp_server_exports);
|
|
6935
|
-
var
|
|
6935
|
+
var fs9 = __toESM(require("node:fs"));
|
|
6936
6936
|
var path10 = __toESM(require("node:path"));
|
|
6937
6937
|
|
|
6938
6938
|
// node_modules/zod/v4/core/core.js
|
|
@@ -17907,11 +17907,11 @@ function relativeToPosix(path11, root) {
|
|
|
17907
17907
|
}
|
|
17908
17908
|
return null;
|
|
17909
17909
|
}
|
|
17910
|
-
function enumerateSourceFiles(
|
|
17910
|
+
function enumerateSourceFiles(fs10, sourceRoot, rootFolders) {
|
|
17911
17911
|
const orderedFiles = [];
|
|
17912
17912
|
for (const root of rootFolders) {
|
|
17913
17913
|
const rootPath = joinPosix2(sourceRoot, root);
|
|
17914
|
-
const rootFiles =
|
|
17914
|
+
const rootFiles = fs10.listFiles(rootPath);
|
|
17915
17915
|
const sorted = [...rootFiles].sort((left, right) => {
|
|
17916
17916
|
const leftRel = relativeToPosix(left, rootPath) ?? left;
|
|
17917
17917
|
const rightRel = relativeToPosix(right, rootPath) ?? right;
|
|
@@ -17921,8 +17921,8 @@ function enumerateSourceFiles(fs9, sourceRoot, rootFolders) {
|
|
|
17921
17921
|
}
|
|
17922
17922
|
return orderedFiles;
|
|
17923
17923
|
}
|
|
17924
|
-
function validateDestination(destinationRoot, repoRoot,
|
|
17925
|
-
if (!
|
|
17924
|
+
function validateDestination(destinationRoot, repoRoot, fs10) {
|
|
17925
|
+
if (!fs10.isDir(destinationRoot)) {
|
|
17926
17926
|
throw new Error(
|
|
17927
17927
|
`Invalid destination: destination directory does not exist: ${destinationRoot}`
|
|
17928
17928
|
);
|
|
@@ -17985,22 +17985,22 @@ function stringifySorted(value, indent) {
|
|
|
17985
17985
|
};
|
|
17986
17986
|
return JSON.stringify(sortKeys(value), null, indent);
|
|
17987
17987
|
}
|
|
17988
|
-
function writeSummaryArtifact(
|
|
17988
|
+
function writeSummaryArtifact(fs10, summary, artifactRoot, artifactDirectory) {
|
|
17989
17989
|
const artifactPath = buildArtifactPath(
|
|
17990
17990
|
summary.startedAt,
|
|
17991
17991
|
artifactRoot,
|
|
17992
17992
|
artifactDirectory
|
|
17993
17993
|
);
|
|
17994
17994
|
const parent = artifactPath.slice(0, artifactPath.lastIndexOf("/"));
|
|
17995
|
-
|
|
17996
|
-
|
|
17995
|
+
fs10.ensureDir(parent);
|
|
17996
|
+
fs10.writeTextFile(artifactPath, renderPushDownSummary(summary));
|
|
17997
17997
|
return artifactPath;
|
|
17998
17998
|
}
|
|
17999
17999
|
function pushDownCustomizations(options) {
|
|
18000
18000
|
const {
|
|
18001
18001
|
repoRoot,
|
|
18002
18002
|
destinationRoot,
|
|
18003
|
-
fs:
|
|
18003
|
+
fs: fs10,
|
|
18004
18004
|
sourceRoot,
|
|
18005
18005
|
artifactRoot,
|
|
18006
18006
|
rootFolders,
|
|
@@ -18014,7 +18014,7 @@ function pushDownCustomizations(options) {
|
|
|
18014
18014
|
const effectiveArtifactDir = artifactDirectory ?? ARTIFACT_DIRECTORY;
|
|
18015
18015
|
const rewrite = rewriteReferences ?? rewriteTextReferences;
|
|
18016
18016
|
const now = clock ?? (() => /* @__PURE__ */ new Date());
|
|
18017
|
-
validateDestination(destinationRoot, repoRoot,
|
|
18017
|
+
validateDestination(destinationRoot, repoRoot, fs10);
|
|
18018
18018
|
const startedAt = now();
|
|
18019
18019
|
let createdCount = 0;
|
|
18020
18020
|
let overwrittenCount = 0;
|
|
@@ -18023,7 +18023,7 @@ function pushDownCustomizations(options) {
|
|
|
18023
18023
|
const unmatchedReferences = [];
|
|
18024
18024
|
const fileResults = [];
|
|
18025
18025
|
for (const sourcePath of enumerateSourceFiles(
|
|
18026
|
-
|
|
18026
|
+
fs10,
|
|
18027
18027
|
effectiveSource,
|
|
18028
18028
|
effectiveRoots
|
|
18029
18029
|
)) {
|
|
@@ -18032,7 +18032,7 @@ function pushDownCustomizations(options) {
|
|
|
18032
18032
|
continue;
|
|
18033
18033
|
}
|
|
18034
18034
|
const destinationPath = joinPosix2(destinationRoot, relativePath2);
|
|
18035
|
-
const destinationStatus =
|
|
18035
|
+
const destinationStatus = fs10.isFile(
|
|
18036
18036
|
destinationPath
|
|
18037
18037
|
) ? "overwritten" : "created";
|
|
18038
18038
|
if (destinationStatus === "created") {
|
|
@@ -18040,7 +18040,7 @@ function pushDownCustomizations(options) {
|
|
|
18040
18040
|
} else {
|
|
18041
18041
|
overwrittenCount += 1;
|
|
18042
18042
|
}
|
|
18043
|
-
const sourceText =
|
|
18043
|
+
const sourceText = fs10.readTextFile(sourcePath);
|
|
18044
18044
|
const [rewrittenText, rewrittenDelta, placeholderDelta, unmatched] = rewrite(sourceText);
|
|
18045
18045
|
rewrittenReferenceCount += rewrittenDelta;
|
|
18046
18046
|
placeholderRewriteCount += placeholderDelta;
|
|
@@ -18053,8 +18053,8 @@ function pushDownCustomizations(options) {
|
|
|
18053
18053
|
0,
|
|
18054
18054
|
destinationPath.lastIndexOf("/")
|
|
18055
18055
|
);
|
|
18056
|
-
|
|
18057
|
-
|
|
18056
|
+
fs10.ensureDir(destParent);
|
|
18057
|
+
fs10.writeTextFile(destinationPath, rewrittenText);
|
|
18058
18058
|
fileResults.push({
|
|
18059
18059
|
relativePath: relativePath2,
|
|
18060
18060
|
destinationStatus,
|
|
@@ -18078,7 +18078,7 @@ function pushDownCustomizations(options) {
|
|
|
18078
18078
|
artifactPath: ""
|
|
18079
18079
|
};
|
|
18080
18080
|
const artifactPath = writeSummaryArtifact(
|
|
18081
|
-
|
|
18081
|
+
fs10,
|
|
18082
18082
|
provisionalSummary,
|
|
18083
18083
|
effectiveArtifact,
|
|
18084
18084
|
effectiveArtifactDir
|
|
@@ -18142,7 +18142,7 @@ function joinPosix3(dir, name) {
|
|
|
18142
18142
|
const normalizedDir = dir.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
18143
18143
|
return normalizedDir === "" ? name : `${normalizedDir}/${name}`;
|
|
18144
18144
|
}
|
|
18145
|
-
function loadPackManifests(manifestDir, selectedPackNames,
|
|
18145
|
+
function loadPackManifests(manifestDir, selectedPackNames, fs10) {
|
|
18146
18146
|
const unknown2 = [...selectedPackNames].filter(
|
|
18147
18147
|
(name) => !MANIFEST_PACK_NAMES.has(name)
|
|
18148
18148
|
);
|
|
@@ -18154,14 +18154,14 @@ function loadPackManifests(manifestDir, selectedPackNames, fs9) {
|
|
|
18154
18154
|
const manifests = /* @__PURE__ */ new Map();
|
|
18155
18155
|
for (const name of [...namesToLoad].sort()) {
|
|
18156
18156
|
const manifestPath = joinPosix3(manifestDir, `${name}.json`);
|
|
18157
|
-
if (!
|
|
18157
|
+
if (!fs10.isFile(manifestPath)) {
|
|
18158
18158
|
throw new ManifestError(
|
|
18159
18159
|
`Codex pack manifest is missing for pack '${name}': ${manifestPath}`
|
|
18160
18160
|
);
|
|
18161
18161
|
}
|
|
18162
18162
|
manifests.set(
|
|
18163
18163
|
name,
|
|
18164
|
-
parseManifest(name, manifestPath,
|
|
18164
|
+
parseManifest(name, manifestPath, fs10.readTextFile(manifestPath))
|
|
18165
18165
|
);
|
|
18166
18166
|
}
|
|
18167
18167
|
return manifests;
|
|
@@ -18418,7 +18418,7 @@ var RoutingConfigFileSystem = class {
|
|
|
18418
18418
|
this.inner.ensureDir(path11);
|
|
18419
18419
|
}
|
|
18420
18420
|
};
|
|
18421
|
-
function resolvePublishedPaths(packs, csharpVariant, bundleRoot,
|
|
18421
|
+
function resolvePublishedPaths(packs, csharpVariant, bundleRoot, fs10) {
|
|
18422
18422
|
const manifestPacks = resolveManifestPackNames(packs ?? null, csharpVariant);
|
|
18423
18423
|
if (manifestPacks === null || manifestPacks.size === 0) {
|
|
18424
18424
|
return null;
|
|
@@ -18426,7 +18426,7 @@ function resolvePublishedPaths(packs, csharpVariant, bundleRoot, fs9) {
|
|
|
18426
18426
|
const manifests = loadPackManifests(
|
|
18427
18427
|
joinPosix4(bundleRoot, PACK_MANIFEST_SUBDIR),
|
|
18428
18428
|
manifestPacks,
|
|
18429
|
-
|
|
18429
|
+
fs10
|
|
18430
18430
|
);
|
|
18431
18431
|
const published = computePublishedPaths(manifestPacks, manifests) ?? /* @__PURE__ */ new Set();
|
|
18432
18432
|
assertSingleCsharpToolchain(published, manifestPacks);
|
|
@@ -18531,18 +18531,18 @@ function joinPosix5(dir, name) {
|
|
|
18531
18531
|
const normalizedDir = dir.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
18532
18532
|
return normalizedDir === "" ? name : `${normalizedDir}/${name}`;
|
|
18533
18533
|
}
|
|
18534
|
-
function loadPackManifests2(manifestDir, selectedPackNames,
|
|
18534
|
+
function loadPackManifests2(manifestDir, selectedPackNames, fs10) {
|
|
18535
18535
|
const namesToLoad = new Set(selectedPackNames);
|
|
18536
18536
|
namesToLoad.add(CORE_PACK_NAME2);
|
|
18537
18537
|
const manifests = /* @__PURE__ */ new Map();
|
|
18538
18538
|
for (const name of [...namesToLoad].sort()) {
|
|
18539
18539
|
const manifestPath = joinPosix5(manifestDir, `${name}.json`);
|
|
18540
|
-
if (!
|
|
18540
|
+
if (!fs10.isFile(manifestPath)) {
|
|
18541
18541
|
throw new ManifestError2(
|
|
18542
18542
|
`Pack manifest is missing for pack '${name}': ${manifestPath}`
|
|
18543
18543
|
);
|
|
18544
18544
|
}
|
|
18545
|
-
const rawText =
|
|
18545
|
+
const rawText = fs10.readTextFile(manifestPath);
|
|
18546
18546
|
manifests.set(name, parseManifest2(name, manifestPath, rawText));
|
|
18547
18547
|
}
|
|
18548
18548
|
return manifests;
|
|
@@ -18962,6 +18962,330 @@ var RoutingMergeFileSystem = class {
|
|
|
18962
18962
|
}
|
|
18963
18963
|
};
|
|
18964
18964
|
|
|
18965
|
+
// ../../extensions/drm-copilot/src/lib/push-down/claude-blast-radius-derive.ts
|
|
18966
|
+
var fs3 = __toESM(require("node:fs"));
|
|
18967
|
+
|
|
18968
|
+
// ../../extensions/drm-copilot/src/lib/push-down/claude-blast-radius-derive-core.ts
|
|
18969
|
+
var BLAST_RADIUS_RELATIVE_PATH = "config/blast-radius.json";
|
|
18970
|
+
var MANIFEST_FILENAMES = /* @__PURE__ */ new Set([
|
|
18971
|
+
"build.gradle",
|
|
18972
|
+
"build.gradle.kts",
|
|
18973
|
+
"Cargo.toml",
|
|
18974
|
+
"go.mod",
|
|
18975
|
+
"package.json",
|
|
18976
|
+
"pom.xml",
|
|
18977
|
+
"pyproject.toml",
|
|
18978
|
+
"setup.py"
|
|
18979
|
+
]);
|
|
18980
|
+
var MANIFEST_SUFFIXES = [
|
|
18981
|
+
".csproj",
|
|
18982
|
+
".fsproj",
|
|
18983
|
+
".vbproj",
|
|
18984
|
+
".sln",
|
|
18985
|
+
".slnx"
|
|
18986
|
+
];
|
|
18987
|
+
var EXCLUDED_DIR_NAMES = /* @__PURE__ */ new Set([
|
|
18988
|
+
"__pycache__",
|
|
18989
|
+
"artifacts",
|
|
18990
|
+
"bin",
|
|
18991
|
+
"build",
|
|
18992
|
+
"coverage",
|
|
18993
|
+
"dist",
|
|
18994
|
+
"doc",
|
|
18995
|
+
"docs",
|
|
18996
|
+
"node_modules",
|
|
18997
|
+
"obj",
|
|
18998
|
+
"out",
|
|
18999
|
+
"target",
|
|
19000
|
+
"test",
|
|
19001
|
+
"tests",
|
|
19002
|
+
"venv"
|
|
19003
|
+
]);
|
|
19004
|
+
var SCAN_DEPTH_LIMIT = 3;
|
|
19005
|
+
var PAYLOAD_MODULES = {
|
|
19006
|
+
"claude-runtime": [".claude/**"],
|
|
19007
|
+
config: ["config/**"]
|
|
19008
|
+
};
|
|
19009
|
+
var FORBIDDEN_GLOBS = [
|
|
19010
|
+
"**",
|
|
19011
|
+
"docs/**",
|
|
19012
|
+
"tests/**"
|
|
19013
|
+
];
|
|
19014
|
+
var CARRIED_KEYS = [
|
|
19015
|
+
"version",
|
|
19016
|
+
"shared_surfaces",
|
|
19017
|
+
"shared_surface_globs",
|
|
19018
|
+
"over_breadth_fraction"
|
|
19019
|
+
];
|
|
19020
|
+
var BlastRadiusDeriveError = class extends Error {
|
|
19021
|
+
/** Destination-relative path of the document that failed to parse. */
|
|
19022
|
+
path;
|
|
19023
|
+
/**
|
|
19024
|
+
* @param path Path named in the message.
|
|
19025
|
+
* @param detail Parser detail appended to the message.
|
|
19026
|
+
*/
|
|
19027
|
+
constructor(path11, detail) {
|
|
19028
|
+
super(
|
|
19029
|
+
`Bundled blast-radius document is not valid JSON and was not written: ${path11} (${detail})`
|
|
19030
|
+
);
|
|
19031
|
+
this.name = "BlastRadiusDeriveError";
|
|
19032
|
+
this.path = path11;
|
|
19033
|
+
}
|
|
19034
|
+
};
|
|
19035
|
+
var BlastRadiusGuardError = class extends Error {
|
|
19036
|
+
/** The forbidden glob that tripped the guard. */
|
|
19037
|
+
glob;
|
|
19038
|
+
/** Name of the module that would have carried the forbidden glob. */
|
|
19039
|
+
moduleName;
|
|
19040
|
+
/**
|
|
19041
|
+
* @param moduleName Module the forbidden glob was assigned to.
|
|
19042
|
+
* @param glob The forbidden glob.
|
|
19043
|
+
*/
|
|
19044
|
+
constructor(moduleName, glob) {
|
|
19045
|
+
super(
|
|
19046
|
+
`Derived blast-radius module ${moduleName} would emit the forbidden glob ${glob}; the derivation was aborted before writing.`
|
|
19047
|
+
);
|
|
19048
|
+
this.name = "BlastRadiusGuardError";
|
|
19049
|
+
this.glob = glob;
|
|
19050
|
+
this.moduleName = moduleName;
|
|
19051
|
+
}
|
|
19052
|
+
};
|
|
19053
|
+
function compareOrdinal(left, right) {
|
|
19054
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
19055
|
+
}
|
|
19056
|
+
function isExcludedDirectoryName(name) {
|
|
19057
|
+
return name.startsWith(".") || EXCLUDED_DIR_NAMES.has(name);
|
|
19058
|
+
}
|
|
19059
|
+
function isManifestFileName(fileName) {
|
|
19060
|
+
if (MANIFEST_FILENAMES.has(fileName)) {
|
|
19061
|
+
return true;
|
|
19062
|
+
}
|
|
19063
|
+
return MANIFEST_SUFFIXES.some((suffix2) => fileName.endsWith(suffix2));
|
|
19064
|
+
}
|
|
19065
|
+
function classifyProjectDirectories(observations) {
|
|
19066
|
+
const projectPaths = [];
|
|
19067
|
+
for (const observation of observations) {
|
|
19068
|
+
if (observation.relativePath === "") {
|
|
19069
|
+
continue;
|
|
19070
|
+
}
|
|
19071
|
+
if (observation.fileNames.some(isManifestFileName)) {
|
|
19072
|
+
projectPaths.push(observation.relativePath);
|
|
19073
|
+
}
|
|
19074
|
+
}
|
|
19075
|
+
return projectPaths.sort(compareOrdinal);
|
|
19076
|
+
}
|
|
19077
|
+
function pruneAncestors(paths) {
|
|
19078
|
+
return paths.filter(
|
|
19079
|
+
(candidate) => !paths.some(
|
|
19080
|
+
(other) => other !== candidate && other.startsWith(`${candidate}/`)
|
|
19081
|
+
)
|
|
19082
|
+
);
|
|
19083
|
+
}
|
|
19084
|
+
function topLevelDirectories(observations) {
|
|
19085
|
+
const names = [];
|
|
19086
|
+
for (const observation of observations) {
|
|
19087
|
+
const relativePath2 = observation.relativePath;
|
|
19088
|
+
if (relativePath2 !== "" && !relativePath2.includes("/")) {
|
|
19089
|
+
names.push(relativePath2);
|
|
19090
|
+
}
|
|
19091
|
+
}
|
|
19092
|
+
return names.sort(compareOrdinal);
|
|
19093
|
+
}
|
|
19094
|
+
function assembleModules(derivedPaths) {
|
|
19095
|
+
const combined = /* @__PURE__ */ new Map();
|
|
19096
|
+
for (const path11 of derivedPaths) {
|
|
19097
|
+
combined.set(path11, [`${path11}/**`]);
|
|
19098
|
+
}
|
|
19099
|
+
for (const [name, globs] of Object.entries(PAYLOAD_MODULES)) {
|
|
19100
|
+
combined.set(name, [...globs]);
|
|
19101
|
+
}
|
|
19102
|
+
const modules = {};
|
|
19103
|
+
for (const name of [...combined.keys()].sort(compareOrdinal)) {
|
|
19104
|
+
const globs = combined.get(name);
|
|
19105
|
+
if (globs !== void 0) {
|
|
19106
|
+
modules[name] = globs;
|
|
19107
|
+
}
|
|
19108
|
+
}
|
|
19109
|
+
return modules;
|
|
19110
|
+
}
|
|
19111
|
+
function assertNoForbiddenGlob(modules) {
|
|
19112
|
+
for (const [name, globs] of Object.entries(modules)) {
|
|
19113
|
+
for (const glob of globs) {
|
|
19114
|
+
if (FORBIDDEN_GLOBS.includes(glob)) {
|
|
19115
|
+
throw new BlastRadiusGuardError(name, glob);
|
|
19116
|
+
}
|
|
19117
|
+
}
|
|
19118
|
+
}
|
|
19119
|
+
}
|
|
19120
|
+
function parseSourceDocument(text) {
|
|
19121
|
+
let parsed;
|
|
19122
|
+
try {
|
|
19123
|
+
parsed = JSON.parse(text);
|
|
19124
|
+
} catch (error2) {
|
|
19125
|
+
const detail = error2 instanceof Error ? error2.message : String(error2);
|
|
19126
|
+
throw new BlastRadiusDeriveError(BLAST_RADIUS_RELATIVE_PATH, detail);
|
|
19127
|
+
}
|
|
19128
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
19129
|
+
throw new BlastRadiusDeriveError(
|
|
19130
|
+
BLAST_RADIUS_RELATIVE_PATH,
|
|
19131
|
+
"document root is not a JSON object"
|
|
19132
|
+
);
|
|
19133
|
+
}
|
|
19134
|
+
return parsed;
|
|
19135
|
+
}
|
|
19136
|
+
function deriveDestinationModuleMap(observations, sourceDocumentText) {
|
|
19137
|
+
const source = parseSourceDocument(sourceDocumentText);
|
|
19138
|
+
const projectPaths = pruneAncestors(classifyProjectDirectories(observations));
|
|
19139
|
+
const derivedPaths = projectPaths.length > 0 ? projectPaths : topLevelDirectories(observations);
|
|
19140
|
+
const modules = assembleModules(derivedPaths);
|
|
19141
|
+
assertNoForbiddenGlob(modules);
|
|
19142
|
+
const document = {
|
|
19143
|
+
version: source[CARRIED_KEYS[0]],
|
|
19144
|
+
shared_surfaces: source[CARRIED_KEYS[1]],
|
|
19145
|
+
shared_surface_globs: source[CARRIED_KEYS[2]],
|
|
19146
|
+
modules,
|
|
19147
|
+
over_breadth_fraction: source[CARRIED_KEYS[3]]
|
|
19148
|
+
};
|
|
19149
|
+
return `${JSON.stringify(document, null, 2)}
|
|
19150
|
+
`;
|
|
19151
|
+
}
|
|
19152
|
+
|
|
19153
|
+
// ../../extensions/drm-copilot/src/lib/push-down/claude-blast-radius-derive.ts
|
|
19154
|
+
function normalizePosix5(value) {
|
|
19155
|
+
return value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
19156
|
+
}
|
|
19157
|
+
function relativeToPosix5(path11, root) {
|
|
19158
|
+
const normalizedPath = normalizePosix5(path11);
|
|
19159
|
+
const normalizedRoot = normalizePosix5(root);
|
|
19160
|
+
if (normalizedPath === normalizedRoot) {
|
|
19161
|
+
return "";
|
|
19162
|
+
}
|
|
19163
|
+
const prefix = `${normalizedRoot}/`;
|
|
19164
|
+
return normalizedPath.startsWith(prefix) ? normalizedPath.slice(prefix.length) : null;
|
|
19165
|
+
}
|
|
19166
|
+
var realDirectoryLister = (root) => {
|
|
19167
|
+
let entries;
|
|
19168
|
+
try {
|
|
19169
|
+
entries = fs3.readdirSync(root, { withFileTypes: true });
|
|
19170
|
+
} catch {
|
|
19171
|
+
return [];
|
|
19172
|
+
}
|
|
19173
|
+
return entries.map((entry) => ({ name: entry.name, isDir: entry.isDirectory() })).sort(
|
|
19174
|
+
(left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0
|
|
19175
|
+
);
|
|
19176
|
+
};
|
|
19177
|
+
function listTolerantly(lister, path11) {
|
|
19178
|
+
try {
|
|
19179
|
+
return lister(path11);
|
|
19180
|
+
} catch {
|
|
19181
|
+
return [];
|
|
19182
|
+
}
|
|
19183
|
+
}
|
|
19184
|
+
function collectDestinationObservations(destinationRoot, lister) {
|
|
19185
|
+
const root = normalizePosix5(destinationRoot);
|
|
19186
|
+
const observations = [];
|
|
19187
|
+
let queue = [
|
|
19188
|
+
{ path: root, relativePath: "" }
|
|
19189
|
+
];
|
|
19190
|
+
for (let depth = 1; depth <= SCAN_DEPTH_LIMIT && queue.length > 0; depth++) {
|
|
19191
|
+
const nextQueue = [];
|
|
19192
|
+
for (const current of queue) {
|
|
19193
|
+
const entries = listTolerantly(lister, current.path);
|
|
19194
|
+
const fileNames = [];
|
|
19195
|
+
for (const entry of entries) {
|
|
19196
|
+
if (!entry.isDir) {
|
|
19197
|
+
fileNames.push(entry.name);
|
|
19198
|
+
continue;
|
|
19199
|
+
}
|
|
19200
|
+
if (isExcludedDirectoryName(entry.name)) {
|
|
19201
|
+
continue;
|
|
19202
|
+
}
|
|
19203
|
+
nextQueue.push({
|
|
19204
|
+
path: `${current.path}/${entry.name}`,
|
|
19205
|
+
relativePath: current.relativePath === "" ? entry.name : `${current.relativePath}/${entry.name}`
|
|
19206
|
+
});
|
|
19207
|
+
}
|
|
19208
|
+
observations.push({
|
|
19209
|
+
relativePath: current.relativePath,
|
|
19210
|
+
fileNames
|
|
19211
|
+
});
|
|
19212
|
+
}
|
|
19213
|
+
queue = nextQueue;
|
|
19214
|
+
}
|
|
19215
|
+
return observations;
|
|
19216
|
+
}
|
|
19217
|
+
var BlastRadiusDeriveFileSystem = class {
|
|
19218
|
+
inner;
|
|
19219
|
+
destinationRoot;
|
|
19220
|
+
deriveRelativePath;
|
|
19221
|
+
lister;
|
|
19222
|
+
/**
|
|
19223
|
+
* @param inner The wrapped adapter performing real I/O.
|
|
19224
|
+
* @param destinationRoot Destination workspace root (POSIX path).
|
|
19225
|
+
* @param lister Shallow directory lister; defaults to the real filesystem.
|
|
19226
|
+
* @param deriveRelativePath Destination-relative path to derive; defaults to
|
|
19227
|
+
* `config/blast-radius.json`.
|
|
19228
|
+
*/
|
|
19229
|
+
constructor(inner, destinationRoot, lister = realDirectoryLister, deriveRelativePath = BLAST_RADIUS_RELATIVE_PATH) {
|
|
19230
|
+
this.inner = inner;
|
|
19231
|
+
this.destinationRoot = normalizePosix5(destinationRoot);
|
|
19232
|
+
this.lister = lister;
|
|
19233
|
+
this.deriveRelativePath = deriveRelativePath;
|
|
19234
|
+
}
|
|
19235
|
+
/** @inheritdoc */
|
|
19236
|
+
listFiles(root) {
|
|
19237
|
+
return this.inner.listFiles(root);
|
|
19238
|
+
}
|
|
19239
|
+
/** @inheritdoc */
|
|
19240
|
+
isDir(path11) {
|
|
19241
|
+
return this.inner.isDir(path11);
|
|
19242
|
+
}
|
|
19243
|
+
/** @inheritdoc */
|
|
19244
|
+
isFile(path11) {
|
|
19245
|
+
return this.inner.isFile(path11);
|
|
19246
|
+
}
|
|
19247
|
+
/** @inheritdoc */
|
|
19248
|
+
readTextFile(path11) {
|
|
19249
|
+
return this.inner.readTextFile(path11);
|
|
19250
|
+
}
|
|
19251
|
+
/** @inheritdoc */
|
|
19252
|
+
ensureDir(path11) {
|
|
19253
|
+
this.inner.ensureDir(path11);
|
|
19254
|
+
}
|
|
19255
|
+
/**
|
|
19256
|
+
* Write a file, deriving the one configured blast-radius path.
|
|
19257
|
+
*
|
|
19258
|
+
* @param path Absolute destination POSIX path.
|
|
19259
|
+
* @param content Bundled source content the engine wants to publish, used as
|
|
19260
|
+
* the derivation's base document rather than written verbatim.
|
|
19261
|
+
* @throws BlastRadiusDeriveError When the bundled document is not parseable.
|
|
19262
|
+
* @throws BlastRadiusGuardError When a forbidden glob would be emitted. Both
|
|
19263
|
+
* errors are raised before the inner write, so the destination bytes are
|
|
19264
|
+
* left untouched.
|
|
19265
|
+
*/
|
|
19266
|
+
writeTextFile(path11, content) {
|
|
19267
|
+
if (!this.isDeriveTarget(path11)) {
|
|
19268
|
+
this.inner.writeTextFile(path11, content);
|
|
19269
|
+
return;
|
|
19270
|
+
}
|
|
19271
|
+
const observations = collectDestinationObservations(
|
|
19272
|
+
this.destinationRoot,
|
|
19273
|
+
this.lister
|
|
19274
|
+
);
|
|
19275
|
+
const derived = deriveDestinationModuleMap(observations, content);
|
|
19276
|
+
this.inner.writeTextFile(path11, derived);
|
|
19277
|
+
}
|
|
19278
|
+
/**
|
|
19279
|
+
* Return whether a destination path is the configured derivation target.
|
|
19280
|
+
*
|
|
19281
|
+
* @param path Absolute destination POSIX path.
|
|
19282
|
+
* @returns True when the path resolves to the derive-target relative path.
|
|
19283
|
+
*/
|
|
19284
|
+
isDeriveTarget(path11) {
|
|
19285
|
+
return relativeToPosix5(path11, this.destinationRoot) === this.deriveRelativePath;
|
|
19286
|
+
}
|
|
19287
|
+
};
|
|
19288
|
+
|
|
18965
19289
|
// ../../extensions/drm-copilot/src/lib/push-down/claude-customizations.ts
|
|
18966
19290
|
var ARTIFACT_DIRECTORY4 = "artifacts/claude-customizations";
|
|
18967
19291
|
var ROOT_FOLDERS2 = [".claude", "config"];
|
|
@@ -18979,7 +19303,7 @@ function joinPosix7(root, relative2) {
|
|
|
18979
19303
|
const normalizedRelative = relative2.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
18980
19304
|
return normalizedRoot === "" ? normalizedRelative : `${normalizedRoot}/${normalizedRelative}`;
|
|
18981
19305
|
}
|
|
18982
|
-
function resolvePublishedPaths2(packs, bundleRoot,
|
|
19306
|
+
function resolvePublishedPaths2(packs, bundleRoot, fs10) {
|
|
18983
19307
|
if (packs === null || packs.size === 0) {
|
|
18984
19308
|
return null;
|
|
18985
19309
|
}
|
|
@@ -18987,7 +19311,7 @@ function resolvePublishedPaths2(packs, bundleRoot, fs9) {
|
|
|
18987
19311
|
const manifests = loadPackManifests2(
|
|
18988
19312
|
manifestDir,
|
|
18989
19313
|
packs,
|
|
18990
|
-
|
|
19314
|
+
fs10
|
|
18991
19315
|
);
|
|
18992
19316
|
const published = computePublishedPaths2(packs, manifests);
|
|
18993
19317
|
const effectivePublished = published ?? /* @__PURE__ */ new Set();
|
|
@@ -18998,29 +19322,35 @@ function pushDownCustomizations4(options) {
|
|
|
18998
19322
|
const {
|
|
18999
19323
|
repoRoot,
|
|
19000
19324
|
destinationRoot,
|
|
19001
|
-
fs:
|
|
19325
|
+
fs: fs10,
|
|
19002
19326
|
sourceRoot,
|
|
19003
19327
|
artifactRoot,
|
|
19004
19328
|
packs,
|
|
19005
19329
|
csharpVariant,
|
|
19006
19330
|
memoryMode,
|
|
19007
19331
|
bundleRoot,
|
|
19008
|
-
clock
|
|
19332
|
+
clock,
|
|
19333
|
+
listEntries
|
|
19009
19334
|
} = options;
|
|
19010
19335
|
const effectiveSource = sourceRoot ?? repoRoot;
|
|
19011
19336
|
const effectiveBundle = bundleRoot ?? joinPosix7(effectiveSource, BUNDLE_ROOT_RELATIVE_DIR);
|
|
19012
19337
|
const publishedPaths = resolvePublishedPaths2(
|
|
19013
19338
|
packs ?? null,
|
|
19014
19339
|
effectiveBundle,
|
|
19015
|
-
|
|
19340
|
+
fs10
|
|
19016
19341
|
);
|
|
19017
19342
|
const mergingFs = new RoutingMergeFileSystem(
|
|
19018
|
-
|
|
19343
|
+
fs10,
|
|
19019
19344
|
destinationRoot,
|
|
19020
19345
|
ROUTING_MERGE_RELATIVE_PATH
|
|
19021
19346
|
);
|
|
19022
|
-
const
|
|
19347
|
+
const derivingFs = listEntries === void 0 ? new BlastRadiusDeriveFileSystem(mergingFs, destinationRoot) : new BlastRadiusDeriveFileSystem(
|
|
19023
19348
|
mergingFs,
|
|
19349
|
+
destinationRoot,
|
|
19350
|
+
listEntries
|
|
19351
|
+
);
|
|
19352
|
+
const excludingFs = new ExcludingFileSystem(
|
|
19353
|
+
derivingFs,
|
|
19024
19354
|
repoRoot,
|
|
19025
19355
|
EXCLUDED_RELATIVE_PATHS,
|
|
19026
19356
|
{
|
|
@@ -19178,7 +19508,7 @@ function runPushDownClaudeCustomizations(input, deps) {
|
|
|
19178
19508
|
var path7 = __toESM(require("node:path"));
|
|
19179
19509
|
|
|
19180
19510
|
// ../../extensions/drm-copilot/src/policy-audit-template-assets.ts
|
|
19181
|
-
var
|
|
19511
|
+
var fs4 = __toESM(require("node:fs"));
|
|
19182
19512
|
var path5 = __toESM(require("node:path"));
|
|
19183
19513
|
var POLICY_AUDIT_TEMPLATE_ASSET_METADATA = {
|
|
19184
19514
|
template: {
|
|
@@ -19222,8 +19552,8 @@ function copyBundledPolicyAuditTemplateAsset(bundledSourcePath, targetPath) {
|
|
|
19222
19552
|
if (normalizedTargetPath === bundledSourcePath) {
|
|
19223
19553
|
return normalizedTargetPath;
|
|
19224
19554
|
}
|
|
19225
|
-
|
|
19226
|
-
|
|
19555
|
+
fs4.mkdirSync(path5.dirname(normalizedTargetPath), { recursive: true });
|
|
19556
|
+
fs4.copyFileSync(bundledSourcePath, normalizedTargetPath);
|
|
19227
19557
|
return normalizedTargetPath;
|
|
19228
19558
|
}
|
|
19229
19559
|
|
|
@@ -19231,7 +19561,7 @@ function copyBundledPolicyAuditTemplateAsset(bundledSourcePath, targetPath) {
|
|
|
19231
19561
|
var path6 = __toESM(require("node:path"));
|
|
19232
19562
|
|
|
19233
19563
|
// ../../extensions/drm-copilot/src/lib/file-system.ts
|
|
19234
|
-
var
|
|
19564
|
+
var fs5 = __toESM(require("node:fs"));
|
|
19235
19565
|
var nodePath3 = __toESM(require("node:path"));
|
|
19236
19566
|
function toPosixPath2(value) {
|
|
19237
19567
|
return value.replace(/\\/g, "/");
|
|
@@ -19302,7 +19632,7 @@ var RealFileSystem = class {
|
|
|
19302
19632
|
const walk = (currentDir, relativePrefix) => {
|
|
19303
19633
|
let entries;
|
|
19304
19634
|
try {
|
|
19305
|
-
entries =
|
|
19635
|
+
entries = fs5.readdirSync(currentDir, { withFileTypes: true });
|
|
19306
19636
|
} catch {
|
|
19307
19637
|
return;
|
|
19308
19638
|
}
|
|
@@ -19325,7 +19655,7 @@ var RealFileSystem = class {
|
|
|
19325
19655
|
*/
|
|
19326
19656
|
isFile(path11) {
|
|
19327
19657
|
try {
|
|
19328
|
-
return
|
|
19658
|
+
return fs5.statSync(path11).isFile();
|
|
19329
19659
|
} catch {
|
|
19330
19660
|
return false;
|
|
19331
19661
|
}
|
|
@@ -19335,7 +19665,7 @@ var RealFileSystem = class {
|
|
|
19335
19665
|
* @returns True when `path` exists; false on any access error.
|
|
19336
19666
|
*/
|
|
19337
19667
|
exists(path11) {
|
|
19338
|
-
return
|
|
19668
|
+
return fs5.existsSync(path11);
|
|
19339
19669
|
}
|
|
19340
19670
|
/**
|
|
19341
19671
|
* @param path Path to test.
|
|
@@ -19343,7 +19673,7 @@ var RealFileSystem = class {
|
|
|
19343
19673
|
*/
|
|
19344
19674
|
isDirectory(path11) {
|
|
19345
19675
|
try {
|
|
19346
|
-
return
|
|
19676
|
+
return fs5.statSync(path11).isDirectory();
|
|
19347
19677
|
} catch {
|
|
19348
19678
|
return false;
|
|
19349
19679
|
}
|
|
@@ -19355,7 +19685,7 @@ var RealFileSystem = class {
|
|
|
19355
19685
|
*/
|
|
19356
19686
|
listDirectory(path11) {
|
|
19357
19687
|
try {
|
|
19358
|
-
return
|
|
19688
|
+
return fs5.readdirSync(path11).sort((left, right) => left.localeCompare(right));
|
|
19359
19689
|
} catch {
|
|
19360
19690
|
return [];
|
|
19361
19691
|
}
|
|
@@ -19365,14 +19695,14 @@ var RealFileSystem = class {
|
|
|
19365
19695
|
* @returns The file content decoded as UTF-8.
|
|
19366
19696
|
*/
|
|
19367
19697
|
readTextFile(path11) {
|
|
19368
|
-
return
|
|
19698
|
+
return fs5.readFileSync(path11, "utf8");
|
|
19369
19699
|
}
|
|
19370
19700
|
/**
|
|
19371
19701
|
* @param path File to write.
|
|
19372
19702
|
* @param content Text content to write as UTF-8.
|
|
19373
19703
|
*/
|
|
19374
19704
|
writeTextFile(path11, content) {
|
|
19375
|
-
|
|
19705
|
+
fs5.writeFileSync(path11, content, "utf8");
|
|
19376
19706
|
}
|
|
19377
19707
|
/**
|
|
19378
19708
|
* Create the directory at `path`, including any missing parents.
|
|
@@ -19384,7 +19714,7 @@ var RealFileSystem = class {
|
|
|
19384
19714
|
* @param path Directory path to create.
|
|
19385
19715
|
*/
|
|
19386
19716
|
ensureDir(path11) {
|
|
19387
|
-
|
|
19717
|
+
fs5.mkdirSync(path11, { recursive: true });
|
|
19388
19718
|
}
|
|
19389
19719
|
};
|
|
19390
19720
|
|
|
@@ -19464,7 +19794,7 @@ function buildFallbackReason(issueContent) {
|
|
|
19464
19794
|
function resolveTemplateName(templateKind) {
|
|
19465
19795
|
return templateKind === "execute" ? "execute-hard-lock.prompt.md" : "resume-hard-lock.prompt.md";
|
|
19466
19796
|
}
|
|
19467
|
-
function resolveTemplatePath(templateName, workspaceRoot, templateRoot,
|
|
19797
|
+
function resolveTemplatePath(templateName, workspaceRoot, templateRoot, fs10) {
|
|
19468
19798
|
const candidates = [];
|
|
19469
19799
|
if (templateRoot !== null) {
|
|
19470
19800
|
candidates.push(joinPosix9(templateRoot, templateName));
|
|
@@ -19476,18 +19806,18 @@ function resolveTemplatePath(templateName, workspaceRoot, templateRoot, fs9) {
|
|
|
19476
19806
|
)
|
|
19477
19807
|
);
|
|
19478
19808
|
for (const candidate of candidates) {
|
|
19479
|
-
if (
|
|
19809
|
+
if (fs10.isFile(candidate)) {
|
|
19480
19810
|
return { path: candidate, checked: candidates };
|
|
19481
19811
|
}
|
|
19482
19812
|
}
|
|
19483
19813
|
return { path: null, checked: candidates };
|
|
19484
19814
|
}
|
|
19485
|
-
function resolveIssueFileForTarget(targetPath, workspaceRoot,
|
|
19815
|
+
function resolveIssueFileForTarget(targetPath, workspaceRoot, fs10) {
|
|
19486
19816
|
const normalizedRoot = toPosixPath2(workspaceRoot).replace(/\/+$/, "");
|
|
19487
19817
|
const relativeTarget = tryRelativeToWorkspace(targetPath, workspaceRoot);
|
|
19488
19818
|
const planDir = parentOf(relativeTarget);
|
|
19489
19819
|
const directIssue = joinPosix9(joinPosix9(normalizedRoot, planDir), "issue.md");
|
|
19490
|
-
if (
|
|
19820
|
+
if (fs10.isFile(directIssue)) {
|
|
19491
19821
|
return directIssue;
|
|
19492
19822
|
}
|
|
19493
19823
|
const planDirParts = splitParts(planDir);
|
|
@@ -19497,15 +19827,15 @@ function resolveIssueFileForTarget(targetPath, workspaceRoot, fs9) {
|
|
|
19497
19827
|
joinPosix9(normalizedRoot, parentOf(planDir)),
|
|
19498
19828
|
"issue.md"
|
|
19499
19829
|
);
|
|
19500
|
-
if (
|
|
19830
|
+
if (fs10.isFile(parentIssue)) {
|
|
19501
19831
|
return parentIssue;
|
|
19502
19832
|
}
|
|
19503
19833
|
}
|
|
19504
19834
|
return directIssue;
|
|
19505
19835
|
}
|
|
19506
|
-
function resolveWorkModeFromIssue(targetPath, workspaceRoot,
|
|
19507
|
-
const issuePath = resolveIssueFileForTarget(targetPath, workspaceRoot,
|
|
19508
|
-
if (!
|
|
19836
|
+
function resolveWorkModeFromIssue(targetPath, workspaceRoot, fs10) {
|
|
19837
|
+
const issuePath = resolveIssueFileForTarget(targetPath, workspaceRoot, fs10);
|
|
19838
|
+
if (!fs10.isFile(issuePath)) {
|
|
19509
19839
|
return {
|
|
19510
19840
|
mode: resolveSelectedWorkMode(null),
|
|
19511
19841
|
fallbackReason: buildFallbackReason(null)
|
|
@@ -19513,7 +19843,7 @@ function resolveWorkModeFromIssue(targetPath, workspaceRoot, fs9) {
|
|
|
19513
19843
|
}
|
|
19514
19844
|
let issueContent;
|
|
19515
19845
|
try {
|
|
19516
|
-
issueContent =
|
|
19846
|
+
issueContent = fs10.readTextFile(issuePath);
|
|
19517
19847
|
} catch {
|
|
19518
19848
|
return {
|
|
19519
19849
|
mode: resolveSelectedWorkMode(null),
|
|
@@ -19525,13 +19855,13 @@ function resolveWorkModeFromIssue(targetPath, workspaceRoot, fs9) {
|
|
|
19525
19855
|
fallbackReason: buildFallbackReason(issueContent)
|
|
19526
19856
|
};
|
|
19527
19857
|
}
|
|
19528
|
-
function resolveHardLockPrompt(templateContent, targetPath, workspaceRoot,
|
|
19858
|
+
function resolveHardLockPrompt(templateContent, targetPath, workspaceRoot, fs10) {
|
|
19529
19859
|
const relativeTarget = tryRelativeToWorkspace(targetPath, workspaceRoot);
|
|
19530
19860
|
const planPathValue = toPosixPath2(relativeTarget);
|
|
19531
19861
|
const { mode, fallbackReason } = resolveWorkModeFromIssue(
|
|
19532
19862
|
targetPath,
|
|
19533
19863
|
workspaceRoot,
|
|
19534
|
-
|
|
19864
|
+
fs10
|
|
19535
19865
|
);
|
|
19536
19866
|
let resolved = templateContent.split("${plan-path}").join(planPathValue);
|
|
19537
19867
|
resolved = resolved.split("${work-mode}").join(mode);
|
|
@@ -19789,18 +20119,18 @@ function isAllDigits(value) {
|
|
|
19789
20119
|
function resolveSpecPath(folderpath) {
|
|
19790
20120
|
return joinFolder(folderpath, "spec.md");
|
|
19791
20121
|
}
|
|
19792
|
-
function resolveUserStoryValue(folderpath, workspaceRoot,
|
|
20122
|
+
function resolveUserStoryValue(folderpath, workspaceRoot, fs10) {
|
|
19793
20123
|
const relativeStory = joinFolder(folderpath, "user-story.md");
|
|
19794
20124
|
const fullStory = joinFolder(toPosixPath2(workspaceRoot), relativeStory);
|
|
19795
|
-
if (
|
|
20125
|
+
if (fs10.isFile(fullStory)) {
|
|
19796
20126
|
return relativeStory;
|
|
19797
20127
|
}
|
|
19798
20128
|
return `${relativeStory} (missing)`;
|
|
19799
20129
|
}
|
|
19800
|
-
function resolveResearchValue(folderpath, workspaceRoot,
|
|
20130
|
+
function resolveResearchValue(folderpath, workspaceRoot, fs10) {
|
|
19801
20131
|
const relativeResearch = joinFolder(folderpath, "research.md");
|
|
19802
20132
|
const fullResearch = joinFolder(toPosixPath2(workspaceRoot), relativeResearch);
|
|
19803
|
-
if (
|
|
20133
|
+
if (fs10.isFile(fullResearch)) {
|
|
19804
20134
|
return relativeResearch;
|
|
19805
20135
|
}
|
|
19806
20136
|
return null;
|
|
@@ -19812,12 +20142,12 @@ function joinFolder(folder, leaf) {
|
|
|
19812
20142
|
}
|
|
19813
20143
|
return `${normalizedFolder}/${leaf}`;
|
|
19814
20144
|
}
|
|
19815
|
-
function resolveWorkModeFromIssue2(folderpath, workspaceRoot,
|
|
20145
|
+
function resolveWorkModeFromIssue2(folderpath, workspaceRoot, fs10) {
|
|
19816
20146
|
const issuePath = joinFolder(
|
|
19817
20147
|
joinFolder(toPosixPath2(workspaceRoot), folderpath),
|
|
19818
20148
|
"issue.md"
|
|
19819
20149
|
);
|
|
19820
|
-
if (!
|
|
20150
|
+
if (!fs10.isFile(issuePath)) {
|
|
19821
20151
|
return {
|
|
19822
20152
|
mode: resolveSelectedWorkMode(null),
|
|
19823
20153
|
fallbackReason: buildFallbackReason(null)
|
|
@@ -19825,7 +20155,7 @@ function resolveWorkModeFromIssue2(folderpath, workspaceRoot, fs9) {
|
|
|
19825
20155
|
}
|
|
19826
20156
|
let issueContent;
|
|
19827
20157
|
try {
|
|
19828
|
-
issueContent =
|
|
20158
|
+
issueContent = fs10.readTextFile(issuePath);
|
|
19829
20159
|
} catch {
|
|
19830
20160
|
return {
|
|
19831
20161
|
mode: resolveSelectedWorkMode(null),
|
|
@@ -19839,7 +20169,7 @@ function resolveWorkModeFromIssue2(folderpath, workspaceRoot, fs9) {
|
|
|
19839
20169
|
}
|
|
19840
20170
|
|
|
19841
20171
|
// ../../extensions/drm-copilot/src/lib/resolve/file-prompt-core.ts
|
|
19842
|
-
function resolvePrompt(templateContent, targetPath, workspaceRoot,
|
|
20172
|
+
function resolvePrompt(templateContent, targetPath, workspaceRoot, fs10) {
|
|
19843
20173
|
let content = stripFrontMatter(templateContent);
|
|
19844
20174
|
const relativeTarget = tryRelativeToWorkspace2(targetPath, workspaceRoot);
|
|
19845
20175
|
const fileValue = toPosixPath2(relativeTarget);
|
|
@@ -19851,19 +20181,19 @@ function resolvePrompt(templateContent, targetPath, workspaceRoot, fs9) {
|
|
|
19851
20181
|
folderpath,
|
|
19852
20182
|
name,
|
|
19853
20183
|
spec: resolveSpecPath(folderpath),
|
|
19854
|
-
"user-story": resolveUserStoryValue(folderpath, workspaceRoot,
|
|
20184
|
+
"user-story": resolveUserStoryValue(folderpath, workspaceRoot, fs10)
|
|
19855
20185
|
};
|
|
19856
20186
|
const { mode, fallbackReason } = resolveWorkModeFromIssue2(
|
|
19857
20187
|
folderpath,
|
|
19858
20188
|
workspaceRoot,
|
|
19859
|
-
|
|
20189
|
+
fs10
|
|
19860
20190
|
);
|
|
19861
20191
|
variables["work-mode"] = mode;
|
|
19862
20192
|
variables["fallback-reason"] = fallbackReason;
|
|
19863
20193
|
if (mode === "minor-audit") {
|
|
19864
20194
|
content = applyMinorAuditOverrides(content);
|
|
19865
20195
|
}
|
|
19866
|
-
const researchValue = resolveResearchValue(folderpath, workspaceRoot,
|
|
20196
|
+
const researchValue = resolveResearchValue(folderpath, workspaceRoot, fs10);
|
|
19867
20197
|
if (researchValue === null) {
|
|
19868
20198
|
content = removeLinesReferencingVariable(content, "research");
|
|
19869
20199
|
} else {
|
|
@@ -25518,9 +25848,9 @@ function validatePhaseCompleteness(state) {
|
|
|
25518
25848
|
(phase) => `Checkpoint completion validation failed: route ${routeId} is missing mandatory phase ${phase}.`
|
|
25519
25849
|
);
|
|
25520
25850
|
}
|
|
25521
|
-
function loadRoutingMatrix(
|
|
25851
|
+
function loadRoutingMatrix(fs10, root) {
|
|
25522
25852
|
const path11 = `${toPosixPath2(root).replace(/\/+$/, "")}/${ROUTING_MATRIX_RELATIVE_PATH}`;
|
|
25523
|
-
return JSON.parse(
|
|
25853
|
+
return JSON.parse(fs10.readTextFile(path11));
|
|
25524
25854
|
}
|
|
25525
25855
|
function stringList(value) {
|
|
25526
25856
|
if (!Array.isArray(value)) {
|
|
@@ -27301,7 +27631,7 @@ function validateReceiptArrays(state, context) {
|
|
|
27301
27631
|
var CONTEXT = "Parallel checkpoint";
|
|
27302
27632
|
var EXPECTED_ROUTE_ID2 = "parallel";
|
|
27303
27633
|
var MIN_CONCURRENCY = 1;
|
|
27304
|
-
var MAX_CONCURRENCY =
|
|
27634
|
+
var MAX_CONCURRENCY = 32;
|
|
27305
27635
|
var REQUIRED_KEYS4 = [
|
|
27306
27636
|
"objective",
|
|
27307
27637
|
"completed_steps",
|
|
@@ -27451,7 +27781,7 @@ function validateParallelOrchestratorStateText(text, options = {}) {
|
|
|
27451
27781
|
// ../../extensions/drm-copilot/src/lib/validate/parallel-planner-state-core.ts
|
|
27452
27782
|
var CONTEXT2 = "Parallel planner checkpoint";
|
|
27453
27783
|
var MIN_CONCURRENCY2 = 1;
|
|
27454
|
-
var MAX_CONCURRENCY2 =
|
|
27784
|
+
var MAX_CONCURRENCY2 = 32;
|
|
27455
27785
|
var REQUIRED_KEYS5 = [
|
|
27456
27786
|
"objective",
|
|
27457
27787
|
"parallel_slug",
|
|
@@ -28137,7 +28467,7 @@ function buildValidateOrchestrationServiceCallInput(fileSystem, input, runner) {
|
|
|
28137
28467
|
}
|
|
28138
28468
|
|
|
28139
28469
|
// ../../extensions/drm-copilot/src/lib/new-potential-bug-entry.ts
|
|
28140
|
-
var
|
|
28470
|
+
var fs6 = __toESM(require("node:fs"));
|
|
28141
28471
|
var nodePath4 = __toESM(require("node:path"));
|
|
28142
28472
|
var SHORT_NAME_PATTERN2 = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
28143
28473
|
var INSIDERS_SIGNAL_NAMES = [
|
|
@@ -28210,7 +28540,7 @@ function defaultWhichLookup(executable) {
|
|
|
28210
28540
|
directory,
|
|
28211
28541
|
process.platform === "win32" ? `${executable}${extension}` : executable
|
|
28212
28542
|
);
|
|
28213
|
-
if (
|
|
28543
|
+
if (fs6.existsSync(candidate)) {
|
|
28214
28544
|
return candidate;
|
|
28215
28545
|
}
|
|
28216
28546
|
}
|
|
@@ -29567,9 +29897,9 @@ function extractIssueReferences2(text) {
|
|
|
29567
29897
|
}
|
|
29568
29898
|
return ordered;
|
|
29569
29899
|
}
|
|
29570
|
-
function resolveFeatureDir2(
|
|
29900
|
+
function resolveFeatureDir2(fs10, baseDir, feature) {
|
|
29571
29901
|
const direct = `${baseDir}/${feature}`;
|
|
29572
|
-
if (
|
|
29902
|
+
if (fs10.exists(direct)) {
|
|
29573
29903
|
return direct;
|
|
29574
29904
|
}
|
|
29575
29905
|
const pattern = new RegExp(
|
|
@@ -29578,9 +29908,9 @@ function resolveFeatureDir2(fs9, baseDir, feature) {
|
|
|
29578
29908
|
);
|
|
29579
29909
|
const strongMatches = [];
|
|
29580
29910
|
const weakMatches = [];
|
|
29581
|
-
for (const name of
|
|
29911
|
+
for (const name of fs10.listDirectory(baseDir)) {
|
|
29582
29912
|
const candidate = `${baseDir}/${name}`;
|
|
29583
|
-
if (!
|
|
29913
|
+
if (!fs10.isDirectory(candidate)) {
|
|
29584
29914
|
continue;
|
|
29585
29915
|
}
|
|
29586
29916
|
if (pattern.test(name)) {
|
|
@@ -29597,11 +29927,11 @@ function resolveFeatureDir2(fs9, baseDir, feature) {
|
|
|
29597
29927
|
}
|
|
29598
29928
|
return null;
|
|
29599
29929
|
}
|
|
29600
|
-
function readText(
|
|
29601
|
-
return
|
|
29930
|
+
function readText(fs10, path11) {
|
|
29931
|
+
return fs10.exists(path11) ? fs10.readTextFile(path11) : "";
|
|
29602
29932
|
}
|
|
29603
|
-
function latestGlobPath(
|
|
29604
|
-
const matches = [...
|
|
29933
|
+
function latestGlobPath(fs10, directory, pattern) {
|
|
29934
|
+
const matches = [...fs10.glob(directory, pattern)].sort(compareCodePoint4);
|
|
29605
29935
|
return matches.length > 0 ? matches[matches.length - 1] : null;
|
|
29606
29936
|
}
|
|
29607
29937
|
function verificationText(planText) {
|
|
@@ -29643,20 +29973,20 @@ function parseReadinessValue(text) {
|
|
|
29643
29973
|
}
|
|
29644
29974
|
return null;
|
|
29645
29975
|
}
|
|
29646
|
-
function resolveReadinessSignal(
|
|
29647
|
-
const auditFiles = [...
|
|
29976
|
+
function resolveReadinessSignal(fs10, featureDir) {
|
|
29977
|
+
const auditFiles = [...fs10.glob(featureDir, "feature-audit.*.md")].sort(
|
|
29648
29978
|
compareCodePoint4
|
|
29649
29979
|
);
|
|
29650
29980
|
for (let index = auditFiles.length - 1; index >= 0; index -= 1) {
|
|
29651
29981
|
const auditPath = auditFiles[index];
|
|
29652
|
-
const readiness = parseReadinessValue(readText(
|
|
29982
|
+
const readiness = parseReadinessValue(readText(fs10, auditPath));
|
|
29653
29983
|
if (readiness) {
|
|
29654
29984
|
return [readiness, auditPath];
|
|
29655
29985
|
}
|
|
29656
29986
|
}
|
|
29657
29987
|
return [null, null];
|
|
29658
29988
|
}
|
|
29659
|
-
function
|
|
29989
|
+
function relativeToPosix6(root, path11) {
|
|
29660
29990
|
const normalizedRoot = toPosixPath2(root).replace(/\/+$/u, "");
|
|
29661
29991
|
const normalized = toPosixPath2(path11);
|
|
29662
29992
|
if (normalized.startsWith(`${normalizedRoot}/`)) {
|
|
@@ -29684,17 +30014,17 @@ var CANONICAL_GLOBS = [
|
|
|
29684
30014
|
"evidence/regression-testing/**/*.md",
|
|
29685
30015
|
"evidence/other/**/*.md"
|
|
29686
30016
|
];
|
|
29687
|
-
function discoverCanonicalEvidenceFiles(
|
|
30017
|
+
function discoverCanonicalEvidenceFiles(fs10, root, feature) {
|
|
29688
30018
|
const normalizedRoot = toPosixPath2(root).replace(/\/+$/u, "");
|
|
29689
30019
|
const featureRoot = `${normalizedRoot}/docs/features/active/${feature}`;
|
|
29690
|
-
if (!
|
|
30020
|
+
if (!fs10.exists(featureRoot) || !fs10.isDirectory(featureRoot)) {
|
|
29691
30021
|
return [];
|
|
29692
30022
|
}
|
|
29693
30023
|
const discovered = /* @__PURE__ */ new Set();
|
|
29694
30024
|
for (const pattern of CANONICAL_GLOBS) {
|
|
29695
|
-
for (const candidate of
|
|
29696
|
-
if (
|
|
29697
|
-
discovered.add(
|
|
30025
|
+
for (const candidate of fs10.glob(featureRoot, pattern)) {
|
|
30026
|
+
if (fs10.isFile(candidate)) {
|
|
30027
|
+
discovered.add(relativeToPosix7(normalizedRoot, candidate));
|
|
29698
30028
|
}
|
|
29699
30029
|
}
|
|
29700
30030
|
}
|
|
@@ -29749,10 +30079,10 @@ function parseVerificationEvidenceMarkdown(params) {
|
|
|
29749
30079
|
};
|
|
29750
30080
|
}
|
|
29751
30081
|
function parseVerificationEvidenceFile(params) {
|
|
29752
|
-
const { fs:
|
|
30082
|
+
const { fs: fs10, root, feature, relativePath: relativePath2 } = params;
|
|
29753
30083
|
const normalizedRoot = toPosixPath2(root).replace(/\/+$/u, "");
|
|
29754
30084
|
const relPosix = toPosixPath2(relativePath2).replace(/^\/+/u, "");
|
|
29755
|
-
const markdown =
|
|
30085
|
+
const markdown = fs10.readTextFile(`${normalizedRoot}/${relPosix}`);
|
|
29756
30086
|
return parseVerificationEvidenceMarkdown({
|
|
29757
30087
|
feature,
|
|
29758
30088
|
sourceFile: relPosix,
|
|
@@ -29765,7 +30095,7 @@ function parseIntegerStrict(value) {
|
|
|
29765
30095
|
}
|
|
29766
30096
|
return Number.parseInt(value, 10);
|
|
29767
30097
|
}
|
|
29768
|
-
function
|
|
30098
|
+
function relativeToPosix7(root, absolute) {
|
|
29769
30099
|
const normalized = toPosixPath2(absolute);
|
|
29770
30100
|
if (normalized.startsWith(`${root}/`)) {
|
|
29771
30101
|
return normalized.slice(root.length + 1);
|
|
@@ -29814,15 +30144,15 @@ function extractFeatures3(changedFiles) {
|
|
|
29814
30144
|
}
|
|
29815
30145
|
return features;
|
|
29816
30146
|
}
|
|
29817
|
-
function gatherFeatureExcerpts2(
|
|
30147
|
+
function gatherFeatureExcerpts2(fs10, root, changedFiles) {
|
|
29818
30148
|
const normalizedRoot = toPosixPath2(root).replace(/\/+$/u, "");
|
|
29819
30149
|
const features = extractFeatures3(changedFiles);
|
|
29820
30150
|
const excerpts = [];
|
|
29821
30151
|
const baseDir = `${normalizedRoot}/docs/features/active`;
|
|
29822
30152
|
const promotedDir = `${normalizedRoot}/docs/features/potential/promoted`;
|
|
29823
30153
|
for (const feature of [...features].sort(compareCodePoint4)) {
|
|
29824
|
-
const featureDir = resolveFeatureDir2(
|
|
29825
|
-
const promotedFeatureDir = resolveFeatureDir2(
|
|
30154
|
+
const featureDir = resolveFeatureDir2(fs10, baseDir, feature);
|
|
30155
|
+
const promotedFeatureDir = resolveFeatureDir2(fs10, promotedDir, feature);
|
|
29826
30156
|
if (featureDir === null && promotedFeatureDir === null) {
|
|
29827
30157
|
continue;
|
|
29828
30158
|
}
|
|
@@ -29833,33 +30163,33 @@ function gatherFeatureExcerpts2(fs9, root, changedFiles) {
|
|
|
29833
30163
|
const specPath = `${activeDir}/spec.md`;
|
|
29834
30164
|
const issuePath = `${activeDir}/issue.md`;
|
|
29835
30165
|
let planPath = `${activeDir}/plan.md`;
|
|
29836
|
-
if (!
|
|
29837
|
-
const latestPlan = latestGlobPath(
|
|
30166
|
+
if (!fs10.exists(planPath)) {
|
|
30167
|
+
const latestPlan = latestGlobPath(fs10, activeDir, "plan.*.md");
|
|
29838
30168
|
if (latestPlan !== null) {
|
|
29839
30169
|
planPath = latestPlan;
|
|
29840
30170
|
}
|
|
29841
30171
|
}
|
|
29842
30172
|
let userStoryPath = `${activeDir}/user-story.md`;
|
|
29843
30173
|
const promotedStoryPath = promotedFeatureDir !== null ? `${promotedFeatureDir}/user-story.md` : null;
|
|
29844
|
-
const promotedStoryText = promotedStoryPath !== null ? readText(
|
|
29845
|
-
if (promotedStoryPath !== null && !
|
|
30174
|
+
const promotedStoryText = promotedStoryPath !== null ? readText(fs10, promotedStoryPath) : "";
|
|
30175
|
+
if (promotedStoryPath !== null && !fs10.exists(userStoryPath)) {
|
|
29846
30176
|
userStoryPath = promotedStoryPath;
|
|
29847
30177
|
}
|
|
29848
|
-
let userStoryText = readText(
|
|
30178
|
+
let userStoryText = readText(fs10, userStoryPath);
|
|
29849
30179
|
if (!userStoryText && promotedStoryText && promotedStoryPath !== null) {
|
|
29850
30180
|
userStoryText = promotedStoryText;
|
|
29851
30181
|
userStoryPath = promotedStoryPath;
|
|
29852
30182
|
}
|
|
29853
|
-
const specText = readText(
|
|
29854
|
-
const issueText = readText(
|
|
29855
|
-
const planText = readText(
|
|
30183
|
+
const specText = readText(fs10, specPath);
|
|
30184
|
+
const issueText = readText(fs10, issuePath);
|
|
30185
|
+
const planText = readText(fs10, planPath);
|
|
29856
30186
|
const primaryIssueRef = parsePrimaryIssueFromMetadata({
|
|
29857
30187
|
specText,
|
|
29858
30188
|
storyText: userStoryText,
|
|
29859
30189
|
issueText
|
|
29860
30190
|
});
|
|
29861
30191
|
const [readinessSignal, readinessSource] = resolveReadinessSignal(
|
|
29862
|
-
|
|
30192
|
+
fs10,
|
|
29863
30193
|
activeDir
|
|
29864
30194
|
);
|
|
29865
30195
|
const specParts = buildSpecParts(specText);
|
|
@@ -29874,7 +30204,7 @@ function gatherFeatureExcerpts2(fs9, root, changedFiles) {
|
|
|
29874
30204
|
verificationBlock
|
|
29875
30205
|
);
|
|
29876
30206
|
const contextFiles = buildContextFiles({
|
|
29877
|
-
fs:
|
|
30207
|
+
fs: fs10,
|
|
29878
30208
|
root: normalizedRoot,
|
|
29879
30209
|
feature,
|
|
29880
30210
|
candidatePaths: [specPath, issuePath, planPath, userStoryPath],
|
|
@@ -29958,18 +30288,18 @@ function buildExcerpt(feature, storyParts, specParts, planSection, verificationB
|
|
|
29958
30288
|
return lines.join("\n");
|
|
29959
30289
|
}
|
|
29960
30290
|
function buildContextFiles(params) {
|
|
29961
|
-
const { fs:
|
|
30291
|
+
const { fs: fs10, root, feature, candidatePaths, readinessSource } = params;
|
|
29962
30292
|
const contextFiles = [];
|
|
29963
30293
|
for (const path11 of candidatePaths) {
|
|
29964
|
-
if (
|
|
29965
|
-
contextFiles.push(
|
|
30294
|
+
if (fs10.exists(path11)) {
|
|
30295
|
+
contextFiles.push(relativeToPosix6(root, path11));
|
|
29966
30296
|
}
|
|
29967
30297
|
}
|
|
29968
30298
|
if (readinessSource !== null) {
|
|
29969
|
-
contextFiles.push(
|
|
30299
|
+
contextFiles.push(relativeToPosix6(root, readinessSource));
|
|
29970
30300
|
}
|
|
29971
30301
|
const evidenceContextFiles = discoverCanonicalEvidenceFiles(
|
|
29972
|
-
|
|
30302
|
+
fs10,
|
|
29973
30303
|
root,
|
|
29974
30304
|
feature
|
|
29975
30305
|
);
|
|
@@ -30182,7 +30512,7 @@ function isScopingDoc(path11) {
|
|
|
30182
30512
|
return lowered.startsWith("docs/features/") && (lowered.endsWith("/spec.md") || lowered.endsWith("/plan.md") || lowered.endsWith("/bug-remediation-plan.md") || lowered.endsWith("/user-story.md") || lowered.endsWith("/readme.md"));
|
|
30183
30513
|
}
|
|
30184
30514
|
function scopingDocChanges(options) {
|
|
30185
|
-
const { git, fs:
|
|
30515
|
+
const { git, fs: fs10, mergeBase, headSha, root, nameStatusText, numstatDetails } = options;
|
|
30186
30516
|
if (!mergeBase || !headSha) {
|
|
30187
30517
|
return [];
|
|
30188
30518
|
}
|
|
@@ -30238,8 +30568,8 @@ function scopingDocChanges(options) {
|
|
|
30238
30568
|
}
|
|
30239
30569
|
let excerpt = null;
|
|
30240
30570
|
const docPath = `${stripTrailingSlash(root)}/${path11}`;
|
|
30241
|
-
if (material &&
|
|
30242
|
-
const content =
|
|
30571
|
+
if (material && fs10.exists(docPath)) {
|
|
30572
|
+
const content = fs10.readTextFile(docPath);
|
|
30243
30573
|
const excerptParts = [];
|
|
30244
30574
|
for (const heading of SCOPING_EXCERPT_HEADINGS) {
|
|
30245
30575
|
const sectionText = parseSection3(content, heading);
|
|
@@ -30315,16 +30645,16 @@ function isDigits2(value) {
|
|
|
30315
30645
|
var SUMMARY_CHAR_BUDGET = 16e4;
|
|
30316
30646
|
var APPENDIX_CHAR_BUDGET = 48e4;
|
|
30317
30647
|
function collectPrContext(options) {
|
|
30318
|
-
const { base, repoRoot, includeUntracked, fs:
|
|
30648
|
+
const { base, repoRoot, includeUntracked, fs: fs10, runner } = options;
|
|
30319
30649
|
const head = options.head ?? null;
|
|
30320
30650
|
const whichGh = options.whichGh;
|
|
30321
|
-
let git = new GitClient(runner, repoRoot,
|
|
30651
|
+
let git = new GitClient(runner, repoRoot, fs10);
|
|
30322
30652
|
const resolvedRoot = git.resolveRoot();
|
|
30323
|
-
git = new GitClient(runner, resolvedRoot,
|
|
30653
|
+
git = new GitClient(runner, resolvedRoot, fs10);
|
|
30324
30654
|
const gh = new GhClient({
|
|
30325
30655
|
runner,
|
|
30326
30656
|
cwd: resolvedRoot,
|
|
30327
|
-
fileSystem:
|
|
30657
|
+
fileSystem: fs10,
|
|
30328
30658
|
...whichGh === void 0 ? {} : { whichGh }
|
|
30329
30659
|
});
|
|
30330
30660
|
let ghAvailable = true;
|
|
@@ -30347,7 +30677,7 @@ function collectPrContext(options) {
|
|
|
30347
30677
|
ghAvailable
|
|
30348
30678
|
});
|
|
30349
30679
|
const changedPaths = extractChangedPaths(contextResult.text);
|
|
30350
|
-
const featureDocs = gatherFeatureExcerpts2(
|
|
30680
|
+
const featureDocs = gatherFeatureExcerpts2(fs10, resolvedRoot, changedPaths);
|
|
30351
30681
|
const additionalContextFiles = sortedSet3(
|
|
30352
30682
|
featureDocs.flatMap((doc) => doc.contextFiles).filter((path11) => path11)
|
|
30353
30683
|
);
|
|
@@ -30460,7 +30790,7 @@ function collectPrContext(options) {
|
|
|
30460
30790
|
const statusMap = parseNameStatusMap(nameStatusText);
|
|
30461
30791
|
const scopingChanges = scopingDocChanges({
|
|
30462
30792
|
git,
|
|
30463
|
-
fs:
|
|
30793
|
+
fs: fs10,
|
|
30464
30794
|
mergeBase: contextResult.mergeBase,
|
|
30465
30795
|
headSha: contextResult.headSha,
|
|
30466
30796
|
root: resolvedRoot,
|
|
@@ -30594,7 +30924,7 @@ function compareCodePoint6(left, right) {
|
|
|
30594
30924
|
}
|
|
30595
30925
|
|
|
30596
30926
|
// ../../extensions/drm-copilot/src/lib/pr-context/collector-output.ts
|
|
30597
|
-
function renderVerificationEvidenceSection(
|
|
30927
|
+
function renderVerificationEvidenceSection(fs10, resolvedRoot, featureDocs) {
|
|
30598
30928
|
const records = [];
|
|
30599
30929
|
for (const doc of featureDocs) {
|
|
30600
30930
|
for (const rawPath of doc.contextFiles) {
|
|
@@ -30605,7 +30935,7 @@ function renderVerificationEvidenceSection(fs9, resolvedRoot, featureDocs) {
|
|
|
30605
30935
|
try {
|
|
30606
30936
|
records.push(
|
|
30607
30937
|
parseVerificationEvidenceFile({
|
|
30608
|
-
fs:
|
|
30938
|
+
fs: fs10,
|
|
30609
30939
|
root: resolvedRoot,
|
|
30610
30940
|
feature: doc.feature,
|
|
30611
30941
|
relativePath: normalized
|
|
@@ -30638,7 +30968,7 @@ function renderVerificationEvidenceSection(fs9, resolvedRoot, featureDocs) {
|
|
|
30638
30968
|
}
|
|
30639
30969
|
return lines.join("\n");
|
|
30640
30970
|
}
|
|
30641
|
-
function buildSummaryText(collected,
|
|
30971
|
+
function buildSummaryText(collected, fs10, appendixPath) {
|
|
30642
30972
|
const ctx = collected.contextResult;
|
|
30643
30973
|
const ghStatusText = resolveGhStatusText(collected);
|
|
30644
30974
|
const intentBlock = [
|
|
@@ -30668,7 +30998,7 @@ function buildSummaryText(collected, fs9, appendixPath) {
|
|
|
30668
30998
|
const prDigests = collected.prDetailsList.map((detail) => prDigest(detail)).join("\n\n");
|
|
30669
30999
|
const featureSummary = buildFeatureSummary(collected.featureDocs);
|
|
30670
31000
|
const verificationEvidenceSection = renderVerificationEvidenceSection(
|
|
30671
|
-
|
|
31001
|
+
fs10,
|
|
30672
31002
|
collected.resolvedRoot,
|
|
30673
31003
|
collected.featureDocs
|
|
30674
31004
|
);
|
|
@@ -30753,16 +31083,16 @@ function buildAppendixText(collected, clock) {
|
|
|
30753
31083
|
}
|
|
30754
31084
|
return appendixText;
|
|
30755
31085
|
}
|
|
30756
|
-
function writeOutput(
|
|
31086
|
+
function writeOutput(fs10, text, outPath, append) {
|
|
30757
31087
|
const parent = parentDir(outPath);
|
|
30758
31088
|
if (parent) {
|
|
30759
|
-
|
|
31089
|
+
fs10.ensureDir(parent);
|
|
30760
31090
|
}
|
|
30761
|
-
if (append &&
|
|
30762
|
-
const existing =
|
|
30763
|
-
|
|
31091
|
+
if (append && fs10.isFile(outPath)) {
|
|
31092
|
+
const existing = fs10.readTextFile(outPath);
|
|
31093
|
+
fs10.writeTextFile(outPath, existing + text);
|
|
30764
31094
|
} else {
|
|
30765
|
-
|
|
31095
|
+
fs10.writeTextFile(outPath, text);
|
|
30766
31096
|
}
|
|
30767
31097
|
}
|
|
30768
31098
|
function collectAndWrite(options) {
|
|
@@ -31206,7 +31536,7 @@ function normalizeSmartPunctuation(text) {
|
|
|
31206
31536
|
var nodePath7 = __toESM(require("node:path"));
|
|
31207
31537
|
|
|
31208
31538
|
// ../../extensions/drm-copilot/src/lib/potential-to-issue/promotion-filesystem.ts
|
|
31209
|
-
var
|
|
31539
|
+
var fs7 = __toESM(require("node:fs"));
|
|
31210
31540
|
var nodeOs = __toESM(require("node:os"));
|
|
31211
31541
|
var nodePath6 = __toESM(require("node:path"));
|
|
31212
31542
|
var RealPotentialFileSystem = class {
|
|
@@ -31223,24 +31553,24 @@ var RealPotentialFileSystem = class {
|
|
|
31223
31553
|
}
|
|
31224
31554
|
/** @returns True when `path` exists. */
|
|
31225
31555
|
exists(path11) {
|
|
31226
|
-
return
|
|
31556
|
+
return fs7.existsSync(path11);
|
|
31227
31557
|
}
|
|
31228
31558
|
/** @returns The UTF-8 file content. */
|
|
31229
31559
|
readText(path11) {
|
|
31230
|
-
return
|
|
31560
|
+
return fs7.readFileSync(path11, "utf8");
|
|
31231
31561
|
}
|
|
31232
31562
|
/** Write `lines` joined with `\n` as UTF-8 text. */
|
|
31233
31563
|
writeLines(path11, lines) {
|
|
31234
|
-
|
|
31564
|
+
fs7.writeFileSync(path11, lines.join("\n"), "utf8");
|
|
31235
31565
|
}
|
|
31236
31566
|
/** Create `path` and any missing parents (idempotent). */
|
|
31237
31567
|
ensureDir(path11) {
|
|
31238
|
-
|
|
31568
|
+
fs7.mkdirSync(path11, { recursive: true });
|
|
31239
31569
|
}
|
|
31240
31570
|
/** Move `src` to `dest`, ensuring the destination parent exists first. */
|
|
31241
31571
|
move(src, dest) {
|
|
31242
|
-
|
|
31243
|
-
|
|
31572
|
+
fs7.mkdirSync(nodePath6.dirname(dest), { recursive: true });
|
|
31573
|
+
fs7.renameSync(src, dest);
|
|
31244
31574
|
}
|
|
31245
31575
|
};
|
|
31246
31576
|
|
|
@@ -31886,7 +32216,7 @@ function replaceRegexLiteral(source, pattern, replacement) {
|
|
|
31886
32216
|
}
|
|
31887
32217
|
|
|
31888
32218
|
// ../../extensions/drm-copilot/src/lib/new-active-feature-folder/io-launcher.ts
|
|
31889
|
-
var
|
|
32219
|
+
var fs8 = __toESM(require("node:fs"));
|
|
31890
32220
|
var nodePath9 = __toESM(require("node:path"));
|
|
31891
32221
|
var INSIDERS_SIGNAL_NAMES2 = [
|
|
31892
32222
|
"TERM_PROGRAM_VERSION",
|
|
@@ -31904,7 +32234,7 @@ function defaultWhichLookup2(executable) {
|
|
|
31904
32234
|
directory,
|
|
31905
32235
|
process.platform === "win32" ? `${executable}${extension}` : executable
|
|
31906
32236
|
);
|
|
31907
|
-
if (
|
|
32237
|
+
if (fs8.existsSync(candidate)) {
|
|
31908
32238
|
return candidate;
|
|
31909
32239
|
}
|
|
31910
32240
|
}
|
|
@@ -31973,14 +32303,14 @@ function stem(path11) {
|
|
|
31973
32303
|
const ext = suffix(path11);
|
|
31974
32304
|
return ext ? name.slice(0, name.length - ext.length) : name;
|
|
31975
32305
|
}
|
|
31976
|
-
function findPotentialFile(featureName, workspace2,
|
|
32306
|
+
function findPotentialFile(featureName, workspace2, fs10) {
|
|
31977
32307
|
const normalized = featureName.replace(/_/g, "-");
|
|
31978
32308
|
const potentialDirs = [
|
|
31979
32309
|
joinPosix13(workspace2, "docs/features/potential"),
|
|
31980
32310
|
joinPosix13(workspace2, "docs/features/potential/promoted")
|
|
31981
32311
|
];
|
|
31982
32312
|
for (const directory of potentialDirs) {
|
|
31983
|
-
const candidates =
|
|
32313
|
+
const candidates = fs10.listFiles(directory).filter(
|
|
31984
32314
|
(file) => suffix(file) === ".md" && baseName(file).includes(normalized) && !EXCLUDED_POTENTIAL_NAMES.has(baseName(file))
|
|
31985
32315
|
);
|
|
31986
32316
|
if (candidates.length > 0) {
|
|
@@ -32011,12 +32341,12 @@ function buildFolderSlug(featureName, potentialFile, issueNumber) {
|
|
|
32011
32341
|
}
|
|
32012
32342
|
return slug;
|
|
32013
32343
|
}
|
|
32014
|
-
function copyTemplate(featureType, templateDir, targetDir,
|
|
32344
|
+
function copyTemplate(featureType, templateDir, targetDir, fs10) {
|
|
32015
32345
|
if (featureType === "bug") {
|
|
32016
32346
|
for (const name of ["spec.md", PLAN_TIMESTAMP_TEMPLATE_NAME, "plan.md"]) {
|
|
32017
32347
|
const src = joinPosix13(templateDir, name);
|
|
32018
|
-
if (
|
|
32019
|
-
|
|
32348
|
+
if (fs10.exists(src)) {
|
|
32349
|
+
fs10.copyFile(src, joinPosix13(targetDir, name));
|
|
32020
32350
|
if (name === PLAN_TIMESTAMP_TEMPLATE_NAME) {
|
|
32021
32351
|
break;
|
|
32022
32352
|
}
|
|
@@ -32025,35 +32355,35 @@ function copyTemplate(featureType, templateDir, targetDir, fs9) {
|
|
|
32025
32355
|
} else if (featureType === "epic") {
|
|
32026
32356
|
for (const name of ["epic.md", "epic-status.md"]) {
|
|
32027
32357
|
const src = joinPosix13(templateDir, name);
|
|
32028
|
-
if (
|
|
32029
|
-
|
|
32358
|
+
if (fs10.exists(src)) {
|
|
32359
|
+
fs10.copyFile(src, joinPosix13(targetDir, name));
|
|
32030
32360
|
}
|
|
32031
32361
|
}
|
|
32032
32362
|
} else {
|
|
32033
|
-
|
|
32363
|
+
fs10.copyTree(templateDir, targetDir);
|
|
32034
32364
|
}
|
|
32035
32365
|
}
|
|
32036
|
-
function copyFeatureTemplateForMinorAudit(templateDir, targetDir,
|
|
32366
|
+
function copyFeatureTemplateForMinorAudit(templateDir, targetDir, fs10) {
|
|
32037
32367
|
const timestampedPlan = joinPosix13(templateDir, PLAN_TIMESTAMP_TEMPLATE_NAME);
|
|
32038
|
-
if (
|
|
32039
|
-
|
|
32368
|
+
if (fs10.exists(timestampedPlan)) {
|
|
32369
|
+
fs10.copyFile(
|
|
32040
32370
|
timestampedPlan,
|
|
32041
32371
|
joinPosix13(targetDir, PLAN_TIMESTAMP_TEMPLATE_NAME)
|
|
32042
32372
|
);
|
|
32043
32373
|
return;
|
|
32044
32374
|
}
|
|
32045
32375
|
const legacyPlan = joinPosix13(templateDir, "plan.md");
|
|
32046
|
-
if (
|
|
32047
|
-
|
|
32376
|
+
if (fs10.exists(legacyPlan)) {
|
|
32377
|
+
fs10.copyFile(legacyPlan, joinPosix13(targetDir, "plan.md"));
|
|
32048
32378
|
}
|
|
32049
32379
|
}
|
|
32050
|
-
function materializePlanFile(featureType, targetDir, featureName, issueField, ownerField, parentField, statusField, versionField, planTimestamp,
|
|
32380
|
+
function materializePlanFile(featureType, targetDir, featureName, issueField, ownerField, parentField, statusField, versionField, planTimestamp, fs10) {
|
|
32051
32381
|
void featureType;
|
|
32052
32382
|
const templatePlan = joinPosix13(targetDir, PLAN_TIMESTAMP_TEMPLATE_NAME);
|
|
32053
|
-
if (
|
|
32383
|
+
if (fs10.exists(templatePlan)) {
|
|
32054
32384
|
const targetPlan = joinPosix13(targetDir, `plan.${planTimestamp}.md`);
|
|
32055
|
-
|
|
32056
|
-
let content =
|
|
32385
|
+
fs10.move(templatePlan, targetPlan);
|
|
32386
|
+
let content = fs10.readText(targetPlan);
|
|
32057
32387
|
const updatedField = planTimestamp;
|
|
32058
32388
|
content = setHeaderPlaceholder(
|
|
32059
32389
|
content,
|
|
@@ -32065,11 +32395,11 @@ function materializePlanFile(featureType, targetDir, featureName, issueField, ow
|
|
|
32065
32395
|
parentField,
|
|
32066
32396
|
versionField
|
|
32067
32397
|
);
|
|
32068
|
-
|
|
32398
|
+
fs10.writeText(targetPlan, content);
|
|
32069
32399
|
return targetPlan;
|
|
32070
32400
|
}
|
|
32071
32401
|
const legacy = joinPosix13(targetDir, "plan.md");
|
|
32072
|
-
if (
|
|
32402
|
+
if (fs10.exists(legacy)) {
|
|
32073
32403
|
return legacy;
|
|
32074
32404
|
}
|
|
32075
32405
|
return null;
|
|
@@ -32114,11 +32444,11 @@ function defaultIssueFetcher(issueNumber, runner, ghLookup = defaultGhLookup) {
|
|
|
32114
32444
|
}
|
|
32115
32445
|
|
|
32116
32446
|
// ../../extensions/drm-copilot/src/lib/new-active-feature-folder/docs.ts
|
|
32117
|
-
function applyHeaderAndSections(path11, featureName, issueField, ownerField, updatedField, parentField, statusField, versionField,
|
|
32118
|
-
if (!
|
|
32447
|
+
function applyHeaderAndSections(path11, featureName, issueField, ownerField, updatedField, parentField, statusField, versionField, fs10, updates) {
|
|
32448
|
+
if (!fs10.exists(path11)) {
|
|
32119
32449
|
return;
|
|
32120
32450
|
}
|
|
32121
|
-
let content =
|
|
32451
|
+
let content = fs10.readText(path11);
|
|
32122
32452
|
content = setHeaderPlaceholder(
|
|
32123
32453
|
content,
|
|
32124
32454
|
featureName,
|
|
@@ -32132,9 +32462,9 @@ function applyHeaderAndSections(path11, featureName, issueField, ownerField, upd
|
|
|
32132
32462
|
for (const [sectionName, body] of updates) {
|
|
32133
32463
|
content = setSection(content, sectionName, body);
|
|
32134
32464
|
}
|
|
32135
|
-
|
|
32465
|
+
fs10.writeText(path11, content);
|
|
32136
32466
|
}
|
|
32137
|
-
function updateFeatureDocs(featureType, featureName, targetDir, issueField, ownerField, updatedField, parentField, statusField, versionField, planUpdatedField,
|
|
32467
|
+
function updateFeatureDocs(featureType, featureName, targetDir, issueField, ownerField, updatedField, parentField, statusField, versionField, planUpdatedField, fs10, sections, planPath) {
|
|
32138
32468
|
const filesToOpen = [];
|
|
32139
32469
|
const get = (key) => sections[key] ?? "";
|
|
32140
32470
|
if (featureType === "feature") {
|
|
@@ -32150,7 +32480,7 @@ function updateFeatureDocs(featureType, featureName, targetDir, issueField, owne
|
|
|
32150
32480
|
parentField,
|
|
32151
32481
|
statusField,
|
|
32152
32482
|
versionField,
|
|
32153
|
-
|
|
32483
|
+
fs10,
|
|
32154
32484
|
[
|
|
32155
32485
|
["Problem / Why", get("problem")],
|
|
32156
32486
|
["Acceptance Criteria", formatChecklist(get("criteria"))]
|
|
@@ -32165,7 +32495,7 @@ function updateFeatureDocs(featureType, featureName, targetDir, issueField, owne
|
|
|
32165
32495
|
parentField,
|
|
32166
32496
|
statusField,
|
|
32167
32497
|
versionField,
|
|
32168
|
-
|
|
32498
|
+
fs10,
|
|
32169
32499
|
[
|
|
32170
32500
|
["Overview", get("problem")],
|
|
32171
32501
|
["Behavior", get("behavior")],
|
|
@@ -32185,7 +32515,7 @@ function updateFeatureDocs(featureType, featureName, targetDir, issueField, owne
|
|
|
32185
32515
|
parentField,
|
|
32186
32516
|
statusField,
|
|
32187
32517
|
versionField,
|
|
32188
|
-
|
|
32518
|
+
fs10,
|
|
32189
32519
|
[]
|
|
32190
32520
|
);
|
|
32191
32521
|
filesToOpen.push(userStory, spec, plan);
|
|
@@ -32201,7 +32531,7 @@ function updateFeatureDocs(featureType, featureName, targetDir, issueField, owne
|
|
|
32201
32531
|
parentField,
|
|
32202
32532
|
statusField,
|
|
32203
32533
|
versionField,
|
|
32204
|
-
|
|
32534
|
+
fs10,
|
|
32205
32535
|
[
|
|
32206
32536
|
["Intent & Outcomes", get("problem")],
|
|
32207
32537
|
["Scope (structural changes)", get("behavior")],
|
|
@@ -32221,7 +32551,7 @@ function updateFeatureDocs(featureType, featureName, targetDir, issueField, owne
|
|
|
32221
32551
|
parentField,
|
|
32222
32552
|
statusField,
|
|
32223
32553
|
versionField,
|
|
32224
|
-
|
|
32554
|
+
fs10,
|
|
32225
32555
|
[]
|
|
32226
32556
|
);
|
|
32227
32557
|
filesToOpen.push(spec, plan);
|
|
@@ -32236,7 +32566,7 @@ function updateFeatureDocs(featureType, featureName, targetDir, issueField, owne
|
|
|
32236
32566
|
parentField,
|
|
32237
32567
|
statusField,
|
|
32238
32568
|
versionField,
|
|
32239
|
-
|
|
32569
|
+
fs10,
|
|
32240
32570
|
[]
|
|
32241
32571
|
);
|
|
32242
32572
|
filesToOpen.push(epic);
|
|
@@ -32298,11 +32628,11 @@ ${get("bug_logs")}`);
|
|
|
32298
32628
|
parentField,
|
|
32299
32629
|
statusField,
|
|
32300
32630
|
versionField,
|
|
32301
|
-
|
|
32631
|
+
fs10,
|
|
32302
32632
|
updates
|
|
32303
32633
|
);
|
|
32304
32634
|
if (bugValidation) {
|
|
32305
|
-
let specContent =
|
|
32635
|
+
let specContent = fs10.readText(spec);
|
|
32306
32636
|
const updateTestStrategy = (body) => prependToSectionBody(body, `Seeded from issue:
|
|
32307
32637
|
|
|
32308
32638
|
${bugValidation}`);
|
|
@@ -32311,7 +32641,7 @@ ${bugValidation}`);
|
|
|
32311
32641
|
"Test Strategy",
|
|
32312
32642
|
updateTestStrategy
|
|
32313
32643
|
);
|
|
32314
|
-
|
|
32644
|
+
fs10.writeText(spec, specContent);
|
|
32315
32645
|
}
|
|
32316
32646
|
applyHeaderAndSections(
|
|
32317
32647
|
plan,
|
|
@@ -32322,7 +32652,7 @@ ${bugValidation}`);
|
|
|
32322
32652
|
parentField,
|
|
32323
32653
|
statusField,
|
|
32324
32654
|
versionField,
|
|
32325
|
-
|
|
32655
|
+
fs10,
|
|
32326
32656
|
[]
|
|
32327
32657
|
);
|
|
32328
32658
|
filesToOpen.push(spec, plan);
|
|
@@ -33388,7 +33718,7 @@ function readPackageVersion(extensionRoot) {
|
|
|
33388
33718
|
const packageJsonPath = path10.join(extensionRoot, "package.json");
|
|
33389
33719
|
try {
|
|
33390
33720
|
const packageJson = JSON.parse(
|
|
33391
|
-
|
|
33721
|
+
fs9.readFileSync(packageJsonPath, "utf-8")
|
|
33392
33722
|
);
|
|
33393
33723
|
return packageJson.version ?? "0.0.1";
|
|
33394
33724
|
} catch {
|