Skip to content

Land mainstream-usability P0-P5 on the v0.2 main line - #58

Open
Hyper66666 wants to merge 19 commits into
mainfrom
codex/mainstream-usability-p0-p5
Open

Land mainstream-usability P0-P5 on the v0.2 main line#58
Hyper66666 wants to merge 19 commits into
mainfrom
codex/mainstream-usability-p0-p5

Conversation

@Hyper66666

Copy link
Copy Markdown
Owner

Summary

  • Land the archived OpenSpec change mainstream-usability-p0-p5 on current main: enum Option/Result, for over collections, quiet English sgc diagnostics, vec! / format print / {:?} / if let, flagship guard-clause rewrites, and width-aware sgfmt.
  • Merge origin/main (v0.2 release evidence) into this branch. Keep --verbose plus --runtime-mode, keep main's Vec-based HTTP router / serve_http_timeout, and convert new Result { ... } struct literals back to Ok/Err.
  • Fill DropBinding live-flag fields after the merge and accept flagged (not unguarded) parent drop glue when both if/else arms move an owned aggregate.

Test plan

  • cargo test -p sengoo-compiler --lib (1173 passed locally after the merge fixes)
  • cargo test -p sgc --test quiet_output — check/json cases passed; sgc run failed locally with missing MSVC headers (environment), not an assertion on quiet output
  • CI: compiler lib, sgc, sgpm, sglsp, sgfmt, clippy -D warnings
  • Realworld locked loop, especially http-echo-service after the router/Ok/Err rewrite

Hyper66666 and others added 19 commits July 26, 2026 22:29
One TLS connection carries a routed buffered answer, a chunked streaming
response whose finish() keeps the connection alive, and a routed
Connection: close answer (tls_composes_with_router_keep_alive_and_streaming,
Windows Schannel). Locked realworld loop re-run green; matrix and
network-runtime constraints updated to current behavior. Closes
http-production-serving tasks 5.4 and 7.4.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Six priorities from verified probes: P0 Option/Result as enums (root
cause: struct-shaped optionals force sentinel payloads), P1 for over
collections, P2 quiet output and one diagnostic language, P3 everyday
syntax, P4 idiomatic flagship examples, P5 width-aware sgfmt blocks.
Records the sgfmt collapse root cause (max_width parsed but never read)
and the pre-existing sgpm v1 lockfile ordering defect as D7/D8.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Successful build/run prints only program output plus one result line;
cache, workset, frontend session/scheduler, generic-instance counters,
and pass-through clang include-path warnings move behind --verbose.
Chinese typeck messages (undefined variable/type, unknown method,
argument count) become English with stable codes unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
format_block_inline falls back to one-statement-per-line rendering when
the inline form would exceed max_width, activating the parsed-but-unread
option for every block form (if/while/for/loop/match arms/async/
parallel/try). Short blocks stay inline byte-identical; width budget
counts indent and header prefix. 18 formatter tests cover breaking,
nesting, else-if chains, and idempotence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
load_config drops from one 700-char five-deep line to guard clauses with
early return plus extracted helpers; behavior unchanged, locked loop
green (check, 3 tests, fmt).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Generic enums monomorphise per instance: MIRType::Enum carries the
instance name, EnumDef keeps HIR payload shapes and instantiates them
with a recursion guard. Payload-free variants infer their arguments from
the expected type (annotated let, return position) exactly like struct
literals. Bare Some/None/Ok/Err resolve to their unique declaring enum
in expressions and match patterns, with ambiguous-enum-variant when two
enums share a name; lexical scope still wins. Exhaustiveness treats a
bare variant arm as that variant, not a catch-all. Single-element
payloads bind whole in match arms (a String payload no longer splits
into word fields). The ? operator propagates enum-shaped Result and
Option unchanged. Six lowering regression tests pin these paths;
compiler suite 1122 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A v1 lockfile stores source as a string where v2 expects a table, so
deserializing the v2 shape first rejected every v1 lock as 'out of
date' while update --check called the same file current. The version
is now probed from a toml::Value first: non-v2 documents return the
graceful empty pin set the existing check intended, unreadable files
report the real IO error, and unparseable documents report 'malformed'
with the file named instead of a false staleness claim. Regression
tests cover v1 tolerance, malformed rejection, and the missing-file
path; the stale-garbage integration test now expects the malformed
wording. 5 of the 7 previously failing fixtures pass check --locked;
p0-foundations (no lockfile committed) and package-release-loop
(checksum-less registry entry) fail for real, correctly named reasons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical sgfmt -w over the ten files the new max_width rule breaks
differently; workspace-doc-loop/src/lib.sg expands 18 -> 115 lines,
showing how much structure the inline form had collapsed. Behavior
unchanged; sgpm integration and realworld_e2e suites green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep array, slice, and range direct lowering, and add map keys()/values() adapters.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep compiler instrumentation behind --verbose and lock the existing error JSON shape.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Fix for-loop None matching, BTreeMap keys() LLVM types, and the realworld fmt/e2e follow-ups so the section 8 cargo and OpenSpec gates pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
All P0-P5 tasks and section 8 verification gates are done, so move the change into the dated archive.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ility-p0-p5

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	docs/network-runtime.md
#	examples/realworld/SUPPORT_MATRIX.md
#	examples/realworld/http-echo-service/src/main.sg
#	examples/realworld/http-echo-service/tests/http_echo_smoke.sg
#	openspec/changes/archive/2026-07-25-http-production-serving/tasks.md
#	runtime/src/net/http_server.rs
#	tools/sgc/src/cli.rs
#	tools/sgc/src/commands/run.rs
#	tools/stdlib/net.sg
The lambda owned-param drop helper was missing the drop-flag fields main added, so the compiler crate would not build.

Co-authored-by: Cursor <cursoragent@cursor.com>
Main's new parent-drop assertion treated any String_Drop_drop as a leak; flagged glue still emits the call, so require a live-flag guard instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant