Optional Readonlydiscovery
discovery?: {
schemaVersion: "discovery.v1";
collectedAt: string;
collectors: Record<string, "partial" | "failed" | "complete">;
diagnostics?: {
name: string;
status: "partial" | "failed" | "complete";
durationMs: number;
errorCode?: string;
timedOut: boolean;
degradedReason?: string;
}[];
repoMetadata: {
defaultBranch: string
| null;
headCommit: string | null;
isDirty: boolean;
worktreePath: string;
canonicalRemote: string | null;
fingerprint: string;
};
stack: {
languages: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
frameworks: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
buildTools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
testFrameworks: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
runtimes: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
tools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
qualityTools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
databases: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
};
topology: {
kind: "unknown"
| "monorepo"
| "single-project";
modules: { path: string; name: string; manifestFile: string }[];
entryPoints: {
path: string;
kind: "other" | "main" | "bin" | "script" | "handler";
}[];
rootConfigs: string[];
ignorePaths: string[];
};
surfaces: {
api: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
persistence: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
cicd: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
security: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
layers: { name: string; pathPatterns: string[] }[];
};
codeSurfaces?: {
status: "ok"
| "partial"
| "failed";
endpoints: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[];
authBoundaries: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
dataAccess: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
integrations: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
testTargets?: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
budget: {
scannedFiles: number;
scannedBytes: number;
maxFiles: number;
maxBytesPerFile: number;
maxTotalBytes: number;
timedOut: boolean;
totalSourceCandidates?: number;
budgetExhausted?: boolean;
};
semanticExtraction?: {
status: "partial"
| "applied"
| "heuristic_only";
appliedExtractors: string[];
unsupportedReason: string | null;
diagnostics: string[];
};
readStatuses?: Record<
string,
"read_ok"
| "not_found"
| "denied"
| "parse_failed"
| "too_large",
>;
};
domainSignals: {
keywords: {
term: string;
occurrences: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
}[];
glossarySources: string[];
};
validationHints: {
commands: {
kind: "other"
| "format"
| "build"
| "test"
| "lint"
| "typecheck";
command: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
}[];
lintTools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
};
}
Type Declaration
schemaVersion: "discovery.v1"
collectedAt: string
collectors: Record<string, "partial" | "failed" | "complete">
Optionaldiagnostics?: {
name: string;
status: "partial" | "failed" | "complete";
durationMs: number;
errorCode?: string;
timedOut: boolean;
degradedReason?: string;
}[]
repoMetadata: {
defaultBranch: string | null;
headCommit: string | null;
isDirty: boolean;
worktreePath: string;
canonicalRemote: string | null;
fingerprint: string;
}
stack: {
languages: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
frameworks: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
buildTools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
testFrameworks: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
runtimes: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
tools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
qualityTools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
databases: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
}
languages: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
frameworks: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
buildTools: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
testFrameworks: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
runtimes: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
tools: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
qualityTools: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
databases: {
id: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[]
topology: {
kind: "unknown" | "monorepo" | "single-project";
modules: { path: string; name: string; manifestFile: string }[];
entryPoints: {
path: string;
kind: "other" | "main" | "bin" | "script" | "handler";
}[];
rootConfigs: string[];
ignorePaths: string[];
}
kind: "unknown" | "monorepo" | "single-project"
modules: { path: string; name: string; manifestFile: string }[]
entryPoints: { path: string; kind: "other" | "main" | "bin" | "script" | "handler" }[]
rootConfigs: string[]
ignorePaths: string[]
surfaces: {
api: {
id: string;
label: string;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
}[];
persistence: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
cicd: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
security: {
id: string;
label: string;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
}[];
layers: { name: string; pathPatterns: string[] }[];
}
OptionalcodeSurfaces?: {
status: "ok" | "partial" | "failed";
endpoints: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[];
authBoundaries: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
dataAccess: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
integrations: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
testTargets?: {
id: string;
label: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
location: string;
}[];
budget: {
scannedFiles: number;
scannedBytes: number;
maxFiles: number;
maxBytesPerFile: number;
maxTotalBytes: number;
timedOut: boolean;
totalSourceCandidates?: number;
budgetExhausted?: boolean;
};
semanticExtraction?: {
status: "partial"
| "applied"
| "heuristic_only";
appliedExtractors: string[];
unsupportedReason: string | null;
diagnostics: string[];
};
readStatuses?: Record<
string,
"read_ok"
| "not_found"
| "denied"
| "parse_failed"
| "too_large",
>;
}
status: "ok" | "partial" | "failed"
endpoints: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[]
authBoundaries: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[]
dataAccess: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[]
integrations: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[]
OptionaltestTargets?: {
id: string;
label: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
evidence: string[];
location: string;
}[]
budget: {
scannedFiles: number;
scannedBytes: number;
maxFiles: number;
maxBytesPerFile: number;
maxTotalBytes: number;
timedOut: boolean;
totalSourceCandidates?: number;
budgetExhausted?: boolean;
}
scannedFiles: number
scannedBytes: number
maxFiles: number
maxBytesPerFile: number
maxTotalBytes: number
timedOut: boolean
OptionaltotalSourceCandidates?: number
OptionalbudgetExhausted?: boolean
OptionalsemanticExtraction?: {
status: "partial" | "applied" | "heuristic_only";
appliedExtractors: string[];
unsupportedReason: string | null;
diagnostics: string[];
}
OptionalreadStatuses?: Record<
string,
"read_ok"
| "not_found"
| "denied"
| "parse_failed"
| "too_large",
>
domainSignals: {
keywords: {
term: string;
occurrences: number;
classification: "fact" | "derived_signal" | "hypothesis";
}[];
glossarySources: string[];
}
keywords: {
term: string;
occurrences: number;
classification: "fact" | "derived_signal" | "hypothesis";
}[]
glossarySources: string[]
validationHints: {
commands: {
kind: "other" | "format" | "build" | "test" | "lint" | "typecheck";
command: string;
confidence: number;
classification: "fact" | "derived_signal" | "hypothesis";
}[];
lintTools: {
id: string;
confidence: number;
classification: "fact"
| "derived_signal"
| "hypothesis";
evidence: string[];
version?: string;
versionEvidence?: string;
compilerTarget?: string;
compilerTargetEvidence?: string;
}[];
}
Input struct for profile auto-detection.
Wraps RepoSignals (always available) and optionally DiscoveryResult (available after Phase 5 discovery). Profiles can use either or both.
This struct is evolvable: new fields can be added without changing the detect() function signature on FlowGuardProfile or ProfileRegistry.