Repository navigation
docs: write the October 8 language decisions into the spec - #58
Merged
Merged
Conversation
Problem: the Architect approved a batch of language decisions, and the spec still described several of them the old way, such as one Lean rules file per namespace, foreign objects created where the app starts, and structs that change through copy-on-write. Solution: docs/spec.md states each decision in the section it belongs to, adds section 32 (Modules), rewrites section 28 and 28.1 (Lean files), and applies the orchestrator's round-2 rulings. Records 050 to 067 are new. Records 001, 014, 029, 030, 034, 040, 041 and 043 quoted replaced text and now match the spec.
…dings Problem: section 28.1 showed no module law's proof, because a module law's Lean name was undecided. Sections 12, 15 and 28.1 still held Open headings that named standard library APIs, which the library specifies itself. Solution: a module law's Lean statement is named by its namespace, Module and the law's name, and section 28.1 proves App.Tenant.Store.Module.receiptMatchesRefunds. The Open headings in sections 12, 15 and 28.1 are gone. Records 057 and 066 state both rules.
Problem: section 28.1's Module.lean example wrote its structure rule with Sharp.importsOf, an API the standard library has not specified (php-sharp #53). Solution: section 28.1 states the rule in words: "App.Tenant.Store imports only App.Tenant.Community and App.Shared.Schema." The Lean example keeps only the module law's proof.
This was referenced Oct 8, 2026
feat: check every method's effects through foreign objects, uses clauses and extern declarations
#60
Closed
Problem: section 28.1 and record 057 showed only the proof lines, so a reader who copied a Lean example got a file that does not compile without its import and open lines. Solution: each proof example opens with its import and open Sharp, the shape sharp/agents/130-lean-design/design.md gives in "The proof file". Money.lean imports Code.App.Shared.Money. Module.lean imports Code.App.Tenant.Store.Module, because Module.sharp states a law, and holds no rule code, so it imports no Sharp.Lean.Facts.
Problem: round 5 added import and open lines to record 057's rejected app/Tenant/Store.lean example, so the record no longer showed the old layout as it was. Solution: the rejected example drops those two lines again and matches its first version.
Brings in the events rewrite (#51). In section 29, a class's effects now include the events its methods emit, and a foreign object is still created in a module binding, not once where the app starts. docs/ └── spec.md* <- section 29 keeps both the events and the module rule
The spec still gave unclassified built-in functions a catch-all effect,
Php, after the rulings removed it. A method calling one could never be
pure, and the signature could not say what the call does. Every built-in
now ships an extern declaration with its real effect, so the effect is
always known, and a missing declaration is a compile error that names it.
A plain PHP object a declared call returns had no effect, so
StripeClient.charges().create(...) could not fit uses Http. It now carries
the effect of the call that returned it, and an extern on the returned
class wins, as Kotlin treats Java's return values.
docs/
├── spec.md* <- section 29 drops Php, adds returned objects
└── decisions/
└── 043-built-in-effects.md* <- every built-in declared, no catch-all
heyJordanParker
added a commit
that referenced
this pull request
Oct 8, 2026
Brings in the October 8 decisions (#58). Section 27 keeps master's Lean wording: a law without a proof stops the file, and the old "rules file stops its namespace" sentence is gone. docs/ └── spec.md* <- section 27 takes the new Lean rule beside the refusal list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writes the October 8 language decisions into
docs/spec.md, adds section 32 (Modules), rewrites section 28 and 28.1 (Lean files), and adds records 050 to 067 indocs/decisions/. Records 001, 014, 029, 030, 034, 040, 041 and 043 quoted replaced text and now match the spec.Round-2 rules
point.x = 5andreadonly structare compile errors, and the copy-on-write bullets and the php-src PR [RFC] Implement structs (WIP) php/php-src#13800 reference are gone (section 10).mago compilewrites.sharp/, and also creates a missing.leanfile beside a class that has a law, never rewriting an existing one (section 27).module { … }.module : App.Shopcompiles (section 23).new (expr)(args)is the form for a class value:new type(key)is nownew (type)(key)everywhere (section 25).private readonly Money totalis a compile error (section 13).Environment.require("NAME")is a static method, listed withEnvironment's other members (section 29).foreignobject is created, and "created once" is gone (sections 29 and 32).PaginatedList<DatabaseEntity>, and a method that takes any page is generic (section 11).ReflectionObject::getTypeArguments()(section 11).Consolecovers standard output and standard error,Filescovers every other file, andProcesscoversexit, and both new effects join section 29's list.Factory<T>ispublic interface Factory<T> { T create(); }, bound as inscoped Mailer = MailerFactory;(section 32).scopedlifetime is one HTTP request, one queued job or one console command run, started and ended by the host (section 32).Module.<Environment>.sharp, picked byAPP_ENV, and a test module is declared in the test file that uses it (section 32).App.Shared.Money.addKeepsCurrency(section 28.1).Round-3 rules
Moduleand the law's name, and section 28.1 provesApp.Tenant.Store.Module.receiptMatchesRefundsin the same shape as the class law.theorem addKeepsCurrency : App.Shared.Money.addKeepsCurrency, the bound on the genericcount, andPoint's{ get; init; }withwith.keys()andentries(), the dispatcher, the structure facts). The library specifies those itself, tracked in php-sharp feat: raise events with emit and run listeners named by on clauses #56 (dispatcher) and feat: check Lean laws and structure rules when PHP# compiles #53 (structure facts).Round-4 rule
App.Tenant.Storeimports onlyApp.Tenant.CommunityandApp.Shared.Schema.", with noSharp.importsOfcode, because that API is the standard library's to specify (php-sharp feat: check Lean laws and structure rules when PHP# compiles #53).Round-5 rule
import Code.<namespace>.<Class>andopen Sharpincluded, in the shape of the Lean design's "The proof file".Module.leanimportsCode.App.Tenant.Store.Moduleand shows everything except its structure rule, whose Lean form waits on php-sharp feat: check Lean laws and structure rules when PHP# compiles #53.Round-6 rule
app/Tenant/Store.lean, shows that layout exactly as it was, with noimportoropenlines.ConsoleandProcessstay standardforeignclasses.Merge order
PR #51 merges first. Read against #51's head
9234071b57, the two PRs touch adjacent lines in three places. In each one, keep both sides:master's Open line about the dispatcher API. docs: specify events as types that listeners name in a trailing on clause #51 keeps that Open line, and this PR deletes it. Drop it: the dispatcher API is tracked in php-sharp feat: raise events with emit and run listeners named by on clauses #56. docs: specify events as types that listeners name in a trailing on clause #51 has no other Open item there.ConsoleandProcessto "The standard library ships …", and docs: specify events as types that listeners name in a trailing on clause #51 adds its "Eventsis the effect ofemit" paragraph directly after that line.foreignbullet: docs: specify events as types that listeners name in a trailing on clause #51 edits the "A class's effects" bullet, and this PR edits theforeignbullet directly below it.feat/slice-genericsWhen
feat/slice-genericsmerges, it must delete two sentences that contradict records 054 and 061:newyet".