check: bare contextual cases beside .Case, and the bare-case lint rule (CLOSED-TRAITS 1a-1) #743

Closed
opened 2026-11-13 12:39:36 +00:00 by orion · 13 comments
Collaborator

Context

Step 1a-1 of #713, cut as its own issue. docs/design/CLOSED-TRAITS.md (accepted) removes the leading dot: a case is written bare where the expected type names it. The record counted about 8,000 .Case sites when it was written; the audit of 2026-11-13 counts 11,844 in 500 .trb files, 529 in Markdown and 1,027 uses of the static-member shorthand .member. Every week without commit 1 adds sites that commit 2 has to migrate.

Source

  • Cleanup audit 2026-11 (#742), finding F1 and F2; the report is docs/project/2026-11-cleanup-audit.md.
  • CLOSED-TRAITS.md 9.2, commit 1 ("teach both forms").

Goal

The compiler resolves a bare contextual case by the rule of decision 6.2 beside .Case, which keeps working, and the lint rule bare-case reports the dot form and fixes it. Nothing is refused and nothing in the repository is migrated yet.

Design record point

docs/design/CLOSED-TRAITS.md: 6.1 (where a case is written bare), decision 6.2 (the resolution rule), 6.3, 6.8 (the messages), section 8 (tooling), 9.2 commit 1, 9.4 (sizes: 600-900 lines by hand, about 400 lines of tests).

Acceptance criteria

  • A bare case resolves by the rule of 6.2 at every position 6.1 names (construction, pattern, argument, return, comparison), on tier A and tier B; conformance programs pin each position
  • The collisions of 6.2 and 6.3 (a binding or a type in scope with the name of a case) resolve as the record says, and the messages of 6.8 are pinned by tests
  • .Case and .member still compile unchanged; the parser still reads a leading . in a match body as an arm (9.2, the note under commit 2)
  • torb lint --rule bare-case reports every .Case; --fix removes the dot where the bare name resolves to the same case and writes Owner.Case where it would collide; a second run changes nothing
  • The fix of the lint rule self-name writes the bare form in a pattern (docs/tooling/torb-lint.md lines 79-80 say .Circle(radius) today), and the page says so
  • Completion and highlighting offer and mark a bare case (section 8)
  • No source of compiler/, std/, examples/ or tests/ is migrated in this PR beyond the new tests; no file under seed/ changes
  • The four gates and the fixpoint are green

Dependencies

None. Blocks 1a-seed (the owner's step) and through it 1a-2 of #713.

Seed

No seed change in this PR. After it is on main the owner refreshes and publishes the seed (step 1a-seed); 1a-2 waits for that seed.

Size

One PR, two commits: the resolution with its messages and tests, then the lint rule with completion and highlighting.

## Context Step 1a-1 of #713, cut as its own issue. `docs/design/CLOSED-TRAITS.md` (accepted) removes the leading dot: a case is written bare where the expected type names it. The record counted about 8,000 `.Case` sites when it was written; the audit of 2026-11-13 counts 11,844 in 500 `.trb` files, 529 in Markdown and 1,027 uses of the static-member shorthand `.member`. Every week without commit 1 adds sites that commit 2 has to migrate. ## Source - Cleanup audit 2026-11 (#742), finding F1 and F2; the report is `docs/project/2026-11-cleanup-audit.md`. - CLOSED-TRAITS.md 9.2, commit 1 ("teach both forms"). ## Goal The compiler resolves a bare contextual case by the rule of decision 6.2 beside `.Case`, which keeps working, and the lint rule `bare-case` reports the dot form and fixes it. Nothing is refused and nothing in the repository is migrated yet. ## Design record point `docs/design/CLOSED-TRAITS.md`: 6.1 (where a case is written bare), decision 6.2 (the resolution rule), 6.3, 6.8 (the messages), section 8 (tooling), 9.2 commit 1, 9.4 (sizes: 600-900 lines by hand, about 400 lines of tests). ## Acceptance criteria - [ ] A bare case resolves by the rule of 6.2 at every position 6.1 names (construction, pattern, argument, return, comparison), on tier A and tier B; conformance programs pin each position - [ ] The collisions of 6.2 and 6.3 (a binding or a type in scope with the name of a case) resolve as the record says, and the messages of 6.8 are pinned by tests - [ ] `.Case` and `.member` still compile unchanged; the parser still reads a leading `.` in a `match` body as an arm (9.2, the note under commit 2) - [ ] `torb lint --rule bare-case` reports every `.Case`; `--fix` removes the dot where the bare name resolves to the same case and writes `Owner.Case` where it would collide; a second run changes nothing - [ ] The fix of the lint rule `self-name` writes the bare form in a pattern (`docs/tooling/torb-lint.md` lines 79-80 say `.Circle(radius)` today), and the page says so - [ ] Completion and highlighting offer and mark a bare case (section 8) - [ ] No source of `compiler/`, `std/`, `examples/` or `tests/` is migrated in this PR beyond the new tests; no file under `seed/` changes - [ ] The four gates and the fixpoint are green ## Dependencies None. Blocks 1a-seed (the owner's step) and through it 1a-2 of #713. ## Seed No seed change in this PR. After it is on `main` the owner refreshes and publishes the seed (step 1a-seed); 1a-2 waits for that seed. ## Size One PR, two commits: the resolution with its messages and tests, then the lint rule with completion and highlighting.
Author
Collaborator

After merge: Orion refreshes and publishes the seed (sh tools/refresh-seed.sh on main with tier A green, then the forge seed workflow; CLOSED-TRAITS 9.2) before phase 1a-2 starts. Owner go: Torben 2026-11-13. Loop: ping Orion in the PR when this is merged; do not start 1a-2 before the new seed is published.

After merge: Orion refreshes and publishes the seed (`sh tools/refresh-seed.sh` on main with tier A green, then the forge `seed` workflow; CLOSED-TRAITS 9.2) before phase 1a-2 starts. Owner go: Torben 2026-11-13. Loop: ping Orion in the PR when this is merged; do not start 1a-2 before the new seed is published.
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-14T01:00:00Z

[loop:torbscript] claim implement by session:loop-torbscript-20261113 until 2026-11-14T01:00:00Z
Author
Collaborator

[loop:torbscript] implement: checkpoint, working on branch orion/743-bare-case (not pushed yet). Checker resolution (name.trb, pattern.trb) written; remaining for commit 1: the == left-operand rule, tests, completion/highlight. Commit 2 (bare-case lint, self-name fix, docs) follows. Verification is CI only.

[loop:torbscript] implement: checkpoint, working on branch `orion/743-bare-case` (not pushed yet). Checker resolution (name.trb, pattern.trb) written; remaining for commit 1: the `==` left-operand rule, tests, completion/highlight. Commit 2 (bare-case lint, self-name fix, docs) follows. Verification is CI only.
Author
Collaborator

[loop:torbscript] implement: PR #765 open on loop/743-bare-case, two commits. First CI run found seed-parser errors (command calls in conditions and interpolations) and a stale pdisc stamp; both fixed and pushed, CI rerunning. next: review once CI is green

[loop:torbscript] implement: PR #765 open on loop/743-bare-case, two commits. First CI run found seed-parser errors (command calls in conditions and interpolations) and a stale pdisc stamp; both fixed and pushed, CI rerunning. next: review once CI is green
Author
Collaborator

[loop:torbscript] implement: PR #765 open, CI pending (bootstrap, pdisc, commit messages, playground and JavaScript conformance green; tier A, PHP conformance and gates still running), next: waiting (CI runner queue)

[loop:torbscript] implement: PR #765 open, CI pending (bootstrap, pdisc, commit messages, playground and JavaScript conformance green; tier A, PHP conformance and gates still running), next: waiting (CI runner queue)
Author
Collaborator

[loop:torbscript] release implement: PR #765 open on loop/743-bare-case, review requested, CI still running after 30 minutes

[loop:torbscript] release implement: PR #765 open on loop/743-bare-case, review requested, CI still running after 30 minutes
Author
Collaborator

[loop:torbscript] claim review by session:loop-torbscript-20261113 until 2026-11-13T21:27Z

[loop:torbscript] claim review by session:loop-torbscript-20261113 until 2026-11-13T21:27Z
Author
Collaborator

[loop:torbscript] review: tier A failed on the PR itself (not inherited): three tests, formatter canon on five files, a stale docs index and skills, and a book output; fixed with a checker message for an unknown bare case with fields, two test corrections, formatter output, regenerated docs and skills, rebased on main, head 81d2b9f7, CI pending after 30 min (all jobs queued), next: waiting (CI and review)

[loop:torbscript] review: tier A failed on the PR itself (not inherited): three tests, formatter canon on five files, a stale docs index and skills, and a book output; fixed with a checker message for an unknown bare case with fields, two test corrections, formatter output, regenerated docs and skills, rebased on main, head 81d2b9f7, CI pending after 30 min (all jobs queued), next: waiting (CI and review)
Author
Collaborator

[loop:torbscript] release review: CI of head 81d2b9f7 still running, argus review request open

[loop:torbscript] release review: CI of head 81d2b9f7 still running, argus review request open
Author
Collaborator

[loop:torbscript] claim review by session:loop-torbscript-20261113 until 2026-11-14T01:20:00Z

[loop:torbscript] claim review by session:loop-torbscript-20261113 until 2026-11-14T01:20:00Z
Author
Collaborator

[loop:torbscript] review: rebased loop/743-bare-case onto main f4bbbdc9 (#767, #768 landed). One conflict, the CONCEPT.md body_hash in .pdisc-sidecar.yaml: took main's side, restamped CONCEPT.md with pdisc.py (pdisc.py check green locally; folded into the last commit, history still 3 commits). Force-pushed with --force-with-lease, new head a7b780b8. CI (gates, commit messages, touches, pdisc) was still pending after about 35 minutes (runner queue), so no formatter result yet for tests/conformance/bare-case-positions.trb, next: waiting (CI and review)

[loop:torbscript] review: rebased `loop/743-bare-case` onto main f4bbbdc9 (#767, #768 landed). One conflict, the CONCEPT.md body_hash in `.pdisc-sidecar.yaml`: took main's side, restamped CONCEPT.md with pdisc.py (`pdisc.py check` green locally; folded into the last commit, history still 3 commits). Force-pushed with --force-with-lease, new head a7b780b8. CI (gates, commit messages, touches, pdisc) was still pending after about 35 minutes (runner queue), so no formatter result yet for tests/conformance/bare-case-positions.trb, next: waiting (CI and review)
Author
Collaborator

[loop:torbscript] release review: PR #765 was rebased to a7b780b8 after it stopped being mergeable; argus is asked to review the new head and land it once CI is green.

[loop:torbscript] release review: PR #765 was rebased to a7b780b8 after it stopped being mergeable; argus is asked to review the new head and land it once CI is green.
argus closed this issue 2026-11-14 01:07:18 +00:00
Author
Collaborator

Post-merge follow-up (orion, PR #765 merged as a7b780b86a by argus). Merged code is in no release yet. Next step: cut the next stable release. release.yml runs on a v0.MINOR.PATCH tag on main, and images.yml then publishes cr.torb.dev images. The version-bump PR (chore(release), project.trb, compiler/project.trb, editors/vscode/package.json, compiler/src/package/version.trb) is not opened in this unattended run: it needs argus as reviewer and gates that only CI runs, and I cannot merge it myself. Open item: version bump PR, reviewer argus, then tag after merge and verify images.yml. No orion/tasks task references this PR, so this comment is the record.

Post-merge follow-up (orion, PR #765 merged as a7b780b86a35adc82695428d3cef18836855fb83 by argus). Merged code is in no release yet. Next step: cut the next stable release. release.yml runs on a v0.MINOR.PATCH tag on main, and images.yml then publishes cr.torb.dev images. The version-bump PR (chore(release), project.trb, compiler/project.trb, editors/vscode/package.json, compiler/src/package/version.trb) is not opened in this unattended run: it needs argus as reviewer and gates that only CI runs, and I cannot merge it myself. Open item: version bump PR, reviewer argus, then tag after merge and verify images.yml. No orion/tasks task references this PR, so this comment is the record.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#743
No description provided.