Skip to content

feat: import Žiz design drop (DESIGN, TRIAGE, JEG, grammar, ziz0 bootstrap) - #12

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/import-design-drop
Oct 6, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
feat/import-design-drop

Conversation

@hyperpolymath

Copy link
Copy Markdown
Contributor

Moves the Žiz design material (ziz-drop/ from metadatastician/standards#1048) into this repo's root, as HANDOFF.adoc instructs.

Source reconciliation

The #1048 branch was deleted after merge and ziz-drop/ is no longer on standards main. The 17 files at its head e56b8bf were diffed against the owner's newer local copy:

  • Identical (modulo blank lines): JEG.adoc, grammar.js, scanner.c, corpus, examples, JSON.
  • Newer locally (applied): owner decisions 2026-09-24 in DESIGN/TRIAGE/README; defmacro, pair?/sym?/str?, self-evaluating keywords in ziz0.chpl; lambda.ziz in the examples recipe.
  • Only local (added): HANDOFF.adoc, lib/dialectic.ziz, examples/lambda.ziz, docs/jeg-schema.a2ml.
  • Stale text fixed: README toolchain roles, TRIAGE "roles undecided"/"definition still needed", DESIGN "not yet written" + a run-on line.

Template collisions

  • README.adoc: the unfilled template README ({{PROJECT_NAME}}) is replaced by the Žiz README.
  • Justfile: the template's placeholder build recipe body is replaced with chpl --fast bootstrap/ziz0.chpl -o ziz0; examples, grammar, ascii-check appended. The fragment file is not committed.

Verified (tree-sitter 0.26.11)

  • tree-sitter generate ✓, tree-sitter test 7/7 ✓
  • every examples/*.ziz + lib/dialectic.ziz parses with 0 ERROR/MISSING; a broken control input still fails
  • scanner.c compiles with -Wall -Wextra -Werror

Three bugs fixed to get there:

  1. Parser hung forever on any input: the scanner emits a zero-width _newline at EOF and source_file accepted it repeatedly.
  2. A newline after a comment-only line was unlexable (\n was not an extra). Now an extra, as in tree-sitter-python.
  3. Mid-file dedents were lost (e.g. print in layout.ziz nested inside define), and bracket counting drifted because the scanner isn't called inside lists. Rewritten to owe NEWLINE DEDENT NEWLINE… zero-width; bracket counting removed.

grammar/test/corpus/layout-regressions.txt pins these; 2/7 fail against the original scanner. Generated parser output is git-ignored (just grammar regenerates).

NOT verified

  • bootstrap/ziz0.chpl has never been compiled: no chpl available. just build / just examples and the expected 3628800 / JEG dump / (var y) (var z) (var q) are unverified.
  • Deleting the two inherited branches at source in hyperpolymath/rsr-template-repo — not checked (they don't exist here).
  • just ascii-check always exits 0 (… || true), so it reports but cannot fail; it currently flags only non-ASCII inside ; comments.
  • Still pending owner decision: where docs/jeg-schema.a2ml is registered (HANDOFF §Pending).

🤖 Generated with Claude Code

…strap)

Moves the ziz-drop material from metadatastician/standards#1048 to the repo
root. The PR branch was deleted after merge, so the 17 files at its head
(e56b8bf) were reconciled against the owner's newer local copy, which adds
HANDOFF.adoc, lib/dialectic.ziz, examples/lambda.ziz, docs/jeg-schema.a2ml,
defmacro + pair?/sym?/str? + self-evaluating keywords in ziz0.chpl, and the
2026-09-24 owner decisions in DESIGN/TRIAGE/README.

Grammar verified with tree-sitter 0.26.11 (generate OK, 7/7 corpus tests,
all examples parse clean). Three bugs fixed on the way:
- parser looped forever at EOF (zero-width _newline accepted by source_file)
- a newline after a comment-only line was unlexable (\n not an extra)
- DEDENTs owed after a mid-file NEWLINE were lost; bracket counting drifted
New corpus file layout-regressions.txt pins them (2/7 fail on the old scanner).

ziz0.chpl has NOT been compiled: no Chapel compiler was available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1ef6cf2b-d0f2-4a0a-8483-a2c35bf66d04
📥 Commits

Reviewing files that changed from the base of the PR and between 1f8d3ef and 034c948.

📒 Files selected for processing (22)
  • DESIGN.adoc
  • HANDOFF.adoc
  • Justfile
  • README.adoc
  • TRIAGE.adoc
  • bootstrap/ziz0.chpl
  • docs/JEG.adoc
  • docs/jeg-schema.a2ml
  • examples/fact.ziz
  • examples/hello.ziz
  • examples/lambda.ziz
  • examples/layout.ziz
  • examples/quote-eval.ziz
  • examples/reflexive.ziz
  • grammar/.gitignore
  • grammar/grammar.js
  • grammar/package.json
  • grammar/src/scanner.c
  • grammar/test/corpus/basics.txt
  • grammar/test/corpus/layout-regressions.txt
  • grammar/tree-sitter.json
  • lib/dialectic.ziz
 ______________________________________________________
< Choose your fighter: Bug Hunter vs. Feature Creator. >
 ------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 6, 2026 08:16
@hyperpolymath
hyperpolymath merged commit 743324d into main Oct 6, 2026
57 of 65 checks passed
@hyperpolymath
hyperpolymath deleted the feat/import-design-drop branch October 6, 2026 08:16
hyperpolymath added a commit that referenced this pull request Oct 6, 2026
…n fail (#13)

Follow-up to #12. `bootstrap/ziz0.chpl` had never been through a
compiler; it now builds with **Chapel 2.10.0** and runs.

## ziz0 fixes (mechanical, no restructuring — per HANDOFF.adoc)
- identifiers that are Chapel keywords: `out`→`buf`, `by`→`agent`,
`index`→`keyIndex`; `for _ in` → named loop var
- `x.car!`/`cdr!`/`body!` yield a *borrowed* `Value`; added
`carV`/`cdrV`/`bodyV` shared accessors, `try! x: V` for the other two
unwraps
- `map` inserts via `add`/`addOrReplace` (indexing a missing key throws
in 2.x)
- concrete `enum P` (`Add = 0`) so prim ids cast; `in` intent on `mkEnv`

## Verified
| Example | Output |
|---|---|
| `fact.ziz` | `3628800`, `(sym:fact :arity 1) ; asserted=1 observed=11`
|
| `lambda.ziz` | `(var y)` `(var z)` `(var q)` — λ-calculus + Y smoke
test |
| `quote-eval.ziz` | `(+ 1 2 3)` `+` `6` `15` |
| `reflexive.ziz`, `hello.ziz` | `84`, `hello, ziz` |
| `lib/dialectic.ziz` | `defmacro` expands; `(sublate 40 2)` → `42`
after `set-resolver!`; `:expanded-by` edges recorded |

`layout.ziz` is not run: the off-side reader is milestone 1 by design.

## Justfile
- `build` checks `chpl` is **2.10** (`chapel_version`) and fails with
install guidance otherwise
- `examples-check` asserts the expected lines above
- `test` = `grammar` + `examples-check` + `ascii-check` (replaces the
template's always-fail stub)
- `ascii-check` rewritten: a small lexer over `.ziz` files, fails on
non-ASCII outside `"strings"` and `;` comments. The old recipe ended in
`|| true` and could never fail.

Planted-fault controls, each confirmed to fail: `λ` as an identifier →
ascii-check rc=1 (non-ASCII inside a string/comment passes); wrong
expected value → examples-check rc=1; fake `chpl 2.9.1` → build rc=1.
`just test` → rc=0.

Docs: README status + tour corrected to the real JEG dump (25 judgements
/ 206 edges, not "6 / 23"); README §Building; TRIAGE/HANDOFF status.

## Not in this PR
- CI does not build ziz0 yet (no Chapel in the runners); `just test` is
local-only for now.
- A2ML → `.deed`: blocked, see the session report — the translator fails
closed because ziz's descriptiles still carry the template identity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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