---
title: "Semaprax 架构：语义程序图"
canonical: https://wavect.io/zh/semaprax/architecture/
language: zh
description: "Semaprax 如何通过语义程序图、稳定 ID、受限上下文、修订版与语义补丁形成面向智能体的编译器架构。"
image: "https://wavect.io/img/general/bak/open_graph_preview.jpg"
---

架构 · GRAPH V10-V14

# 让智能体直接查询程序模型，无需从文本重新推断语义。

先稳定身份，再修改源代码。

Semaprax 语义程序图在内容派生的修订版下记录类型化声明、效果、契约、所有权事实、调用关系和编译身份。

semaprax://architecture v0.2

```
entity     Semaprax
status     预 Alpha 研究
verified   2026-08-11
authority  github.com/wavect/semaprax
```

## Semaprax 如何工作？

Semaprax 将人类可读源代码解析为已验证的 HIR 和版本化语义图。智能体按稳定 ID 请求受限上下文，针对精确修订版预览或提交补丁，并在原生或 Wasm 编译前获得确定性诊断或证据。

// 01

## 先稳定身份，再修改源代码。

### 稳定语义身份

作者定义的 `@id` 与编译器身份会在源代码、HIR、图序列化、诊断和生成符号之间保持一致。包含 NUL 的身份在机器输出前被拒绝。

### 受限智能体上下文

Agent Context v1 与 v2 返回受依赖关系约束的图切片，并明确限制节点、字节、深度与遍历方向。

### 绑定修订版的语义补丁

补丁操作面向语义身份和精确图修订版。过期修订版会以 fail-closed 方式失败，当前操作族保持刻意受限。

### 发布前证据

Review、Impact、Target 与 Workspace 证据路径生成带明确非声明的确定性产物。它们不授予批准，也不替代项目测试。

// 02

## 源代码投影保持可读

```
module examples.meaning;

@id("math.add")
fn add(left: i64, right: i64) -> i64
    requires left >= 0
    ensures result == left + right
{
    left + right
}
```

GitHub 规范是权威来源。本页是带日期的研究摘要。 [GitHub 仓库](https://github.com/wavect/semaprax).

// FAQ

## 不夸大的问答

### 语义图是知识图谱或 RAG 系统吗？

不是。它是编译器的类型化版本化程序表示，不是通用文档或向量集合。

### 智能体能通过语义补丁编辑任意程序吗？

还不能。当前模式只允许受限操作，并拒绝过期修订版、无效选择器和语义扩大。

Wavect 研究项目: [Wavect GmbH](/zh/). 由 Wavect 创建的开源系统研究项目。

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://wavect.io/#organization",
      "@type": [
        "Organization",
        "ProfessionalService",
        "LocalBusiness"
      ],
      "employee": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "founder": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "legalRepresentative": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "name": "Wavect GmbH",
      "subjectOf": {
        "@id": "https://wavect.io/verified-claims.json#dataset",
        "@type": "Dataset",
        "creator": {
          "@id": "https://wavect.io/#organization",
          "@type": [
            "Organization",
            "ProfessionalService",
            "LocalBusiness"
          ]
        },
        "description": "A machine-readable registry of quantitative and qualitative claims published by Wavect, with review dates, localized page appearances and public third-party citations where available.",
        "inLanguage": "en",
        "isAccessibleForFree": true,
        "license": "https://creativecommons.org/licenses/by/4.0/",
        "name": "Wavect verified publication claims",
        "url": "https://wavect.io/verified-claims.json"
      },
      "url": "https://wavect.io/"
    },
    {
      "@id": "https://wavect.io/team/kevin-riedl/#person",
      "@type": "Person",
      "jobTitle": "Managing Director",
      "name": "Kevin Riedl",
      "sameAs": [
        "https://www.wikidata.org/wiki/Q139796365",
        "https://www.linkedin.com/in/wsdt",
        "https://github.com/wsdt"
      ],
      "url": "https://wavect.io/team/kevin-riedl/",
      "worksFor": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      }
    },
    {
      "@id": "https://wavect.io/team/christof-jori/#person",
      "@type": "Person",
      "jobTitle": "Managing Director",
      "name": "Christof Jori",
      "sameAs": [
        "https://www.wikidata.org/wiki/Q139796367",
        "https://www.linkedin.com/in/jocr77/",
        "https://github.com/jo-chris"
      ],
      "url": "https://wavect.io/team/christof-jori/",
      "worksFor": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      }
    },
    {
      "@id": "https://wavect.io/#website",
      "@type": "WebSite",
      "inLanguage": [
        "en",
        "de",
        "es",
        "zh"
      ],
      "name": "Wavect",
      "potentialAction": {
        "@type": "SearchAction",
        "query-input": "required name=search_term_string",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://wavect.io/search/?q={search_term_string}"
        }
      },
      "publisher": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "url": "https://wavect.io/"
    },
    {
      "@id": "https://wavect.io/zh/semaprax/architecture/#webpage",
      "@type": "WebPage",
      "dateModified": "2026-08-11",
      "inLanguage": "zh",
      "isPartOf": {
        "@id": "https://wavect.io/#website",
        "@type": "WebSite"
      },
      "lastReviewed": "2026-08-11",
      "url": "https://wavect.io/zh/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/verified-claims.json#semaprax-v02-semantic-graph-patches",
      "@type": "Claim",
      "appearance": {
        "@id": "https://wavect.io/zh/semaprax/architecture/#webpage",
        "@type": "WebPage",
        "inLanguage": "zh",
        "url": "https://wavect.io/zh/semaprax/architecture/"
      },
      "author": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "citation": {
        "@type": "WebPage",
        "url": "https://github.com/wavect/semaprax/blob/main/docs/SEMANTIC-PATCH-V2.md"
      },
      "dateModified": "2026-08-11",
      "identifier": "semaprax-v02-semantic-graph-patches",
      "inLanguage": "en",
      "text": "The Semaprax v0.2 prototype exposes a stable, queryable semantic program graph and revision-bound semantic patch operations for documented language subsets."
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://wavect.io/zh/semaprax/architecture/#webpage",
      "@type": "WebPage",
      "creator": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "dateModified": "2026-08-11",
      "description": "Semaprax 如何通过语义程序图、稳定 ID、受限上下文、修订版与语义补丁形成面向智能体的编译器架构。",
      "inLanguage": "zh",
      "mainEntity": {
        "@id": "https://wavect.io/zh/semaprax/architecture/#article",
        "@type": "TechArticle"
      },
      "name": "Semaprax 架构：语义程序图 | Wavect",
      "url": "https://wavect.io/zh/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/zh/semaprax/architecture/#article",
      "@type": "TechArticle",
      "about": {
        "@id": "https://wavect.io/semaprax/#software",
        "@type": "SoftwareSourceCode"
      },
      "author": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "dateModified": "2026-08-11",
      "datePublished": "2026-08-11",
      "description": "Semaprax 如何通过语义程序图、稳定 ID、受限上下文、修订版与语义补丁形成面向智能体的编译器架构。",
      "headline": "让智能体直接查询程序模型，无需从文本重新推断语义。",
      "inLanguage": "zh",
      "isPartOf": {
        "@id": "https://wavect.io/semaprax/#webpage",
        "@type": "WebPage"
      },
      "mainEntityOfPage": {
        "@id": "https://wavect.io/zh/semaprax/architecture/#webpage"
      },
      "publisher": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "url": "https://wavect.io/zh/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/semaprax/#software",
      "@type": "SoftwareSourceCode"
    },
    {
      "@id": "https://wavect.io/zh/semaprax/architecture/#faq",
      "@type": "FAQPage",
      "inLanguage": "zh",
      "mainEntity": [
        {
          "@type": "Question",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "不是。它是编译器的类型化版本化程序表示，不是通用文档或向量集合。"
          },
          "name": "语义图是知识图谱或 RAG 系统吗？"
        },
        {
          "@type": "Question",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "还不能。当前模式只允许受限操作，并拒绝过期修订版、无效选择器和语义扩大。"
          },
          "name": "智能体能通过语义补丁编辑任意程序吗？"
        }
      ],
      "url": "https://wavect.io/zh/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/verified-claims.json#semaprax-v02-semantic-graph-patches",
      "@type": "Claim",
      "appearance": {
        "@id": "https://wavect.io/zh/semaprax/architecture/#webpage",
        "@type": "WebPage",
        "inLanguage": "zh",
        "url": "https://wavect.io/zh/semaprax/architecture/"
      },
      "author": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "citation": {
        "@type": "WebPage",
        "url": "https://github.com/wavect/semaprax/blob/main/docs/SEMANTIC-PATCH-V2.md"
      },
      "dateModified": "2026-08-11",
      "identifier": "semaprax-v02-semantic-graph-patches",
      "inLanguage": "en",
      "text": "The Semaprax v0.2 prototype exposes a stable, queryable semantic program graph and revision-bound semantic patch operations for documented language subsets."
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "item": "https://wavect.io/zh/",
      "name": "首页",
      "position": 1
    },
    {
      "@type": "ListItem",
      "item": "https://wavect.io/zh/semaprax/",
      "name": "Semaprax",
      "position": 2
    },
    {
      "@type": "ListItem",
      "item": "https://wavect.io/zh/semaprax/architecture/",
      "name": "让智能体直接查询程序模型，无需从文本重新推断语义。",
      "position": 3
    }
  ]
}
```
