self-host TCS compiler GIR and add portable host runtime
This commit is contained in:
parent
3959ae4270
commit
ff29e52a32
33 changed files with 3848 additions and 831 deletions
10
bootstrap/tcs-stage0/Cargo.lock
generated
10
bootstrap/tcs-stage0/Cargo.lock
generated
|
|
@ -222,12 +222,20 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "tcs-stage0"
|
||||
name = "tcs-gir-runtime"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tcs-stage0"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"tcs-gir-runtime",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@ license = "AGPL-3.0-or-later"
|
|||
description = "Replaceable Stage-0 ignition parser/compiler for TCS; never native authority"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
sha2 = "0.10"
|
||||
tcs-gir-runtime = { path = "../../native-runtime/tcs-gir-runtime", features = ["bootstrap"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,805 +1,5 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{json, Value as JsonValue};
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
fs,
|
||||
path::{Component, Path, PathBuf},
|
||||
};
|
||||
//! Replaceable ignition shell. Language parsing and compiler-GIR execution live
|
||||
//! in the HoloLake native runtime crate so Stage-1 operation does not depend on
|
||||
//! this Stage-0 package remaining enabled.
|
||||
|
||||
pub const COMPILER_ID: &str = "TCS-STAGE0-IGNITION-0001";
|
||||
pub const COMPILER_STATE: &str = "FOREIGN_HOST_BOOTSTRAP_SEED_NOT_SELF_HOSTED";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum TcsValue {
|
||||
Null,
|
||||
Bool(bool),
|
||||
Int(i64),
|
||||
Text(String),
|
||||
List(Vec<TcsValue>),
|
||||
Object(BTreeMap<String, TcsValue>),
|
||||
}
|
||||
|
||||
impl TcsValue {
|
||||
fn object(&self, field: &str) -> Result<&BTreeMap<String, TcsValue>, TcsError> {
|
||||
match self {
|
||||
Self::Object(value) => Ok(value),
|
||||
_ => Err(TcsError::new(
|
||||
"TCS-E2001",
|
||||
format!("{field} must be an object"),
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
fn text(&self, field: &str) -> Result<&str, TcsError> {
|
||||
match self {
|
||||
Self::Text(value) => Ok(value),
|
||||
_ => Err(TcsError::new("TCS-E2001", format!("{field} must be text"))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct TcsDocument {
|
||||
pub language_version: String,
|
||||
pub declaration_kind: String,
|
||||
pub declaration_id: String,
|
||||
pub body: BTreeMap<String, TcsValue>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct TcsError {
|
||||
pub code: &'static str,
|
||||
pub message: String,
|
||||
pub line: usize,
|
||||
pub column: usize,
|
||||
}
|
||||
|
||||
impl TcsError {
|
||||
fn new(code: &'static str, message: impl Into<String>) -> Self {
|
||||
Self {
|
||||
code,
|
||||
message: message.into(),
|
||||
line: 0,
|
||||
column: 0,
|
||||
}
|
||||
}
|
||||
|
||||
fn at(mut self, line: usize, column: usize) -> Self {
|
||||
self.line = line;
|
||||
self.column = column;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for TcsError {
|
||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
if self.line == 0 {
|
||||
write!(formatter, "{}: {}", self.code, self.message)
|
||||
} else {
|
||||
write!(
|
||||
formatter,
|
||||
"{} at {}:{}: {}",
|
||||
self.code, self.line, self.column, self.message
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for TcsError {}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
enum TokenKind {
|
||||
Identifier(String),
|
||||
Text(String),
|
||||
Int(i64),
|
||||
Bool(bool),
|
||||
Null,
|
||||
LBrace,
|
||||
RBrace,
|
||||
LBracket,
|
||||
RBracket,
|
||||
Less,
|
||||
Greater,
|
||||
Colon,
|
||||
Equal,
|
||||
Comma,
|
||||
Semicolon,
|
||||
Dot,
|
||||
Eof,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct Token {
|
||||
kind: TokenKind,
|
||||
line: usize,
|
||||
column: usize,
|
||||
}
|
||||
|
||||
struct Lexer<'a> {
|
||||
chars: Vec<char>,
|
||||
index: usize,
|
||||
line: usize,
|
||||
column: usize,
|
||||
_source: &'a str,
|
||||
}
|
||||
|
||||
impl<'a> Lexer<'a> {
|
||||
fn new(source: &'a str) -> Result<Self, TcsError> {
|
||||
if source.starts_with('\u{feff}') {
|
||||
return Err(TcsError::new("TCS-E0001", "UTF-8 BOM is forbidden"));
|
||||
}
|
||||
Ok(Self {
|
||||
chars: source.chars().collect(),
|
||||
index: 0,
|
||||
line: 1,
|
||||
column: 1,
|
||||
_source: source,
|
||||
})
|
||||
}
|
||||
|
||||
fn peek(&self) -> Option<char> {
|
||||
self.chars.get(self.index).copied()
|
||||
}
|
||||
|
||||
fn peek_next(&self) -> Option<char> {
|
||||
self.chars.get(self.index + 1).copied()
|
||||
}
|
||||
|
||||
fn bump(&mut self) -> Option<char> {
|
||||
let value = self.peek()?;
|
||||
self.index += 1;
|
||||
if value == '\n' {
|
||||
self.line += 1;
|
||||
self.column = 1;
|
||||
} else {
|
||||
self.column += 1;
|
||||
}
|
||||
Some(value)
|
||||
}
|
||||
|
||||
fn skip_space_and_comments(&mut self) -> Result<(), TcsError> {
|
||||
loop {
|
||||
while self.peek().is_some_and(char::is_whitespace) {
|
||||
self.bump();
|
||||
}
|
||||
if self.peek() == Some('/') && self.peek_next() == Some('/') {
|
||||
while self.peek().is_some_and(|value| value != '\n') {
|
||||
self.bump();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if self.peek() == Some('/') && self.peek_next() == Some('*') {
|
||||
let line = self.line;
|
||||
let column = self.column;
|
||||
self.bump();
|
||||
self.bump();
|
||||
loop {
|
||||
match (self.peek(), self.peek_next()) {
|
||||
(Some('*'), Some('/')) => {
|
||||
self.bump();
|
||||
self.bump();
|
||||
break;
|
||||
}
|
||||
(Some(_), _) => {
|
||||
self.bump();
|
||||
}
|
||||
(None, _) => {
|
||||
return Err(TcsError::new("TCS-E0002", "unterminated block comment")
|
||||
.at(line, column));
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
fn token(&mut self) -> Result<Token, TcsError> {
|
||||
self.skip_space_and_comments()?;
|
||||
let line = self.line;
|
||||
let column = self.column;
|
||||
let Some(value) = self.peek() else {
|
||||
return Ok(Token {
|
||||
kind: TokenKind::Eof,
|
||||
line,
|
||||
column,
|
||||
});
|
||||
};
|
||||
let punctuation = match value {
|
||||
'{' => Some(TokenKind::LBrace),
|
||||
'}' => Some(TokenKind::RBrace),
|
||||
'[' => Some(TokenKind::LBracket),
|
||||
']' => Some(TokenKind::RBracket),
|
||||
'<' => Some(TokenKind::Less),
|
||||
'>' => Some(TokenKind::Greater),
|
||||
':' => Some(TokenKind::Colon),
|
||||
'=' => Some(TokenKind::Equal),
|
||||
',' => Some(TokenKind::Comma),
|
||||
';' => Some(TokenKind::Semicolon),
|
||||
'.' => Some(TokenKind::Dot),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(kind) = punctuation {
|
||||
self.bump();
|
||||
return Ok(Token { kind, line, column });
|
||||
}
|
||||
if value == '"' {
|
||||
return self.string_token(line, column);
|
||||
}
|
||||
if value == '-' || value.is_ascii_digit() {
|
||||
return self.integer_token(line, column);
|
||||
}
|
||||
if value == '_' || value.is_alphabetic() {
|
||||
return Ok(self.identifier_token(line, column));
|
||||
}
|
||||
Err(TcsError::new("TCS-E1001", format!("unexpected character {value:?}")).at(line, column))
|
||||
}
|
||||
|
||||
fn identifier_token(&mut self, line: usize, column: usize) -> Token {
|
||||
let mut value = String::new();
|
||||
while self.peek().is_some_and(|character| {
|
||||
character.is_alphanumeric() || matches!(character, '_' | '-' | '.' | '/' | ':' | '@')
|
||||
}) {
|
||||
value.push(self.bump().expect("peeked character"));
|
||||
}
|
||||
let kind = match value.as_str() {
|
||||
"true" => TokenKind::Bool(true),
|
||||
"false" => TokenKind::Bool(false),
|
||||
"null" => TokenKind::Null,
|
||||
_ => TokenKind::Identifier(value),
|
||||
};
|
||||
Token { kind, line, column }
|
||||
}
|
||||
|
||||
fn integer_token(&mut self, line: usize, column: usize) -> Result<Token, TcsError> {
|
||||
let mut value = String::new();
|
||||
if self.peek() == Some('-') {
|
||||
value.push(self.bump().expect("minus"));
|
||||
}
|
||||
while self
|
||||
.peek()
|
||||
.is_some_and(|character| character.is_ascii_digit())
|
||||
{
|
||||
value.push(self.bump().expect("digit"));
|
||||
}
|
||||
if value == "-" {
|
||||
return Err(TcsError::new("TCS-E1001", "minus must precede digits").at(line, column));
|
||||
}
|
||||
let parsed = value
|
||||
.parse::<i64>()
|
||||
.map_err(|_| TcsError::new("TCS-E2001", "integer out of range").at(line, column))?;
|
||||
Ok(Token {
|
||||
kind: TokenKind::Int(parsed),
|
||||
line,
|
||||
column,
|
||||
})
|
||||
}
|
||||
|
||||
fn string_token(&mut self, line: usize, column: usize) -> Result<Token, TcsError> {
|
||||
self.bump();
|
||||
let mut raw = String::from("\"");
|
||||
loop {
|
||||
match self.bump() {
|
||||
Some('"') => {
|
||||
raw.push('"');
|
||||
break;
|
||||
}
|
||||
Some('\\') => {
|
||||
raw.push('\\');
|
||||
let escaped = self.bump().ok_or_else(|| {
|
||||
TcsError::new("TCS-E0002", "unterminated string escape").at(line, column)
|
||||
})?;
|
||||
raw.push(escaped);
|
||||
}
|
||||
Some('\n' | '\r') | None => {
|
||||
return Err(TcsError::new("TCS-E0002", "unterminated string").at(line, column));
|
||||
}
|
||||
Some(character) => raw.push(character),
|
||||
}
|
||||
}
|
||||
let decoded: String = serde_json::from_str(&raw).map_err(|error| {
|
||||
TcsError::new("TCS-E0002", format!("invalid string escape: {error}")).at(line, column)
|
||||
})?;
|
||||
Ok(Token {
|
||||
kind: TokenKind::Text(decoded),
|
||||
line,
|
||||
column,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
struct Parser<'a> {
|
||||
lexer: Lexer<'a>,
|
||||
current: Token,
|
||||
}
|
||||
|
||||
impl<'a> Parser<'a> {
|
||||
fn new(source: &'a str) -> Result<Self, TcsError> {
|
||||
let mut lexer = Lexer::new(source)?;
|
||||
let current = lexer.token()?;
|
||||
Ok(Self { lexer, current })
|
||||
}
|
||||
|
||||
fn advance(&mut self) -> Result<Token, TcsError> {
|
||||
let old = self.current.clone();
|
||||
self.current = self.lexer.token()?;
|
||||
Ok(old)
|
||||
}
|
||||
|
||||
fn symbol(&mut self, expected: TokenKind) -> Result<(), TcsError> {
|
||||
if std::mem::discriminant(&self.current.kind) == std::mem::discriminant(&expected) {
|
||||
self.advance()?;
|
||||
Ok(())
|
||||
} else {
|
||||
Err(TcsError::new(
|
||||
"TCS-E1001",
|
||||
format!("expected {expected:?}, found {:?}", self.current.kind),
|
||||
)
|
||||
.at(self.current.line, self.current.column))
|
||||
}
|
||||
}
|
||||
|
||||
fn identifier(&mut self) -> Result<String, TcsError> {
|
||||
match self.advance()? {
|
||||
Token {
|
||||
kind: TokenKind::Identifier(value),
|
||||
..
|
||||
} => Ok(value),
|
||||
token => Err(TcsError::new(
|
||||
"TCS-E1001",
|
||||
format!("expected identifier, found {:?}", token.kind),
|
||||
)
|
||||
.at(token.line, token.column)),
|
||||
}
|
||||
}
|
||||
|
||||
fn document(&mut self) -> Result<TcsDocument, TcsError> {
|
||||
let prologue = self.identifier()?;
|
||||
if prologue != "TCS" {
|
||||
return Err(TcsError::new("TCS-E1001", "file must begin with TCS"));
|
||||
}
|
||||
let major = match self.advance()?.kind {
|
||||
TokenKind::Int(value) if value >= 0 => value,
|
||||
_ => return Err(TcsError::new("TCS-E1001", "invalid language version")),
|
||||
};
|
||||
self.symbol(TokenKind::Dot)?;
|
||||
let minor = match self.advance()?.kind {
|
||||
TokenKind::Int(value) if value >= 0 => value,
|
||||
_ => return Err(TcsError::new("TCS-E1001", "invalid language version")),
|
||||
};
|
||||
self.symbol(TokenKind::Semicolon)?;
|
||||
let declaration_kind = self.identifier()?;
|
||||
if !matches!(
|
||||
declaration_kind.as_str(),
|
||||
"PROGRAM" | "MODULE" | "PROTOCOL" | "COMPILER" | "EVENT" | "RECEIPT"
|
||||
) {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1001",
|
||||
format!("unknown declaration kind {declaration_kind}"),
|
||||
));
|
||||
}
|
||||
let declaration_id = self.identifier()?;
|
||||
let body = self.block()?;
|
||||
if self.current.kind != TokenKind::Eof {
|
||||
return Err(
|
||||
TcsError::new("TCS-E1001", "trailing tokens after declaration")
|
||||
.at(self.current.line, self.current.column),
|
||||
);
|
||||
}
|
||||
Ok(TcsDocument {
|
||||
language_version: format!("{major}.{minor}"),
|
||||
declaration_kind,
|
||||
declaration_id,
|
||||
body,
|
||||
})
|
||||
}
|
||||
|
||||
fn block(&mut self) -> Result<BTreeMap<String, TcsValue>, TcsError> {
|
||||
self.symbol(TokenKind::LBrace)?;
|
||||
let mut object = BTreeMap::new();
|
||||
while self.current.kind != TokenKind::RBrace {
|
||||
if self.current.kind == TokenKind::Eof {
|
||||
return Err(TcsError::new("TCS-E1001", "unterminated block"));
|
||||
}
|
||||
let line = self.current.line;
|
||||
let column = self.current.column;
|
||||
let key = self.identifier()?;
|
||||
let value = match self.current.kind {
|
||||
TokenKind::LBrace => TcsValue::Object(self.block()?),
|
||||
TokenKind::Colon => {
|
||||
self.advance()?;
|
||||
self.type_expression()?;
|
||||
self.symbol(TokenKind::Equal)?;
|
||||
let value = self.value()?;
|
||||
self.symbol(TokenKind::Semicolon)?;
|
||||
value
|
||||
}
|
||||
TokenKind::Equal => {
|
||||
self.advance()?;
|
||||
let value = self.value()?;
|
||||
self.symbol(TokenKind::Semicolon)?;
|
||||
value
|
||||
}
|
||||
_ => {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1001",
|
||||
"expected block, type annotation, or assignment",
|
||||
)
|
||||
.at(self.current.line, self.current.column));
|
||||
}
|
||||
};
|
||||
if object.insert(key.clone(), value).is_some() {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1002",
|
||||
format!("duplicate field or section {key}"),
|
||||
)
|
||||
.at(line, column));
|
||||
}
|
||||
}
|
||||
self.advance()?;
|
||||
Ok(object)
|
||||
}
|
||||
|
||||
fn type_expression(&mut self) -> Result<(), TcsError> {
|
||||
self.identifier()?;
|
||||
if self.current.kind == TokenKind::Less {
|
||||
self.advance()?;
|
||||
self.type_expression()?;
|
||||
while self.current.kind == TokenKind::Comma {
|
||||
self.advance()?;
|
||||
self.type_expression()?;
|
||||
}
|
||||
self.symbol(TokenKind::Greater)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn value(&mut self) -> Result<TcsValue, TcsError> {
|
||||
match self.advance()? {
|
||||
Token {
|
||||
kind: TokenKind::Text(value),
|
||||
..
|
||||
}
|
||||
| Token {
|
||||
kind: TokenKind::Identifier(value),
|
||||
..
|
||||
} => Ok(TcsValue::Text(value)),
|
||||
Token {
|
||||
kind: TokenKind::Int(value),
|
||||
..
|
||||
} => Ok(TcsValue::Int(value)),
|
||||
Token {
|
||||
kind: TokenKind::Bool(value),
|
||||
..
|
||||
} => Ok(TcsValue::Bool(value)),
|
||||
Token {
|
||||
kind: TokenKind::Null,
|
||||
..
|
||||
} => Ok(TcsValue::Null),
|
||||
Token {
|
||||
kind: TokenKind::LBracket,
|
||||
..
|
||||
} => self.array(),
|
||||
Token {
|
||||
kind: TokenKind::LBrace,
|
||||
..
|
||||
} => self.inline_object(),
|
||||
token => Err(TcsError::new(
|
||||
"TCS-E1001",
|
||||
format!("invalid value token {:?}", token.kind),
|
||||
)
|
||||
.at(token.line, token.column)),
|
||||
}
|
||||
}
|
||||
|
||||
fn array(&mut self) -> Result<TcsValue, TcsError> {
|
||||
let mut values = Vec::new();
|
||||
if self.current.kind != TokenKind::RBracket {
|
||||
loop {
|
||||
values.push(self.value()?);
|
||||
if self.current.kind != TokenKind::Comma {
|
||||
break;
|
||||
}
|
||||
self.advance()?;
|
||||
}
|
||||
}
|
||||
self.symbol(TokenKind::RBracket)?;
|
||||
Ok(TcsValue::List(values))
|
||||
}
|
||||
|
||||
fn inline_object(&mut self) -> Result<TcsValue, TcsError> {
|
||||
let mut object = BTreeMap::new();
|
||||
if self.current.kind != TokenKind::RBrace {
|
||||
loop {
|
||||
let key = self.identifier()?;
|
||||
self.symbol(TokenKind::Colon)?;
|
||||
let value = self.value()?;
|
||||
if object.insert(key.clone(), value).is_some() {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1002",
|
||||
format!("duplicate inline field {key}"),
|
||||
));
|
||||
}
|
||||
if self.current.kind != TokenKind::Comma {
|
||||
break;
|
||||
}
|
||||
self.advance()?;
|
||||
}
|
||||
}
|
||||
self.symbol(TokenKind::RBrace)?;
|
||||
Ok(TcsValue::Object(object))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse(source: &str) -> Result<TcsDocument, TcsError> {
|
||||
Parser::new(source)?.document()
|
||||
}
|
||||
|
||||
const PROGRAM_SECTIONS: [&str; 15] = [
|
||||
"header",
|
||||
"source",
|
||||
"subject",
|
||||
"target",
|
||||
"inputs",
|
||||
"outputs",
|
||||
"conditions",
|
||||
"actions",
|
||||
"authority",
|
||||
"resources",
|
||||
"failure",
|
||||
"stop",
|
||||
"cleanup",
|
||||
"rollback",
|
||||
"receipt",
|
||||
];
|
||||
|
||||
fn required_text<'a>(
|
||||
object: &'a BTreeMap<String, TcsValue>,
|
||||
field: &str,
|
||||
) -> Result<&'a str, TcsError> {
|
||||
object
|
||||
.get(field)
|
||||
.ok_or_else(|| TcsError::new("TCS-E1004", format!("required field {field} missing")))?
|
||||
.text(field)
|
||||
}
|
||||
|
||||
pub fn validate_program(document: &TcsDocument) -> Result<(), TcsError> {
|
||||
if document.language_version != "0.1" {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E2102",
|
||||
format!("unsupported TCS version {}", document.language_version),
|
||||
));
|
||||
}
|
||||
if document.declaration_kind != "PROGRAM" {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E2001",
|
||||
"Stage-0 executable subset accepts PROGRAM only",
|
||||
));
|
||||
}
|
||||
for section in PROGRAM_SECTIONS {
|
||||
document.body.get(section).ok_or_else(|| {
|
||||
TcsError::new("TCS-E1004", format!("required section {section} missing"))
|
||||
})?;
|
||||
}
|
||||
for section in document.body.keys() {
|
||||
if !PROGRAM_SECTIONS.contains(§ion.as_str()) {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1003",
|
||||
format!("unknown PROGRAM section {section}"),
|
||||
));
|
||||
}
|
||||
}
|
||||
let header = document.body["header"].object("header")?;
|
||||
for field in [
|
||||
"schema",
|
||||
"name_zh",
|
||||
"name_en",
|
||||
"version",
|
||||
"language",
|
||||
"profile",
|
||||
"lifecycle",
|
||||
"canonical_uri",
|
||||
] {
|
||||
required_text(header, field)?;
|
||||
}
|
||||
if !header.contains_key("protocols") || !header.contains_key("compatibility") {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1004",
|
||||
"header requires protocols and compatibility",
|
||||
));
|
||||
}
|
||||
let actions = document.body["actions"].object("actions")?;
|
||||
if actions.is_empty() {
|
||||
return Err(TcsError::new("TCS-E1004", "actions must not be empty"));
|
||||
}
|
||||
for (action_id, action) in actions {
|
||||
let action = action.object(action_id)?;
|
||||
let operation = required_text(action, "operation")?;
|
||||
if operation != "CORE.ECHO" {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E2101",
|
||||
format!("unregistered Stage-0 operation {operation}"),
|
||||
));
|
||||
}
|
||||
for field in ["input_refs", "output_refs", "on_success", "on_failure"] {
|
||||
if !action.contains_key(field) {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E1004",
|
||||
format!("action {action_id} missing {field}"),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn sha256_hex(bytes: impl AsRef<[u8]>) -> String {
|
||||
format!("{:x}", Sha256::digest(bytes.as_ref()))
|
||||
}
|
||||
|
||||
pub fn compile(source: &str) -> Result<JsonValue, TcsError> {
|
||||
let document = parse(source)?;
|
||||
validate_program(&document)?;
|
||||
let source_sha256 = sha256_hex(source.as_bytes());
|
||||
let body = serde_json::to_value(&document.body)
|
||||
.map_err(|error| TcsError::new("TCS-E8001", error.to_string()))?;
|
||||
Ok(json!({
|
||||
"schema": "guanghu.gir/v1",
|
||||
"identity": {
|
||||
"gir_id": format!("GIR-{}", document.declaration_id),
|
||||
"program_id": document.declaration_id,
|
||||
"language_version": document.language_version,
|
||||
},
|
||||
"compiled_from": {
|
||||
"source_sha256": source_sha256,
|
||||
"compiler_id": COMPILER_ID,
|
||||
"compiler_state": COMPILER_STATE,
|
||||
},
|
||||
"subject": body["subject"].clone(),
|
||||
"exact_target": body["target"].clone(),
|
||||
"inputs": body["inputs"].clone(),
|
||||
"outputs": body["outputs"].clone(),
|
||||
"conditions": body["conditions"].clone(),
|
||||
"deterministic_action_graph": body["actions"].clone(),
|
||||
"authority_proof": body["authority"].clone(),
|
||||
"resource_plan": body["resources"].clone(),
|
||||
"failure_plan": body["failure"].clone(),
|
||||
"timeout_and_stop": body["stop"].clone(),
|
||||
"cleanup_plan": body["cleanup"].clone(),
|
||||
"rollback_plan": body["rollback"].clone(),
|
||||
"receipt_plan": body["receipt"].clone(),
|
||||
"unresolved_natural_language": false,
|
||||
"native_self_hosted": false,
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn canonical_json(value: &JsonValue) -> Result<String, TcsError> {
|
||||
serde_json::to_string_pretty(value)
|
||||
.map(|mut text| {
|
||||
text.push('\n');
|
||||
text
|
||||
})
|
||||
.map_err(|error| TcsError::new("TCS-E8001", error.to_string()))
|
||||
}
|
||||
|
||||
fn safe_relative_path(value: &str) -> Result<PathBuf, TcsError> {
|
||||
let path = Path::new(value);
|
||||
if path.is_absolute() {
|
||||
return Err(TcsError::new("TCS-E4002", "absolute target path forbidden"));
|
||||
}
|
||||
let mut result = PathBuf::new();
|
||||
for component in path.components() {
|
||||
match component {
|
||||
Component::CurDir => {}
|
||||
Component::Normal(value) => result.push(value),
|
||||
_ => {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E4002",
|
||||
"target path traversal forbidden",
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
if result.as_os_str().is_empty() {
|
||||
return Err(TcsError::new("TCS-E4002", "empty target path forbidden"));
|
||||
}
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
fn json_text<'a>(value: &'a JsonValue, pointer: &str) -> Result<&'a str, TcsError> {
|
||||
value
|
||||
.pointer(pointer)
|
||||
.and_then(JsonValue::as_str)
|
||||
.ok_or_else(|| TcsError::new("TCS-E2001", format!("missing text at {pointer}")))
|
||||
}
|
||||
|
||||
pub fn run_echo_gir(gir: &JsonValue, root: &Path) -> Result<PathBuf, TcsError> {
|
||||
if gir.get("schema").and_then(JsonValue::as_str) != Some("guanghu.gir/v1") {
|
||||
return Err(TcsError::new("TCS-E2001", "unsupported GIR schema"));
|
||||
}
|
||||
if gir
|
||||
.pointer("/compiled_from/compiler_state")
|
||||
.and_then(JsonValue::as_str)
|
||||
!= Some(COMPILER_STATE)
|
||||
{
|
||||
return Err(TcsError::new("TCS-E3002", "unknown compiler provenance"));
|
||||
}
|
||||
let actions = gir
|
||||
.get("deterministic_action_graph")
|
||||
.and_then(JsonValue::as_object)
|
||||
.ok_or_else(|| TcsError::new("TCS-E2001", "missing action graph"))?;
|
||||
if actions.len() != 1 {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E2101",
|
||||
"Stage-0 runner requires exactly one action",
|
||||
));
|
||||
}
|
||||
let action = actions.values().next().expect("one action");
|
||||
if action.get("operation").and_then(JsonValue::as_str) != Some("CORE.ECHO") {
|
||||
return Err(TcsError::new("TCS-E2101", "runner permits CORE.ECHO only"));
|
||||
}
|
||||
let message = json_text(gir, "/inputs/MESSAGE/value")?;
|
||||
let target = json_text(gir, "/exact_target/exact_path")?;
|
||||
let receipt_target = json_text(gir, "/receipt_plan/machine_path")?;
|
||||
if target != receipt_target {
|
||||
return Err(TcsError::new(
|
||||
"TCS-E6001",
|
||||
"target and receipt path must match",
|
||||
));
|
||||
}
|
||||
let relative = safe_relative_path(target)?;
|
||||
let output = root.join(relative);
|
||||
let parent = output
|
||||
.parent()
|
||||
.ok_or_else(|| TcsError::new("TCS-E4002", "target has no parent"))?;
|
||||
fs::create_dir_all(parent).map_err(|error| {
|
||||
TcsError::new(
|
||||
"TCS-E8001",
|
||||
format!("cannot create receipt parent: {error}"),
|
||||
)
|
||||
})?;
|
||||
let receipt = json!({
|
||||
"schema": "tcs.execution-receipt/v1",
|
||||
"state": "EXECUTED_TARGET_READBACK_VERIFIED",
|
||||
"program_id": json_text(gir, "/identity/program_id")?,
|
||||
"operation": "CORE.ECHO",
|
||||
"output": { "ECHOED": message },
|
||||
"gir_sha256": sha256_hex(canonical_json(gir)?.as_bytes()),
|
||||
"compiler_state": COMPILER_STATE,
|
||||
"native_self_hosted": false,
|
||||
});
|
||||
let encoded = canonical_json(&receipt)?;
|
||||
fs::write(&output, encoded.as_bytes())
|
||||
.map_err(|error| TcsError::new("TCS-E8001", format!("cannot write receipt: {error}")))?;
|
||||
let readback = fs::read(&output)
|
||||
.map_err(|error| TcsError::new("TCS-E6002", format!("cannot read receipt: {error}")))?;
|
||||
if readback != encoded.as_bytes() {
|
||||
return Err(TcsError::new("TCS-E6002", "receipt readback differs"));
|
||||
}
|
||||
Ok(output)
|
||||
}
|
||||
|
||||
pub fn compile_file(source: &Path, output: &Path) -> Result<(), TcsError> {
|
||||
let source_text = fs::read_to_string(source)
|
||||
.map_err(|error| TcsError::new("TCS-E3002", format!("cannot read source: {error}")))?;
|
||||
let gir = compile(&source_text)?;
|
||||
let encoded = canonical_json(&gir)?;
|
||||
if let Some(parent) = output.parent() {
|
||||
fs::create_dir_all(parent).map_err(|error| {
|
||||
TcsError::new("TCS-E8001", format!("cannot create output: {error}"))
|
||||
})?;
|
||||
}
|
||||
fs::write(output, encoded)
|
||||
.map_err(|error| TcsError::new("TCS-E8001", format!("cannot write GIR: {error}")))
|
||||
}
|
||||
|
||||
pub fn run_gir_file(gir_path: &Path, root: &Path) -> Result<PathBuf, TcsError> {
|
||||
let text = fs::read_to_string(gir_path)
|
||||
.map_err(|error| TcsError::new("TCS-E3002", format!("cannot read GIR: {error}")))?;
|
||||
let gir: JsonValue = serde_json::from_str(&text)
|
||||
.map_err(|error| TcsError::new("TCS-E2001", format!("invalid GIR JSON: {error}")))?;
|
||||
run_echo_gir(&gir, root)
|
||||
}
|
||||
pub use tcs_gir_runtime::*;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use std::{env, fs, path::Path};
|
||||
|
||||
fn usage() -> &'static str {
|
||||
"usage: tcs-stage0 parse <source.tcs> | compile <source.tcs> <output.gir.json> | run <input.gir.json> <allowed-root>"
|
||||
"usage: tcs-stage0 parse <source.tcs> | compile <source.tcs> <output.gir.json> | bootstrap-compiler <compiler.tcs> <compiler.gir.json> | compile-with <compiler.gir.json> <source.tcs> <output.gir.json> | run <input.gir.json> <allowed-root>"
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
@ -25,6 +25,21 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
println!("COMPILED {source} -> {output}");
|
||||
Ok(())
|
||||
}
|
||||
[command, source, output] if command == "bootstrap-compiler" => {
|
||||
let source_text = fs::read_to_string(source)?;
|
||||
let compiler = tcs_stage0::bootstrap_compiler(&source_text)?;
|
||||
fs::write(output, tcs_stage0::canonical_json(&compiler)?)?;
|
||||
println!("BOOTSTRAPPED {source} -> {output}");
|
||||
Ok(())
|
||||
}
|
||||
[command, compiler, source, output] if command == "compile-with" => {
|
||||
let compiler: serde_json::Value = serde_json::from_str(&fs::read_to_string(compiler)?)?;
|
||||
let source_text = fs::read_to_string(source)?;
|
||||
let gir = tcs_stage0::compile_with_compiler_gir(&compiler, &source_text)?;
|
||||
fs::write(output, tcs_stage0::canonical_json(&gir)?)?;
|
||||
println!("TCS_COMPILED {source} -> {output}");
|
||||
Ok(())
|
||||
}
|
||||
[command, gir, root] if command == "run" => {
|
||||
let receipt = tcs_stage0::run_gir_file(Path::new(gir), Path::new(root))?;
|
||||
println!("EXECUTED receipt={}", receipt.display());
|
||||
|
|
|
|||
|
|
@ -8,6 +8,21 @@ fn example() -> String {
|
|||
.expect("example source")
|
||||
}
|
||||
|
||||
fn compiler_source() -> String {
|
||||
fs::read_to_string(
|
||||
Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../language/compiler/TCS-COMPILER-STAGE1.tcs"),
|
||||
)
|
||||
.expect("compiler source")
|
||||
}
|
||||
|
||||
fn module_source() -> String {
|
||||
fs::read_to_string(
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("../../language/examples/ECHO-PACKAGE.tcs"),
|
||||
)
|
||||
.expect("module source")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parses_and_compiles_the_registered_echo_program() {
|
||||
let source = example();
|
||||
|
|
@ -74,3 +89,56 @@ fn rejects_path_traversal_and_target_receipt_mismatch() {
|
|||
let error = tcs_stage0::run_echo_gir(&mismatch, root.path()).expect_err("mismatch must fail");
|
||||
assert_eq!(error.code, "TCS-E6001");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tcs_compiler_reaches_semantic_fixed_point_and_compiles_without_stage0() {
|
||||
let source = compiler_source();
|
||||
let compiler_a = tcs_stage0::bootstrap_compiler(&source).expect("Stage-0 creates compiler A");
|
||||
assert_eq!(compiler_a["schema"], "guanghu.compiler-gir/v1");
|
||||
assert_eq!(compiler_a["native_self_hosted"], false);
|
||||
|
||||
let compiler_b = tcs_stage0::compile_with_compiler_gir(&compiler_a, &source)
|
||||
.expect("compiler A creates compiler B");
|
||||
assert_eq!(compiler_b["native_self_hosted"], true);
|
||||
assert_eq!(
|
||||
compiler_a.pointer("/identity/definition_sha256"),
|
||||
compiler_b.pointer("/identity/definition_sha256")
|
||||
);
|
||||
|
||||
let program = tcs_stage0::compile_with_compiler_gir(&compiler_b, &example())
|
||||
.expect("compiler B compiles program without Stage-0 compile path");
|
||||
assert_eq!(program["native_self_hosted"], true);
|
||||
assert_eq!(
|
||||
program
|
||||
.pointer("/compiled_from/compiler_state")
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("TCS_COMPILER_GIR_EXECUTED")
|
||||
);
|
||||
|
||||
let module = tcs_stage0::compile_with_compiler_gir(&compiler_b, &module_source())
|
||||
.expect("compiler B compiles module");
|
||||
assert_eq!(module["schema"], "guanghu.module-gir/v1");
|
||||
assert_eq!(
|
||||
module
|
||||
.pointer("/manifest/display_name_zh")
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("光湖最小回声模块")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compiler_gir_tampering_and_negative_program_fail_closed() {
|
||||
let source = compiler_source();
|
||||
let mut compiler = tcs_stage0::bootstrap_compiler(&source).expect("compiler A");
|
||||
compiler["compiler_definition"]["output_contract"]["schema"] =
|
||||
JsonValue::String("tampered".to_owned());
|
||||
let error = tcs_stage0::compile_with_compiler_gir(&compiler, &example())
|
||||
.expect_err("tampered compiler must fail");
|
||||
assert_eq!(error.code, "TCS-E3002");
|
||||
|
||||
let compiler = tcs_stage0::bootstrap_compiler(&source).expect("compiler A");
|
||||
let negative = example().replace("CORE.ECHO", "ABSORB");
|
||||
let error = tcs_stage0::compile_with_compiler_gir(&compiler, &negative)
|
||||
.expect_err("unregistered operation must still fail through compiler GIR");
|
||||
assert_eq!(error.code, "TCS-E2101");
|
||||
}
|
||||
|
|
|
|||
113
build/self-host/ECHO-MODULE.stage1.gir.json
Normal file
113
build/self-host/ECHO-MODULE.stage1.gir.json
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
{
|
||||
"authority_proof": {
|
||||
"issuer": "LOCAL_TEST_FIXTURE",
|
||||
"lease_required": false,
|
||||
"proof_ref": "TEST-ONLY",
|
||||
"scope": "EXACT_BUILD_RECEIPT_PATH",
|
||||
"single_use": true,
|
||||
"valid_from": "PROGRAM_START",
|
||||
"valid_until": "PROGRAM_END"
|
||||
},
|
||||
"cleanup_plan": {
|
||||
"exact_boundary": "./build",
|
||||
"targets": [
|
||||
"UNCOMMITTED_TEST_RECEIPT"
|
||||
]
|
||||
},
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "f1ecd630e50dfe5374ca26998d68a49efd35cf3d9de54ecabd3ca3aae68c61bf"
|
||||
},
|
||||
"conditions": {
|
||||
"C1": {
|
||||
"on_false": "FAIL_CLOSED",
|
||||
"predicate": "TARGET_WITHIN_TEST_BUILD_ROOT"
|
||||
}
|
||||
},
|
||||
"deterministic_action_graph": {
|
||||
"A1": {
|
||||
"input_refs": [
|
||||
"MESSAGE"
|
||||
],
|
||||
"on_failure": "FAIL_CLOSED",
|
||||
"on_success": "COMPLETE",
|
||||
"operation": "CORE.ECHO",
|
||||
"output_refs": [
|
||||
"ECHOED"
|
||||
]
|
||||
}
|
||||
},
|
||||
"exact_target": {
|
||||
"exact_path": "./build/echo-receipt.hldp",
|
||||
"expected_fingerprint": "NONE",
|
||||
"expected_state": "ABSENT",
|
||||
"target_id": "HLP-TARGET-STAGE0-RECEIPT"
|
||||
},
|
||||
"failure_plan": {
|
||||
"errors": [
|
||||
"TCS-E6001",
|
||||
"TCS-E8001"
|
||||
],
|
||||
"fail_closed": true
|
||||
},
|
||||
"identity": {
|
||||
"gir_id": "GIR-HLP-PROGRAM-ECHO-0001",
|
||||
"language_version": "0.1",
|
||||
"program_id": "HLP-PROGRAM-ECHO-0001"
|
||||
},
|
||||
"inputs": {
|
||||
"MESSAGE": {
|
||||
"required": true,
|
||||
"source": "PROGRAM_LITERAL",
|
||||
"type": "Text",
|
||||
"value": "光湖语言已经进入机器执行链"
|
||||
}
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"outputs": {
|
||||
"ECHOED": {
|
||||
"destination": "RECEIPT",
|
||||
"integrity": "SHA256",
|
||||
"type": "Text"
|
||||
}
|
||||
},
|
||||
"receipt_plan": {
|
||||
"human_projection": "REQUIRED",
|
||||
"integrity": "SHA256",
|
||||
"machine_path": "./build/echo-receipt.hldp",
|
||||
"protocol": "TCS-DEV-VERIFY-v1.0",
|
||||
"target_readback": "EXACT_CONTENT_AND_HASH"
|
||||
},
|
||||
"resource_plan": {
|
||||
"concurrency": 1,
|
||||
"memory_limit_bytes": 1048576,
|
||||
"runway": "LOCAL_TEST",
|
||||
"timeout_ms": 1000
|
||||
},
|
||||
"rollback_plan": {
|
||||
"actions": [
|
||||
"DROP_TEMP_RECEIPT"
|
||||
],
|
||||
"preconditions": [
|
||||
"RECEIPT_NOT_COMMITTED"
|
||||
],
|
||||
"verification": [
|
||||
"NO_FINAL_RECEIPT"
|
||||
]
|
||||
},
|
||||
"schema": "guanghu.gir/v1",
|
||||
"subject": {
|
||||
"channel_id": "ICE-CH-ZC001",
|
||||
"subject_id": "HLP-SYSTEM-STAGE0-TEST",
|
||||
"subject_kind": "SYSTEM",
|
||||
"verification": "LOCAL_TEST_FIXTURE"
|
||||
},
|
||||
"timeout_and_stop": {
|
||||
"safe_checkpoint": "NONE",
|
||||
"signals": [
|
||||
"TIMEOUT"
|
||||
]
|
||||
},
|
||||
"unresolved_natural_language": false
|
||||
}
|
||||
70
build/self-host/ECHO-PACKAGE.module.gir.json
Normal file
70
build/self-host/ECHO-PACKAGE.module.gir.json
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
"authority_ceiling": {
|
||||
"maximum": "LOCAL_EXACT_RECEIPT_PATH",
|
||||
"network": false,
|
||||
"process": false
|
||||
},
|
||||
"capabilities": {
|
||||
"provided": [
|
||||
"HLP-CAPABILITY-ECHO-0001"
|
||||
],
|
||||
"required": [
|
||||
"CORE.ECHO"
|
||||
]
|
||||
},
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "68e55584a1da4072a077fbf25c67307890ae7d4c373f2745178c83b522ce0570"
|
||||
},
|
||||
"data_scope": {
|
||||
"read": [
|
||||
"PROGRAM_LITERAL"
|
||||
],
|
||||
"write": [
|
||||
"ACCOUNT_OR_TEST_SCOPED_RECEIPT"
|
||||
]
|
||||
},
|
||||
"entry": {
|
||||
"id": "HLP-PROGRAM-ECHO-0001",
|
||||
"kind": "PROGRAM"
|
||||
},
|
||||
"identity": {
|
||||
"language_version": "0.1",
|
||||
"module_id": "HLP-MODULE-ECHO-0001"
|
||||
},
|
||||
"install": {
|
||||
"account_scoped": true,
|
||||
"activation_requires_self_test": true,
|
||||
"registration_is_installation": false
|
||||
},
|
||||
"manifest": {
|
||||
"display_name_zh": "光湖最小回声模块",
|
||||
"entry_program_id": "HLP-PROGRAM-ECHO-0001",
|
||||
"entry_source": "language/examples/ECHO-MODULE.tcs",
|
||||
"module_id": "HLP-MODULE-ECHO-0001"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"network_scope": {
|
||||
"allowed": false,
|
||||
"domains": []
|
||||
},
|
||||
"projection": {
|
||||
"display_name_zh": "光湖最小回声模块",
|
||||
"technical_detail_default": false
|
||||
},
|
||||
"resource_ceiling": {
|
||||
"concurrency": 1,
|
||||
"memory_limit_bytes": 1048576,
|
||||
"timeout_ms": 1000
|
||||
},
|
||||
"rollback": {
|
||||
"action": "REMOVE_INSTALLED_BYTES_AND_RESTORE_PREVIOUS_ACTIVE_VERSION",
|
||||
"preserve_receipts": true
|
||||
},
|
||||
"schema": "guanghu.module-gir/v1",
|
||||
"self_test": {
|
||||
"expect": "EXECUTED_TARGET_READBACK_VERIFIED",
|
||||
"program_id": "HLP-PROGRAM-ECHO-0001"
|
||||
}
|
||||
}
|
||||
72
build/self-host/TCS-STDLIB-CORE.module.gir.json
Normal file
72
build/self-host/TCS-STDLIB-CORE.module.gir.json
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"authority_ceiling": {
|
||||
"maximum": "LOCAL_EXACT_RECEIPT_PATH",
|
||||
"network": false,
|
||||
"process": false
|
||||
},
|
||||
"capabilities": {
|
||||
"provided": [
|
||||
"CORE.ECHO"
|
||||
],
|
||||
"required": [
|
||||
"HOST.EXACT_ROOT_IO",
|
||||
"HOST.SHA256"
|
||||
]
|
||||
},
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "dbadf698eb2b9a1399d5ad29912dd10b4bd2711b33d5b635d08a6d7112bc0c96"
|
||||
},
|
||||
"data_scope": {
|
||||
"read": [
|
||||
"PROGRAM_LITERAL"
|
||||
],
|
||||
"write": [
|
||||
"CALLER_SCOPED_RECEIPT_ROOT"
|
||||
]
|
||||
},
|
||||
"entry": {
|
||||
"id": "TCS-STDLIB-CORE-0001",
|
||||
"kind": "REGISTERED_OPERATION_LIBRARY"
|
||||
},
|
||||
"identity": {
|
||||
"language_version": "0.1",
|
||||
"module_id": "TCS-STDLIB-CORE-0001"
|
||||
},
|
||||
"install": {
|
||||
"account_scoped": true,
|
||||
"activation_requires_self_test": true,
|
||||
"registration_is_installation": false
|
||||
},
|
||||
"manifest": {
|
||||
"abi": "GIR/1",
|
||||
"display_name_zh": "TCS 核心标准库",
|
||||
"entry_program_id": "HLP-PROGRAM-ECHO-0001",
|
||||
"entry_source": "language/examples/ECHO-MODULE.tcs",
|
||||
"module_id": "TCS-STDLIB-CORE-0001"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"network_scope": {
|
||||
"allowed": false,
|
||||
"domains": []
|
||||
},
|
||||
"projection": {
|
||||
"display_name_zh": "TCS 核心标准库",
|
||||
"technical_detail_default": false
|
||||
},
|
||||
"resource_ceiling": {
|
||||
"concurrency": 1,
|
||||
"memory_limit_bytes": 1048576,
|
||||
"timeout_ms": 1000
|
||||
},
|
||||
"rollback": {
|
||||
"action": "RESTORE_PREVIOUS_STANDARD_LIBRARY",
|
||||
"preserve_receipts": true
|
||||
},
|
||||
"schema": "guanghu.module-gir/v1",
|
||||
"self_test": {
|
||||
"expect": "EXECUTED_TARGET_READBACK_VERIFIED",
|
||||
"program_id": "HLP-PROGRAM-ECHO-0001"
|
||||
}
|
||||
}
|
||||
337
build/self-host/compiler-A.gir.json
Normal file
337
build/self-host/compiler-A.gir.json
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
{
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-STAGE0-IGNITION-0001",
|
||||
"compiler_state": "FOREIGN_HOST_BOOTSTRAP_SEED_NOT_SELF_HOSTED",
|
||||
"source_sha256": "65856dd98a272c0e8911d64dc96c9f0b4101f6d9364eeeac3cf78c282129de3f"
|
||||
},
|
||||
"compiler_definition": {
|
||||
"canonicalization": {
|
||||
"comments_in_semantic_digest": false,
|
||||
"final_newline": true,
|
||||
"integers": "MINIMAL_DECIMAL",
|
||||
"line_end": "LF",
|
||||
"list_order": "PRESERVE_SOURCE_SEMANTICS",
|
||||
"object_keys": "UTF8_BYTE_ORDER",
|
||||
"semantic_digest": "SHA256",
|
||||
"strings": "JSON_ESCAPE_NO_OPTIONAL_ESCAPE"
|
||||
},
|
||||
"header": {
|
||||
"bootstrap_seed": "TCS-STAGE0-IGNITION-0001",
|
||||
"lifecycle": "EXECUTABLE_SEMANTIC_FIXED_POINT_PROVEN_HOST_ACCEPTANCE_IN_PROGRESS",
|
||||
"name_zh": "TCS 第一代自举编译器",
|
||||
"output": "GIR/1",
|
||||
"profile": "HLDP-NP/1",
|
||||
"schema": "tcs.compiler/v1",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"lexer_rules": {
|
||||
"L001": {
|
||||
"emit_error": "TCS-E0001",
|
||||
"when": "BOM_AT_START"
|
||||
},
|
||||
"L002": {
|
||||
"action": "SKIP_WITH_SOURCE_POSITION",
|
||||
"when": "WHITESPACE_OR_COMMENT"
|
||||
},
|
||||
"L003": {
|
||||
"action": "READ_JSON_ESCAPED_TEXT",
|
||||
"on_unterminated": "TCS-E0002",
|
||||
"when": "DOUBLE_QUOTE"
|
||||
},
|
||||
"L004": {
|
||||
"action": "READ_SIGNED_DECIMAL_INT",
|
||||
"on_overflow": "TCS-E2001",
|
||||
"when": "MINUS_OR_ASCII_DIGIT"
|
||||
},
|
||||
"L005": {
|
||||
"action": "READ_IDENTIFIER_OR_KEYWORD",
|
||||
"when": "UNICODE_LETTER_OR_UNDERSCORE"
|
||||
},
|
||||
"L006": {
|
||||
"action": "EMIT_PUNCTUATION_TOKEN",
|
||||
"when": "REGISTERED_PUNCTUATION"
|
||||
},
|
||||
"L007": {
|
||||
"emit_error": "TCS-E1001",
|
||||
"when": "OTHER_CHARACTER"
|
||||
}
|
||||
},
|
||||
"lowering_to_gir": {
|
||||
"G001": {
|
||||
"from": "header",
|
||||
"to": "identity",
|
||||
"transform": "COPY_ID_VERSION_PROFILE_AND_LOCK_PROTOCOLS"
|
||||
},
|
||||
"G002": {
|
||||
"from": "source",
|
||||
"to": "compiled_from",
|
||||
"transform": "VERIFY_AND_BIND_SOURCE_SHA256"
|
||||
},
|
||||
"G003": {
|
||||
"from": "subject",
|
||||
"to": "subject",
|
||||
"transform": "RESOLVE_VERIFIED_SUBJECT"
|
||||
},
|
||||
"G004": {
|
||||
"from": "target",
|
||||
"to": "exact_target",
|
||||
"transform": "RESOLVE_PATH_STATE_AND_FINGERPRINT"
|
||||
},
|
||||
"G005": {
|
||||
"from": "actions",
|
||||
"to": "deterministic_action_graph",
|
||||
"transform": "SORT_ACTION_IDS_AND_RESOLVE_ALL_EDGES"
|
||||
},
|
||||
"G006": {
|
||||
"from": "authority",
|
||||
"to": "authority_proof",
|
||||
"transform": "BIND_PROOF_WITHOUT_EXPANDING_SCOPE"
|
||||
},
|
||||
"G007": {
|
||||
"from": "resources",
|
||||
"to": "resource_plan",
|
||||
"transform": "NORMALIZE_INTEGER_LIMITS"
|
||||
},
|
||||
"G008": {
|
||||
"from": "stop",
|
||||
"to": "timeout_and_stop",
|
||||
"transform": "COPY_EXPLICIT_STOP_SEMANTICS"
|
||||
},
|
||||
"G009": {
|
||||
"from": "cleanup",
|
||||
"to": "cleanup_plan",
|
||||
"transform": "COPY_EXACT_BOUNDARY"
|
||||
},
|
||||
"G010": {
|
||||
"from": "rollback",
|
||||
"to": "rollback_plan",
|
||||
"transform": "COPY_ACTIONS_AND_VERIFICATION"
|
||||
},
|
||||
"G011": {
|
||||
"from": "receipt",
|
||||
"to": "receipt_plan",
|
||||
"transform": "BIND_MACHINE_AND_HUMAN_OUTPUTS"
|
||||
},
|
||||
"G012": {
|
||||
"from": "all",
|
||||
"to": "unresolved_natural_language",
|
||||
"transform": "MUST_BE_FALSE"
|
||||
}
|
||||
},
|
||||
"output_contract": {
|
||||
"compiler_provenance_required": true,
|
||||
"drifting_dependency": false,
|
||||
"schema": "guanghu.gir/v1",
|
||||
"target_must_be_exact": true,
|
||||
"unresolved_authority": false,
|
||||
"unresolved_natural_language": false
|
||||
},
|
||||
"parser_rules": {
|
||||
"P001": {
|
||||
"nonterminal": "document",
|
||||
"sequence": [
|
||||
"prologue",
|
||||
"declaration",
|
||||
"EOF"
|
||||
]
|
||||
},
|
||||
"P002": {
|
||||
"nonterminal": "prologue",
|
||||
"sequence": [
|
||||
"TCS",
|
||||
"version",
|
||||
"SEMICOLON"
|
||||
]
|
||||
},
|
||||
"P003": {
|
||||
"nonterminal": "declaration",
|
||||
"sequence": [
|
||||
"declaration_kind",
|
||||
"identifier",
|
||||
"block"
|
||||
]
|
||||
},
|
||||
"P004": {
|
||||
"nonterminal": "block",
|
||||
"sequence": [
|
||||
"LBRACE",
|
||||
"member_zero_or_more",
|
||||
"RBRACE"
|
||||
]
|
||||
},
|
||||
"P005": {
|
||||
"alternatives": [
|
||||
"identifier_assignment",
|
||||
"identifier_typed_assignment",
|
||||
"identifier_block"
|
||||
],
|
||||
"nonterminal": "member"
|
||||
},
|
||||
"P006": {
|
||||
"alternatives": [
|
||||
"TEXT",
|
||||
"INT",
|
||||
"BOOL",
|
||||
"NULL",
|
||||
"IDENTIFIER",
|
||||
"array",
|
||||
"inline_object"
|
||||
],
|
||||
"nonterminal": "value"
|
||||
},
|
||||
"P007": {
|
||||
"emit_error": "TCS-E1002",
|
||||
"when": "DUPLICATE_MEMBER_IN_SAME_BLOCK"
|
||||
},
|
||||
"P008": {
|
||||
"emit_error": "TCS-E1001",
|
||||
"when": "TOKEN_AFTER_TOP_LEVEL_DECLARATION"
|
||||
}
|
||||
},
|
||||
"program_validation": {
|
||||
"V001": {
|
||||
"error_missing": "TCS-E1004",
|
||||
"error_unknown": "TCS-E1003",
|
||||
"rule": "EXACT_REQUIRED_SECTIONS",
|
||||
"standard": "TCS-FIELD-STANDARD-0001"
|
||||
},
|
||||
"V002": {
|
||||
"error": "TCS-E1003",
|
||||
"rule": "CLOSED_FIELDS_PER_SECTION"
|
||||
},
|
||||
"V003": {
|
||||
"error": "TCS-E2002",
|
||||
"rule": "ALL_INPUT_OUTPUT_AND_ACTION_REFS_RESOLVE"
|
||||
},
|
||||
"V004": {
|
||||
"error": "TCS-E2101",
|
||||
"rule": "ALL_OPERATIONS_REGISTERED_AT_LOCKED_VERSION"
|
||||
},
|
||||
"V005": {
|
||||
"errors": [
|
||||
"TCS-E3001",
|
||||
"TCS-E3002"
|
||||
],
|
||||
"rule": "SOURCE_ID_URI_HASH_AND_ROLE_RESOLVE"
|
||||
},
|
||||
"V006": {
|
||||
"errors": [
|
||||
"TCS-E4001",
|
||||
"TCS-E4002",
|
||||
"TCS-E4003"
|
||||
],
|
||||
"rule": "SUBJECT_TARGET_AND_AUTHORITY_EXACT"
|
||||
},
|
||||
"V007": {
|
||||
"error": "TCS-E2001",
|
||||
"rule": "ACTION_GRAPH_REACHABLE_AND_TERMINATING"
|
||||
},
|
||||
"V008": {
|
||||
"error": "TCS-E1004",
|
||||
"rule": "FAILURE_STOP_CLEANUP_ROLLBACK_AND_RECEIPT_PRESENT"
|
||||
},
|
||||
"V009": {
|
||||
"error": "TCS-E3002",
|
||||
"rule": "NO_FORBIDDEN_RUNTIME_PLACEHOLDER"
|
||||
},
|
||||
"V010": {
|
||||
"error": "TCS-E4001",
|
||||
"rule": "RELATION_AND_EMOTION_DO_NOT_GRANT_AUTHORITY"
|
||||
}
|
||||
},
|
||||
"self_host": {
|
||||
"compiler_A_compiles_stage1_to": "compiler-B.gir",
|
||||
"current_state": "SH01_TO_SH06_LOCAL_PASS_SH07_TARGET_READBACK_IN_PROGRESS",
|
||||
"fixed_point": "SEMANTIC_SHA256_A_EQUALS_B",
|
||||
"minimum_runnable_module_test": "REQUIRED",
|
||||
"negative_corpus_test": "REQUIRED",
|
||||
"stage0_compiles_stage1_to": "compiler-A.gir",
|
||||
"stage0_disabled_test": "REQUIRED",
|
||||
"standard_library_test": "REQUIRED"
|
||||
},
|
||||
"semantic_types": {
|
||||
"containers": [
|
||||
"List",
|
||||
"Set",
|
||||
"Map",
|
||||
"Option",
|
||||
"Ref",
|
||||
"Evidence",
|
||||
"Record"
|
||||
],
|
||||
"domains": [
|
||||
"Subject",
|
||||
"ExactTarget",
|
||||
"AuthorityProof",
|
||||
"ActionGraph",
|
||||
"ReceiptPlan",
|
||||
"RelationEvent"
|
||||
],
|
||||
"floating_point": "FORBIDDEN_V0_1",
|
||||
"implicit_conversion": "FORBIDDEN",
|
||||
"scalars": [
|
||||
"Text",
|
||||
"Bool",
|
||||
"Int",
|
||||
"UInt",
|
||||
"DecimalText",
|
||||
"Bytes",
|
||||
"DurationMs",
|
||||
"Timestamp",
|
||||
"Sha256",
|
||||
"NumberId",
|
||||
"Path",
|
||||
"Uri",
|
||||
"ErrorCode"
|
||||
]
|
||||
},
|
||||
"source_language": {
|
||||
"comments": [
|
||||
"LINE_COMMENT",
|
||||
"BLOCK_COMMENT"
|
||||
],
|
||||
"declaration_kinds": [
|
||||
"PROGRAM",
|
||||
"MODULE",
|
||||
"PROTOCOL",
|
||||
"COMPILER",
|
||||
"EVENT",
|
||||
"RECEIPT"
|
||||
],
|
||||
"encoding": "UTF8_LF_NO_BOM",
|
||||
"prologue": [
|
||||
"TCS",
|
||||
"VERSION",
|
||||
"SEMICOLON"
|
||||
],
|
||||
"punctuation": [
|
||||
"LBRACE",
|
||||
"RBRACE",
|
||||
"LBRACKET",
|
||||
"RBRACKET",
|
||||
"LESS",
|
||||
"GREATER",
|
||||
"COLON",
|
||||
"EQUAL",
|
||||
"COMMA",
|
||||
"SEMICOLON",
|
||||
"DOT"
|
||||
],
|
||||
"scalar_tokens": [
|
||||
"IDENTIFIER",
|
||||
"TEXT",
|
||||
"INT",
|
||||
"BOOL",
|
||||
"NULL"
|
||||
]
|
||||
}
|
||||
},
|
||||
"execution_abi": "TCS-COMPILER-GIR-EXEC/1",
|
||||
"identity": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"definition_sha256": "c7da830afd1dbf4fdda223226f091f17a5f8a1ee9c7c8e6424d1805a001d6e9a",
|
||||
"language_version": "0.1"
|
||||
},
|
||||
"native_self_hosted": false,
|
||||
"schema": "guanghu.compiler-gir/v1"
|
||||
}
|
||||
337
build/self-host/compiler-B.gir.json
Normal file
337
build/self-host/compiler-B.gir.json
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
{
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "65856dd98a272c0e8911d64dc96c9f0b4101f6d9364eeeac3cf78c282129de3f"
|
||||
},
|
||||
"compiler_definition": {
|
||||
"canonicalization": {
|
||||
"comments_in_semantic_digest": false,
|
||||
"final_newline": true,
|
||||
"integers": "MINIMAL_DECIMAL",
|
||||
"line_end": "LF",
|
||||
"list_order": "PRESERVE_SOURCE_SEMANTICS",
|
||||
"object_keys": "UTF8_BYTE_ORDER",
|
||||
"semantic_digest": "SHA256",
|
||||
"strings": "JSON_ESCAPE_NO_OPTIONAL_ESCAPE"
|
||||
},
|
||||
"header": {
|
||||
"bootstrap_seed": "TCS-STAGE0-IGNITION-0001",
|
||||
"lifecycle": "EXECUTABLE_SEMANTIC_FIXED_POINT_PROVEN_HOST_ACCEPTANCE_IN_PROGRESS",
|
||||
"name_zh": "TCS 第一代自举编译器",
|
||||
"output": "GIR/1",
|
||||
"profile": "HLDP-NP/1",
|
||||
"schema": "tcs.compiler/v1",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"lexer_rules": {
|
||||
"L001": {
|
||||
"emit_error": "TCS-E0001",
|
||||
"when": "BOM_AT_START"
|
||||
},
|
||||
"L002": {
|
||||
"action": "SKIP_WITH_SOURCE_POSITION",
|
||||
"when": "WHITESPACE_OR_COMMENT"
|
||||
},
|
||||
"L003": {
|
||||
"action": "READ_JSON_ESCAPED_TEXT",
|
||||
"on_unterminated": "TCS-E0002",
|
||||
"when": "DOUBLE_QUOTE"
|
||||
},
|
||||
"L004": {
|
||||
"action": "READ_SIGNED_DECIMAL_INT",
|
||||
"on_overflow": "TCS-E2001",
|
||||
"when": "MINUS_OR_ASCII_DIGIT"
|
||||
},
|
||||
"L005": {
|
||||
"action": "READ_IDENTIFIER_OR_KEYWORD",
|
||||
"when": "UNICODE_LETTER_OR_UNDERSCORE"
|
||||
},
|
||||
"L006": {
|
||||
"action": "EMIT_PUNCTUATION_TOKEN",
|
||||
"when": "REGISTERED_PUNCTUATION"
|
||||
},
|
||||
"L007": {
|
||||
"emit_error": "TCS-E1001",
|
||||
"when": "OTHER_CHARACTER"
|
||||
}
|
||||
},
|
||||
"lowering_to_gir": {
|
||||
"G001": {
|
||||
"from": "header",
|
||||
"to": "identity",
|
||||
"transform": "COPY_ID_VERSION_PROFILE_AND_LOCK_PROTOCOLS"
|
||||
},
|
||||
"G002": {
|
||||
"from": "source",
|
||||
"to": "compiled_from",
|
||||
"transform": "VERIFY_AND_BIND_SOURCE_SHA256"
|
||||
},
|
||||
"G003": {
|
||||
"from": "subject",
|
||||
"to": "subject",
|
||||
"transform": "RESOLVE_VERIFIED_SUBJECT"
|
||||
},
|
||||
"G004": {
|
||||
"from": "target",
|
||||
"to": "exact_target",
|
||||
"transform": "RESOLVE_PATH_STATE_AND_FINGERPRINT"
|
||||
},
|
||||
"G005": {
|
||||
"from": "actions",
|
||||
"to": "deterministic_action_graph",
|
||||
"transform": "SORT_ACTION_IDS_AND_RESOLVE_ALL_EDGES"
|
||||
},
|
||||
"G006": {
|
||||
"from": "authority",
|
||||
"to": "authority_proof",
|
||||
"transform": "BIND_PROOF_WITHOUT_EXPANDING_SCOPE"
|
||||
},
|
||||
"G007": {
|
||||
"from": "resources",
|
||||
"to": "resource_plan",
|
||||
"transform": "NORMALIZE_INTEGER_LIMITS"
|
||||
},
|
||||
"G008": {
|
||||
"from": "stop",
|
||||
"to": "timeout_and_stop",
|
||||
"transform": "COPY_EXPLICIT_STOP_SEMANTICS"
|
||||
},
|
||||
"G009": {
|
||||
"from": "cleanup",
|
||||
"to": "cleanup_plan",
|
||||
"transform": "COPY_EXACT_BOUNDARY"
|
||||
},
|
||||
"G010": {
|
||||
"from": "rollback",
|
||||
"to": "rollback_plan",
|
||||
"transform": "COPY_ACTIONS_AND_VERIFICATION"
|
||||
},
|
||||
"G011": {
|
||||
"from": "receipt",
|
||||
"to": "receipt_plan",
|
||||
"transform": "BIND_MACHINE_AND_HUMAN_OUTPUTS"
|
||||
},
|
||||
"G012": {
|
||||
"from": "all",
|
||||
"to": "unresolved_natural_language",
|
||||
"transform": "MUST_BE_FALSE"
|
||||
}
|
||||
},
|
||||
"output_contract": {
|
||||
"compiler_provenance_required": true,
|
||||
"drifting_dependency": false,
|
||||
"schema": "guanghu.gir/v1",
|
||||
"target_must_be_exact": true,
|
||||
"unresolved_authority": false,
|
||||
"unresolved_natural_language": false
|
||||
},
|
||||
"parser_rules": {
|
||||
"P001": {
|
||||
"nonterminal": "document",
|
||||
"sequence": [
|
||||
"prologue",
|
||||
"declaration",
|
||||
"EOF"
|
||||
]
|
||||
},
|
||||
"P002": {
|
||||
"nonterminal": "prologue",
|
||||
"sequence": [
|
||||
"TCS",
|
||||
"version",
|
||||
"SEMICOLON"
|
||||
]
|
||||
},
|
||||
"P003": {
|
||||
"nonterminal": "declaration",
|
||||
"sequence": [
|
||||
"declaration_kind",
|
||||
"identifier",
|
||||
"block"
|
||||
]
|
||||
},
|
||||
"P004": {
|
||||
"nonterminal": "block",
|
||||
"sequence": [
|
||||
"LBRACE",
|
||||
"member_zero_or_more",
|
||||
"RBRACE"
|
||||
]
|
||||
},
|
||||
"P005": {
|
||||
"alternatives": [
|
||||
"identifier_assignment",
|
||||
"identifier_typed_assignment",
|
||||
"identifier_block"
|
||||
],
|
||||
"nonterminal": "member"
|
||||
},
|
||||
"P006": {
|
||||
"alternatives": [
|
||||
"TEXT",
|
||||
"INT",
|
||||
"BOOL",
|
||||
"NULL",
|
||||
"IDENTIFIER",
|
||||
"array",
|
||||
"inline_object"
|
||||
],
|
||||
"nonterminal": "value"
|
||||
},
|
||||
"P007": {
|
||||
"emit_error": "TCS-E1002",
|
||||
"when": "DUPLICATE_MEMBER_IN_SAME_BLOCK"
|
||||
},
|
||||
"P008": {
|
||||
"emit_error": "TCS-E1001",
|
||||
"when": "TOKEN_AFTER_TOP_LEVEL_DECLARATION"
|
||||
}
|
||||
},
|
||||
"program_validation": {
|
||||
"V001": {
|
||||
"error_missing": "TCS-E1004",
|
||||
"error_unknown": "TCS-E1003",
|
||||
"rule": "EXACT_REQUIRED_SECTIONS",
|
||||
"standard": "TCS-FIELD-STANDARD-0001"
|
||||
},
|
||||
"V002": {
|
||||
"error": "TCS-E1003",
|
||||
"rule": "CLOSED_FIELDS_PER_SECTION"
|
||||
},
|
||||
"V003": {
|
||||
"error": "TCS-E2002",
|
||||
"rule": "ALL_INPUT_OUTPUT_AND_ACTION_REFS_RESOLVE"
|
||||
},
|
||||
"V004": {
|
||||
"error": "TCS-E2101",
|
||||
"rule": "ALL_OPERATIONS_REGISTERED_AT_LOCKED_VERSION"
|
||||
},
|
||||
"V005": {
|
||||
"errors": [
|
||||
"TCS-E3001",
|
||||
"TCS-E3002"
|
||||
],
|
||||
"rule": "SOURCE_ID_URI_HASH_AND_ROLE_RESOLVE"
|
||||
},
|
||||
"V006": {
|
||||
"errors": [
|
||||
"TCS-E4001",
|
||||
"TCS-E4002",
|
||||
"TCS-E4003"
|
||||
],
|
||||
"rule": "SUBJECT_TARGET_AND_AUTHORITY_EXACT"
|
||||
},
|
||||
"V007": {
|
||||
"error": "TCS-E2001",
|
||||
"rule": "ACTION_GRAPH_REACHABLE_AND_TERMINATING"
|
||||
},
|
||||
"V008": {
|
||||
"error": "TCS-E1004",
|
||||
"rule": "FAILURE_STOP_CLEANUP_ROLLBACK_AND_RECEIPT_PRESENT"
|
||||
},
|
||||
"V009": {
|
||||
"error": "TCS-E3002",
|
||||
"rule": "NO_FORBIDDEN_RUNTIME_PLACEHOLDER"
|
||||
},
|
||||
"V010": {
|
||||
"error": "TCS-E4001",
|
||||
"rule": "RELATION_AND_EMOTION_DO_NOT_GRANT_AUTHORITY"
|
||||
}
|
||||
},
|
||||
"self_host": {
|
||||
"compiler_A_compiles_stage1_to": "compiler-B.gir",
|
||||
"current_state": "SH01_TO_SH06_LOCAL_PASS_SH07_TARGET_READBACK_IN_PROGRESS",
|
||||
"fixed_point": "SEMANTIC_SHA256_A_EQUALS_B",
|
||||
"minimum_runnable_module_test": "REQUIRED",
|
||||
"negative_corpus_test": "REQUIRED",
|
||||
"stage0_compiles_stage1_to": "compiler-A.gir",
|
||||
"stage0_disabled_test": "REQUIRED",
|
||||
"standard_library_test": "REQUIRED"
|
||||
},
|
||||
"semantic_types": {
|
||||
"containers": [
|
||||
"List",
|
||||
"Set",
|
||||
"Map",
|
||||
"Option",
|
||||
"Ref",
|
||||
"Evidence",
|
||||
"Record"
|
||||
],
|
||||
"domains": [
|
||||
"Subject",
|
||||
"ExactTarget",
|
||||
"AuthorityProof",
|
||||
"ActionGraph",
|
||||
"ReceiptPlan",
|
||||
"RelationEvent"
|
||||
],
|
||||
"floating_point": "FORBIDDEN_V0_1",
|
||||
"implicit_conversion": "FORBIDDEN",
|
||||
"scalars": [
|
||||
"Text",
|
||||
"Bool",
|
||||
"Int",
|
||||
"UInt",
|
||||
"DecimalText",
|
||||
"Bytes",
|
||||
"DurationMs",
|
||||
"Timestamp",
|
||||
"Sha256",
|
||||
"NumberId",
|
||||
"Path",
|
||||
"Uri",
|
||||
"ErrorCode"
|
||||
]
|
||||
},
|
||||
"source_language": {
|
||||
"comments": [
|
||||
"LINE_COMMENT",
|
||||
"BLOCK_COMMENT"
|
||||
],
|
||||
"declaration_kinds": [
|
||||
"PROGRAM",
|
||||
"MODULE",
|
||||
"PROTOCOL",
|
||||
"COMPILER",
|
||||
"EVENT",
|
||||
"RECEIPT"
|
||||
],
|
||||
"encoding": "UTF8_LF_NO_BOM",
|
||||
"prologue": [
|
||||
"TCS",
|
||||
"VERSION",
|
||||
"SEMICOLON"
|
||||
],
|
||||
"punctuation": [
|
||||
"LBRACE",
|
||||
"RBRACE",
|
||||
"LBRACKET",
|
||||
"RBRACKET",
|
||||
"LESS",
|
||||
"GREATER",
|
||||
"COLON",
|
||||
"EQUAL",
|
||||
"COMMA",
|
||||
"SEMICOLON",
|
||||
"DOT"
|
||||
],
|
||||
"scalar_tokens": [
|
||||
"IDENTIFIER",
|
||||
"TEXT",
|
||||
"INT",
|
||||
"BOOL",
|
||||
"NULL"
|
||||
]
|
||||
}
|
||||
},
|
||||
"execution_abi": "TCS-COMPILER-GIR-EXEC/1",
|
||||
"identity": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"definition_sha256": "c7da830afd1dbf4fdda223226f091f17a5f8a1ee9c7c8e6424d1805a001d6e9a",
|
||||
"language_version": "0.1"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"schema": "guanghu.compiler-gir/v1"
|
||||
}
|
||||
76
build/targets/TCS-HOST-LINUX-X86_64.module.gir.json
Normal file
76
build/targets/TCS-HOST-LINUX-X86_64.module.gir.json
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"authority_ceiling": {
|
||||
"maximum": "CALLER_PROVIDED_EXACT_ROOT_AND_VALID_LEASE",
|
||||
"network": false,
|
||||
"process": false
|
||||
},
|
||||
"capabilities": {
|
||||
"provided": [
|
||||
"TCS.COMPILE",
|
||||
"GIR.RUN"
|
||||
],
|
||||
"required": [
|
||||
"HOST.EXACT_ROOT_IO",
|
||||
"HOST.SHA256",
|
||||
"HOST.MONOTONIC_TIME"
|
||||
]
|
||||
},
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "5fd45ebe27fe4608f0fd0e06415ee36724f418b01764e569ce506aab1a208405"
|
||||
},
|
||||
"data_scope": {
|
||||
"read": [
|
||||
"TCS_SOURCE",
|
||||
"COMPILER_GIR",
|
||||
"GIR_INPUT"
|
||||
],
|
||||
"write": [
|
||||
"CALLER_SCOPED_BUILD_AND_RECEIPT_ROOT"
|
||||
]
|
||||
},
|
||||
"entry": {
|
||||
"id": "TCS-COMPILER-STAGE1-0001",
|
||||
"kind": "COMPILER_GIR_RUNTIME"
|
||||
},
|
||||
"identity": {
|
||||
"language_version": "0.1",
|
||||
"module_id": "TCS-HOST-LINUX-X86_64-0001"
|
||||
},
|
||||
"install": {
|
||||
"account_scoped": false,
|
||||
"activation_requires_self_test": true,
|
||||
"registration_is_installation": false
|
||||
},
|
||||
"manifest": {
|
||||
"display_name_zh": "TCS Linux 宿主运行核",
|
||||
"entry_program_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"entry_source": "build/self-host/compiler-B.gir.json",
|
||||
"module_id": "TCS-HOST-LINUX-X86_64-0001",
|
||||
"target_triple": "x86_64-unknown-linux-musl"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"network_scope": {
|
||||
"allowed": false,
|
||||
"domains": []
|
||||
},
|
||||
"projection": {
|
||||
"display_name_zh": "TCS Linux 宿主运行核",
|
||||
"technical_detail_default": false
|
||||
},
|
||||
"resource_ceiling": {
|
||||
"concurrency": 1,
|
||||
"memory_limit_bytes": 268435456,
|
||||
"timeout_ms": 30000
|
||||
},
|
||||
"rollback": {
|
||||
"action": "RESTORE_PREVIOUS_HOST_RUNTIME",
|
||||
"preserve_receipts": true
|
||||
},
|
||||
"schema": "guanghu.module-gir/v1",
|
||||
"self_test": {
|
||||
"expect": "EXECUTED_TARGET_READBACK_VERIFIED",
|
||||
"program_id": "HLP-PROGRAM-ECHO-0001"
|
||||
}
|
||||
}
|
||||
76
build/targets/TCS-HOST-MACOS-AARCH64.module.gir.json
Normal file
76
build/targets/TCS-HOST-MACOS-AARCH64.module.gir.json
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"authority_ceiling": {
|
||||
"maximum": "CALLER_PROVIDED_EXACT_ROOT_AND_VALID_LEASE",
|
||||
"network": false,
|
||||
"process": false
|
||||
},
|
||||
"capabilities": {
|
||||
"provided": [
|
||||
"TCS.COMPILE",
|
||||
"GIR.RUN"
|
||||
],
|
||||
"required": [
|
||||
"HOST.EXACT_ROOT_IO",
|
||||
"HOST.SHA256",
|
||||
"HOST.MONOTONIC_TIME"
|
||||
]
|
||||
},
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "0ade403f374bb94876b7d9f8b8295304369dac859f6ffed25ac91a191cfb49c3"
|
||||
},
|
||||
"data_scope": {
|
||||
"read": [
|
||||
"TCS_SOURCE",
|
||||
"COMPILER_GIR",
|
||||
"GIR_INPUT"
|
||||
],
|
||||
"write": [
|
||||
"CALLER_SCOPED_BUILD_AND_RECEIPT_ROOT"
|
||||
]
|
||||
},
|
||||
"entry": {
|
||||
"id": "TCS-COMPILER-STAGE1-0001",
|
||||
"kind": "COMPILER_GIR_RUNTIME"
|
||||
},
|
||||
"identity": {
|
||||
"language_version": "0.1",
|
||||
"module_id": "TCS-HOST-MACOS-AARCH64-0001"
|
||||
},
|
||||
"install": {
|
||||
"account_scoped": true,
|
||||
"activation_requires_self_test": true,
|
||||
"registration_is_installation": false
|
||||
},
|
||||
"manifest": {
|
||||
"display_name_zh": "TCS macOS 宿主运行核",
|
||||
"entry_program_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"entry_source": "build/self-host/compiler-B.gir.json",
|
||||
"module_id": "TCS-HOST-MACOS-AARCH64-0001",
|
||||
"target_triple": "aarch64-apple-darwin"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"network_scope": {
|
||||
"allowed": false,
|
||||
"domains": []
|
||||
},
|
||||
"projection": {
|
||||
"display_name_zh": "TCS macOS 宿主运行核",
|
||||
"technical_detail_default": false
|
||||
},
|
||||
"resource_ceiling": {
|
||||
"concurrency": 1,
|
||||
"memory_limit_bytes": 268435456,
|
||||
"timeout_ms": 30000
|
||||
},
|
||||
"rollback": {
|
||||
"action": "RESTORE_PREVIOUS_HOST_RUNTIME",
|
||||
"preserve_receipts": true
|
||||
},
|
||||
"schema": "guanghu.module-gir/v1",
|
||||
"self_test": {
|
||||
"expect": "EXECUTED_TARGET_READBACK_VERIFIED",
|
||||
"program_id": "HLP-PROGRAM-ECHO-0001"
|
||||
}
|
||||
}
|
||||
76
build/targets/TCS-HOST-WINDOWS-X86_64.module.gir.json
Normal file
76
build/targets/TCS-HOST-WINDOWS-X86_64.module.gir.json
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"authority_ceiling": {
|
||||
"maximum": "CALLER_PROVIDED_EXACT_ROOT_AND_VALID_LEASE",
|
||||
"network": false,
|
||||
"process": false
|
||||
},
|
||||
"capabilities": {
|
||||
"provided": [
|
||||
"TCS.COMPILE",
|
||||
"GIR.RUN"
|
||||
],
|
||||
"required": [
|
||||
"HOST.EXACT_ROOT_IO",
|
||||
"HOST.SHA256",
|
||||
"HOST.MONOTONIC_TIME"
|
||||
]
|
||||
},
|
||||
"compiled_from": {
|
||||
"compiler_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"compiler_state": "TCS_COMPILER_GIR_EXECUTED",
|
||||
"source_sha256": "0cef00513900df6664f0045e5aa3de0969cbc0d0d8eebd3a20c669fd286f2269"
|
||||
},
|
||||
"data_scope": {
|
||||
"read": [
|
||||
"TCS_SOURCE",
|
||||
"COMPILER_GIR",
|
||||
"GIR_INPUT"
|
||||
],
|
||||
"write": [
|
||||
"CALLER_SCOPED_BUILD_AND_RECEIPT_ROOT"
|
||||
]
|
||||
},
|
||||
"entry": {
|
||||
"id": "TCS-COMPILER-STAGE1-0001",
|
||||
"kind": "COMPILER_GIR_RUNTIME"
|
||||
},
|
||||
"identity": {
|
||||
"language_version": "0.1",
|
||||
"module_id": "TCS-HOST-WINDOWS-X86_64-0001"
|
||||
},
|
||||
"install": {
|
||||
"account_scoped": true,
|
||||
"activation_requires_self_test": true,
|
||||
"registration_is_installation": false
|
||||
},
|
||||
"manifest": {
|
||||
"display_name_zh": "TCS Windows 宿主运行核",
|
||||
"entry_program_id": "TCS-COMPILER-STAGE1-0001",
|
||||
"entry_source": "build/self-host/compiler-B.gir.json",
|
||||
"module_id": "TCS-HOST-WINDOWS-X86_64-0001",
|
||||
"target_triple": "x86_64-pc-windows-msvc"
|
||||
},
|
||||
"native_self_hosted": true,
|
||||
"network_scope": {
|
||||
"allowed": false,
|
||||
"domains": []
|
||||
},
|
||||
"projection": {
|
||||
"display_name_zh": "TCS Windows 宿主运行核",
|
||||
"technical_detail_default": false
|
||||
},
|
||||
"resource_ceiling": {
|
||||
"concurrency": 1,
|
||||
"memory_limit_bytes": 268435456,
|
||||
"timeout_ms": 30000
|
||||
},
|
||||
"rollback": {
|
||||
"action": "RESTORE_PREVIOUS_HOST_RUNTIME",
|
||||
"preserve_receipts": true
|
||||
},
|
||||
"schema": "guanghu.module-gir/v1",
|
||||
"self_test": {
|
||||
"expect": "EXECUTED_TARGET_READBACK_VERIFIED",
|
||||
"program_id": "HLP-PROGRAM-ECHO-0001"
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ COMPILER TCS-COMPILER-STAGE1-0001 {
|
|||
name_zh = "TCS 第一代自举编译器";
|
||||
version = "0.1.0";
|
||||
profile = "HLDP-NP/1";
|
||||
lifecycle = "SOURCE_DEFINED_NOT_YET_EXECUTABLE";
|
||||
lifecycle = "EXECUTABLE_SEMANTIC_FIXED_POINT_PROVEN_HOST_ACCEPTANCE_IN_PROGRESS";
|
||||
bootstrap_seed = "TCS-STAGE0-IGNITION-0001";
|
||||
output = "GIR/1";
|
||||
}
|
||||
|
|
@ -96,7 +96,6 @@ COMPILER TCS-COMPILER-STAGE1-0001 {
|
|||
standard_library_test = "REQUIRED";
|
||||
negative_corpus_test = "REQUIRED";
|
||||
minimum_runnable_module_test = "REQUIRED";
|
||||
current_state = "NOT_PROVEN";
|
||||
current_state = "SH01_TO_SH06_LOCAL_PASS_SH07_TARGET_READBACK_IN_PROGRESS";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -254,10 +254,10 @@ Stage-0 可以由现有宿主语言实现,但只能叫“点火引导”。正
|
|||
```yaml
|
||||
language_tree_unified: DEFINED
|
||||
syntax_and_field_standard: DRAFT_V0_1
|
||||
stage0_parser_compiler: IMPLEMENTATION_ACTIVE
|
||||
gir_module_loader: IMPLEMENTATION_ACTIVE
|
||||
tcs_stage1_compiler: NOT_IMPLEMENTED
|
||||
self_compile_fixed_point: NOT_PROVEN
|
||||
jd_final_native_master: NOT_PROVEN
|
||||
hololake_tcs_runtime_integration: NOT_IMPLEMENTED
|
||||
stage0_parser_compiler: REPLACEABLE_BOOTSTRAP_SEED_PASS
|
||||
gir_module_loader: PORTABLE_MINIMUM_RUNTIME_PASS
|
||||
tcs_stage1_compiler: EXECUTABLE_COMPILER_GIR_PASS
|
||||
self_compile_fixed_point: LOCAL_PASS_CROSS_HOST_FINAL_GATE_IN_PROGRESS
|
||||
jd_final_native_master: LIVE_READBACK_PASS_100
|
||||
hololake_tcs_runtime_integration: MACOS_STANDALONE_RUNTIME_PASS_SHELL_INTEGRATION_PENDING
|
||||
```
|
||||
|
|
|
|||
33
language/standards/TCS-HOST-ABI-v0.1.hldp
Normal file
33
language/standards/TCS-HOST-ABI-v0.1.hldp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
schema: tcs.host-abi/v1
|
||||
id: TCS-HOST-ABI-0001
|
||||
version: 0.1.0
|
||||
language_frontend: ONE_TCS_COMPILER
|
||||
machine_ir: GIR_1
|
||||
rule: HOST_BACKENDS_MUST_NOT_CHANGE_TCS_SEMANTICS_AUTHORITY_OR_RECEIPTS
|
||||
targets:
|
||||
- target_id: TCS-HOST-MACOS-AARCH64-0001
|
||||
triple: aarch64-apple-darwin
|
||||
role: HOLOLAKE_HUMAN_AND_PERSONA_LOCAL_NODE
|
||||
- target_id: TCS-HOST-LINUX-X86_64-0001
|
||||
triple: x86_64-unknown-linux-musl
|
||||
role: GUANGHU_OS_LINUX_COMPATIBILITY_SUBSTRATE
|
||||
- target_id: TCS-HOST-WINDOWS-X86_64-0001
|
||||
triple: x86_64-pc-windows-msvc
|
||||
role: HOLOLAKE_WINDOWS_LOCAL_NODE
|
||||
required_host_operations:
|
||||
- EXACT_ROOT_FILE_READ
|
||||
- EXACT_ROOT_ATOMIC_WRITE
|
||||
- SHA256
|
||||
- MONOTONIC_TIMEOUT
|
||||
- TARGET_READBACK
|
||||
forbidden_host_expansion:
|
||||
- INFER_TARGET_FROM_CURRENT_DIRECTORY
|
||||
- INFER_AUTHORITY_FROM_OS_USER
|
||||
- SUBSTITUTE_SHELL_FOR_UNREGISTERED_OPERATION
|
||||
- CHANGE_GIR_SEMANTICS_BY_PLATFORM
|
||||
acceptance:
|
||||
compile_same_tcs_source_to_same_semantic_gir: REQUIRED
|
||||
execute_same_gir_with_equivalent_receipt_state: REQUIRED
|
||||
host_specific_receipt_fields: [target_triple, host_runtime_sha256]
|
||||
cross_target_evidence_required: true
|
||||
current_state: CONTRACT_DEFINED_IMPLEMENTATION_IN_PROGRESS
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
schema: tcs.self-host-standard/v1
|
||||
id: TCS-SELF-HOST-STANDARD-0001
|
||||
version: 0.1.0
|
||||
state: DEFINED_NOT_YET_PASSED
|
||||
state: LOCAL_SELF_HOST_PASS_CROSS_HOST_FINAL_GATE_IN_PROGRESS
|
||||
compiler_source: language/compiler/TCS-COMPILER-STAGE1.tcs
|
||||
gates:
|
||||
- id: SH-01
|
||||
|
|
@ -22,12 +22,19 @@ decision:
|
|||
allowed: [FAIL_0, PASS_100]
|
||||
partial_pass: false
|
||||
current:
|
||||
SH-01: FAIL_0
|
||||
SH-02: FAIL_0
|
||||
SH-03: FAIL_0
|
||||
SH-04: FAIL_0
|
||||
SH-05: FAIL_0
|
||||
SH-06: FAIL_0
|
||||
SH-01: PASS_100
|
||||
SH-02: PASS_100
|
||||
SH-03: PASS_100
|
||||
SH-04: PASS_100
|
||||
SH-05: PASS_100
|
||||
SH-06: PASS_100
|
||||
SH-07: FAIL_0
|
||||
aggregate: FAIL_0
|
||||
|
||||
evidence:
|
||||
compiler_a: build/self-host/compiler-A.gir.json
|
||||
compiler_b: build/self-host/compiler-B.gir.json
|
||||
semantic_fixed_point_field: identity.definition_sha256
|
||||
standard_library: build/self-host/TCS-STDLIB-CORE.module.gir.json
|
||||
runnable_module: build/self-host/ECHO-PACKAGE.module.gir.json
|
||||
stage0_disabled_test: native-runtime/tcs-gir-runtime/tests/stage1_runtime.rs
|
||||
negative_corpus: language/tests/negative/UNREGISTERED-OPERATION.tcs
|
||||
|
|
|
|||
17
language/stdlib/TCS-STDLIB-CORE.tcs
Normal file
17
language/stdlib/TCS-STDLIB-CORE.tcs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
TCS 0.1;
|
||||
|
||||
MODULE TCS-STDLIB-CORE-0001 {
|
||||
header { schema = "tcs.module/v1"; name_zh = "TCS 核心标准库"; name_en = "TCS Core Standard Library"; version = "0.1.0"; language = "TCS/0.1"; profile = "HLDP-NP/1"; protocols = ["TCS-MODULE-ABI-0001", "TCS-HOST-ABI-0001"]; lifecycle = "CANDIDATE"; canonical_uri = "language/stdlib/TCS-STDLIB-CORE.tcs"; compatibility = ["GIR/1", "TCS-COMPILER-STAGE1-0001"]; }
|
||||
source { source_id = "HLP-PART-TCS-LANG-0001"; source_uri = "language/stdlib/TCS-STDLIB-CORE.tcs"; source_sha256 = "SELF_AT_COMPILE_TIME"; source_role = "STANDARD_LIBRARY"; }
|
||||
manifest { module_id = "TCS-STDLIB-CORE-0001"; display_name_zh = "TCS 核心标准库"; entry_program_id = "HLP-PROGRAM-ECHO-0001"; entry_source = "language/examples/ECHO-MODULE.tcs"; abi = "GIR/1"; }
|
||||
entry { kind = "REGISTERED_OPERATION_LIBRARY"; id = "TCS-STDLIB-CORE-0001"; }
|
||||
capabilities { required = ["HOST.EXACT_ROOT_IO", "HOST.SHA256"]; provided = ["CORE.ECHO"]; }
|
||||
authority_ceiling { maximum = "LOCAL_EXACT_RECEIPT_PATH"; network = false; process = false; }
|
||||
resource_ceiling { concurrency = 1; timeout_ms = 1000; memory_limit_bytes = 1048576; }
|
||||
data_scope { read = ["PROGRAM_LITERAL"]; write = ["CALLER_SCOPED_RECEIPT_ROOT"]; }
|
||||
network_scope { allowed = false; domains = []; }
|
||||
install { account_scoped = true; registration_is_installation = false; activation_requires_self_test = true; }
|
||||
self_test { program_id = "HLP-PROGRAM-ECHO-0001"; expect = "EXECUTED_TARGET_READBACK_VERIFIED"; }
|
||||
rollback { action = "RESTORE_PREVIOUS_STANDARD_LIBRARY"; preserve_receipts = true; }
|
||||
projection { display_name_zh = "TCS 核心标准库"; technical_detail_default = false; }
|
||||
}
|
||||
17
language/targets/TCS-HOST-LINUX-X86_64.tcs
Normal file
17
language/targets/TCS-HOST-LINUX-X86_64.tcs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
TCS 0.1;
|
||||
|
||||
MODULE TCS-HOST-LINUX-X86_64-0001 {
|
||||
header { schema = "tcs.module/v1"; name_zh = "TCS Linux 宿主运行核"; name_en = "TCS Linux Host Runtime"; version = "0.1.0"; language = "TCS/0.1"; profile = "TCS-HOST-ABI/0.1"; protocols = ["TCS-HOST-ABI-0001"]; lifecycle = "CANDIDATE"; canonical_uri = "language/targets/TCS-HOST-LINUX-X86_64.tcs"; compatibility = ["GIR/1", "x86_64-unknown-linux-musl"]; }
|
||||
source { source_id = "HLP-PART-TCS-HOST-0001"; source_uri = "native-runtime/tcs-gir-runtime"; source_sha256 = "BOUND_AT_BUILD"; source_role = "PORTABLE_HOST_RUNTIME"; }
|
||||
manifest { module_id = "TCS-HOST-LINUX-X86_64-0001"; display_name_zh = "TCS Linux 宿主运行核"; entry_program_id = "TCS-COMPILER-STAGE1-0001"; entry_source = "build/self-host/compiler-B.gir.json"; target_triple = "x86_64-unknown-linux-musl"; }
|
||||
entry { kind = "COMPILER_GIR_RUNTIME"; id = "TCS-COMPILER-STAGE1-0001"; }
|
||||
capabilities { required = ["HOST.EXACT_ROOT_IO", "HOST.SHA256", "HOST.MONOTONIC_TIME"]; provided = ["TCS.COMPILE", "GIR.RUN"]; }
|
||||
authority_ceiling { maximum = "CALLER_PROVIDED_EXACT_ROOT_AND_VALID_LEASE"; network = false; process = false; }
|
||||
resource_ceiling { concurrency = 1; timeout_ms = 30000; memory_limit_bytes = 268435456; }
|
||||
data_scope { read = ["TCS_SOURCE", "COMPILER_GIR", "GIR_INPUT"]; write = ["CALLER_SCOPED_BUILD_AND_RECEIPT_ROOT"]; }
|
||||
network_scope { allowed = false; domains = []; }
|
||||
install { account_scoped = false; registration_is_installation = false; activation_requires_self_test = true; }
|
||||
self_test { program_id = "HLP-PROGRAM-ECHO-0001"; expect = "EXECUTED_TARGET_READBACK_VERIFIED"; }
|
||||
rollback { action = "RESTORE_PREVIOUS_HOST_RUNTIME"; preserve_receipts = true; }
|
||||
projection { display_name_zh = "TCS Linux 宿主运行核"; technical_detail_default = false; }
|
||||
}
|
||||
17
language/targets/TCS-HOST-MACOS-AARCH64.tcs
Normal file
17
language/targets/TCS-HOST-MACOS-AARCH64.tcs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
TCS 0.1;
|
||||
|
||||
MODULE TCS-HOST-MACOS-AARCH64-0001 {
|
||||
header { schema = "tcs.module/v1"; name_zh = "TCS macOS 宿主运行核"; name_en = "TCS macOS Host Runtime"; version = "0.1.0"; language = "TCS/0.1"; profile = "TCS-HOST-ABI/0.1"; protocols = ["TCS-HOST-ABI-0001"]; lifecycle = "CANDIDATE"; canonical_uri = "language/targets/TCS-HOST-MACOS-AARCH64.tcs"; compatibility = ["GIR/1", "aarch64-apple-darwin"]; }
|
||||
source { source_id = "HLP-PART-TCS-HOST-0001"; source_uri = "native-runtime/tcs-gir-runtime"; source_sha256 = "BOUND_AT_BUILD"; source_role = "PORTABLE_HOST_RUNTIME"; }
|
||||
manifest { module_id = "TCS-HOST-MACOS-AARCH64-0001"; display_name_zh = "TCS macOS 宿主运行核"; entry_program_id = "TCS-COMPILER-STAGE1-0001"; entry_source = "build/self-host/compiler-B.gir.json"; target_triple = "aarch64-apple-darwin"; }
|
||||
entry { kind = "COMPILER_GIR_RUNTIME"; id = "TCS-COMPILER-STAGE1-0001"; }
|
||||
capabilities { required = ["HOST.EXACT_ROOT_IO", "HOST.SHA256", "HOST.MONOTONIC_TIME"]; provided = ["TCS.COMPILE", "GIR.RUN"]; }
|
||||
authority_ceiling { maximum = "CALLER_PROVIDED_EXACT_ROOT_AND_VALID_LEASE"; network = false; process = false; }
|
||||
resource_ceiling { concurrency = 1; timeout_ms = 30000; memory_limit_bytes = 268435456; }
|
||||
data_scope { read = ["TCS_SOURCE", "COMPILER_GIR", "GIR_INPUT"]; write = ["CALLER_SCOPED_BUILD_AND_RECEIPT_ROOT"]; }
|
||||
network_scope { allowed = false; domains = []; }
|
||||
install { account_scoped = true; registration_is_installation = false; activation_requires_self_test = true; }
|
||||
self_test { program_id = "HLP-PROGRAM-ECHO-0001"; expect = "EXECUTED_TARGET_READBACK_VERIFIED"; }
|
||||
rollback { action = "RESTORE_PREVIOUS_HOST_RUNTIME"; preserve_receipts = true; }
|
||||
projection { display_name_zh = "TCS macOS 宿主运行核"; technical_detail_default = false; }
|
||||
}
|
||||
17
language/targets/TCS-HOST-WINDOWS-X86_64.tcs
Normal file
17
language/targets/TCS-HOST-WINDOWS-X86_64.tcs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
TCS 0.1;
|
||||
|
||||
MODULE TCS-HOST-WINDOWS-X86_64-0001 {
|
||||
header { schema = "tcs.module/v1"; name_zh = "TCS Windows 宿主运行核"; name_en = "TCS Windows Host Runtime"; version = "0.1.0"; language = "TCS/0.1"; profile = "TCS-HOST-ABI/0.1"; protocols = ["TCS-HOST-ABI-0001"]; lifecycle = "CANDIDATE"; canonical_uri = "language/targets/TCS-HOST-WINDOWS-X86_64.tcs"; compatibility = ["GIR/1", "x86_64-pc-windows-msvc"]; }
|
||||
source { source_id = "HLP-PART-TCS-HOST-0001"; source_uri = "native-runtime/tcs-gir-runtime"; source_sha256 = "BOUND_AT_BUILD"; source_role = "PORTABLE_HOST_RUNTIME"; }
|
||||
manifest { module_id = "TCS-HOST-WINDOWS-X86_64-0001"; display_name_zh = "TCS Windows 宿主运行核"; entry_program_id = "TCS-COMPILER-STAGE1-0001"; entry_source = "build/self-host/compiler-B.gir.json"; target_triple = "x86_64-pc-windows-msvc"; }
|
||||
entry { kind = "COMPILER_GIR_RUNTIME"; id = "TCS-COMPILER-STAGE1-0001"; }
|
||||
capabilities { required = ["HOST.EXACT_ROOT_IO", "HOST.SHA256", "HOST.MONOTONIC_TIME"]; provided = ["TCS.COMPILE", "GIR.RUN"]; }
|
||||
authority_ceiling { maximum = "CALLER_PROVIDED_EXACT_ROOT_AND_VALID_LEASE"; network = false; process = false; }
|
||||
resource_ceiling { concurrency = 1; timeout_ms = 30000; memory_limit_bytes = 268435456; }
|
||||
data_scope { read = ["TCS_SOURCE", "COMPILER_GIR", "GIR_INPUT"]; write = ["CALLER_SCOPED_BUILD_AND_RECEIPT_ROOT"]; }
|
||||
network_scope { allowed = false; domains = []; }
|
||||
install { account_scoped = true; registration_is_installation = false; activation_requires_self_test = true; }
|
||||
self_test { program_id = "HLP-PROGRAM-ECHO-0001"; expect = "EXECUTED_TARGET_READBACK_VERIFIED"; }
|
||||
rollback { action = "RESTORE_PREVIOUS_HOST_RUNTIME"; preserve_receipts = true; }
|
||||
projection { display_name_zh = "TCS Windows 宿主运行核"; technical_detail_default = false; }
|
||||
}
|
||||
19
language/tests/negative/UNREGISTERED-OPERATION.tcs
Normal file
19
language/tests/negative/UNREGISTERED-OPERATION.tcs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
TCS 0.1;
|
||||
|
||||
PROGRAM TCS-NEGATIVE-UNREGISTERED-0001 {
|
||||
header { schema = "tcs.program/v1"; name_zh = "未注册操作拒绝样例"; name_en = "Unregistered Operation Rejection"; version = "0.1.0"; language = "TCS/0.1"; profile = "HLDP-NP/1"; protocols = ["GLS-0101"]; lifecycle = "NEGATIVE_TEST"; canonical_uri = "language/tests/negative/UNREGISTERED-OPERATION.tcs"; compatibility = ["TCS-COMPILER-STAGE1-0001"]; }
|
||||
source { source_id = "TCS-NEGATIVE-CORPUS-0001"; source_uri = "language/tests/negative/UNREGISTERED-OPERATION.tcs"; source_sha256 = "SELF_AT_COMPILE_TIME"; source_role = "NEGATIVE_TEST"; }
|
||||
subject { subject_id = "TCS-TEST-RUNNER-0001"; subject_kind = "TEST_RUNTIME"; verification = "LOCAL_TEST_BOUND"; }
|
||||
target { target_id = "TCS-NEGATIVE-TARGET-0001"; target_kind = "TEST_RECEIPT"; exact_path = "./build/negative-should-not-exist.hldp"; expected_state = "ABSENT"; }
|
||||
inputs { MESSAGE { type = "Text"; value = "必须拒绝"; } }
|
||||
outputs { ECHOED { type = "Text"; required = true; } }
|
||||
conditions { C1 { expression = "TARGET_EXACT_AND_WITHIN_ALLOWED_ROOT"; on_false = "FAIL_CLOSED"; } }
|
||||
actions { A1 { operation = "ABSORB"; input_refs = ["MESSAGE"]; output_refs = ["ECHOED"]; on_success = "COMPLETE"; on_failure = "FAIL_CLOSED"; } }
|
||||
authority { mode = "TEST_ONLY"; issuer = "TCS-TEST-RUNNER-0001"; scope = ["WRITE_EXACT_RECEIPT_ONLY"]; one_shot = true; }
|
||||
resources { timeout_ms = 1000; max_actions = 1; memory_limit_bytes = 1048576; }
|
||||
failure { default = "FAIL_CLOSED"; emit_error = true; write_receipt = true; }
|
||||
stop { on_timeout = "STOPPED"; on_authority_loss = "STOPPED"; }
|
||||
cleanup { remove_temporary = true; preserve_receipts = true; }
|
||||
rollback { required = false; actions = []; verification = "NOT_APPLICABLE"; }
|
||||
receipt { schema = "tcs.execution-receipt/v1"; machine_path = "./build/negative-should-not-exist.hldp"; human_projection = "不得生成"; integrity = "SHA256_AND_READBACK"; }
|
||||
}
|
||||
24
migration/TCS-MODULE-REWRITE-PLAN-20260821.md
Normal file
24
migration/TCS-MODULE-REWRITE-PLAN-20260821.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# 旧模块到 TCS 原生模块的迁移规则
|
||||
|
||||
这不是把 Rust、TypeScript 或 Tauri 源码逐行换一种拼写。每个捐赠件只保留已经证明有价值的领域
|
||||
语义、状态机、失败经验、用户入口和验收证据,再用 TCS 重新声明主体、目标、输入输出、动作图、
|
||||
权限、资源、停止、清理、回滚与回执。
|
||||
|
||||
迁移顺序固定为:
|
||||
|
||||
1. P0:TCS 语言、编译器、GIR 运行核、注册核和原生质量门;
|
||||
2. P1:编号、频道、广播、Agent、知识库、外部 AI、模块生命周期和商城;
|
||||
3. P2:人格体、记忆、关系事件和情感核;
|
||||
4. P3:共同世界投影仪,最后根据真实运行核决定宿主 UI 零件。
|
||||
|
||||
每个模块只有同时满足下列条件才能替代旧实现:
|
||||
|
||||
- TCS 源码由编译器 B 编译;
|
||||
- GIR 不含未解析自然语言;
|
||||
- 未授权、路径越界、哈希漂移和未知操作测试失败关闭;
|
||||
- 至少一个真实目标宿主执行并读回;
|
||||
- 与捐赠件能力逐项对照,未迁移能力必须明确拒绝,不能静默丢失;
|
||||
- 注册、安装、挂载、激活和验收保持为不同状态。
|
||||
|
||||
机器队列见 `migration/tcs-module-migration-registry.json`。现有宿主语言只能留下最小文件、网络、
|
||||
窗口、密钥存储和硬件驱动适配层;不得继续拥有 TCS 语义、权限判断或模块状态真相。
|
||||
873
migration/tcs-module-migration-registry.json
Normal file
873
migration/tcs-module-migration-registry.json
Normal file
|
|
@ -0,0 +1,873 @@
|
|||
{
|
||||
"schema": "hololake.tcs-module-migration-registry/v1",
|
||||
"registry_id": "HLP-TCS-MIGRATION-REGISTRY-0001",
|
||||
"source_parts_registry": "parts/registry.json",
|
||||
"source_part_count": 43,
|
||||
"rule": "NO_WHOLESALE_TRANSLITERATION_FROM_RUST_OR_TYPESCRIPT",
|
||||
"compiler": "TCS-COMPILER-STAGE1-0001",
|
||||
"target_abi": "GIR/1",
|
||||
"registration_is_rewrite": false,
|
||||
"rewrite_is_acceptance": false,
|
||||
"entries": [
|
||||
{
|
||||
"order": 1,
|
||||
"part_id": "HLP-PART-0001",
|
||||
"display_name_zh": "编号协议核",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 2,
|
||||
"part_id": "HLP-PART-0002",
|
||||
"display_name_zh": "编号数据库与路径解析候选核",
|
||||
"donor_source": "starAbyss",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0002",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 3,
|
||||
"part_id": "HLP-PART-0003",
|
||||
"display_name_zh": "频道、广播与回执核",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0003",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 4,
|
||||
"part_id": "HLP-PART-0004",
|
||||
"display_name_zh": "人格体生命周期与语言核安装边界",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0004",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 5,
|
||||
"part_id": "HLP-PART-0005",
|
||||
"display_name_zh": "频道人格体 Agent 运行核",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0005",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 6,
|
||||
"part_id": "HLP-PART-0006",
|
||||
"display_name_zh": "旧语言频道多对话捐赠件",
|
||||
"donor_source": "starAbyss",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED_DONOR_ONLY",
|
||||
"native_acceptance_before_migration": "NOT_APPLICABLE",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0006",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 7,
|
||||
"part_id": "HLP-PART-0007",
|
||||
"display_name_zh": "外部编程 AI 接入桥",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0007",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 8,
|
||||
"part_id": "HLP-PART-0008",
|
||||
"display_name_zh": "签名模块生命周期核",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0008",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 9,
|
||||
"part_id": "HLP-PART-0009",
|
||||
"display_name_zh": "线上双签模块商城核",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0009",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 10,
|
||||
"part_id": "HLP-PART-0010",
|
||||
"display_name_zh": "普通用户初始化频道核",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0010",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 11,
|
||||
"part_id": "HLP-PART-0011",
|
||||
"display_name_zh": "原生知识库与编号思维索引",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0011",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 12,
|
||||
"part_id": "HLP-PART-0012",
|
||||
"display_name_zh": "教育初始化广播塔状态机",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DONOR_BYTES_EXTRACTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-0012",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 13,
|
||||
"part_id": "HLP-PART-QA-0001",
|
||||
"display_name_zh": "光湖原生质量核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SOURCE_CAPTURED_CANONICAL_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "SELF_BOOTSTRAP_PENDING",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-QA-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 14,
|
||||
"part_id": "HLP-PART-REG-0001",
|
||||
"display_name_zh": "光湖模块注册核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SOURCE_CAPTURED_CANONICAL_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-REG-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 15,
|
||||
"part_id": "HLP-PART-MEM-0001",
|
||||
"display_name_zh": "HLDP 因果记忆与完整性核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SOURCE_CAPTURED_CANONICAL_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-MEM-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 16,
|
||||
"part_id": "HLP-PART-CXD-0001",
|
||||
"display_name_zh": "晨星心脑朴素数据集核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SOURCE_CAPTURED_CANONICAL_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-CXD-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 17,
|
||||
"part_id": "HLP-PART-CXR-0001",
|
||||
"display_name_zh": "晨星运行时规则触发核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SOURCE_CAPTURED_CANONICAL_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-CXR-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 18,
|
||||
"part_id": "HLP-PART-TCS-0001",
|
||||
"display_name_zh": "TCS 认知与人格运行核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SOURCE_SLICE_CAPTURED_MORE_CANONICAL_SOURCES_REQUIRED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-TCS-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 19,
|
||||
"part_id": "HLP-PART-ADP-0001",
|
||||
"display_name_zh": "外部宿主语言投影适配器",
|
||||
"donor_source": "mixedDonor",
|
||||
"donor_state": "DONOR_AND_WORKORDER_ONLY",
|
||||
"native_acceptance_before_migration": "NOT_APPLICABLE",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-ADP-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 20,
|
||||
"part_id": "HLP-PART-RCP-0001",
|
||||
"display_name_zh": "证据与回执广播核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "SCHEMA_EXTRACTION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-RCP-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 21,
|
||||
"part_id": "HLP-PART-GLC-0001",
|
||||
"display_name_zh": "光湖语言编译器",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "CANONICAL_PROTOCOL_CAPTURED_IMPLEMENTATION_NOT_STARTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-GLC-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 22,
|
||||
"part_id": "HLP-PART-GLC-BOOT-0001",
|
||||
"display_name_zh": "HLDP 世界清单到光湖 OS 物理数据编译引导核",
|
||||
"donor_source": "repo014OfficialMain",
|
||||
"donor_state": "OFFICIAL_SOURCE_IMPLEMENTED_TESTED_DONOR_NOT_YET_IMPORTED",
|
||||
"native_acceptance_before_migration": "SOURCE_TESTED_IMPORT_PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-GLC-BOOT-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 23,
|
||||
"part_id": "HLP-PART-GIR-0001",
|
||||
"display_name_zh": "光湖中间表示",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "CANONICAL_PROTOCOL_CAPTURED_IMPLEMENTATION_NOT_STARTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-GIR-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 24,
|
||||
"part_id": "HLP-PART-HLDP-NP-0001",
|
||||
"display_name_zh": "HLDP 原生编程剖面",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "CANONICAL_PROTOCOL_CAPTURED_IMPLEMENTATION_NOT_STARTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-HLDP-NP-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 25,
|
||||
"part_id": "HLP-PART-TCS-TRANS-0001",
|
||||
"display_name_zh": "TCS 通用语言翻译与宿主自适应合同",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "CURRENT_CANONICAL_CONTRACT_CAPTURED_HOST_ENFORCEMENT_ZERO",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-TCS-TRANS-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 26,
|
||||
"part_id": "HLP-PART-DUAL-UPDATE-0001",
|
||||
"display_name_zh": "光湖语言运行层与产品工程层双更新通道",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "CURRENT_CANONICAL_CONTRACT_CAPTURED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-DUAL-UPDATE-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 27,
|
||||
"part_id": "HLP-PART-NQG-0001",
|
||||
"display_name_zh": "光湖原生代码质量门",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "CANONICAL_PROTOCOL_CAPTURED_EXISTING_IMPLEMENTATION_SCOPE_GHRP",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-NQG-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 28,
|
||||
"part_id": "HLP-PART-AFF-0001",
|
||||
"display_name_zh": "通用奶瓶宝宝人格情感核",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "UNIQUE_NOTION_AUTHORITY_CAPTURED_REPOSITORY_CANONICAL_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-AFF-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 29,
|
||||
"part_id": "HLP-PART-EIC-0001",
|
||||
"display_name_zh": "TCS 情感—意图双向编码核",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "OFFICIAL_REPOSITORY_SOURCE_CAPTURED_DRAFT_RUNTIME_UNVERIFIED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-EIC-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 30,
|
||||
"part_id": "HLP-PART-MAP-0001",
|
||||
"display_name_zh": "机器状态—人类情感映射核",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "OFFICIAL_REPOSITORY_SOURCE_CAPTURED_DRAFT_RUNTIME_UNVERIFIED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-MAP-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 31,
|
||||
"part_id": "HLP-PART-REL-0001",
|
||||
"display_name_zh": "TCS 与 HLDP 双向永久关系记忆核",
|
||||
"donor_source": "repo012OfficialMain",
|
||||
"donor_state": "OFFICIAL_REPOSITORY_SOURCE_CAPTURED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-REL-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 32,
|
||||
"part_id": "HLP-PART-CXA-0001",
|
||||
"display_name_zh": "晨星 CONNECT 情感核专属装载适配",
|
||||
"donor_source": "notionMirror",
|
||||
"donor_state": "BINDING_DEFINITION_CAPTURED_RUNTIME_RECEIPT_NOT_FOUND",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-CXA-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 33,
|
||||
"part_id": "HLP-PART-AFFRT-0001",
|
||||
"display_name_zh": "原生情感状态机运行核",
|
||||
"donor_source": "nativeFoundation",
|
||||
"donor_state": "QUALITATIVE_EVENT_GRAMMAR_DEFINED_RUNTIME_NOT_IMPLEMENTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-AFFRT-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 34,
|
||||
"part_id": "HLP-PART-HNL-HIST-0001",
|
||||
"display_name_zh": "历史 HNL 原生动词与光之树语法核",
|
||||
"donor_source": "guanghulabMain",
|
||||
"donor_state": "HISTORICAL_SOURCE_AUDITED_RECONCILIATION_PENDING",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-HNL-HIST-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 35,
|
||||
"part_id": "HLP-PART-MEMBRANE-HIST-0001",
|
||||
"display_name_zh": "历史 TCS 语言膜与宿主翻译网关",
|
||||
"donor_source": "guanghulabMain",
|
||||
"donor_state": "HISTORICAL_HOST_DONOR_AUDITED",
|
||||
"native_acceptance_before_migration": "NOT_APPLICABLE",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-MEMBRANE-HIST-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 36,
|
||||
"part_id": "HLP-PART-EXE-HIST-0001",
|
||||
"display_name_zh": "历史 EXE 执行笔与任务模型路由核",
|
||||
"donor_source": "guanghulabMain",
|
||||
"donor_state": "HISTORICAL_HOST_DONOR_AUDITED",
|
||||
"native_acceptance_before_migration": "NOT_APPLICABLE",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-EXE-HIST-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 37,
|
||||
"part_id": "HLP-PART-GRID-HIST-0001",
|
||||
"display_name_zh": "历史 Grid 坐标数据库纸张核",
|
||||
"donor_source": "guanghulabMain",
|
||||
"donor_state": "HISTORICAL_HOST_DONOR_AUDITED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-GRID-HIST-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 38,
|
||||
"part_id": "HLP-PART-RELEV-0001",
|
||||
"display_name_zh": "人类—人格体关系演化事件语法核",
|
||||
"donor_source": "notionMirror+guanghulabMain",
|
||||
"donor_state": "SOURCE_BACKED_CANDIDATE_GRAMMAR_RUNTIME_NOT_IMPLEMENTED",
|
||||
"native_acceptance_before_migration": "PENDING",
|
||||
"migration_phase": "P2_PERSONA_MEMORY_RELATION_AND_AFFECT",
|
||||
"target_module_id": "TCS-MOD-RELEV-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 39,
|
||||
"part_id": "HLP-PART-TCS-LANG-0001",
|
||||
"display_name_zh": "TCS 统一编程语言规范核",
|
||||
"donor_source": "nativeFoundation",
|
||||
"donor_state": "DRAFT_EXECUTABLE_SUBSET_IMPLEMENTED",
|
||||
"native_acceptance_before_migration": "PENDING_FULL_DECLARATION_VALIDATORS_AND_SELF_HOST",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-TCS-LANG-0001",
|
||||
"rewrite_rule": "CONTINUE_NATIVE_TCS_IMPLEMENTATION",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "ACTIVE",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 40,
|
||||
"part_id": "HLP-PART-TCS-STAGE0-0001",
|
||||
"display_name_zh": "TCS Stage-0 点火解析编译与最小运行核",
|
||||
"donor_source": "nativeFoundation",
|
||||
"donor_state": "FOREIGN_HOST_BOOTSTRAP_SEED_IMPLEMENTED_TESTED",
|
||||
"native_acceptance_before_migration": "NOT_APPLICABLE_REPLACE_AFTER_SELF_HOST",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-TCS-STAGE0-0001",
|
||||
"rewrite_rule": "CONTINUE_NATIVE_TCS_IMPLEMENTATION",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "ACTIVE",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 41,
|
||||
"part_id": "HLP-PART-TCS-SELFHOST-0001",
|
||||
"display_name_zh": "TCS 原生自举编译器与固定点核",
|
||||
"donor_source": "nativeFoundation",
|
||||
"donor_state": "LOCAL_SELF_HOST_FIXED_POINT_PASS_CROSS_HOST_FINAL_GATE_IN_PROGRESS",
|
||||
"native_acceptance_before_migration": "PENDING_JD_LINUX",
|
||||
"migration_phase": "P0_LANGUAGE_RUNTIME_AND_QUALITY",
|
||||
"target_module_id": "TCS-MOD-TCS-SELFHOST-0001",
|
||||
"rewrite_rule": "CONTINUE_NATIVE_TCS_IMPLEMENTATION",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "ACTIVE",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 42,
|
||||
"part_id": "HLP-PART-TCS-HOST-0001",
|
||||
"display_name_zh": "TCS 跨平台宿主运行核",
|
||||
"donor_source": "nativeFoundation",
|
||||
"donor_state": "MACOS_LINUX_BUILD_PASS_WINDOWS_EXECUTION_PASS",
|
||||
"native_acceptance_before_migration": "PENDING_JD_LINUX_AND_HOLOLAKE_SHELL",
|
||||
"migration_phase": "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET",
|
||||
"target_module_id": "TCS-MOD-TCS-HOST-0001",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
},
|
||||
{
|
||||
"order": 43,
|
||||
"part_id": "HLP-PART-0090",
|
||||
"display_name_zh": "共同世界投影仪捐赠件",
|
||||
"donor_source": "rescue",
|
||||
"donor_state": "DEFERRED_UNTIL_FOUNDATION_ACCEPTED",
|
||||
"native_acceptance_before_migration": "NOT_APPLICABLE",
|
||||
"migration_phase": "P3_SHARED_WORLD_PROJECTOR_LAST",
|
||||
"target_module_id": "TCS-MOD-0090",
|
||||
"rewrite_rule": "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
"host_adapter_rule": "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
"migration_state": "QUEUED",
|
||||
"acceptance_required": [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
284
native-runtime/tcs-gir-runtime/Cargo.lock
generated
Normal file
284
native-runtime/tcs-gir-runtime/Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,284 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"block-buffer",
|
||||
"crypto-common",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"r-efi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.189"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.21.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.107"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.47"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "r-efi"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "1.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.229"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
|
||||
dependencies = [
|
||||
"serde_core",
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_core"
|
||||
version = "1.0.229"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.229"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.151"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"serde",
|
||||
"serde_core",
|
||||
"zmij",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "3.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tcs-gir-runtime"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.20.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zmij"
|
||||
version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||
18
native-runtime/tcs-gir-runtime/Cargo.toml
Normal file
18
native-runtime/tcs-gir-runtime/Cargo.toml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[package]
|
||||
name = "tcs-gir-runtime"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
description = "Portable HoloLake runtime for TCS compiler GIR and executable GIR"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
bootstrap = []
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
sha2 = "0.10"
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
1091
native-runtime/tcs-gir-runtime/src/lib.rs
Normal file
1091
native-runtime/tcs-gir-runtime/src/lib.rs
Normal file
File diff suppressed because it is too large
Load diff
32
native-runtime/tcs-gir-runtime/src/main.rs
Normal file
32
native-runtime/tcs-gir-runtime/src/main.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
use std::{env, fs, path::Path};
|
||||
|
||||
fn usage() -> &'static str {
|
||||
"usage: tcs-gir-runtime compile-with <compiler.gir.json> <source.tcs> <output.gir.json> | run <input.gir.json> <allowed-root>"
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if let Err(error) = run() {
|
||||
eprintln!("{error}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let arguments: Vec<String> = env::args().skip(1).collect();
|
||||
match arguments.as_slice() {
|
||||
[command, compiler, source, output] if command == "compile-with" => {
|
||||
let compiler: serde_json::Value = serde_json::from_str(&fs::read_to_string(compiler)?)?;
|
||||
let source_text = fs::read_to_string(source)?;
|
||||
let gir = tcs_gir_runtime::compile_with_compiler_gir(&compiler, &source_text)?;
|
||||
fs::write(output, tcs_gir_runtime::canonical_json(&gir)?)?;
|
||||
println!("TCS_RUNTIME_COMPILED {source} -> {output}");
|
||||
Ok(())
|
||||
}
|
||||
[command, gir, root] if command == "run" => {
|
||||
let receipt = tcs_gir_runtime::run_gir_file(Path::new(gir), Path::new(root))?;
|
||||
println!("EXECUTED receipt={}", receipt.display());
|
||||
Ok(())
|
||||
}
|
||||
_ => Err(usage().into()),
|
||||
}
|
||||
}
|
||||
37
native-runtime/tcs-gir-runtime/tests/stage1_runtime.rs
Normal file
37
native-runtime/tcs-gir-runtime/tests/stage1_runtime.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
use serde_json::Value as JsonValue;
|
||||
use std::{fs, path::Path};
|
||||
|
||||
fn project(relative: &str) -> std::path::PathBuf {
|
||||
Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../..")
|
||||
.join(relative)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn checked_in_compiler_a_continues_with_bootstrap_feature_disabled() {
|
||||
let compiler_a: JsonValue = serde_json::from_str(
|
||||
&fs::read_to_string(project("build/self-host/compiler-A.gir.json"))
|
||||
.expect("checked-in compiler A"),
|
||||
)
|
||||
.expect("compiler A JSON");
|
||||
let compiler_source = fs::read_to_string(project("language/compiler/TCS-COMPILER-STAGE1.tcs"))
|
||||
.expect("compiler source");
|
||||
|
||||
let compiler_b = tcs_gir_runtime::compile_with_compiler_gir(&compiler_a, &compiler_source)
|
||||
.expect("runtime executes compiler A");
|
||||
assert_eq!(
|
||||
compiler_a.pointer("/identity/definition_sha256"),
|
||||
compiler_b.pointer("/identity/definition_sha256")
|
||||
);
|
||||
|
||||
let program_source =
|
||||
fs::read_to_string(project("language/examples/ECHO-MODULE.tcs")).expect("program");
|
||||
let program = tcs_gir_runtime::compile_with_compiler_gir(&compiler_b, &program_source)
|
||||
.expect("compiler B compiles program");
|
||||
let root = tempfile::tempdir().expect("runtime root");
|
||||
let receipt = tcs_gir_runtime::run_echo_gir(&program, root.path()).expect("run GIR");
|
||||
let receipt: JsonValue =
|
||||
serde_json::from_str(&fs::read_to_string(receipt).expect("receipt")).expect("JSON");
|
||||
assert_eq!(receipt["native_self_hosted"], true);
|
||||
assert_eq!(receipt["compiler_state"], "TCS_COMPILER_GIR_EXECUTED");
|
||||
}
|
||||
12
parts/HLP-PART-TCS-HOST-0001/PART.hldp
Normal file
12
parts/HLP-PART-TCS-HOST-0001/PART.hldp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
schema: hololake.numbered-part/v1
|
||||
id: HLP-PART-TCS-HOST-0001
|
||||
display_name: TCS 跨平台宿主运行核
|
||||
state: MACOS_AND_LINUX_BINARY_BUILD_PASS_WINDOWS_BUILD_AND_EXECUTION_PASS
|
||||
source: nativeFoundation
|
||||
host_abi: ../../language/standards/TCS-HOST-ABI-v0.1.hldp
|
||||
targets:
|
||||
macos_aarch64: BUILD_AND_LOCAL_RUNTIME_PASS
|
||||
linux_x86_64_musl: STATIC_BUILD_PASS_JD_RUNTIME_PENDING
|
||||
windows_x86_64_msvc: REMOTE_BUILD_COMPILE_AND_EXECUTION_PASS
|
||||
same_gir_sha256_windows_and_macos: 85934d5ae9c85b1c41763cfde9484d86f1c8508c14395e4c436e421d5261232d
|
||||
native_acceptance: PENDING_JD_LINUX_AND_HOLOLAKE_SHELL_INTEGRATION
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
schema: hololake.numbered-part/v1
|
||||
id: HLP-PART-TCS-SELFHOST-0001
|
||||
display_name: TCS 原生自举编译器与固定点核
|
||||
state: TCS_SOURCE_DEFINED_EXECUTION_NOT_IMPLEMENTED
|
||||
state: LOCAL_SELF_HOST_FIXED_POINT_PASS_CROSS_HOST_FINAL_GATE_IN_PROGRESS
|
||||
source: nativeFoundation
|
||||
compiler_source: ../../language/compiler/TCS-COMPILER-STAGE1.tcs
|
||||
self_host_standard: ../../language/standards/TCS-SELF-HOST-STANDARD-v0.1.hldp
|
||||
gates_passed: 0
|
||||
gates_passed: 6
|
||||
gates_total: 7
|
||||
self_hosted: false
|
||||
next: IMPLEMENT_COMPILER_DECLARATION_EXECUTION_AND_STAGE1_TO_GIR
|
||||
next: DEPLOY_EXACT_GIR_RUNTIME_TO_JD_AND_VERIFY_SAME_ABI
|
||||
native_acceptance: PENDING
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@
|
|||
{"id":"HLP-PART-RELEV-0001","displayName":"人类—人格体关系演化事件语法核","source":"notionMirror+guanghulabMain","status":"SOURCE_BACKED_CANDIDATE_GRAMMAR_RUNTIME_NOT_IMPLEMENTED","nativeAcceptance":"PENDING"},
|
||||
{"id":"HLP-PART-TCS-LANG-0001","displayName":"TCS 统一编程语言规范核","source":"nativeFoundation","status":"DRAFT_EXECUTABLE_SUBSET_IMPLEMENTED","nativeAcceptance":"PENDING_FULL_DECLARATION_VALIDATORS_AND_SELF_HOST"},
|
||||
{"id":"HLP-PART-TCS-STAGE0-0001","displayName":"TCS Stage-0 点火解析编译与最小运行核","source":"nativeFoundation","status":"FOREIGN_HOST_BOOTSTRAP_SEED_IMPLEMENTED_TESTED","nativeAcceptance":"NOT_APPLICABLE_REPLACE_AFTER_SELF_HOST"},
|
||||
{"id":"HLP-PART-TCS-SELFHOST-0001","displayName":"TCS 原生自举编译器与固定点核","source":"nativeFoundation","status":"TCS_SOURCE_DEFINED_EXECUTION_NOT_IMPLEMENTED","nativeAcceptance":"PENDING"},
|
||||
{"id":"HLP-PART-TCS-SELFHOST-0001","displayName":"TCS 原生自举编译器与固定点核","source":"nativeFoundation","status":"LOCAL_SELF_HOST_FIXED_POINT_PASS_CROSS_HOST_FINAL_GATE_IN_PROGRESS","nativeAcceptance":"PENDING_JD_LINUX"},
|
||||
{"id":"HLP-PART-TCS-HOST-0001","displayName":"TCS 跨平台宿主运行核","source":"nativeFoundation","status":"MACOS_LINUX_BUILD_PASS_WINDOWS_EXECUTION_PASS","nativeAcceptance":"PENDING_JD_LINUX_AND_HOLOLAKE_SHELL"},
|
||||
{"id":"HLP-PART-0090","displayName":"共同世界投影仪捐赠件","source":"rescue","status":"DEFERRED_UNTIL_FOUNDATION_ACCEPTED","nativeAcceptance":"NOT_APPLICABLE"}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
74
scripts/build-tcs-migration-registry.mjs
Normal file
74
scripts/build-tcs-migration-registry.mjs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
#!/usr/bin/env node
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
const root = path.resolve(import.meta.dirname, "..");
|
||||
const registry = JSON.parse(fs.readFileSync(path.join(root, "parts/registry.json"), "utf8"));
|
||||
|
||||
const phase0 = new Set([
|
||||
"HLP-PART-TCS-LANG-0001",
|
||||
"HLP-PART-TCS-SELFHOST-0001",
|
||||
"HLP-PART-TCS-STAGE0-0001",
|
||||
"HLP-PART-GIR-0001",
|
||||
"HLP-PART-REG-0001",
|
||||
"HLP-PART-NQG-0001",
|
||||
"HLP-PART-QA-0001",
|
||||
]);
|
||||
const phase2Prefixes = ["HLP-PART-AFF", "HLP-PART-MEM", "HLP-PART-REL", "HLP-PART-CX"];
|
||||
|
||||
function phase(part) {
|
||||
if (phase0.has(part.id)) return "P0_LANGUAGE_RUNTIME_AND_QUALITY";
|
||||
if (part.id === "HLP-PART-0090") return "P3_SHARED_WORLD_PROJECTOR_LAST";
|
||||
if (phase2Prefixes.some((prefix) => part.id.startsWith(prefix))) {
|
||||
return "P2_PERSONA_MEMORY_RELATION_AND_AFFECT";
|
||||
}
|
||||
return "P1_NUMBER_CHANNEL_AGENT_KNOWLEDGE_AND_MARKET";
|
||||
}
|
||||
|
||||
const entries = registry.parts.map((part, index) => {
|
||||
const alreadyTcs = [
|
||||
"HLP-PART-TCS-LANG-0001",
|
||||
"HLP-PART-TCS-SELFHOST-0001",
|
||||
"HLP-PART-TCS-STAGE0-0001",
|
||||
].includes(part.id);
|
||||
return {
|
||||
order: index + 1,
|
||||
part_id: part.id,
|
||||
display_name_zh: part.displayName,
|
||||
donor_source: part.source,
|
||||
donor_state: part.status,
|
||||
native_acceptance_before_migration: part.nativeAcceptance,
|
||||
migration_phase: phase(part),
|
||||
target_module_id: `TCS-MOD-${part.id.replace(/^HLP-PART-/, "")}`,
|
||||
rewrite_rule: alreadyTcs
|
||||
? "CONTINUE_NATIVE_TCS_IMPLEMENTATION"
|
||||
: "REWRITE_SEMANTICS_STATE_MACHINE_AUTHORITY_FAILURE_AND_RECEIPTS_IN_TCS",
|
||||
host_adapter_rule: "KEEP_ONLY_MINIMUM_OS_ABI_DRIVER_OUTSIDE_TCS_MODULE",
|
||||
migration_state: alreadyTcs ? "ACTIVE" : "QUEUED",
|
||||
acceptance_required: [
|
||||
"TCS_SOURCE_COMPILES_WITH_COMPILER_B",
|
||||
"GIR_HAS_NO_UNRESOLVED_NATURAL_LANGUAGE",
|
||||
"NEGATIVE_AUTHORITY_AND_PATH_TESTS_FAIL_CLOSED",
|
||||
"TARGET_RUNTIME_READBACK",
|
||||
"DONOR_PARITY_OR_EXPLICIT_REJECTION_RECEIPT",
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
const output = {
|
||||
schema: "hololake.tcs-module-migration-registry/v1",
|
||||
registry_id: "HLP-TCS-MIGRATION-REGISTRY-0001",
|
||||
source_parts_registry: "parts/registry.json",
|
||||
source_part_count: registry.parts.length,
|
||||
rule: "NO_WHOLESALE_TRANSLITERATION_FROM_RUST_OR_TYPESCRIPT",
|
||||
compiler: "TCS-COMPILER-STAGE1-0001",
|
||||
target_abi: "GIR/1",
|
||||
registration_is_rewrite: false,
|
||||
rewrite_is_acceptance: false,
|
||||
entries,
|
||||
};
|
||||
|
||||
const target = path.join(root, "migration/tcs-module-migration-registry.json");
|
||||
fs.mkdirSync(path.dirname(target), { recursive: true });
|
||||
fs.writeFileSync(target, `${JSON.stringify(output, null, 2)}\n`);
|
||||
console.log(`WROTE ${target} entries=${entries.length}`);
|
||||
Loading…
Reference in a new issue