From 8e3926a3aaf1083cf181dda70e4c5d5492292a6f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Aug 2026 23:09:09 +0000 Subject: [PATCH] Sync generated provider output --- .agents/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .claude/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .cursor/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .gemini/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .github/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .grok/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .hermes/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .kiro/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .../skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .pi/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .qoder/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .rovodev/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .trae-cn/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .trae/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- .vibe/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- plugin/skills/impeccable/scripts/doctor.mjs | 37 +++++++------------ .../impeccable/scripts/lib/staleness.mjs | 37 +++++++++++-------- 32 files changed, 560 insertions(+), 624 deletions(-) diff --git a/.agents/skills/impeccable/scripts/doctor.mjs b/.agents/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.agents/skills/impeccable/scripts/doctor.mjs +++ b/.agents/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.agents/skills/impeccable/scripts/lib/staleness.mjs b/.agents/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.agents/skills/impeccable/scripts/lib/staleness.mjs +++ b/.agents/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.claude/skills/impeccable/scripts/doctor.mjs b/.claude/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.claude/skills/impeccable/scripts/doctor.mjs +++ b/.claude/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.claude/skills/impeccable/scripts/lib/staleness.mjs b/.claude/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.claude/skills/impeccable/scripts/lib/staleness.mjs +++ b/.claude/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.cursor/skills/impeccable/scripts/doctor.mjs b/.cursor/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.cursor/skills/impeccable/scripts/doctor.mjs +++ b/.cursor/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.cursor/skills/impeccable/scripts/lib/staleness.mjs b/.cursor/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.cursor/skills/impeccable/scripts/lib/staleness.mjs +++ b/.cursor/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.gemini/skills/impeccable/scripts/doctor.mjs b/.gemini/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.gemini/skills/impeccable/scripts/doctor.mjs +++ b/.gemini/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.gemini/skills/impeccable/scripts/lib/staleness.mjs b/.gemini/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.gemini/skills/impeccable/scripts/lib/staleness.mjs +++ b/.gemini/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.github/skills/impeccable/scripts/doctor.mjs b/.github/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.github/skills/impeccable/scripts/doctor.mjs +++ b/.github/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.github/skills/impeccable/scripts/lib/staleness.mjs b/.github/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.github/skills/impeccable/scripts/lib/staleness.mjs +++ b/.github/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.grok/skills/impeccable/scripts/doctor.mjs b/.grok/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.grok/skills/impeccable/scripts/doctor.mjs +++ b/.grok/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.grok/skills/impeccable/scripts/lib/staleness.mjs b/.grok/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.grok/skills/impeccable/scripts/lib/staleness.mjs +++ b/.grok/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.hermes/skills/impeccable/scripts/doctor.mjs b/.hermes/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.hermes/skills/impeccable/scripts/doctor.mjs +++ b/.hermes/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.hermes/skills/impeccable/scripts/lib/staleness.mjs b/.hermes/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.hermes/skills/impeccable/scripts/lib/staleness.mjs +++ b/.hermes/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.kiro/skills/impeccable/scripts/doctor.mjs b/.kiro/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.kiro/skills/impeccable/scripts/doctor.mjs +++ b/.kiro/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.kiro/skills/impeccable/scripts/lib/staleness.mjs b/.kiro/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.kiro/skills/impeccable/scripts/lib/staleness.mjs +++ b/.kiro/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.opencode/skills/impeccable/scripts/doctor.mjs b/.opencode/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.opencode/skills/impeccable/scripts/doctor.mjs +++ b/.opencode/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.opencode/skills/impeccable/scripts/lib/staleness.mjs b/.opencode/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.opencode/skills/impeccable/scripts/lib/staleness.mjs +++ b/.opencode/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.pi/skills/impeccable/scripts/doctor.mjs b/.pi/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.pi/skills/impeccable/scripts/doctor.mjs +++ b/.pi/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.pi/skills/impeccable/scripts/lib/staleness.mjs b/.pi/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.pi/skills/impeccable/scripts/lib/staleness.mjs +++ b/.pi/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.qoder/skills/impeccable/scripts/doctor.mjs b/.qoder/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.qoder/skills/impeccable/scripts/doctor.mjs +++ b/.qoder/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.qoder/skills/impeccable/scripts/lib/staleness.mjs b/.qoder/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.qoder/skills/impeccable/scripts/lib/staleness.mjs +++ b/.qoder/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.rovodev/skills/impeccable/scripts/doctor.mjs b/.rovodev/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.rovodev/skills/impeccable/scripts/doctor.mjs +++ b/.rovodev/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.rovodev/skills/impeccable/scripts/lib/staleness.mjs b/.rovodev/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.rovodev/skills/impeccable/scripts/lib/staleness.mjs +++ b/.rovodev/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.trae-cn/skills/impeccable/scripts/doctor.mjs b/.trae-cn/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.trae-cn/skills/impeccable/scripts/doctor.mjs +++ b/.trae-cn/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.trae-cn/skills/impeccable/scripts/lib/staleness.mjs b/.trae-cn/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.trae-cn/skills/impeccable/scripts/lib/staleness.mjs +++ b/.trae-cn/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.trae/skills/impeccable/scripts/doctor.mjs b/.trae/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.trae/skills/impeccable/scripts/doctor.mjs +++ b/.trae/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.trae/skills/impeccable/scripts/lib/staleness.mjs b/.trae/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.trae/skills/impeccable/scripts/lib/staleness.mjs +++ b/.trae/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/.vibe/skills/impeccable/scripts/doctor.mjs b/.vibe/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/.vibe/skills/impeccable/scripts/doctor.mjs +++ b/.vibe/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/.vibe/skills/impeccable/scripts/lib/staleness.mjs b/.vibe/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/.vibe/skills/impeccable/scripts/lib/staleness.mjs +++ b/.vibe/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); } diff --git a/plugin/skills/impeccable/scripts/doctor.mjs b/plugin/skills/impeccable/scripts/doctor.mjs index ca3105809..b311f0366 100644 --- a/plugin/skills/impeccable/scripts/doctor.mjs +++ b/plugin/skills/impeccable/scripts/doctor.mjs @@ -33,13 +33,8 @@ import { stampProductSchema, } from './lib/artifact-schema.mjs'; import { - checkBuildPathUnset, - checkConfig, - checkDesignSidecar, + collectBootFindingGroups, checkNativePlatformEvidence, - checkProduct, - checkProjectRoots, - checkSurfaceBriefs, designSidecarCandidatesFor, } from './lib/staleness.mjs'; import { @@ -106,34 +101,30 @@ async function collect(cwd, targetOptions) { extractPlatform, readFile: safeRead, }); + const bootFindings = collectBootFindingGroups(ctx, { + absDesignPath, + sidecarCandidates, + projectRootPatterns: readProjectRootPatterns(ctx.repoRoot), + targetCandidates: workspaceCandidates, + }); const findings = [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), - ...(ctx.product - ? checkNativePlatformEvidence({ - projectRoot, - platform: ctx.platform, - product: ctx.product, - productPath: ctx.productPath, - }) - : []), - ...checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates, projectRoot }), + ...bootFindings.product, + ...bootFindings.nativePlatform, + ...bootFindings.designSidecar, ...checkDesignDrift({ designPath: absDesignPath, projectRoot }), ...checkDesignCoverage({ design: ctx.design, designPath: ctx.designPath, parseDesignMd }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + ...bootFindings.config, + ...bootFindings.buildPath, ...checkDetectorIgnores({ projectRoot, knownRuleIds }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + ...bootFindings.surfaceBriefs, ...checkHookInstallation({ projectRoot, repoRoot: ctx.repoRoot, providerId: IMPECCABLE_PROVIDER_ID, }), ...checkLegacyLiveState({ projectRoot }), - ...checkProjectRoots({ - patterns: readProjectRootPatterns(ctx.repoRoot), - candidates: workspaceCandidates, - }), + ...bootFindings.projectRoots, ...workspaceResult.findings, ]; diff --git a/plugin/skills/impeccable/scripts/lib/staleness.mjs b/plugin/skills/impeccable/scripts/lib/staleness.mjs index 80599095b..dde3b2715 100644 --- a/plugin/skills/impeccable/scripts/lib/staleness.mjs +++ b/plugin/skills/impeccable/scripts/lib/staleness.mjs @@ -488,41 +488,46 @@ export function describeWorkspaceContext(candidates = []) { // ─── Tier 1 orchestration ────────────────────────────────────────────────── /** - * Everything a boot can afford. `ctx` is the loadContext result; `extras` - * carries values the caller already computed so nothing is recomputed here. + * Everything a boot can afford, grouped by artifact so deeper reports can + * interleave their own checks without rebuilding this policy. `ctx` is the + * loadContext result; `extras` carries values the caller already computed so + * nothing is recomputed here. */ -export function collectBootFindings(ctx, extras = {}) { - if (!ctx) return []; +export function collectBootFindingGroups(ctx, extras = {}) { + if (!ctx) return {}; const projectRoot = ctx.projectRoot || process.cwd(); - const absProductPath = extras.absProductPath || null; const absDesignPath = extras.absDesignPath || null; - return [ - ...checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), + return { + product: checkProduct(ctx.product, ctx.productPath || 'PRODUCT.md'), // Only checked once a PRODUCT.md exists. Without one the boot already // emits NO_PRODUCT_MD and routes into init, which asks for the platform // directly; a second signal saying the same thing is noise. - ...(ctx.product + nativePlatform: ctx.product ? checkNativePlatformEvidence({ projectRoot, platform: ctx.platform, product: ctx.product, productPath: ctx.productPath, }) - : []), - ...checkDesignSidecar({ + : [], + designSidecar: checkDesignSidecar({ designPath: absDesignPath, sidecarCandidates: extras.sidecarCandidates || [], projectRoot, }), - ...checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), - ...checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), - ...checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), - ...(extras.projectRootPatterns + config: checkConfig({ projectRoot, repoRoot: ctx.repoRoot }), + buildPath: checkBuildPathUnset({ projectRoot, repoRoot: ctx.repoRoot, product: ctx.product }), + surfaceBriefs: checkSurfaceBriefs({ candidates: ctx.surfaceBriefCandidates, projectRoot }), + projectRoots: extras.projectRootPatterns ? checkProjectRoots({ patterns: extras.projectRootPatterns, candidates: extras.targetCandidates || [], }) - : []), - ]; + : [], + }; +} + +export function collectBootFindings(ctx, extras = {}) { + return Object.values(collectBootFindingGroups(ctx, extras)).flat(); }