$ loading_
帮助你快速理解 Pyre/Pysa 代码架构并定位关键实现位置
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "architecture" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/pyre-check/main/.llms/skills/architecture/SKILL.md 2. 保存为 ~/.claude/skills/architecture/SKILL.md 3. 装好后重载技能,告诉我可以用了
请帮我梳理 Pyre 代码库中类型检查的整体架构,并指出负责类型推断、错误报告和核心检查流程的主要模块与目录。
返回一份结构化说明,概述类型检查流程,并列出相关源码目录与关键文件。
我在调试 Pysa 的污点分析结果异常。请告诉我污点源、传播规则、sink 判断和结果生成分别在哪些模块实现,并说明它们之间的调用关系。
输出与污点分析相关的核心模块地图,以及各阶段之间的关系说明。
请作为代码向导,带我快速熟悉 Pyre/Pysa 仓库的源码目录结构,按功能说明每个主要目录的用途,并标出适合新贡献者优先阅读的入口文件。
给出按目录划分的功能导览,并附上适合入门阅读的文件建议清单。
client/): Reads .pyre_configuration, determines flags, shells out to pyre.binsource/main.ml): Routes to Check, Analyze (Pysa), Infer, Server, CodeNavigation, or NoDaemonQuerysource/menhir_parser/, source/cpython_parser/): Python source -> AST (source/ast/)source/analysis/): Populates global type environment in parallel. All sources added at once (not recursively following imports). Builds a layered environment chain: UnannotatedGlobalEnvironment -> ClassHierarchyEnvironment -> TypeAliasEnvironment -> AnnotatedGlobalEnvironment -> FunctionDefinitionEnvironment -> ErrorsEnvironment -> TypeEnvironmentsource/analysis/typeCheck.ml): Each function checked in parallel via control flow graph. Propagates parameter types through function body, checks compatibility at each operation. Never goes beyond function call boundaries.source/interprocedural_analyses/taint/taintAnalysis.ml): Main entrypoint of the analysis, runs the different analysis stepssource/interprocedural/pyrePysaApi.ml): Provides an API to query a type checker (pyre or pyrefly)source/interprocedural/classHierarchyGraph.ml): Builds a class hierarchy graphsource/interprocedural/callablesSharedMemory.ml): Builds a mapping from callables (functions and methods) to their AST and signaturesource/interprocedural/callGraph.ml): Defines call graph data structuressource/interprocedural/callGraphBuilder.ml): Builds call graphs for all callablessource/interprocedural_analyses/taint/modelParser.ml): Parses .pysa model filessource/interprocedural_analyses/taint/forwardAnalysis.ml): Tracks taint from sourcessource/interprocedural_analyses/taint/backwardAnalysis.ml): Tracks taint to sinkssource/interprocedural_analyses/taint/taintConfiguration.ml): Defines rules connecting sources to sinkssource/interprocedural/fixpointAnalysis.ml): Implements a global fixpoint over callablessource/interprocedural_analyses/taint/model.ml): Defines a summary of the taint behavior of a function, inferred during analysissource/ast/: Python AST representation (Expression, Statement, Source, Location, Reference)source/analysis/: Core type checker: type representation (type.ml), CFG, fixpoint, preprocessing, environments, type order, class hierarchysource/interprocedural/: Interprocedural framework: call graph, dependency graph, override graph, fixpointsource/interprocedural_analyses/taint/: Pysa taint analysis: sources, sinks, domains, models, rules, reportingsource/interprocedural_analyses/type_inference/: Interprocedural type inferencesource/server/: Pyre daemon for incremental analysissource/code_navigation_server/: IDE code navigation serversource/command/: OCaml CLI command implementationssource/buck_command/: Buck-specific commandssource/buck_integration/: Buck build system integrationsource/service/: Shared memory management, schedulingsource/domains/: Abstract domain library (lattices for interprocedural analyses)source/hack_parallel/: Shared memory and multi-worker infrastructure (forked from Hack)source/saved_state/: Serialization for incremental analysisclient/: Python CLI (pyre command)client/commands/: All user-facing commands (check, analyze, start, stop, infer, query, etc.)client/configuration/: .pyre_configuration file parsing…
帮助开发者在提交代码或生成 diff 时套用正确的提交前缀、审阅人和测试计划。
帮助开发者排查 Pysa 漏报污点问题,比较输出并定位污点流丢失位置。
用于运行、调试与更新 Pysa 污点分析端到端集成测试及期望结果
帮助开发者读取、编写并调试 Pysa 的 JSON 污点模型与 .models 输出
帮助排查常见故障、版本兼容与会话流诊断问题,提升开发调试效率
帮助开发者完成 Meta AI 应用注册与设备权限接入流程配置。
用于规划 Python 模块架构、重构类层次并指导跨文件设计改造。
用于代码与分支审查,综合检查正确性、兼容性、架构、测试、性能与安全问题。
帮助分析代码库架构、查询依赖关系并生成交互式可视化图谱。
帮助团队快速理解超大型代码库,进行语义检索、依赖分析与影响评估
帮助开发者规划 Python 模块结构、重构类层次并设计跨文件架构变更方案。
帮助你创建或评审架构决策记录,明确技术取舍、约束与影响。