Skip to content
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0af2730
interpreter: honour the declared return type of first() and last()
Sep 3, 2026
cc0f5f5
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 3, 2026
e40e101
The evaluator consumed half of the checker's decision: derive both ar…
Sep 3, 2026
a16f544
chore: regenerate drifted generated artifacts (ci auto-heal)
Sep 3, 2026
96ec728
The floor hole was a DROPPED DIMENSION: judge cardinality instead of …
Sep 3, 2026
c7acca7
Merge remote-tracking branch 'origin/session/still-swift-363-first-co…
Sep 3, 2026
2fd11d9
Declare the check's subject, and derive the bare-none exclusion from …
Sep 3, 2026
43fd1c0
Merge main; repair the argument seam that judged the PEELED formal
Sep 3, 2026
ff58852
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 3, 2026
b99a52c
Dissolve four list-equality folds into one that CONSUMES the optional
Sep 3, 2026
a221905
Repair the five guarded sites, and the regen closure reaches zero
Sep 4, 2026
6480680
Row: adopt the obviation framing and the per-check subsumption rule
Sep 4, 2026
cae4b36
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 4, 2026
dc9a0fa
Decline to judge optionality on an unsubstituted formal, rather than …
Sep 4, 2026
26a231e
File the instrument-scope failure mode and enroll it on the roster
Sep 4, 2026
b06e784
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 4, 2026
abff82c
File: a result that confirms the hypothesis exactly is the one to dis…
Sep 4, 2026
b812bd4
Emit the decline: a silent admission is worse than the false positive…
Sep 4, 2026
20e2519
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 4, 2026
ba60f5a
the optional-into-required seam declines instead of admitting silently
Sep 4, 2026
cdbdbdc
Merge origin/main into session/still-swift-363-first-conformance
Sep 4, 2026
c422044
optional-into-required corpus repair, batch 1: 34 sites across 8 files
Sep 4, 2026
96fdedb
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 4, 2026
4c33fcc
repair the corpus for real Optional first()/last(), and withdraw the …
Sep 4, 2026
87d1444
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 4, 2026
9aa8ad7
discharge the six review findings: positive variant classification, t…
Sep 4, 2026
7789bc0
withdraw instantiation_unavailable_unreachable_stall: its central cla…
Sep 4, 2026
a70bba1
remove a scratch probe file that a git add -A swept into the tree, an…
Sep 4, 2026
be43301
extract the record-literal instantiation repair; this PR keeps no hal…
Sep 4, 2026
40a36ba
the unsubstituted-formal arm was accusing; key it to the OWNING decla…
Sep 4, 2026
169901a
Merge remote-tracking branch 'origin/main' into session/still-swift-3…
Sep 4, 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
51 changes: 0 additions & 51 deletions ROADMAP.md

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions dag/extdeps/bmc/types.dag
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ fn bmc_redfish_surface_for(
) -> BmcRedfishSurfaceDerivation {
let matches = bmc_redfish_surface_matches(catalog: catalog, firmware: firmware)
let count = list_length(matches)
if count == 0 {
SurfaceShapeUncatalogued { firmware: firmware }
} else if count == 1 {
SurfaceShapeKnown { shape: matches.first().shape }
} else {
SurfaceShapeAmbiguous { firmware: firmware, matches: count }
match matches.first() {
Absent => SurfaceShapeUncatalogued { firmware: firmware }
Present { value: only_or_first } =>
match matches.skip(n: 1).first() {
Absent => SurfaceShapeKnown { shape: only_or_first.shape }
Present { value: _ } => SurfaceShapeAmbiguous { firmware: firmware, matches: count }
}
}
}

Expand Down
18 changes: 13 additions & 5 deletions dag/extdeps/container/oci/digest.dag
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,19 @@ fn oci_wire_digest_parts(raw: String) -> OciWireDigestParts? {
if length(parts) != 2 {
none
} else {
Present {
value: oci_wire_digest_parts_from_split(
algorithm: parts.first(),
encoded: parts.skip(n: 1).first(),
)
match parts.first() {
Absent => none
Present { value: algorithm } =>
match parts.skip(n: 1).first() {
Absent => none
Present { value: encoded } =>
Present {
value: oci_wire_digest_parts_from_split(
algorithm: algorithm,
encoded: encoded,
)
}
}
}
}
}
Expand Down
13 changes: 3 additions & 10 deletions dag/extdeps/container/oci/manifest.dag
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,16 @@ fn accept_image_manifest(m: ImageManifest) -> ManifestOutcome {
}
}

fn layer_at(layers: List<OciDescriptor>, index: Int) -> OciDescriptor? {
match layers |> get(index) {
null => null
other => other
}
}

fn accept_image_manifest_layers(m: ImageManifest, index: Int) -> ManifestOutcome {
if index >= count(m.layers) {
ManifestAccepted { value: m }
} else {
match layer_at(m.layers, index) {
null =>
match m.layers |> get(index) {
Absent =>
ManifestRejected {
reason: LayerMissing { index: index },
}
layer =>
Present { value: layer } =>
match accept_descriptor(layer) {
DescriptorRejected { reason } =>
ManifestRejected {
Expand Down
42 changes: 30 additions & 12 deletions dag/extdeps/github/expressions.dag
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,17 @@ fn parse_function_call_atom(s: String, sp: ExpressionSpellings) -> Expression? {
} else {
after
}
match function_from_name(name: segs.first()) {
match segs.first() {
Absent => none
Present { value: head_seg } =>
match function_from_name(name: head_seg) {
Absent => none
Present { value: fn_variant } => match parse_args_with(args_str: args_str, sp: sp) {
Absent => none
Present { value: args } => Present { value: FunctionCall { function: fn_variant, args: args } }
}
}
}
}
}

Expand All @@ -341,9 +345,13 @@ fn parse_function_call_atom(s: String, sp: ExpressionSpellings) -> Expression? {
fn parse_context_access_atom(s: String, sp: ExpressionSpellings) -> Expression? {
let dotted = replace(replace(s, sp.index_open, sp.path_sep), sp.index_close, "")
let segs = split(s: dotted, delimiter: sp.path_sep)
match context_from_name(name: segs.first()) {
match segs.first() {
Absent => none
Present { value: ctx } => Present { value: ContextAccess { context: ctx, path: segs.skip(n: 1) } }
Present { value: head_seg } =>
match context_from_name(name: head_seg) {
Absent => none
Present { value: ctx } => Present { value: ContextAccess { context: ctx, path: segs.skip(n: 1) } }
}
}
}

Expand All @@ -363,13 +371,17 @@ fn parse_expression_with(s: String, sp: ExpressionSpellings) -> Expression? {
if parts.length() == 1 {
parse_atom_with(s: s, sp: sp)
} else {
fold(parts.skip(n: 1), init: parse_atom_with(s: parts.first(), sp: sp), f: (acc, part) => match acc {
match parts.first() {
Absent => none
Present { value: left } => match parse_atom_with(s: part, sp: sp) {
Absent => none
Present { value: e } => Present { value: LogicalOr { left: left, right: e } }
}
})
Present { value: head_part } =>
fold(parts.skip(n: 1), init: parse_atom_with(s: head_part, sp: sp), f: (acc, part) => match acc {
Absent => none
Present { value: left } => match parse_atom_with(s: part, sp: sp) {
Absent => none
Present { value: e } => Present { value: LogicalOr { left: left, right: e } }
}
})
}
}
}

Expand All @@ -383,8 +395,10 @@ fn ingest_expression(src: String) -> Expression? {

fn ingest_template_with(src: String, sp: ExpressionSpellings) -> ExpressionTemplate? {
let parts = split(s: src, delimiter: sp.interp_open)
let lead = parts.first()
let lead_segs = if lead == "" { [] } else { [ LiteralText { text: lead } ] }
let lead_segs = match parts.first() {
Absent => []
Present { value: lead } => if lead == "" { [] } else { [ LiteralText { text: lead } ] }
}
let built = fold(parts.skip(n: 1), init: Present { value: lead_segs }, f: (acc, part) => match acc {
Absent => none
Present { value: sofar } => {
Expand All @@ -393,7 +407,10 @@ fn ingest_template_with(src: String, sp: ExpressionSpellings) -> ExpressionTempl
none
} else {
let trailing = join(halves.skip(n: 1), sp.interp_close)
match parse_expression_with(s: halves.first(), sp: sp) {
match halves.first() {
Absent => none
Present { value: head_half } =>
match parse_expression_with(s: head_half, sp: sp) {
Absent => none
Present { value: e } => {
let with_interp = concat(sofar, [ Interpolation { expression: e } ])
Expand All @@ -402,6 +419,7 @@ fn ingest_template_with(src: String, sp: ExpressionSpellings) -> ExpressionTempl
}
}
}
}
}
}
})
Expand Down
35 changes: 30 additions & 5 deletions dag/extdeps/languages/html.dag
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,34 @@ fn parse_attrs_with(attrs_str: String, sp: MarkupBracket) -> HtmlAttrFoldState {
})
}

// THE Absent ARMS BELOW ARE UNREACHABLE, AND THEY REFUSE RATHER THAN SUBSTITUTE.
// Every optional here is `split(...).first()`, and `split` cannot return an empty
// list -- on the empty string it returns [""] -- so Absent cannot occur. That
// non-emptiness is a property of split's IMPLEMENTATION that its return type
// `List<T>` does not carry, which is exactly why these positions are diagnosed at
// all: nothing enforces the property the code relies on.
//
// The arms therefore refuse instead of substituting a plausible value. The choice
// is only free while the unreachability argument holds, so it is made for the case
// where that argument is WRONG -- a reimplemented split, a different producer, a
// caller passing something that is not a split result. A refusal stops the line
// loudly and located; a fabricated empty value would be the absorbing fallback
// (DESIGN 5). Dissolves when split's return type carries non-emptiness AND these
// callers consume it -- see gunbc.guarantee_stall split_non_emptiness_unmodelled_stall.
fn parse_one_with(s: String, sp: MarkupBracket) -> HtmlParseOneResult {
if starts_with(s: s, prefix: sp.end_tag_open) {
ParseOneRejected { reason: "unexpected end tag" }
} else if starts_with(s: s, prefix: sp.tag_open) {
let open_chunks = split(s: s, delimiter: sp.tag_close)
let open_content = open_chunks.first()
match open_chunks.first() {
Absent => ParseOneRejected { reason: "unterminated open tag" }
Present { value: open_content } =>
let after_open_tag = html_strip_prefix(s: s, prefix: join([open_content, sp.tag_close], ""))
let tag_and_attrs = html_strip_prefix(s: open_content, prefix: sp.tag_open)
let tag_parts = split(s: tag_and_attrs, delimiter: sp.attr_sep)
let tag = tag_parts.first()
match tag_parts.first() {
Absent => ParseOneRejected { reason: "open tag names no element" }
Present { value: tag } =>
let attrs_raw = join(tag_parts.skip(n: 1), sp.attr_sep)
let attr_result = parse_attrs_with(attrs_str: attrs_raw, sp: sp)
if attr_result.rejected {
Expand All @@ -221,10 +239,17 @@ fn parse_one_with(s: String, sp: MarkupBracket) -> HtmlParseOneResult {
}
}
}
}
}
} else {
let text_raw = split(s: s, delimiter: sp.tag_open).first()
let rest = html_strip_prefix(s: s, prefix: text_raw)
ParsedOne { node: FragmentText { content: unescape_text(s: text_raw) }, rest: rest }
match split(s: s, delimiter: sp.tag_open).first() {
Absent => ParseOneRejected { reason: "no text content before tag open" }
Present { value: text_raw } =>
ParsedOne {
node: FragmentText { content: unescape_text(s: text_raw) },
rest: html_strip_prefix(s: s, prefix: text_raw),
}
}
}
}

Expand Down
52 changes: 40 additions & 12 deletions dag/extdeps/languages/markdown.dag
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,20 @@ fn md_parse_code(block_lines: List<String>) -> MarkdownBlock {
}
}

// THE Absent ARM IS UNREACHABLE AND, UNIQUELY HERE, CANNOT REFUSE. `lines` is a
// `split` result and split cannot return an empty list, so Absent cannot occur --
// a property of split's implementation that its `List<T>` return type does not
// carry. Elsewhere in this population the unreachable arm refuses; it cannot here,
// because MarkdownBlock declares no refusal variant and md_parse_block is total,
// so refusing would mean changing the return type of every caller. The arm
// therefore routes to the same ParagraphBlock fallthrough the function already
// produces when nothing else matches. Rostered as the weakest member of
// gunbc.guarantee_stall split_non_emptiness_unmodelled_stall.
fn md_parse_block(block_src: String, sp: MarkdownSpellings) -> MarkdownBlock {
let lines = split(s: block_src, delimiter: "\n")
let first = lines.first()
match lines.first() {
Absent => ParagraphBlock { inlines: md_parse_inline_rest(text: block_src, sp: sp) }
Present { value: first } =>
if starts_with(s: block_src, prefix: sp.code_fence) {
md_parse_code(block_lines: lines)
} else if md_is_heading(line: first, sp: sp) {
Expand All @@ -477,6 +488,7 @@ fn md_parse_block(block_src: String, sp: MarkdownSpellings) -> MarkdownBlock {

ParagraphBlock { inlines: md_parse_inline_rest(text: block_src, sp: sp) }
}
}
}

fn ingest_markdown_source_with(src: String, sp: MarkdownSpellings) -> MarkdownDocument {
Expand Down Expand Up @@ -628,14 +640,19 @@ type InlineSplitResult

fn md_split_on_delim_pair(text: String, delim: String) -> InlineSplitResult {
let parts = split(s: text, delimiter: delim)
if parts.length() >= 3 {
let before = parts.first()
let tail = parts.skip(n: 1)
let inner = tail.first()
let after = join(tail.skip(n: 1), delim)
FoundSplit { parts: InlineSplit { before: before, inner: inner, after: after } }
} else {
NoSplit
let tail = parts.skip(n: 1)
match parts.first() {
Absent => NoSplit
Present { value: before } =>
match tail.first() {
Absent => NoSplit
Present { value: inner } =>
if parts.length() >= 3 {
FoundSplit { parts: InlineSplit { before: before, inner: inner, after: join(tail.skip(n: 1), delim) } }
} else {
NoSplit
}
}
}
}

Expand Down Expand Up @@ -689,20 +706,26 @@ fn md_parse_inline_link(text: String, sp: MarkdownSpellings) -> List<MarkdownInl
if open_parts.length() < 2 {
[ TextInline { text: text } ]
} else {
let before_bracket = open_parts.first()
match open_parts.first() {
Absent => [ TextInline { text: text } ]
Present { value: before_bracket } => {
let after_bracket = join(open_parts.skip(n: 1), sp.link_text_open)
let close_open_pat = join([sp.link_text_close, sp.link_url_open], "")
let inner_parts = split(s: after_bracket, delimiter: close_open_pat)
if inner_parts.length() < 2 {
[ TextInline { text: text } ]
} else {
let label_text = inner_parts.first()
match inner_parts.first() {
Absent => [ TextInline { text: text } ]
Present { value: label_text } => {
let url_and_rest = join(inner_parts.skip(n: 1), close_open_pat)
let url_parts = split(s: url_and_rest, delimiter: sp.link_url_close)
if url_parts.length() < 2 {
[ TextInline { text: text } ]
} else {
let url = url_parts.first()
match url_parts.first() {
Absent => [ TextInline { text: text } ]
Present { value: url } =>
let after_link = join(url_parts.skip(n: 1), sp.link_url_close)
concat(
md_text_inline_if_nonempty(s: before_bracket),
Expand All @@ -715,6 +738,11 @@ fn md_parse_inline_link(text: String, sp: MarkdownSpellings) -> List<MarkdownInl
md_parse_inline_rest(text: after_link, sp: sp)
)
)
}
}
}
}
}
}
}
}
Expand Down
24 changes: 22 additions & 2 deletions dag/extdeps/languages/yaml/ingest.dag
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,27 @@ fn yaml_collect_literal_lines_from(lines: List<String>, index: Int, content_inde
}
}

// THE Absent ARMS BELOW ARE UNREACHABLE, AND THEY REFUSE RATHER THAN SUBSTITUTE.
// Every optional here is `split(...).first()`, and `split` cannot return an empty
// list -- on the empty string it returns [""] -- so Absent cannot occur. That
// non-emptiness is a property of split's IMPLEMENTATION that its return type
// `List<T>` does not carry, which is exactly why these positions are diagnosed at
// all: nothing enforces the property the code relies on.
//
// The arms therefore refuse instead of substituting a plausible value. The choice
// is only free while the unreachability argument holds, so it is made for the case
// where that argument is WRONG -- a reimplemented split, a different producer, a
// caller passing something that is not a split result. A refusal stops the line
// loudly and located; a fabricated empty value would be the absorbing fallback
// (DESIGN 5). Dissolves when split's return type carries non-emptiness AND these
// callers consume it -- see gunbc.guarantee_stall split_non_emptiness_unmodelled_stall.
fn yaml_parse_mapping_entry(lines: List<String>, index: Int, indent: Int) -> YamlEntryResult {
let content = yaml_strip_indent(line: yaml_line_at(lines: lines, index: index), indent: indent)
let parts = split(s: content, delimiter: ": ")
if parts.length() > 1 {
let key = parts.first()
match parts.first() {
Absent => YamlEntryRejected { reason: concat("malformed mapping entry: ", content) }
Present { value: key } =>
let rest = join(parts.skip(n: 1), ": ")
if yaml_has_unmodeled_inline_comment(text: rest) {
YamlEntryRejected { reason: "inline YAML comments after values are not modeled" }
Expand All @@ -197,6 +213,7 @@ fn yaml_parse_mapping_entry(lines: List<String>, index: Int, indent: Int) -> Yam
} else {
ParsedYamlEntry { entry: kv(key: key, value: yaml_parse_scalar_text(text: rest)), next_index: index + 1 }
}
}
} else if ends_with(s: content, suffix: ":") {
let key = substring(s: content, start: 0, end: content.length() - 1)
if yaml_has_line_at(lines: lines, index: index + 1) && (yaml_indent_at(lines: lines, index: index + 1) == indent + 2) {
Expand All @@ -216,7 +233,9 @@ fn yaml_parse_mapping_entry(lines: List<String>, index: Int, indent: Int) -> Yam
fn yaml_parse_mapping_entry_from_text(text: String, lines: List<String>, index: Int, indent: Int) -> YamlEntryResult {
let parts = split(s: text, delimiter: ": ")
if parts.length() > 1 {
let key = parts.first()
match parts.first() {
Absent => YamlEntryRejected { reason: concat("malformed mapping entry: ", text) }
Present { value: key } =>
let rest = join(parts.skip(n: 1), ": ")
if yaml_has_unmodeled_inline_comment(text: rest) {
YamlEntryRejected { reason: "inline YAML comments after values are not modeled" }
Expand All @@ -228,6 +247,7 @@ fn yaml_parse_mapping_entry_from_text(text: String, lines: List<String>, index:
} else {
ParsedYamlEntry { entry: kv(key: key, value: yaml_parse_scalar_text(text: rest)), next_index: index + 1 }
}
}
} else if ends_with(s: text, suffix: ":") {
let key = substring(s: text, start: 0, end: text.length() - 1)
if yaml_has_line_at(lines: lines, index: index + 1) && (yaml_indent_at(lines: lines, index: index + 1) == indent + 4) {
Expand Down
Loading
Loading