FlowGuard API - v1.2.0-tp.1
    Preparing search index...

    Interface ProfileDetectionInput

    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.

    interface ProfileDetectionInput {
        repoSignals: RepoSignals;
        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;
                }[];
            };
        };
    }
    Index

    Properties

    repoSignals: RepoSignals
    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">

      Per-collector execution status (legacy flat map — derived from diagnostics).

    • Optionaldiagnostics?: {
          name: string;
          status: "partial" | "failed" | "complete";
          durationMs: number;
          errorCode?: string;
          timedOut: boolean;
          degradedReason?: string;
      }[]

      Per-collector structured diagnostics: timing, status, error info.

    • 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;
        }[]

        Detected ecosystem tools (e.g., openapi-generator, flyway, liquibase). Default [] for backward compat.

      • qualityTools: {
            id: string;
            confidence: number;
            classification: "fact" | "derived_signal" | "hypothesis";
            evidence: string[];
            version?: string;
            versionEvidence?: string;
            compilerTarget?: string;
            compilerTargetEvidence?: string;
        }[]

        Detected quality/analysis tools (e.g., spotless, checkstyle, jacoco). Default [] for backward compat.

      • databases: {
            id: string;
            confidence: number;
            classification: "fact" | "derived_signal" | "hypothesis";
            evidence: string[];
            version?: string;
            versionEvidence?: string;
            compilerTarget?: string;
            compilerTargetEvidence?: string;
        }[]

        Detected database engines (e.g., postgresql, mysql, mongodb). Default [] for backward compat.

    • 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[]

        Root-level config files (relative paths).

      • ignorePaths: string[]

        Paths to ignore during analysis (node_modules, dist, etc.).

    • 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;
        }[]

        Advisory semantic test targets when framework/test patterns are detected.

      • 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

          Total source-file candidates before budget slice.

        • OptionalbudgetExhausted?: boolean

          Whether budget exhaustion truncated the scan (true = partial due to budget).

      • OptionalsemanticExtraction?: {
            status: "partial" | "applied" | "heuristic_only";
            appliedExtractors: string[];
            unsupportedReason: string | null;
            diagnostics: string[];
        }

        Optional semantic extraction diagnostics; advisory, bounded, and non-authoritative.

      • OptionalreadStatuses?: Record<
            string,
            "read_ok"
            | "not_found"
            | "denied"
            | "parse_failed"
            | "too_large",
        >

        Per-file read outcome diagnostics (populated when reads degrade).

    • 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[]

        Files that might contain domain glossary (README, GLOSSARY, etc.).

    • 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;
          }[];
      }

      Validation hints derived from stack + topology analysis.

      Superseded by verificationCandidates (planVerificationCandidates output). Retained for discovery digest stability. Do not consume for agent guidance.