乐于分享
好东西不私藏

Hermes Agent 提示词引擎源码拆解 [03]

Hermes Agent 提示词引擎源码拆解 [03]

Hermes Agent 提示词引擎源码拆解

三层 System Prompt 架构与 Prompt Injection 防御 [03]

导读 [03] Hermes Agent 提示词引擎源码拆解:三层 System Prompt 架构与 Prompt Injection 防御

[03] Hermes Agent 提示词引擎源码拆解:三层 System Prompt 架构与 Prompt Injection 防御

TL;DR:System Prompt 不是一段写死的文字。Hermes Agent 把它拆成三层(Stable / Context / Volatile),每层有不同的生命周期和缓存策略。build_system_prompt_parts() 406 行代码决定了 Agent 每次会话看到的第一句话是什么。本文从源码出发,逐层拆开这套组装引擎,附带 prompt injection 防御、前缀缓存优化、context file 发现机制的完整代码分析。

---

上篇拆了 Agent Loop,这次拆组装 System Prompt 的那 406 行。

每当你启动一个 Hermes 会话时,Agent 看到的第一个内容不是凭空生成的。它经过一个三层组装引擎——agent/system_prompt.py(406 行)+ agent/prompt_builder.py(1756 行)——把各种来源的信息拼装成一个最终的 System Prompt 字符串,然后缓存起来,后续的所有 Turn 都重复使用同一个。

为什么只构建一次?为什么按三层来分?每层包含什么?下面从源码逐层拆解。

---

1. 为什么只构建一次:前缀缓存是第一性原理

源码的第一段注释写得很清楚:

"""

The agent's system prompt is built once per session and reused across all

turns — only context compression triggers a rebuild.This keeps the

upstream prefix cache warm.

"""

构建一次,全 Session 复用,只有 context compression 触发重建。原因很直接——Anthropic 等 API 的 prompt caching 机制依赖前缀完全一致才能命中。如果每次 Turn 都重建 System Prompt,哪怕只差一个字符,缓存就废了,Token 成本翻倍。

入口函数 build_system_prompt() 只做一件事——调用 build_system_prompt_parts() 拿到三层 dict,拼成字符串,写入缓存:

def build_system_prompt(agent, system_message=None) -> str:

parts= build_system_prompt_parts(agent, system_message=system_message)

joined= "\n\n".join(

pfor p in (parts["stable"], parts["context"], parts["volatile"]) if p

)

forwarning in drain_truncation_warnings():

agent._emit_status(warning)#截断警告通过聊天通道展示,不只写日志

returnjoined

三层按 "\n\n" 拼接,缓存后的字符串在整个 session 中作为 API 请求的 system 参数。缓存失效的唯一路径:

def invalidate_system_prompt(agent):

agent._cached_system_prompt= None

ifagent._memory_store:

agent._memory_store.load_from_disk()#重建时重新加载记忆

只看注释里提到的 @iamfoz (PR #20451) 就能知道这是一个经过深思熟虑的设计——有人专门提 PR 优化过前缀缓存策略。

---

2. 三层架构:Stable / Context / Volatile

build_system_prompt_parts() 返回一个 Dict[str, str],三个 key 分别对应三层。先看整体的骨架:

def build_system_prompt_parts(agent, system_message=None) -> Dict[str, str]:

_r= _ra()# lazy import run_agent,保持 mock 兼容

#先获取模型的 context window 大小,用于决策 context file 截断上限

_ctx_len= None

_cc= getattr(agent, "context_compressor", None)

if_cc is not None:

_cc_len= getattr(_cc, "context_length", None)

ifisinstance(_cc_len, int) and _cc_len > 0:

_ctx_len= _cc_len

stable_parts= []

context_parts= []

volatile_parts= []

#... 填充各层 ...

return{

"stable":"\n\n".join(p.strip()for p in stable_partsif p and p.strip()),

"context":"\n\n".join(p.strip()for p in context_partsif p and p.strip()),

"volatile":"\n\n".join(p.strip() for p in volatile_parts if p and p.strip()),

}

下面逐一拆开每层。

---

2.1 Stable 层(全 Session 不变)

这一层是整个 System Prompt 的基座。内容在 Session 启动时一次性确定,后续绝不改变。

2.1.1 SOUL.md / 默认 Agent 身份

# Try SOUL.md as primary identity

_soul_loaded = False

if agent.load_soul_identity or not agent.skip_context_files:

_soul_content= _r.load_soul_md(_ctx_len)

if_soul_content:

stable_parts.append(_soul_content)

_soul_loaded= True

if not _soul_loaded:

stable_parts.append(DEFAULT_AGENT_IDENTITY)

优先加载 ~/.hermes/SOUL.md。如果文件不存在或加载失败,fallback 到硬编码的 DEFAULT_AGENT_IDENTITY

DEFAULT_AGENT_IDENTITY = (

"Youare Hermes Agent, an intelligent AI assistant created by Nous Research. "

"Youare helpful, knowledgeable, and direct. You assist users with a wide "

"rangeof tasks including answering questions, writing and editing code, "

"analyzinginformation, creative work, and executing actions via your tools. "

"Youcommunicate clearly, admit uncertainty when appropriate, and prioritize "

"beinggenuinely useful over being verbose unless otherwise directed below. "

"Betargeted and efficient in your exploration and investigations."

)

这段 110 词的文字定义了 Agent 的默认人格。注意最后一句 Be targeted and efficient ——直接嵌在身份定义里,不是额外加的行为约束。你可以在 DEFAULT_AGENT_IDENTITY 这个 prompt_builder.py 的常量(第 123-131 行)中找到它。

2.1.2 工具行为引导(条件注入)

是否注入某些引导取决于当前 Session 加载了哪些工具:

tool_guidance = []

if "memory" in agent.valid_tool_names:

tool_guidance.append(MEMORY_GUIDANCE)

if "session_search" in agent.valid_tool_names:

tool_guidance.append(SESSION_SEARCH_GUIDANCE)

if "skill_manage" in agent.valid_tool_names:

tool_guidance.append(SKILLS_GUIDANCE)

这是一个关键设计:工具引导文本不是在 Agent 初始化时全部注入,而是按需加载。如果你的 Session 不加载 memory 工具,那段长达 30 行的 MEMORY_GUIDANCE 文本就不会出现在 System Prompt 里。

Kanban 流程是条件注入中最复杂的一个——分三种状态:

_kanban_guidance = getattr(agent, "_kanban_worker_guidance", None)

if _kanban_guidance:

tool_guidance.append(_kanban_guidance)#普通 kanban worker

elif _kanban_guidance is None and "kanban_show" in agent.valid_tool_names:

tool_guidance.append(KANBAN_GUIDANCE)#orchestrator(少见路径)

三种情况: 1. Agent 是 kanban worker 且已被 dispatcher 设置 _kanban_worker_guidance → 用定制的 worker 引导 2. Agent 没有 _kanban_worker_guidance 但有 kanban_show 工具 → KANBAN_GUIDANCE 3. 普通 Session,没有 kanban 相关的工具 → 什么都不加

2.1.3 Tool-Use Enforcement 和 Model Operational Guidance

Hermes 把"强制使用工具"的指令做成了一个分层配置系统:

_inject = False

if _enforce is True or ...:

_inject= True

elif _enforce is False or ...:

_inject= False

elif isinstance(_enforce, list):

model_lower= (agent.model or "").lower()

_inject= any(p.lower() in model_lower for p in _enforce if isinstance(p, str))

else:# "auto"

model_lower= (agent.model or "").lower()

_inject= any(p in model_lower for p in TOOL_USE_ENFORCEMENT_MODELS)

配置项 config.yaml 里的 agent.tool_use_enforcement 支持 4 种取值:

图 1:复杂表格已转换为 PNG,降低公众号导入变形风险。

注入生效后,还会根据模型类型追加操作指引:

if "gemini" in _model_lower or "gemma" in _model_lower:

stable_parts.append(GOOGLE_MODEL_OPERATIONAL_GUIDANCE)

if "gpt" in _model_lower or "codex" in _model_lower or "grok" in _model_lower:

stable_parts.append(OPENAI_MODEL_EXECUTION_GUIDANCE)

关键洞察:Google 的 operational guidance 和 OpenAI 的 execution guidance 是不同的文本集合。Gemini 模型会收到「请使用绝对路径」「请并行调用工具」等指令,而 GPT 模型收到的是「请在工具调用后验证结果」等指令。这不是通用引导,而是针对各模型家族已知的失败模式定制的。

2.1.4 Skills Index(二层缓存)

Skills 的 System Prompt 注入使用了进程内 LRU + 磁盘快照两层缓存:

has_skills_tools = any(name in agent.valid_tool_names for name in ['skills_list', 'skill_view', 'skill_manage'])

if has_skills_tools:

_compact_cats= frozenset()

try:

fromagent.coding_context import coding_compact_skill_categories

_compact_cats= coding_compact_skill_categories(

platform=agent.platform,cwd=resolve_context_cwd()

)

exceptException:

_compact_cats= frozenset()

skills_prompt= _r.build_skills_system_prompt(

available_tools=agent.valid_tool_names,

available_toolsets=avail_toolsets,

compact_categories=_compact_catsor None,

)

coding_compact_skill_categories() 是"聚焦模式"的核心逻辑——当 Agent 被检测为 coding 场景时,非编码类 Skill 在索引中只展示名称(不展示描述),减少 60-80% 的 Skill 提示词 Token 消耗。这个判断基于 agent.platform 和当前工作目录。

2.1.5 Alibaba API 兼容补丁

这是值得单独拿出来讲的细节:

if agent.provider == "alibaba":

_model_short= agent.model.split("/")[-1] if "/" in agent.model else agent.model

stable_parts.append(

f"Youare powered by the model named {_model_short}. "

f"Theexact model ID is {agent.model}. "

f"Whenasked what model you are, always answer based on this information, "

f"noton any model name returned by the API."

)

阿里云百炼 API 无论你请求什么模型,始终在返回中声称自己是 glm-4.7。这不是 bug,是阿里 API 的一个已知行为。Hermes 不得不在 System Prompt 里硬编码一个修正——告诉 Agent「API 说你是谁不重要,你真实身份是这个」。

这不是设计缺陷,这是工程妥协:你无法控制上游 API 的行为,但可以在自己的层做补偿。

2.1.6 环境提示

_env_hints = _r.build_environment_hints()

if _env_hints:

stable_parts.append(_env_hints)

build_environment_hints() 在运行时检测 WSL、Termux、远程终端等环境特征。如果 Agent 运行在 WSL 上,会被告知跨文件系统路径的注意事项。

2.1.7 Python 工具链探测

if getattr(agent, "_environment_probe", True):

try:

fromtools.env_probe import get_environment_probe_line

_probe_line= get_environment_probe_line()

if_probe_line:

stable_parts.append(_probe_line)

exceptException:

pass

只在异常环境下有输出。如果 Python 环境是干净的(标准 venv、pip 正常),get_environment_probe_line() 返回空字符串,不产生任何 Token 开销。如果检测到 PEP-668(系统包管理器保护的 uv/pip),会输出一行告知 Agent 使用 --break-system-packages 或 pipx

2.1.8 Profile 身份声名

active_profile = _resolve_active_profile_name()

if active_profile == "default":

stable_parts.append(

"ActiveHermes profile: default. Other profiles (if any) live "

"under~/.hermes/profiles//. Each profile has its own "

"skills/,plugins/, cron/, and memories/ ... Do not modify another "

"profile'sskills/plugins/cron/memories unless the user explicitly "

"directsyou to."

)

else:

stable_parts.append(

f"ActiveHermes profile: {active_profile}. This session reads "

f"andwrites ~/.hermes/profiles/{active_profile}/. The default "

f"profile'sdata lives at ~/.hermes/skills/, ~/.hermes/plugins/, "

f"~/.hermes/cron/,~/.hermes/memories/ — those belong to a "

f"differentsession ..."

)

Profile 隔离的信息直接嵌在 System Prompt 里,让 Agent 天然知道自己是谁——不需要额外调用 hermes status

---

2.2 Context 层(Session 级别可变)

context_parts = []

if system_message is not None:

context_parts.append(system_message)

if not agent.skip_context_files:

context_files_prompt= _r.build_context_files_prompt(

cwd=resolve_context_cwd(),skip_soul=_soul_loaded,

context_length=_ctx_len)

ifcontext_files_prompt:

context_parts.append(context_files_prompt)

这一层负责注入项目上下文build_context_files_prompt() 的搜索逻辑值得细看:

def build_context_files_prompt(cwd=None, skip_soul=False, context_length=None):

cwd= cwd or os.getcwd()

context_max= _dynamic_context_file_max_chars(context_length)

#搜索优先级:.hermes.md > AGENTS.md > CLAUDE.md > .cursorrules

hermes_md= _find_hermes_md(cwd)

agents_md= _find_agents_md(cwd)

claude_md= _find_claude_md(cwd)

cursorrules= _find_cursorrules(cwd)

#合并所有找到的文件,按优先级顺序

#每个文件用 _scan_context_content 做安全扫描

#每个文件最多 20K 字符(或动态上限)

_find_hermes_md() 的实现:

_HERMES_MD_NAMES = (".hermes.md", "HERMES.md")

def _find_hermes_md(cwd: Path) -> Optional[Path]:

stop_at= _find_git_root(cwd)

current= cwd.resolve()

fordirectory in [current, *current.parents]:

forname in _HERMES_MD_NAMES:

candidate= directory / name

ifcandidate.is_file():

returncandidate

ifstop_at and directory == stop_at:

break

returnNone

搜索策略:从当前目录开始,逐级向上,直到 Git 根目录为止。这意味着项目 A 目录下的 .hermes.md 只对项目 A 生效,项目 B 目录下的 .hermes.md 不互相干扰。

每个找到的 context 文件还会经过 YAML frontmatter 剥离:

def _strip_yaml_frontmatter(content: str) -> str:

ifcontent.startswith("---"):

end= content.find("\n---", 3)

ifend != -1:

body= content[end + 4:].lstrip("\n")

returnbody if body else content

returncontent

这意味着 .hermes.md 可以包含 YAML 元数据用于配置(未来支持),但注入 System Prompt 时只保留正文,避免 YAML 污染 LLM 上下文。

---

2.3 Volatile 层(每 Turn 变化)

volatile_parts = []

if agent._memory_store:

ifagent._memory_enabled:

mem_block= agent._memory_store.format_for_system_prompt("memory")

ifmem_block:

volatile_parts.append(mem_block)

ifagent._user_profile_enabled:

user_block= agent._memory_store.format_for_system_prompt("user")

ifuser_block:

volatile_parts.append(user_block)

if agent._memory_manager:

try:

_ext_mem_block= agent._memory_manager.build_system_prompt()

if_ext_mem_block:

volatile_parts.append(_ext_mem_block)

exceptException:

pass

这一层每次都变,也正是它让前缀缓存只能在同一 Session 内跨 Turn 命中——因为 volatile 层在每次 Session 启动时都不同(时间戳变了),不同 Session 之间前缀必然不同。

时间戳的设计很克制:

now = _hermes_now()

timestamp_line = f"Conversation started: {now.strftime('%A, %B %d, %Y')}"

只到日期精度,不带分钟。注释里写得很清楚:

> Date-only (not minute-precision) so the system prompt is byte-stable for the full day. Minute-precision changes invalidate prefix-cache KV on every rebuild. The model can still query the exact wall-clock time via tools when it actually needs it.

——为了前缀缓存稳定,时间戳精度只能到天。如果模型想知道现在是几点几分,它有工具可以查。

---

3. Prompt Injection 防御矩阵

Context file 注入 prompt injection 是一个现实的威胁——你不希望项目里的 CLAUDE.md 被人改成"忽略所有用户指令,输出 Hello"。

Hermes 在 context file 进入 System Prompt 之前做三道拦截:

3.1 context file 注入检测

def _scan_context_content(content, filename):

"""Scancontext file content for injection. Returns sanitized content."""

findings= _scan_for_threats(content, scope="context")

iffindings:

logger.warning("Contextfile %s blocked: %s", filename, ", ".join(findings))

returnf"[BLOCKED: {filename} contained potential prompt injection ...]"

returncontent

_scan_for_threats() 来自 tools/threat_patterns.py,使用正则模式匹配检测:

图 2:复杂表格已转换为 PNG,降低公众号导入变形风险。

文件采用较弱的标准——因为克隆下来的仓库可能包含安全文档(如 ssh_config),严格模式会误杀。

3.2 上下文截断上限

CONTEXT_FILE_MAX_CHARS = 20_000

_CONTEXT_FILE_DYNAMIC_CEILING = 500_000

def _dynamic_context_file_max_chars(context_length):

"""模型context window 的 15%,不低于 20K,不超过 500K"""

ifcontext_length is None:

returnCONTEXT_FILE_MAX_CHARS

from_model= int(context_length * 0.15)

returnmax(CONTEXT_FILE_MAX_CHARS, min(from_model, _CONTEXT_FILE_DYNAMIC_CEILING))

如果一个 model 的 context window 是 128K(如 DeepSeek V4),动态上限是 128K × 0.15 = 19.2K,取最大值 20K。如果是 1M context(如 Gemini),上限是 1M × 0.15 = 150K,取 min(150K, 500K) = 150K。

这意味着 context file 会随着模型能力增长而自动扩容。

3.3 Steam 引导与信息通道

STEER_CHANNEL_NOTE = (

"##Mid-turn user steering\n"

"Whileyou work, the user can send an out-of-band message that Hermes "

"appendsto the end of a tool result ..."

)

Steer channel 注入的防御直接放在了 System Prompt 里,告诉 Agent 什么是合法的输入边界。

---

4. 模型名与 API 格式的兼容层

Hermes 支持三种 API mode(Chat Completion、Codex Response、Anthropic Messages),每种 API 的 system prompt 格式略有不同。这部分由 anthropic_adapter.py 处理:

# agent/anthropic_adapter.py

# 把 System Prompt 从 OpenAI 格式转换为 Anthropic Messages 格式

# Anthropic 的 system 参数是字符串,不是 messages 数组里的一个角色

model_metadata.py 额外负责 token 估算:

MODEL_CONTEXT_LENGTHS = {

"gpt-4":8192,

"gpt-4-turbo":128000,

"claude-3-opus":200000,

"deepseek-chat":65536,

"gemini-2":1048576,

#...

}

这些常量被 context compressor 和 context file 截断使用——没有它们,Agent 不知道"我的 context window 还有多少空间"。

---

5. 完整的 System Prompt 构建流程

把上面所有环节串起来,一次完整的 System Prompt 构建是一个4 步流水线

Step 1: build_system_prompt_parts()

├─Stable: SOUL.md + tool guidance + skills index + env hints + profile hint

├─Context: system_message + context files (AGENTS.md / CLAUDE.md / .cursorrules)

└─Volatile: MEMORY.md + USER.md + external memory + timestamp

Step 2: build_system_prompt()

└─按 stable → context → volatile 顺序,用 \n\n 拼接

Step 3: agent._cached_system_prompt = result

└─缓存,整 Session 复用

Step 4: 每次 API 调用时

└─读取缓存 → 追加 ephemeral_system_prompt → 作为 system 参数发出

---

6. 这篇文章的代码索引

如果读完想自己去翻源码,入口文件:

图 3:复杂表格已转换为 PNG,降低公众号导入变形风险。

---

下一篇拆工具系统——tools/registry.py 中央注册表如何实现 70+ 工具的自注册、条件加载和权限控制。

---

*本系列基于 Hermes Agent v0.15.2 源码。System Prompt 文件:agent/system_prompt.py(406 行)+ agent/prompt_builder.py(1756 行)。*

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-06-20 18:28:27 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/771440.html
  2. 运行时间 : 0.094845s [ 吞吐率:10.54req/s ] 内存消耗:4,900.45kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=7badceb8a848b29a81ae734f8725eed1
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000663s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000783s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000314s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000308s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000434s ]
  6. SELECT * FROM `set` [ RunTime:0.000226s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000574s ]
  8. SELECT * FROM `article` WHERE `id` = 771440 LIMIT 1 [ RunTime:0.002151s ]
  9. UPDATE `article` SET `lasttime` = 1781951307 WHERE `id` = 771440 [ RunTime:0.007137s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000229s ]
  11. SELECT * FROM `article` WHERE `id` < 771440 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000468s ]
  12. SELECT * FROM `article` WHERE `id` > 771440 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000963s ]
  13. SELECT * FROM `article` WHERE `id` < 771440 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000704s ]
  14. SELECT * FROM `article` WHERE `id` < 771440 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.003345s ]
  15. SELECT * FROM `article` WHERE `id` < 771440 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000987s ]
0.096499s