← Archive
lm-004697 · 2026-10

NOVA–ISQL Native Program Graph(NIPG)架構規格 v0.1

下載 MD 檔 ⬇
📎 附件 · Companion files — 隨文交付的程式 / 證明 / 資料,可獨立下載重驗

NOVA–ISQL Native Program Graph(NIPG)架構規格 v0.1

NOVA–ISQL Native Program Graph Architecture

版本: v0.1
作者: Neo.K
機構: EveMissLab
日期: 2026-09-16
狀態: Architecture Draft / Native Program Graph Contract

公司: 一言諾科技有限公司


0. 背景

現有 PBSOI / CISG 的核心問題是:

當權威程式物件是傳統 Source Code 時,如何從實作中反演出真正的程式結構?

因此:

CL→ρLGCISGC_L \xrightarrow{\rho_L} G_{\mathrm{CISG}}

其中 CLC_L 是某種語言的 Source Projection。

但 NOVA 與 ISQL-M 的方向不同。

NOVA-Core-Closure 已明確定義:

Canonical Program=Typed Structural Graph\boxed{ \text{Canonical Program} = \text{Typed Structural Graph} }

NOVA-Language 也保留:

Program Authority=Typed Structural Machine Object\boxed{ \text{Program Authority} = \text{Typed Structural Machine Object} }

Human-readable source、graph view、AI transaction 與 foreign-language bridge 都只是 projection / authoring surface。

因此,若仍使用 CISG 作為 NOVA 的主要程式圖,就會產生本體方向倒置:

Authoritative Graph→Text Projection→CISG Re-inference\text{Authoritative Graph} \rightarrow \text{Text Projection} \rightarrow \text{CISG Re-inference}

這沒有必要。

NOVA / ISQL 的原生工作流應改為:

PNOVA∗→πNIPGGNIPG\boxed{ P^\ast_{\mathrm{NOVA}} \xrightarrow{\pi_{\mathrm{NIPG}}} G_{\mathrm{NIPG}} }

其中 PNOVA∗P^\ast_{\mathrm{NOVA}} 本身就是權威 typed structural machine object。


一、NIPG 的定位

本文定義:

NOVA–ISQL Native Program Graph(NIPG)

NIPG 是:

專供 AI、PSMR、工具鏈、跨系統語義查詢、修改規劃與驗證使用的原生程式媒介圖。

它不是:

  • NOVA canonical graph 的替代品;
  • ISQL-M state object 的替代品;
  • NOVA-Language compiler IR 的替代品;
  • universal AST;
  • universal ontology;
  • SREG / NOVA equivalence layer。

核心原則:

NIPG≠Program Authority\boxed{ \text{NIPG} \neq \text{Program Authority} }

而是:

NIPG=Program Authority-aware Mediation Graph\boxed{ \text{NIPG} = \text{Program Authority-aware Mediation Graph} }

二、與 CISG 的分工

2.1 CISG

對傳統程式:

Source→Observed / Inferred Semantic Graph\boxed{ \text{Source} \rightarrow \text{Observed / Inferred Semantic Graph} }

其核心 epistemic 問題是:

Source 真正表示了什麼?


2.2 NIPG

對 NOVA:

Canonical Structural Object→Native Program Mediation Graph\boxed{ \text{Canonical Structural Object} \rightarrow \text{Native Program Mediation Graph} }

其核心問題是:

權威程式物件如何被 AI / PSMR 查詢、連結、規劃、修改與驗證?

因此:

GCISG≠GNIPG\boxed{ G_{\mathrm{CISG}} \neq G_{\mathrm{NIPG}} }

但兩者可以在 PSMR Workspace 中建立 bridge。


三、NIPG 必須是 Multiplex Graph

NIPG 不應是一張扁平 node-edge graph。

定義:

GN=(V,{Er}r∈R,L,P,Q)\boxed{ \mathcal G_N = ( V, \{E_r\}_{r\in\mathcal R}, L, P, Q ) }

其中:

  • VV:semantic objects;
  • ErE_r:typed relations;
  • LL:semantic layers;
  • PP:profile / authority bindings;
  • QQ:evidence / obligation / validation state。

因此同一個 program object 可以同時存在於不同層的關係中,而不需要合併 identity。


四、六個核心 Layer

第一版 NIPG 至少包含六個 Layer。


4.1 Identity / Address Layer

來源:

  • ISQL-M;
  • NOVA stable IDs;
  • registry bindings。

包含:

EntityIdentity
SubjectStateIdentity
SemanticAddress
RegistryBinding
RecordIdentity
ProjectionIdentity
VersionIdentity

核心區分:

E≠H≠HM≠A\boxed{ E \neq H \neq H_M \neq A }

其中:

  • EE:persistent entity identity;
  • HH:represented subject state;
  • HMH_M:projection identity;
  • AA:semantic address。

4.2 Canonical Program Layer

來源:

  • NOVA-Core-Closure;
  • NOVA-Language machine object。

包含:

Project
Module
Graph
Node
Value
Operator
Input
Output
ScopedSymbol
Type
ExternalContract

主要結構:

Project
 └─ Module
     └─ Graph
         ├─ Node
         ├─ Value
         ├─ Constraint
         ├─ Effect
         └─ Output

4.3 Closure / Constraint Layer

包含:

TensorType
Shape
ShapeConstraint
ShapeObligation
Effect
CompositionConstraint
OperatorClosure
BrokenOperator
SemanticObligation
BuildConstraint
ProofStatus

這一層回答:

哪些條件必須成立,這個 program object 才是合法、可執行或可組合的?


4.4 Transformation / Planning Layer

包含:

GraphPatch
GraphTransaction
SemanticDelta
DifferentiationRequest
DerivativeGraph
MemoryPlan
ExecutionStrategyPlan
SemanticCandidateSet
SemanticCorrection
SemanticResolution

這一層回答:

程式如何從一個 canonical state 演化到另一個 state?


4.5 Projection / Authoring Layer

包含:

HumanSourceProjection
StructuredProjection
GraphView
FormulaProjection
NotebookProjection
AITransaction
ForeignLanguageProjection
DiagnosticProjection

核心原則:

Projection≠Authority\boxed{ \text{Projection} \neq \text{Authority} }

Source location、human name、display label 全部只屬於 projection/evidence。


4.6 Execution / Evidence Layer

包含:

ExecutionPlan
BackendBinding
RuntimeValue
ExecutionTrace
TestEvidence
GradientCheck
ResourceVerification
BuildAudit
InteropEvidence
CorpusEvidence

此層回答:

這個 canonical program 在實際執行/驗證時發生了什麼?


五、第一版 Node Types

NIPG v0.1 建議至少定義下列 node family。

Identity

identity.entity
identity.state
identity.address
identity.registry
identity.projection
identity.version

Program

program.project
program.module
program.graph
program.node
program.value
program.operator
program.symbol
program.input
program.output

Type / Domain

type.tensor
type.scalar
type.shape
type.dimension
type.domain
type.external

Constraint

constraint.shape
constraint.effect
constraint.resource
constraint.composition
constraint.semantic
constraint.runtime
constraint.obligation

Transformation

transform.graph_patch
transform.transaction
transform.autodiff
transform.memory_plan
transform.execution_plan
transform.semantic_candidate
transform.semantic_correction

Projection

projection.human_source
projection.structured
projection.graph_view
projection.formula
projection.notebook
projection.ai_transaction
projection.foreign

Evidence

evidence.runtime
evidence.test
evidence.audit
evidence.provenance
evidence.validation
evidence.correspondence

六、第一版 Relation Types

NIPG relation 必須 typed。


6.1 Containment

contains
member_of
declares

6.2 Data / Operator

consumes
produces
input_of
output_of
applies_operator

6.3 Type / Shape

has_type
has_shape
has_dimension
constrained_by
requires_obligation
discharges_obligation

6.4 Effect / Resource

has_effect
requires_resource
owns
borrows
transfers_to
allocated_by
planned_by

6.5 Transformation

patched_by
transforms_to
differentiates_to
lowered_to
planned_as
candidate_for
committed_from
rolled_back_to

6.6 Projection

projects_to
projected_from
authored_through
diagnosed_by

6.7 Identity / Address

identified_by
state_identity
addressed_by
registry_bound
version_of

6.8 Evidence

observed_by
validated_by
tested_by
supported_by
derived_from
audited_by

6.9 Cross-System Correspondence

這一類最重要。

corresponds_to
represented_by
representation_candidate
operator_family_candidate
domain_candidate

不得預設:

equivalent_to
same_as

七、ISQL-M F15 對 NIPG 的直接要求

最新 ISQL-M F15 已經建立:

Rn⇝TensorType⁡(f64,[n],dense,cpu)\mathbb R^n \rightsquigarrow \operatorname{TensorType} ( \texttt{f64}, [n], \texttt{dense}, \texttt{cpu} )

但其明確聲明:

Representation Correspondence≠Mathematical Type Equivalence\boxed{ \text{Representation Correspondence} \neq \text{Mathematical Type Equivalence} }

因此 NIPG 必須能表示:

SREG Domain Node: R^n
        |
        | representation_candidate
        v
NOVA TensorType: f64[n]

並同時連接:

validated_claim:
  rank_correspondence

validated_claim:
  dimension_symbol_correspondence

open_obligation:
  rounding_semantics_unproven

open_obligation:
  NaN/Inf_policy_unproven

open_obligation:
  value_domain_equivalence_unproven

所以:

Correspondence Edge+Open Obligations\boxed{ \text{Correspondence Edge} + \text{Open Obligations} }

必須是一級結構。

不能只留下:

similarity = 0.97

八、NOVA Core Closure 對 NIPG 的直接要求

NOVA Core 已經具備:

  • canonical graph identity;
  • semantic hash / record hash;
  • tensor / shape;
  • runtime;
  • GraphPatch;
  • automatic differentiation;
  • memory/resource planning;
  • projection editing;
  • AI-native graph construction;
  • SOS operator closure;
  • execution-paradigm planning;
  • ISQL SemanticTensor bridge。

因此 NIPG 不能只是一張:

function → calls → function

的 graph。

它必須至少保留:

Program+Type+Constraint+Effect+Resource+Transformation+Projection+Evidence\boxed{ \text{Program} + \text{Type} + \text{Constraint} + \text{Effect} + \text{Resource} + \text{Transformation} + \text{Projection} + \text{Evidence} }

九、NOVA-Language 對 NIPG 的直接要求

NOVA-Language Practical Track 進一步加入:

surface syntax
parser
resolver
compiler pipeline
runtime
backend
FFI / ABI
package
debugger
corpus engine

因此 NIPG 還需要 Practical Layer relations:

parsed_from
resolved_to
normalized_to
lowered_to
backend_bound
ffi_bound
packaged_as
debug_projection
corpus_recorded_as

這些 relation 不屬於 canonical program ontology 本身,但屬於 practical software lifecycle。


十、NIPG 與 NOVA Canonical Graph 的關係

NOVA canonical graph:

GN∗G_N^\ast

是 program authority。

NIPG:

GMG_M

是 mediation projection。

因此:

GN∗≠GM\boxed{ G_N^\ast \neq G_M }

但:

GM=πM(GN∗,I,C,T,X,E,P)G_M = \pi_M ( G_N^\ast, I, C, T, X, E, P )

其中:

  • II:identity state;
  • CC:constraints;
  • TT:transformations;
  • XX:execution state;
  • EE:evidence;
  • PP:projections。

十一、NIPG Identity Rule

每個 NIPG object 至少有:

nipg_id
profile
upstream_system
upstream_id
upstream_revision
authority
semantic_hash
record_hash

若上游已有權威 identity:

IDNOVAID_{\mathrm{NOVA}}

NIPG 不重新發明新的 ontology identity。

它只建立:

IDNIPG=H(profile,upstream binding,projection contract)ID_{\mathrm{NIPG}} = H( \text{profile}, \text{upstream binding}, \text{projection contract} )

十二、NIPG Profile

第一版 profile:

nipg/nova-isql-program/v0.1

其上游 profile 至少包含:

isql-m
nova-core
nova-language
runtime
psmr

跨 profile equality:

IDp=IDq⇏Ontology Equality\boxed{ ID_p=ID_q \not\Rightarrow \text{Ontology Equality} }

十三、Canonical / Derived / Evidence 分離

每個 NIPG fact 必須標記:

canonical
derived
projected
observed
inferred
claimed
unknown
conflicted

例如:

NOVA Graph node
→ canonical

Human source name
→ projected

MemoryPlan candidate
→ derived / candidate

Execution trace
→ observed

ISQL-M domain mapping
→ correspondence evidence

十四、NIPG Graph Delta

因為 NOVA 本來就支援 GraphPatch,NIPG 修改不應退回 source diff。

定義:

ΔGNIPG\Delta G_{\mathrm{NIPG}}

其核心可以直接引用:

NOVA GraphPatch
NOVA GraphTransaction
PSMR SemanticDelta

因此 AI-native path:

Intent→ΔGNIPG→Candidate GraphPatch→NOVA Validation→GN∗′\boxed{ \text{Intent} \rightarrow \Delta G_{\mathrm{NIPG}} \rightarrow \text{Candidate GraphPatch} \rightarrow \text{NOVA Validation} \rightarrow G_N^{\ast\prime} }

而不是:

Intent→Text Patch→Parser→G\text{Intent} \rightarrow \text{Text Patch} \rightarrow \text{Parser} \rightarrow G

十五、NIPG Query Model

AI-facing query 建議:

nipg.describe
nipg.search
nipg.subgraph
nipg.identity
nipg.constraints
nipg.obligations
nipg.effects
nipg.resources
nipg.projections
nipg.runtime_evidence
nipg.transform_history
nipg.correspondence

十六、NIPG Semantic Slice

對目標 object xx:

S(x)=(I,G,T,C,E,R,P,Q)S(x) = ( I, G, T, C, E, R, P, Q )

其中:

  • II:identity;
  • GG:program neighborhood;
  • TT:type/domain;
  • CC:constraints;
  • EE:effects;
  • RR:resource/runtime;
  • PP:projections;
  • QQ:obligations/evidence。

這比單純:

callers
callees

更適合 AI-native NOVA。


十七、NIPG 的三種 Impact

NIPG impact 至少分:

Structural Impact

graph topology
value dependencies
operator closure

Semantic Constraint Impact

type
shape
effect
obligation
domain correspondence

Execution / Resource Impact

runtime
memory
backend
device
FFI
execution strategy

所以:

NIPG Impact≠Traditional Call Graph Impact\boxed{ \text{NIPG Impact} \neq \text{Traditional Call Graph Impact} }

十八、NIPG 與 PSMR

PSMR 將同時容納:

CISG Provider
NIPG Provider
Schema Provider
Intent Provider
Runtime Provider

對傳統程式:

Source→CISG→PSMR\text{Source} \rightarrow CISG \rightarrow PSMR

對 NOVA:

NOVA Canonical Object→NIPG→PSMR\text{NOVA Canonical Object} \rightarrow NIPG \rightarrow PSMR

因此:

PSMR=multi-program-ontology mediation runtime\boxed{ \text{PSMR} = \text{multi-program-ontology mediation runtime} }

而不是只能理解傳統 source code。


十九、NIPG 與 ISQL-M Structural Witness

ISQL-M Structural Witness:

W=⟨p,B,K,E⟩W = \langle p, B, K, E \rangle

可以成為 NIPG 中的:

evidence.structural_witness

但:

Structural Witness≠NIPG Program Node\boxed{ \text{Structural Witness} \neq \text{NIPG Program Node} }

Witness 提供 bridge / evidence。

NIPG 保留 program semantics。


二十、NIPG 與 SemanticTensor

NOVA G7:

Tsem→{N1,…,Nk}+A+OT_{\mathrm{sem}} \rightarrow \{\mathcal N_1,\ldots,\mathcal N_k\} + \mathcal A + \mathcal O

NIPG 應直接表示:

SemanticTensor
 ├─ candidate_for → ProgramCandidate 1
 ├─ candidate_for → ProgramCandidate 2
 ├─ ambiguity → A1
 └─ obligation → O1

而不是強迫:

Tsem→N1T_{\mathrm{sem}} \rightarrow \mathcal N_1

唯一化。


二十一、NIPG 與 NOVA-Language Source

Human source:

SHS_H

只是 projection。

因此:

SourceSpan
HumanName
Comment
Formatting

不能成為 canonical program identity。

關係應為:

GN∗→πHSHG_N^\ast \xrightarrow{\pi_H} S_H

NIPG 保存:

projects_to
source_span_evidence
human_name_projection

二十二、第一版 Schema 骨架

概念物件:

{
  "schema": "nipg/nova-isql-program/v0.1",
  "graph_id": "nipg:...",
  "upstreams": [],
  "nodes": [],
  "edges": [],
  "constraints": [],
  "obligations": [],
  "projections": [],
  "evidence": [],
  "transformations": [],
  "unknowns": [],
  "conflicts": []
}

二十三、第一版最小 MVP

NIPG v0.1 不需要一次映射 NOVA 全部能力。

第一階段只做:

Project
Module
Graph
Node
Value
Operator
TensorType
Shape
Constraint
Effect
GraphPatch
Projection
Runtime Trace
ISQL-M Identity
ISQL-M Correspondence

即:

Identity+Canonical Program+Constraint+Transformation+Projection+Evidence\boxed{ \text{Identity} + \text{Canonical Program} + \text{Constraint} + \text{Transformation} + \text{Projection} + \text{Evidence} }

二十四、第一個驗證案例

建議使用 NOVA Core 的 tensor demo / differentiable example。

流程:

NOVA Project→NIPG→AI Query→GraphPatch Proposal→NOVA Validation→NIPG′\text{NOVA Project} \rightarrow NIPG \rightarrow \text{AI Query} \rightarrow \text{GraphPatch Proposal} \rightarrow \text{NOVA Validation} \rightarrow NIPG'

驗證:

ΔGNIPG≈πNIPG(GN∗′)−πNIPG(GN∗)\boxed{ \Delta G_{\mathrm{NIPG}} \approx \pi_{\mathrm{NIPG}} ( G_N^{\ast\prime} ) - \pi_{\mathrm{NIPG}} ( G_N^\ast ) }

二十五、第二個驗證案例

接 ISQL-M F15:

Rn⇝f64[n]\mathbb R^n \rightsquigarrow f64[n]

建立:

SREG Domain
→ Representation Correspondence
→ NOVA TensorType
→ Constraint / Open Obligations
→ Program Value

然後讓 AI 查:

這個 NOVA Value 為什麼被表示成 f64[n]?哪些性質已被驗證?哪些仍然未知?

這會直接測出 NIPG 是否真的比普通程式圖更適合 ISQL/NOVA。


二十六、最重要的 Epistemic Invariants

NIPG 必須固定:

Name≠Identity\boxed{ \text{Name} \neq \text{Identity} } Projection≠Authority\boxed{ \text{Projection} \neq \text{Authority} } Candidate≠Committed Program\boxed{ \text{Candidate} \neq \text{Committed Program} } Representation Correspondence≠Type Equivalence\boxed{ \text{Representation Correspondence} \neq \text{Type Equivalence} } Structural Similarity≠Program Equivalence\boxed{ \text{Structural Similarity} \neq \text{Program Equivalence} } Runtime Observation≠Canonical Program\boxed{ \text{Runtime Observation} \neq \text{Canonical Program} }

二十七、目前三個 Repository 的角色

ISQL-M

負責:

Identity+Address+Profile+Correspondence Evidence+Recoverability\boxed{ \text{Identity} + \text{Address} + \text{Profile} + \text{Correspondence Evidence} + \text{Recoverability} }

NOVA-Core-Closure

負責:

Canonical Program Semantics+Validation+Transformation+Execution Closure\boxed{ \text{Canonical Program Semantics} + \text{Validation} + \text{Transformation} + \text{Execution Closure} }

NOVA-Language

負責:

Practical Authoring+Compiler+Runtime+FFI+Package+Corpus\boxed{ \text{Practical Authoring} + \text{Compiler} + \text{Runtime} + \text{FFI} + \text{Package} + \text{Corpus} }

NIPG 的角色是:

把三者投影成 AI / PSMR 可運算的 Program World\boxed{ \text{把三者投影成 AI / PSMR 可運算的 Program World} }

二十八、結論

CISG 解決:

既有 Source Code 真正代表什麼?

NIPG 解決:

已經具有原生 typed structural program ontology 的系統,要如何讓 AI 直接運算它?

因此未來的程式媒介不再只有一種圖。

而是:

Traditional Software→GCISG\boxed{ \text{Traditional Software} \rightarrow G_{\mathrm{CISG}} }

與:

NOVA / ISQL Native Software→GNIPG\boxed{ \text{NOVA / ISQL Native Software} \rightarrow G_{\mathrm{NIPG}} }

最後共同進入:

PSMR Semantic Workspace\boxed{ \text{PSMR Semantic Workspace} }

這使 PSMR 從「理解程式碼」進一步成為:

理解並運算不同程式本體的媒介 Runtime\boxed{ \text{理解並運算不同程式本體的媒介 Runtime} }