@moldea.ai/core 9.1.0 → 9.2.0

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/README.md CHANGED
@@ -88,12 +88,18 @@ Core checks each declared binding's file and, when a symbol is named, its syntax
88
88
 
89
89
  Every diagnostic has `severity`, `group`, and stable `source: 'core'`. The groups are `discovery`, `manifest`, `references`, `agents`, `mirrors`, and `integration`. The result reports complete `errorCount`, unaccepted `warningCount`, `acceptedWarningCount`, and `diagnosticCount`; warnings do not invalidate a project. Manifest `acceptedWarnings` match a warning's code, subject, and qualifier and require a non-empty reason. Accepted findings remain visible. Unmatched impact patterns are best-effort warnings; a skipped check never makes an acceptance obsolete. Validation and inspection also check the root `/AGENTS.md` managed block against its referenced skill installation, reporting missing blocks, missing installation files, drift, or a link that doesn't lead to a file in the repository, with its reason as qualifier, as acceptable integration warnings. They also check whether `/CLAUDE.md`, `/.claude/CLAUDE.md`, or, without shared files, `/CLAUDE.local.md` loads AGENTS.md through an import line or a link, reporting `MOLDEA_INTEGRATION_CLAUDE_IMPORT_MISSING` when it does not. An optional `instructions` reader supplies the four instruction files; links are followed inside the repository with Repository's `resolveRepositoryLink`, and link targets, the skill installation, and every other check read `repository`. `parseIntegrationBlock(text)` extracts the safe relative installation path or a reason it could not be found. Manifest-only operations and `scope` do not read the integration.
90
90
 
91
+ Managed-block comparison tolerates LF/CRLF differences, an optional final line break, empty lines immediately inside the markers, and spaces or tabs after marker comments. It preserves exact instruction text and internal whitespace; duplicate, reversed, missing, or otherwise malformed markers still produce diagnostics.
92
+
93
+ Core 9.2 supplies normalized scalar-based source ranges for pointer-addressed manifest and decision YAML diagnostics, including cross-file findings and unmatched acceptances. Missing members point to their nearest existing ancestor; existing explicit ranges stay unchanged. See [diagnostic locations](docs/diagnostics.md) for member spans and unavailable-source behavior.
94
+
91
95
  ## Resource and trust boundaries
92
96
 
93
97
  Core uses independent limits for distinct entries, total bytes read, per-file bytes, manifest bytes, logical retained bytes, diagnostics, and coverage records. The default logical retained-memory ceiling is 512 MiB. Before reading a supported source for export analysis, Core checks `maxFileBytes`, confirms read-buffer headroom, and reserves `65536 + sourceBytes * (8 + 512)` bytes for text and syntax nodes. An oversized source or reservation miss records `resource-limit` without a source read; a subsequent failed read, cancellation, or operation budget failure rejects the whole operation. Each distinct source is parsed at most once per operation. Source buffers and syntax reservations are released after analysis; only export names remain in the inventory cache. Core executes no repository code, follows instruction links only inside the snapshot, receives no host path or source credential, and returns logical paths only.
94
98
 
95
99
  Logical `RESOURCE_LIMIT_EXCEEDED` exceptions identify the exceeded limit, its configured maximum, the observed or projected usage, and `reduce-input-or-increase-limit`. Verified isolated-worker heap exhaustion uses `review-inspection-capacity` with unknown observed usage. Fixed transport limits have no next action. Core refuses an operation before allocating retained state beyond the applicable ceiling.
96
100
 
101
+ Private manifest and decision YAML trees and their pointer-lookup storage also reserve logical retained memory until final locations are resolved. These reservations are released on success or failure; they do not remain in prepared inspection handles.
102
+
97
103
  ## Development
98
104
 
99
105
  From the monorepo root:
@@ -1,4 +1,4 @@
1
- import { n as normalizeCoreOptions } from "./chunks/options-C5360E_N.js";
1
+ import { n as normalizeCoreOptions } from "./chunks/options-BXKLnSDR.js";
2
2
  import { n as CoreOperationException } from "./chunks/exceptions-AT654xUL.js";
3
3
  import { a as encodeInspectionMessage, d as NODE_INSPECTION_TRANSPORT_BYTES, i as decodeInspectionMessage, n as serializeInspectionFailure, o as NODE_INSPECTION_FILE_PAGE_BYTES, r as createInspectionProcessFailure, t as deserializeInspectionFailure } from "./chunks/errors-Uvb-9X1u.js";
4
4
  import { a as parseRpcLinkText, i as parseRpcFilePage, n as parseRpcEntry, r as parseRpcEntryPage } from "./chunks/repository-rpc-B9YaeLba.js";
@@ -91,7 +91,7 @@ var repository = createProxyReader("repository", start.snapshot);
91
91
  var instructions = start.instructions === null ? null : createProxyReader("instructions", start.instructions.snapshot);
92
92
  /** Prepares the fixed Core implementation after the parent acknowledges the heap. */
93
93
  var prepare = async () => {
94
- const { createCore } = await import("./chunks/core-CFmT3SRC.js").then((n) => n.t);
94
+ const { createCore } = await import("./chunks/core-DOzzzqoB.js").then((n) => n.t);
95
95
  inspection = await createCore(normalizeCoreOptions({ limits: {
96
96
  ...start.limits,
97
97
  maxRetainedBytes: start.limits.maxRetainedBytes - NODE_INSPECTION_TRANSPORT_BYTES
@@ -1,6 +1,6 @@
1
- import { a as escapeJsonPointerSegment, i as createCoreDiagnosticCollector, n as normalizeCoreOptions, o as normalizeDiagnostics, r as countDiagnosticsBySeverity, s as createNullPrototypeRecord, t as createCoreOperationOptionsSnapshot } from "./options-C5360E_N.js";
1
+ import { a as escapeJsonPointerSegment, c as measureYamlRetainedBytes, i as createCoreDiagnosticCollector, l as parseStrictYaml, n as normalizeCoreOptions, o as locateDiagnosticRanges, r as countDiagnosticsBySeverity, s as normalizeDiagnostics, t as createCoreOperationOptionsSnapshot, u as createNullPrototypeRecord } from "./options-BXKLnSDR.js";
2
2
  import { n as CoreOperationException } from "./exceptions-AT654xUL.js";
3
- import { _ as trimRepositoryFormatWhitespace, a as createSourceLocator, c as calculateContentDigest, d as countUnicodeScalars, f as hasNonWhitespace, g as parseDecisionIdFromPath, h as isVariableId, i as parseStrictYaml, l as calculateNormalizedTextDigest, m as isRuntimeGuidancePath, n as inspectManifestDocument, o as collectManifestScopeDeclarations, p as isContextPath, r as parseManifestDocument, s as matchesRepositoryGlob, t as matchManifestScope, u as normalizeTextDocument } from "./scope-CNg6Gnpi.js";
3
+ import { a as collectManifestScopeDeclarations, c as calculateNormalizedTextDigest, d as hasNonWhitespace, f as isContextPath, g as trimRepositoryFormatWhitespace, h as parseDecisionIdFromPath, i as createSourceLocator, l as normalizeTextDocument, m as isVariableId, n as inspectManifestDocument, o as matchesRepositoryGlob, p as isRuntimeGuidancePath, r as parseManifestDocument, s as calculateContentDigest, t as matchManifestScope, u as countUnicodeScalars } from "./scope-COlv6gct.js";
4
4
  import { ERRORS, compareCodePoints, deepFreeze, findMarkedRegion, isObjectValid } from "jg-utilities";
5
5
  import { hasErrorCode } from "jg-exception";
6
6
  import { REPOSITORY_LINK_TEXT_MAX_BYTES, REPOSITORY_ROOT, RepositorySourceException, compareRepositoryPaths, createRepositoryIdentity, isRepositoryPath, parseRepositoryPath, resolveRepositoryLink } from "@moldea.ai/repository";
@@ -352,7 +352,7 @@ var validateDecisionBody = (body, range, context) => {
352
352
  * - INVALID_ARGUMENT: The Core operation received an invalid argument.
353
353
  * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
354
354
  */
355
- var parseDecisionDocument = async (input, options, operation = "parse-decision") => {
355
+ var inspectDecisionDocument = async (input, options, operation = "parse-decision") => {
356
356
  options = createCoreOperationOptionsSnapshot(options);
357
357
  const normalized = normalizeTextDocument(input, options.limits, operation);
358
358
  const path = parseRepositoryPath(input.path);
@@ -366,7 +366,8 @@ var parseDecisionDocument = async (input, options, operation = "parse-decision")
366
366
  if (!normalized.valid || normalized.text === null) return deepFreeze({
367
367
  decision: null,
368
368
  diagnostics: diagnostics.finalize(),
369
- valid: false
369
+ valid: false,
370
+ yamlRoot: null
370
371
  });
371
372
  const context = {
372
373
  decisionId,
@@ -376,15 +377,19 @@ var parseDecisionDocument = async (input, options, operation = "parse-decision")
376
377
  const locator = createSourceLocator(normalized.text.value);
377
378
  const sections = extractDecisionSections(normalized.text.value, locator, context);
378
379
  let metadata = null;
380
+ let yamlRoot = null;
379
381
  if (sections !== null) {
380
382
  validateDecisionBody(sections.body, sections.bodyRange, context);
381
383
  const parsed = parseStrictYaml(sections.yaml, path, locator, diagnostics);
384
+ yamlRoot = parsed.value;
382
385
  if (parsed.valid && parsed.value !== null) metadata = validateDecisionFrontmatter(parsed.value, context);
383
386
  }
387
+ const locatedDiagnostics = locateDiagnosticRanges(diagnostics.finalize(), new Map(yamlRoot === null ? [] : [[path, yamlRoot]]));
384
388
  if (decisionId === null || sections === null || metadata === null || diagnostics.size > 0) return deepFreeze({
385
389
  decision: null,
386
- diagnostics: diagnostics.finalize(),
387
- valid: false
390
+ diagnostics: locatedDiagnostics,
391
+ valid: false,
392
+ yamlRoot
388
393
  });
389
394
  const digest = await calculateNormalizedTextDigest(normalized.text);
390
395
  const asset = {
@@ -404,8 +409,25 @@ var parseDecisionDocument = async (input, options, operation = "parse-decision")
404
409
  status: metadata.status,
405
410
  supersedes: metadata.supersedes
406
411
  },
407
- diagnostics: diagnostics.finalize(),
408
- valid: true
412
+ diagnostics: locatedDiagnostics,
413
+ valid: true,
414
+ yamlRoot
415
+ });
416
+ };
417
+ /**
418
+ * Parses a decision without exposing private YAML nodes to public callers.
419
+ * @returns The immutable decision parse result.
420
+ * @throws
421
+ * - INVALID_REPOSITORY_PATH: The repository path is invalid.
422
+ * - INVALID_ARGUMENT: The Core operation received an invalid argument.
423
+ * - RESOURCE_LIMIT_EXCEEDED: A Core resource limit was exceeded.
424
+ */
425
+ var parseDecisionDocument = async (input, options, operation = "parse-decision") => {
426
+ const inspection = await inspectDecisionDocument(input, options, operation);
427
+ return deepFreeze({
428
+ decision: inspection.decision,
429
+ diagnostics: inspection.diagnostics,
430
+ valid: inspection.valid
409
431
  });
410
432
  };
411
433
  //#endregion
@@ -1751,6 +1773,7 @@ var sortDecisions = (decisions) => {
1751
1773
  * @param paths The decision candidates retained by canonical discovery.
1752
1774
  * @param options The immutable Core limit snapshot.
1753
1775
  * @param signal Optional cancellation forwarded to every repository read.
1776
+ * @param retainYamlRoot Optional inspection owner that admits private roots to its memory ledger.
1754
1777
  * @returns A deeply immutable internal decision set and its deterministic diagnostics.
1755
1778
  * @throws
1756
1779
  * - ENTRY_NOT_FOUND: The requested repository entry was not found.
@@ -1764,7 +1787,7 @@ var sortDecisions = (decisions) => {
1764
1787
  * - ABORTED: The Core operation was aborted.
1765
1788
  * - ABORTED: The repository operation was aborted.
1766
1789
  */
1767
- var readDecisionGraph = async (repository, paths, options, signal) => {
1790
+ var readDecisionGraph = async (repository, paths, options, signal, retainYamlRoot) => {
1768
1791
  options = createCoreOperationOptionsSnapshot(options);
1769
1792
  const diagnostics = createCoreDiagnosticCollector(options.limits, "validate-project");
1770
1793
  const candidates = [];
@@ -1773,10 +1796,11 @@ var readDecisionGraph = async (repository, paths, options, signal) => {
1773
1796
  for (const path of [...paths].sort(compareCodePoints)) {
1774
1797
  const content = await repository.readCompleteFile(path, readOptions);
1775
1798
  if (!(content instanceof Uint8Array)) return invalidSourceData(path);
1776
- const parsed = await parseDecisionDocument({
1799
+ const parsed = await inspectDecisionDocument({
1777
1800
  content: content.slice(),
1778
1801
  path
1779
1802
  }, options, "validate-project");
1803
+ if (parsed.yamlRoot !== null) retainYamlRoot?.(path, parsed.yamlRoot);
1780
1804
  for (const diagnostic of parsed.diagnostics) diagnostics.merge(diagnostic);
1781
1805
  candidates.push({
1782
1806
  decision: parsed.decision,
@@ -1884,18 +1908,36 @@ var MARKERS = {
1884
1908
  };
1885
1909
  /**
1886
1910
  * Finds the managed block's region with the skill writer's region semantics: one start and one end
1887
- * marker, each on its own line, the start first.
1911
+ * marker, each on its own line with optional trailing spaces or tabs, the start first.
1888
1912
  * @param text The instruction document.
1889
1913
  * @returns The region, or why the document has none.
1890
1914
  */
1891
1915
  var parseManagedIntegrationRegion = (text) => {
1892
1916
  try {
1893
- return findMarkedRegion(text, MARKERS) ?? "block-missing";
1917
+ const region = findMarkedRegion(text.replace(/(<!-- moldea:(?:start|end) -->)[ \t]+(?=\r?$)/gmu, "$1"), MARKERS);
1918
+ if (region === null) return "block-missing";
1919
+ const start = text.indexOf(MARKERS.start);
1920
+ const closingLineBreak = text.indexOf("\n", text.indexOf(MARKERS.end));
1921
+ return {
1922
+ start,
1923
+ end: closingLineBreak === -1 ? text.length : closingLineBreak + 1,
1924
+ lineEnding: region.lineEnding
1925
+ };
1894
1926
  } catch (error) {
1895
1927
  if (hasErrorCode(error, ERRORS.INVALID_MARKED_REGION)) return "block-invalid";
1896
1928
  throw error;
1897
1929
  }
1898
1930
  };
1931
+ /** Removes only managed-envelope formatting differences, preserving all instruction content. */
1932
+ var normalizeManagedIntegrationBlock = (text) => {
1933
+ const normalized = text.replaceAll("\r\n", "\n").replace(/(<!-- moldea:(?:start|end) -->)[ \t]+(?=\n|$)/gu, "$1");
1934
+ if (!normalized.startsWith(`${MARKERS.start}\n`) || !(normalized.endsWith(MARKERS.end) || normalized.endsWith(`${MARKERS.end}\n`))) return normalized;
1935
+ let start = MARKERS.start.length;
1936
+ let end = normalized.lastIndexOf(MARKERS.end);
1937
+ while (start < end && normalized[start] === "\n") start++;
1938
+ while (end > start && normalized[end - 1] === "\n") end--;
1939
+ return `${MARKERS.start}\n${normalized.slice(start, end)}\n${MARKERS.end}`;
1940
+ };
1899
1941
  /**
1900
1942
  * Extracts the relative installation path from the fixed relevance-gate command without executing it.
1901
1943
  * @returns The safe installation path or the reason it could not be obtained.
@@ -2068,8 +2110,8 @@ var checkAgentsDocument = async (context, report, load, entryDetails) => {
2068
2110
  const renderedReservation = (asset.text.length + occurrences * skillPath.length) * 8;
2069
2111
  ledger.reserve(renderedReservation);
2070
2112
  try {
2071
- const expected = asset.text.replaceAll("{{skill-path}}", skillPath).replace(/\r\n?/g, "\n").replaceAll("\n", region.lineEnding);
2072
- if (document.text.slice(region.start, region.end) !== expected) return report("MOLDEA_INTEGRATION_BLOCK_STALE", { referencedPath: `/${skillPath}` });
2113
+ const expected = normalizeManagedIntegrationBlock(asset.text.replaceAll("{{skill-path}}", skillPath).replace(/\r\n?/gu, "\n"));
2114
+ if (normalizeManagedIntegrationBlock(document.text.slice(region.start, region.end)) !== expected) return report("MOLDEA_INTEGRATION_BLOCK_STALE", { referencedPath: `/${skillPath}` });
2073
2115
  } finally {
2074
2116
  ledger.release(renderedReservation);
2075
2117
  }
@@ -3117,86 +3159,102 @@ var inspectUniversalProject = async (context, options) => {
3117
3159
  const coverage = [];
3118
3160
  const collector = createCoreDiagnosticCollector(options.limits, "validate-project");
3119
3161
  const operationOptions = signal === void 0 ? void 0 : { signal };
3120
- const moldeaRoot = await session.reader.getEntry(MOLDEA_ROOT, operationOptions);
3121
- let manifestEntry = null;
3122
- let projectEntry = null;
3123
- let indexedManifest = null;
3124
- let formatVersion = null;
3125
- if (moldeaRoot?.type === "directory") {
3126
- manifestEntry = await session.reader.getEntry(MANIFEST_PATH, operationOptions);
3127
- if (manifestEntry?.type === "file") {
3128
- const content = await session.reader.readCompleteFile(MANIFEST_PATH, operationOptions);
3129
- const parsedManifest = await inspectManifestDocument({
3130
- content,
3131
- path: MANIFEST_PATH
3132
- }, options, "validate-project");
3133
- formatVersion = parsedManifest.formatVersion;
3134
- addDiagnostics(collector, parsedManifest.diagnostics);
3135
- if (parsedManifest.asset !== null && parsedManifest.manifest !== null) indexedManifest = {
3136
- asset: parsedManifest.asset,
3137
- value: parsedManifest.manifest
3138
- };
3162
+ const yamlRoots = /* @__PURE__ */ new Map();
3163
+ const memory = getRetainedMemory(session.reader);
3164
+ let retainedYamlBytes = 0;
3165
+ /** Reserves each parsed tree until final cross-file and acceptance locations are resolved. */
3166
+ const retainYamlRoot = (path, root) => {
3167
+ const bytes = measureYamlRetainedBytes(root);
3168
+ memory.reserve(bytes);
3169
+ retainedYamlBytes += bytes;
3170
+ yamlRoots.set(path, root);
3171
+ };
3172
+ try {
3173
+ const moldeaRoot = await session.reader.getEntry(MOLDEA_ROOT, operationOptions);
3174
+ let manifestEntry = null;
3175
+ let projectEntry = null;
3176
+ let indexedManifest = null;
3177
+ let formatVersion = null;
3178
+ if (moldeaRoot?.type === "directory") {
3179
+ manifestEntry = await session.reader.getEntry(MANIFEST_PATH, operationOptions);
3180
+ if (manifestEntry?.type === "file") {
3181
+ const content = await session.reader.readCompleteFile(MANIFEST_PATH, operationOptions);
3182
+ const parsedManifest = await inspectManifestDocument({
3183
+ content,
3184
+ path: MANIFEST_PATH
3185
+ }, options, "validate-project");
3186
+ if (parsedManifest.yamlRoot !== null) retainYamlRoot(MANIFEST_PATH, parsedManifest.yamlRoot);
3187
+ formatVersion = parsedManifest.formatVersion;
3188
+ addDiagnostics(collector, parsedManifest.diagnostics);
3189
+ if (parsedManifest.asset !== null && parsedManifest.manifest !== null) indexedManifest = {
3190
+ asset: parsedManifest.asset,
3191
+ value: parsedManifest.manifest
3192
+ };
3193
+ }
3194
+ projectEntry = await session.reader.getEntry(PROJECT_PATH, operationOptions);
3139
3195
  }
3140
- projectEntry = await session.reader.getEntry(PROJECT_PATH, operationOptions);
3141
- }
3142
- const projectFile = await readProjectFile(session.reader, projectEntry?.type === "file" ? PROJECT_PATH : null, options, signal);
3143
- addDiagnostics(collector, projectFile.diagnostics);
3144
- const discovery = await discoverCanonicalAssets(session.reader, options.limits, signal, {
3145
- manifest: manifestEntry,
3146
- moldeaRoot,
3147
- project: projectEntry
3148
- });
3149
- addDiagnostics(collector, discovery.diagnostics);
3150
- session.throwIfAborted();
3151
- const projectAssets = await readProjectAssets(session.reader, indexedManifest?.value ?? null, discovery, options, signal, projectFile);
3152
- addDiagnostics(collector, projectAssets.diagnostics);
3153
- const runtimeGuidance = await readRuntimeGuidance(session.reader, discovery.inventory.manifest ?? MANIFEST_PATH, indexedManifest?.value ?? null, discovery, options, signal);
3154
- addDiagnostics(collector, runtimeGuidance.diagnostics);
3155
- const decisionGraph = await readDecisionGraph(session.reader, discovery.inventory.decisions, options, signal);
3156
- addDiagnostics(collector, decisionGraph.diagnostics);
3157
- let agents = [];
3158
- let agentMirrors = [];
3159
- if (indexedManifest !== null) {
3160
- const manifestPath = indexedManifest.asset.path;
3161
- const agentAssets = await inspectAgentAssets(session.reader, indexedManifest.value, discovery, options, signal);
3162
- agents = agentAssets.agents;
3163
- addDiagnostics(collector, agentAssets.diagnostics);
3164
- addDiagnostics(collector, validateManifestRelationships(manifestPath, indexedManifest.value, discovery, decisionGraph.decisions, options.limits));
3165
- addDiagnostics(collector, await validateRepositoryReferences(session.reader, manifestPath, indexedManifest.value, discovery, options.limits, signal, coverage));
3166
- const mirrorInspection = await inspectMirrors(session.reader, manifestPath, agents, options, signal);
3167
- agentMirrors = mirrorInspection.agentMirrors;
3168
- addDiagnostics(collector, mirrorInspection.diagnostics);
3196
+ const projectFile = await readProjectFile(session.reader, projectEntry?.type === "file" ? PROJECT_PATH : null, options, signal);
3197
+ addDiagnostics(collector, projectFile.diagnostics);
3198
+ const discovery = await discoverCanonicalAssets(session.reader, options.limits, signal, {
3199
+ manifest: manifestEntry,
3200
+ moldeaRoot,
3201
+ project: projectEntry
3202
+ });
3203
+ addDiagnostics(collector, discovery.diagnostics);
3204
+ session.throwIfAborted();
3205
+ const projectAssets = await readProjectAssets(session.reader, indexedManifest?.value ?? null, discovery, options, signal, projectFile);
3206
+ addDiagnostics(collector, projectAssets.diagnostics);
3207
+ const runtimeGuidance = await readRuntimeGuidance(session.reader, discovery.inventory.manifest ?? MANIFEST_PATH, indexedManifest?.value ?? null, discovery, options, signal);
3208
+ addDiagnostics(collector, runtimeGuidance.diagnostics);
3209
+ const decisionGraph = await readDecisionGraph(session.reader, discovery.inventory.decisions, options, signal, retainYamlRoot);
3210
+ addDiagnostics(collector, decisionGraph.diagnostics);
3211
+ let agents = [];
3212
+ let agentMirrors = [];
3213
+ if (indexedManifest !== null) {
3214
+ const manifestPath = indexedManifest.asset.path;
3215
+ const agentAssets = await inspectAgentAssets(session.reader, indexedManifest.value, discovery, options, signal);
3216
+ agents = agentAssets.agents;
3217
+ addDiagnostics(collector, agentAssets.diagnostics);
3218
+ addDiagnostics(collector, validateManifestRelationships(manifestPath, indexedManifest.value, discovery, decisionGraph.decisions, options.limits));
3219
+ addDiagnostics(collector, await validateRepositoryReferences(session.reader, manifestPath, indexedManifest.value, discovery, options.limits, signal, coverage));
3220
+ const mirrorInspection = await inspectMirrors(session.reader, manifestPath, agents, options, signal);
3221
+ agentMirrors = mirrorInspection.agentMirrors;
3222
+ addDiagnostics(collector, mirrorInspection.diagnostics);
3223
+ }
3224
+ session.throwIfAborted();
3225
+ addDiagnostics(collector, await inspectCodingAgentIntegration(session.reader, session.instructions, options.limits, signal));
3226
+ const patterns = indexedManifest === null ? {
3227
+ completed: false,
3228
+ diagnostics: []
3229
+ } : await inspectImpactPatterns(session.reader, indexedManifest.value, options.limits, signal);
3230
+ session.throwIfAborted();
3231
+ addDiagnostics(collector, patterns.diagnostics);
3232
+ const diagnostics = locateDiagnosticRanges(applyWarningAcceptances(collector.finalize(), indexedManifest?.value.acceptedWarnings ?? [], /* @__PURE__ */ new Set([...[
3233
+ "MOLDEA_INTEGRATION_BLOCK_MISSING",
3234
+ "MOLDEA_INTEGRATION_SKILL_MISSING",
3235
+ "MOLDEA_INTEGRATION_BLOCK_STALE",
3236
+ "MOLDEA_INTEGRATION_LINK_UNRESOLVED",
3237
+ "MOLDEA_INTEGRATION_CLAUDE_IMPORT_MISSING"
3238
+ ], ...patterns.completed ? ["MOLDEA_IMPACT_PATTERN_UNMATCHED"] : []]), options.limits), yamlRoots);
3239
+ const project = !diagnostics.some((diagnostic) => diagnostic.severity === "error") && indexedManifest !== null && projectAssets.project !== null ? createProjectIndex({
3240
+ agentMirrors,
3241
+ agents,
3242
+ context: projectAssets.context,
3243
+ decisions: decisionGraph.decisions,
3244
+ manifest: indexedManifest,
3245
+ project: projectAssets.project,
3246
+ runtimes: runtimeGuidance.runtimes
3247
+ }) : null;
3248
+ return deepFreeze({
3249
+ diagnostics,
3250
+ coverage,
3251
+ formatVersion,
3252
+ project
3253
+ });
3254
+ } finally {
3255
+ yamlRoots.clear();
3256
+ memory.release(retainedYamlBytes);
3169
3257
  }
3170
- session.throwIfAborted();
3171
- addDiagnostics(collector, await inspectCodingAgentIntegration(session.reader, session.instructions, options.limits, signal));
3172
- const patterns = indexedManifest === null ? {
3173
- completed: false,
3174
- diagnostics: []
3175
- } : await inspectImpactPatterns(session.reader, indexedManifest.value, options.limits, signal);
3176
- session.throwIfAborted();
3177
- addDiagnostics(collector, patterns.diagnostics);
3178
- const diagnostics = applyWarningAcceptances(collector.finalize(), indexedManifest?.value.acceptedWarnings ?? [], /* @__PURE__ */ new Set([...[
3179
- "MOLDEA_INTEGRATION_BLOCK_MISSING",
3180
- "MOLDEA_INTEGRATION_SKILL_MISSING",
3181
- "MOLDEA_INTEGRATION_BLOCK_STALE",
3182
- "MOLDEA_INTEGRATION_LINK_UNRESOLVED",
3183
- "MOLDEA_INTEGRATION_CLAUDE_IMPORT_MISSING"
3184
- ], ...patterns.completed ? ["MOLDEA_IMPACT_PATTERN_UNMATCHED"] : []]), options.limits);
3185
- const project = !diagnostics.some((diagnostic) => diagnostic.severity === "error") && indexedManifest !== null && projectAssets.project !== null ? createProjectIndex({
3186
- agentMirrors,
3187
- agents,
3188
- context: projectAssets.context,
3189
- decisions: decisionGraph.decisions,
3190
- manifest: indexedManifest,
3191
- project: projectAssets.project,
3192
- runtimes: runtimeGuidance.runtimes
3193
- }) : null;
3194
- return deepFreeze({
3195
- diagnostics,
3196
- coverage,
3197
- formatVersion,
3198
- project
3199
- });
3200
3258
  };
3201
3259
  //#endregion
3202
3260
  //#region src/project-validation/index.ts
@@ -3633,4 +3691,4 @@ var createCore = (options) => {
3633
3691
  //#endregion
3634
3692
  export { createCore as n, parseIntegrationBlock as r, core_exports as t };
3635
3693
 
3636
- //# sourceMappingURL=core-CFmT3SRC.js.map
3694
+ //# sourceMappingURL=core-DOzzzqoB.js.map