Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
287f4fb
docs(audit): subvalue bounded lattice claim
briansrls May 2, 2026
4abdf05
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
60658df
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
1734b9f
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
c49d4b1
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
3cc4994
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
094522a
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
4c6aff3
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
791813b
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
6c19da5
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 2, 2026
795ddfe
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
1d4aa93
WIP: snappy-koi-58
briansrls May 3, 2026
2b78d33
chore: apply cargo fmt
briansrls May 3, 2026
b6bb23d
WIP: snappy-koi-58
briansrls May 3, 2026
ad92101
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
f5fab4d
WIP: snappy-koi-58
briansrls May 3, 2026
2661617
WIP: snappy-koi-58
briansrls May 3, 2026
72daff4
chore: apply cargo fmt
briansrls May 3, 2026
3b486cb
WIP: snappy-koi-58
briansrls May 3, 2026
9a09f28
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
32b8584
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
44a82d8
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
19034d5
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
78e04e8
Merge remote-tracking branch 'origin/main' into codex/subvalue-bounde…
briansrls May 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ Surfaced by paired Exploratory Analysis (gpt-5-5-pro main@8cd5359; 9 findings ag

#### B. Exploratory findings — sharpened tracked items

- **`??` and `%` declared in dag-syntax authority but absent from v3 token/parser/operator surface** (sharpened from operator-ontology-three-coexisting-authorities at ROADMAP:424-425): `dsl/extdeps/languages/dag/syntax.dag:99-115` declares `OperatorSpec` rows for `??` (`NullCoalesce` binop) and `%` (`Mod` binop). v3's token taxonomy at `src/v3/std/tokenize.dag:15-60` has `Question` but no `QuestionQuestion`; has `Slash` but no `Percent`. Punctuation list at `:95-123` matches. `src/v3/compiler/parse_tables.dag:173-243` covers `||`, `&&`, comparisons, `+ - * /` but no `%` or `??`. v3 operator ontology at `src/v3/std/substrate.dag:223-253` has Add/Sub/Mul/Div + comparisons + And/Or; no Mod or NullCoalesce. `src/v3/compiler/operators.dag::from_symbol:5-18` no branch. The parse-table cross-validation comment at `parse_tables.dag:149-166` claims cross-validation against `dag_operators` — visibly violated. **Dissolution**: short-term either remove unsupported rows from `dag_operators` until v3 supports them, OR add the full chain (token + parse + OperatorKind + algebra-field mapping + lowering/inference) in one PR. Long-term: T-Ground-Services parser-grammar slice derives parser rows from syntax authority — concrete scope item for that lane. Surfaced 2026-05-01 (Exploratory Finding 4). Owner: R3 Substrate (operator ontology) + R3 Grounding (T-Ground-Services).
- **`??` and `%` declared in dag-syntax authority but absent from v3 token/parser/operator surface — RESOLVED 2026-05-03 (Grounding parser-grammar slice)** (sharpened from operator-ontology-three-coexisting-authorities at ROADMAP:424-425): unsupported `dag_operators` rows for `??` (`NullCoalesce` binop) and `%` (`Mod` binop) were removed from `dsl/extdeps/languages/dag/syntax.dag`; the v3-supported `.dag` binary operator set is now exactly `||`, `&&`, comparisons, `+`, `-`, `*`, and `/`, with `|>` / `.` remaining tokenized parser forms whose `binop` is `none`. Regression coverage now requires every `dag_operators` row with a binary `binop` to have matching `TokenKind` coverage, a `BinaryOpRow` in `src/v3/compiler/parse_tables.dag`, and an `operators.dag::from_symbol` mapping; tokenizer authority also rejects parser-only shared operators. **Future scope:** reviving `%` or `??` is additive, not debt cleanup, and must land the full chain together (token + parse + `OperatorKind` + algebra-field/lowering/inference semantics) after the R3 Substrate operator-ontology decision. Surfaced 2026-05-01 (Exploratory Finding 4); resolved by deletion + executable cross-validation gate.

- **`CollectionOps` / `StringOps` / `MapOps` duplicate algebra operation surfaces as target-string templates** (sharpened from language-fact-duplication / LanguageSpec-dual-authority at ROADMAP:365 + :424): `dsl/std/algebra.dag:301-326` declares `FreeMonoid<T>` carrying `concat`, `empty`, `length`, `map`, `filter`, `fold`, `flat_map`, etc. as algebraic operations; `:328-349` declares `PartialFunction<K,V>` carrying `lookup`, `empty`, `insert`, `merge`, `keys`, `values`. `dsl/std/languages.dag:281-318` then declares per-target `CollectionOps`, `StringOps`, `MapOps` records with `count: String` / `first: String` / `fold: String` / `empty_list: String` etc. — second operation ontology parallel to FreeMonoid + PartialFunction. **Dissolution**: realize operations should reference `DeclarationRef` / method contracts for algebra fields. Target templates can remain render-data, but identity is "realization of `FreeMonoid<T>.fold` for Rust", not a second `fold: String` field. Surfaced 2026-05-01 (Exploratory Finding 7). Owner: R3 Grounding (T-Ground-LanguageSpec + algebra method contracts).

Expand Down
8 changes: 3 additions & 5 deletions dsl/extdeps/languages/dag/syntax.dag
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import std.syntax {
ExprBody, BlockBody, TypeBody, ValueBody, NoBody,
ServiceBody, ResourceBody,
OperatorSpec, SyntaxSpec,
BinOp, Add, Sub, Mul, Div, Mod,
Eq, Ne, Lt, Gt, Le, Ge, And, Or, NullCoalesce,
BinOp, Add, Sub, Mul, Div,
Eq, Ne, Lt, Gt, Le, Ge, And, Or,
LiteralValue, LitBool, LitNull
}

Expand Down Expand Up @@ -92,12 +92,11 @@ data dag_non_name_keywords: Map<String, Bool> = {
}

// Operator precedence table.
// ?? < || < && < cmp < add < mul < |> < .
// || < && < cmp < add < mul < |> < .
// |> and . have binding power entries but their binop field is unused
// (the expression loop handles them as pipe/field-access, not binary ops).

data dag_operators: List<OperatorSpec> = [
OperatorSpec { symbol: "??", left_bp: 3, right_bp: 4, binop: NullCoalesce, algebra_field: none },
OperatorSpec { symbol: "||", left_bp: 5, right_bp: 6, binop: Or, algebra_field: none },
OperatorSpec { symbol: "&&", left_bp: 7, right_bp: 8, binop: And, algebra_field: none },
OperatorSpec { symbol: "==", left_bp: 9, right_bp: 10, binop: Eq, algebra_field: none },
Expand All @@ -110,7 +109,6 @@ data dag_operators: List<OperatorSpec> = [
OperatorSpec { symbol: "-", left_bp: 13, right_bp: 14, binop: Sub, algebra_field: none },
OperatorSpec { symbol: "*", left_bp: 15, right_bp: 16, binop: Mul, algebra_field: none },
OperatorSpec { symbol: "/", left_bp: 15, right_bp: 16, binop: Div, algebra_field: none },
OperatorSpec { symbol: "%", left_bp: 15, right_bp: 16, binop: Mod, algebra_field: none },
OperatorSpec { symbol: "|>", left_bp: 17, right_bp: 18, binop: none, algebra_field: none },
OperatorSpec { symbol: ".", left_bp: 19, right_bp: 20, binop: none, algebra_field: none }
]
Expand Down
5 changes: 4 additions & 1 deletion dsl/gunbc/tools/gist.dag
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import std.types { CommitSha, Url }
// Guess a language tag from a file extension for code block syntax highlighting.
fn lang_for_path(path: String) -> String {
let parts = split(path, ".")
let ext = last(parts) ?? ""
let ext = match last(parts) {
Some { value: value } => value
None => ""
}
match ext {
"rs" => "rust"
"dag" => "dag"
Expand Down
6 changes: 3 additions & 3 deletions src/v2/02_parse.dag
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// && bp 4 (left)
// == != < > <= >= bp 6 (left)
// + - + bp 8 (left, +is list/string concat)
// * / % bp 10 (left)
// * / bp 10 (left)
// ! - (unary) bp 12 (prefix)
// . () [] bp 14 (postfix, handled separately)

Expand Down Expand Up @@ -2708,8 +2708,8 @@ fn int_to_string(value: Int) -> String {
fn int_to_string_acc(value: Int, acc: List<String>) -> List<String> {
if value == 0 { acc }
else {
let digit = value % 10
let rest = (value - digit) / 10
let rest = value / 10
let digit = value - (rest * 10)
let digit_chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
let ch = match digit_chars |> enumerate |> filter(p => p.first == digit) |> first {
Some { value: p } => p.second
Expand Down
4 changes: 2 additions & 2 deletions src/v2/05_emit.dag
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ fn to_string_helper(value: Int, acc: List<String>) -> List<String> {
if value == 0 {
acc
} else {
let digit = value % 10
let rest = (value - digit) / 10
let rest = value / 10
let digit = value - (rest * 10)
let digit_chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
let ch = match digit_chars |> enumerate |> filter(p => p.first == digit) |> first {
Some { value: p } => p.second
Expand Down
16 changes: 1 addition & 15 deletions src/v2/stage0/src/extdeps_languages_dag_syntax.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Generated by v2 compiler -- do not edit.
// Source module: extdeps.languages.dag.syntax

use crate::std_syntax::BinOp::{
Add, And, Div, Eq, Ge, Gt, Le, Lt, Mod, Mul, Ne, NullCoalesce, Or, Sub,
};
use crate::std_syntax::BinOp::{Add, And, Div, Eq, Ge, Gt, Le, Lt, Mul, Ne, Or, Sub};
use crate::std_syntax::BodyKind::{
BlockBody, ExprBody, NoBody, ResourceBody, ServiceBody, TypeBody, ValueBody,
};
Expand Down Expand Up @@ -184,12 +182,6 @@ pub fn dag_operators() -> Rc<Vec<Rc<OperatorSpec>>> {
thread_local! {
static CACHED: Rc<Vec<Rc<OperatorSpec>>> = {
Rc::new(vec![Rc::new(OperatorSpec {
symbol: "??".to_string(),
left_bp: 3,
right_bp: 4,
binop: Some(BinOp::NullCoalesce),
algebra_field: None,
}), Rc::new(OperatorSpec {
symbol: "||".to_string(),
left_bp: 5,
right_bp: 6,
Expand Down Expand Up @@ -261,12 +253,6 @@ pub fn dag_operators() -> Rc<Vec<Rc<OperatorSpec>>> {
right_bp: 16,
binop: Some(BinOp::Div),
algebra_field: None,
}), Rc::new(OperatorSpec {
symbol: "%".to_string(),
left_bp: 15,
right_bp: 16,
binop: Some(BinOp::Mod),
algebra_field: None,
}), Rc::new(OperatorSpec {
symbol: "|>".to_string(),
left_bp: 17,
Expand Down
6 changes: 3 additions & 3 deletions src/v2/stage0/src/v2_compiler_emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ pub fn to_string_helper(mut value: i64, mut acc: Rc<Vec<String>>) -> Rc<Vec<Stri
if (value.clone() == 0) {
break acc;
} else {
let digit = (value.clone() % 10);
let rest = ((value.clone() - digit.clone()) / 10);
let rest = (value.clone() / 10);
let digit = (value.clone() - (rest.clone() * 10));
let digit_chars = Rc::new(vec![
"0".to_string(),
"1".to_string(),
Expand Down Expand Up @@ -1100,7 +1100,7 @@ pub fn to_string_helper(mut value: i64, mut acc: Rc<Vec<String>>) -> Rc<Vec<Stri
None => "?".to_string(),
};
{
let __tco_0 = rest;
let __tco_0 = rest.clone();
let __tco_1 = v2_rt::concat(Rc::new(vec![ch]), acc);
value = __tco_0;
acc = __tco_1;
Expand Down
6 changes: 3 additions & 3 deletions src/v2/stage0/src/v2_compiler_parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7782,8 +7782,8 @@ pub fn int_to_string_acc(mut value: i64, mut acc: Rc<Vec<String>>) -> Rc<Vec<Str
if (value.clone() == 0) {
break acc;
} else {
let digit = (value.clone() % 10);
let rest = ((value.clone() - digit.clone()) / 10);
let rest = (value.clone() / 10);
let digit = (value.clone() - (rest.clone() * 10));
let digit_chars = Rc::new(vec![
"0".to_string(),
"1".to_string(),
Expand Down Expand Up @@ -7822,7 +7822,7 @@ pub fn int_to_string_acc(mut value: i64, mut acc: Rc<Vec<String>>) -> Rc<Vec<Str
None => "?".to_string(),
};
{
let __tco_0 = rest;
let __tco_0 = rest.clone();
let __tco_1 = v2_rt::concat(Rc::new(vec![ch]), acc);
value = __tco_0;
acc = __tco_1;
Expand Down
2 changes: 1 addition & 1 deletion src/v3/compiler/src/regen_parse_tables_emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub fn render_parse_tables_generated_rs(
/// - `And` ← bp 7/8 (`&&`)
/// - `Comparison` ← bp 9/10 or 11/12 (`== != < <= > >=`)
/// - `Additive` ← bp 13/14 (`+ -`)
/// - `Multiplicative` ← bp 15/16 (`* / %`)
/// - `Multiplicative` ← bp 15/16 (`* /`)
///
/// If the shared authority introduces an operator at a bp outside these
/// bands, regen fails closed (`BinaryOpLevel` does not yet cover it).
Expand Down
24 changes: 1 addition & 23 deletions src/v3/compiler/tests/integration/sg1_tokenize_authority_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ fn shared_operator_boundary_is_explicit_and_fail_closed() {
.collect();

let mut shared_tokenized_kinds = BTreeSet::new();
let mut parser_only_patterns = BTreeSet::new();
for pattern in &shared_operators {
match classify_shared_operator_for_tokenizer(pattern) {
SharedOperatorTokenizerBoundary::Tokenized { kind } => {
Expand All @@ -262,23 +261,9 @@ fn shared_operator_boundary_is_explicit_and_fail_closed() {
);
shared_tokenized_kinds.insert(kind.to_string());
}
SharedOperatorTokenizerBoundary::ParserOnlyDebt { reason } => {
assert!(
!reason.is_empty(),
"parser-only shared operator `{pattern}` should carry a dissolution note"
);
parser_only_patterns.insert(pattern.clone());
}
}
}

assert_eq!(
parser_only_patterns,
BTreeSet::from([String::from("%"), String::from("??")]),
"SG-1a banks exactly two parser-only shared operators today; changing that boundary \
must update the ratchet and the scaffold rationale together"
);

let mut covered_punct_kinds = shared_tokenized_kinds;
for decl in dag.declarations() {
let Some(name) = &decl.name else {
Expand Down Expand Up @@ -329,7 +314,6 @@ fn keyword_spelling_for_token_kind(kind: &str) -> String {

enum SharedOperatorTokenizerBoundary {
Tokenized { kind: &'static str },
ParserOnlyDebt { reason: &'static str },
}

fn classify_shared_operator_for_tokenizer(pattern: &str) -> SharedOperatorTokenizerBoundary {
Expand All @@ -348,15 +332,9 @@ fn classify_shared_operator_for_tokenizer(pattern: &str) -> SharedOperatorTokeni
"||" => SharedOperatorTokenizerBoundary::Tokenized { kind: "PipePipe" },
"|>" => SharedOperatorTokenizerBoundary::Tokenized { kind: "PipeArrow" },
"." => SharedOperatorTokenizerBoundary::Tokenized { kind: "Dot" },
"??" => SharedOperatorTokenizerBoundary::ParserOnlyDebt {
reason: "null-coalescing remains outside the v3 tokenizer punctuation subset",
},
"%" => SharedOperatorTokenizerBoundary::ParserOnlyDebt {
reason: "modulo remains outside the v3 tokenizer punctuation subset",
},
other => panic!(
"shared syntax operator `{other}` must be classified as tokenizer punctuation or \
explicit parser-only debt"
removed until v3 supports it end-to-end"
),
}
}
Expand Down
Loading
Loading