Skip to content

Drop workarounds for issues that are now fixed - #3

Merged
DerekCorniello merged 3 commits into
mainfrom
chore/drop-fixed-workarounds
Aug 19, 2026
Merged

Drop workarounds for issues that are now fixed#3
DerekCorniello merged 3 commits into
mainfrom
chore/drop-fixed-workarounds

Conversation

@DerekCorniello

Copy link
Copy Markdown
Contributor

Three rough edges these examples were written around have landed, so the comments explaining them now describe a compiler that no longer exists.

http_server read fields with stringify, which returns the JSON encoding of a value - so the path arrived as "/echo" with its quotes and the router compared against "\"/echo\"". The typed accessors (muxlang/mux-compiler#392) return the value itself, so field uses as_string and the router matches /echo.

status is a number in the document, so it reads through a new int_field using as_int rather than as_string - which accessor to reach for is decided by what the field holds, not by what you want to do with it afterwards. Each returns an optional, because a field holding a different kind than expected is ordinary when reading a document you did not write.

route_finder imported std.dsa.collection.Collection only because Graph implements it and importing the type without it was an internal compiler error. An import now brings along the interfaces the type implements (muxlang/mux-compiler#391), so the line goes. The std.dsa.* wildcard stays - algorithm.reverse comes from it.

Expected output changes with the quotes: server handled GET /echo.

Corpus passes 12/12 locally against mux-compiler main.

Three of the rough edges these examples were written around have landed, and
the comments explaining them are now describing a compiler that no longer
exists.

http_server read fields with `stringify`, which returns the JSON ENCODING of a
value - so the path arrived as `"/echo"` with its quotes and the router had to
compare against `"\"/echo\""`. The typed accessors (#392) return the value
itself, so `field` uses `as_string` and the router matches `/echo`. `status` is
a number in the document, so it reads through `as_int` rather than `as_string`:
which accessor to reach for is decided by what the field holds. Each returns an
optional, because a field holding a different kind than expected is ordinary
when reading a document you did not write.

route_finder imported `std.dsa.collection.Collection` only because `Graph`
implements it and importing the type without it was an internal compiler error.
An import now brings along the interfaces the type implements (#391), so the
line goes. The `std.dsa.*` wildcard stays - `algorithm.reverse` comes from it.

Expected output changes with the quotes: `server handled GET /echo`.
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown

Greptile Summary

The PR removes obsolete compiler workarounds now that typed JSON accessors and transitive interface imports are supported.

  • Updates the HTTP server to decode string and integer fields with typed accessors.
  • Updates routing and expected output to use unquoted request values.
  • Removes the redundant Collection import and all stale guidance requiring it.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
AGENTS.md Replaces obsolete import and multiline-expression guidance with current compiler behavior.
examples/http_server/main.mux Replaces JSON serialization-based field reads with typed string and integer accessors and routes using decoded paths.
examples/http_server/README.md Documents typed JSON field access and removes the obsolete quoted-string workaround.
examples/http_server/expected_output.txt Updates the recorded output to reflect decoded method and path strings.
examples/route_finder/main.mux Removes the redundant Collection import while retaining imports used by the graph, queue, and reverse operation.
examples/route_finder/README.md Removes the stale warning that importing Graph without Collection causes a compiler error.

Reviews (3): Last reviewed commit: "Merge branch 'main' into chore/drop-fixe..." | Re-trigger Greptile

Comment thread examples/route_finder/main.mux
Removing the Collection import left two files still telling readers it was
required: route_finder's README called the four imports load-bearing and
named the internal compiler error, and AGENTS.md listed the import as a hard
rule. Contradicting the code they document is worse than either state alone.

AGENTS.md carried a second stale rule while I was in there - expressions
have been able to span an open bracket since #395 - and gained the one that
replaced the ICE: a namespace import binds the namespace, so after
`import std.net` the type is `net.TcpListener` and the bare name is not in
scope.

Caught by Greptile on the PR.
@DerekCorniello
DerekCorniello merged commit 190d87e into main Aug 19, 2026
2 checks passed
@DerekCorniello
DerekCorniello deleted the chore/drop-fixed-workarounds branch August 19, 2026 22:32
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