Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/acdeveloper-sci/fortriage/llms.txt

Use this file to discover all available pages before exploring further.

All configuration for ForTriage is defined as typed constants in fortriage/config.py. Most constants are fixed defaults baked into the source — only PROMPTS_DIR is overridable at runtime via an environment variable. This page documents every constant, its type, default value, and effect on the application.

Forti4D Pipeline Invocation

These constants control how run_pipeline() invokes the forti4d subprocess.
ConstantTypeDefaultDescription
FORTI4D_COMMANDstr"forti4d"Console entry-point name installed by the forti4d package. Looked up via PATH by the subprocess layer.
FORTI4D_FLAGSlist[str]["--skip", "visual_graph", "--quiet"]CLI flags passed to every pipeline run. --skip visual_graph omits the graph rendering step; --quiet suppresses verbose progress output.
STDERR_TAIL_LINESint20Number of trailing stderr lines kept in a PipelineError message when Forti4D exits with a non-zero code. Only the tail tends to carry the actual error.

Pipeline Output Filenames

These constants define the filenames that Forti4D writes to the output directory. run_pipeline() reads each file by name after a successful analysis run.
ConstantTypeDefaultDescription
REPORT_PRIORITIZATIONstr"report_prioritization.csv"Prioritized findings by tier — one row per unit with Score, CC, Fan-In, Strategy, and Reachability_Status.
REPORT_CONSOLIDATEDstr"report_consolidated.csv"Full ~34-column diagnostic report per unit. Source for the Drill-down view’s detailed metrics.
PROJECT_SUMMARYstr"PROJECT_SUMMARY.md"Executive summary in Markdown format, rendered verbatim in the Executive Summary view.
REPORT_MIGRATION_STRATEGYstr"report_migration_strategy.csv"Per-unit migration strategy report, sorted by Priority_Num. Not pre-aggregated by strategy — one row per unit.
COMMON_COUPLINGstr"common_coupling.csv"COMMON block coupling report. Note: filename has no report_ prefix, unlike the other reports.
REPORT_CLONESstr"report_clones.csv"Duplicate and near-duplicate unit detection report — one row per clone pair.

Upload Constraints

These constants govern what files are accepted and what size limits are enforced across all upload mechanisms (direct file selection and ZIP archive).
ConstantTypeDefaultDescription
ALLOWED_EXTENSIONSset[str]{".f", ".f90", ".f95", ".for", ".fpp"}Fortran source file extensions accepted for upload. Files with other extensions are silently excluded from staging.
MAX_FILE_SIZE_MBint200Per-file size cap enforced uniformly across all upload mechanisms. Mirrors Streamlit’s platform default but is also enforced explicitly in Python for the ZIP mechanism, which bypasses st.file_uploader.
LARGE_CORPUS_WARNING_THRESHOLD_MBint6Total staged corpus size (in MB) above which a non-blocking warning appears before the user clicks “Run analysis”. Purely advisory — does not disable the run button or alter the analysis.
MAX_FILE_SIZE_MB applies per-file (not per-corpus). A ZIP archive with many files, each under 200 MB, is valid even if the total exceeds 200 MB. The LARGE_CORPUS_WARNING_THRESHOLD_MB threshold is the only corpus-level size gate, and it is advisory only.

Sample Fixtures

ConstantTypeDefaultDescription
SAMPLE_FIXTURES_ZIPPathtests/fixtures/fixtures.zipPath to the committed sample-fixtures ZIP. Fed through the existing ZIP upload path (extract_zip_entries / merge_upload_sources) by the “Load sample fixtures” button. The same small corpus used by Forti4D’s own test suite — included purely as a demo and onboarding aid.

Tier and Reachability Colors

These constants define the visual identity for tiers and reachability statuses. They are shared by summary cards, bar charts, table badges, and the Drill-down modal so that tier color is visually consistent everywhere it appears.
ConstantTypeDescription
TIER_ORDERlist[str]Canonical severity ordering used for chart axis domains and sort defaults: ["CRITICAL", "HIGH", "MEDIUM", "LOW", "DEAD_CODE"].
TIER_COLORSdict[str, str]Hex color per tier. See the Risk Tiers reference for color meanings and usage.
REACHABILITY_COLORSdict[str, str]Hex colors for REACHABLE (#5B9BD5), UNREACHABLE (#D64545), and ENTRY_POINT (#E8874A).
TIER_COLORS values:
TierHex
CRITICAL#D64545
HIGH#E8874A
MEDIUM#E8C547
LOW#5B9BD5
DEAD_CODE#9AA5B1
REACHABILITY_COLORS values:
StatusHex
REACHABLE#5B9BD5
UNREACHABLE#D64545
ENTRY_POINT#E8874A

AI Insights

These constants configure the Gemini provider adapter (gemini_client.py) and the context aggregation thresholds used by insights_context.py.
ConstantTypeDefaultDescription
PROMPTS_DIRPathprompts/ (repo root)Root directory for LLM prompt files. Overridable at runtime via the FORTRIAGE_PROMPTS_DIR environment variable — mirrors the FORT_SRC/FORT_OUT pattern used by the pipeline.
AI_INSIGHTS_MODELstr"gemini-3.5-flash-lite"Gemini model ID used for both structured insights generation and follow-up chat.
AI_INSIGHTS_TIMEOUT_SECONDSfloat30.0Per-request timeout in seconds passed to the Gemini SDK’s http_options.timeout for all API calls.
AI_INSIGHTS_CHAT_ENABLEDboolTrueHard switch for the chat sub-feature. When False, the chat UI is not rendered even if a Gemini API key is configured.
AI_INSIGHTS_CORE_KNOT_TOP_Nint5Maximum number of core-knot candidates (high CC × high Fan-In) included in the risk data sent to the LLM.
AI_INSIGHTS_CORE_KNOT_MIN_CCint11Minimum cyclomatic complexity a unit must have to qualify as a core-knot candidate for AI Insights.
AI_INSIGHTS_CORE_KNOT_MIN_FAN_INint5Minimum Fan-In a unit must have to qualify as a core-knot candidate for AI Insights.
AI_INSIGHTS_COMMON_COUPLING_TOP_Nint3Maximum number of common-block coupling entries included in the risk data sent to the LLM, ranked by risk level then unit count.
AI_INSIGHTS_CHAT_TOP_UNITSint15Maximum number of top-scoring units (by Score) included in the chat context’s drilldown summary.
FORTRIAGE_PROMPTS_DIR is the only environment variable that overrides a config.py constant at runtime. All other constants are fixed at import time. Setting FORTRIAGE_PROMPTS_DIR lets you substitute custom prompt files (e.g., domain-specific framing or few-shot examples) without modifying the source.
Example: overriding the prompts directory
FORTRIAGE_PROMPTS_DIR=/path/to/custom/prompts uv run streamlit run streamlit_app.py

Build docs developers (and LLMs) love