Skip to content

Polish: second cartridge, GUI smoke test, finish .adoc tidy#39

Merged
hyperpolymath merged 27 commits into
mainfrom
claude/dreamy-sagan-1ukmue
Jun 27, 2026
Merged

Polish: second cartridge, GUI smoke test, finish .adoc tidy#39
hyperpolymath merged 27 commits into
mainfrom
claude/dreamy-sagan-1ukmue

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Three small follow-ups, done in turn

1. Second example cartridge — proves the engine is language-agnostic

cartridges/reference/python-ruby.cartridge.json: 6 Python→Ruby transitions spanning cognate (def, string interpolation), false-friend (empty-collection truthiness — [] is falsy in Python, truthy in Ruby), alien-realization (comprehension → block map), novel (Ruby :symbol), and vanished (explicit self parameter). Dogfoods the cartridge contract on a fresh pair. Cartridge invariants went 59 → 107 checks, all green; the CLI/GUI now present 2 packs / 12 correspondences.

2. GUI smoke test

gui/server.js now exports handler + loadCartridges and opens a listener only under import.meta.main — so test/gui_smoke_test.js drives the handler in-process (no socket, --allow-read only): the static shell + #index/#paneForms/#paneClassify, the /app.js bundle, the /api/cartridges shape (every transition has a valid kind + from/to), and a clean 404. 38 checks, all passing. Wired into deno task test (and test:gui) + a just test-gui recipe. Verified the real server still starts via a live probe.

3. Finished the .adoc migration

TOPOLOGY.mdTOPOLOGY.adoc (and corrected its data-flow diagram, which still described the old JS→migration-report pipeline, to the real cartridge→engine→GUI/CLI flow) and TEST-NEEDS.mdTEST-NEEDS.adoc (coverage refreshed to include the GUI smoke test). Root docs are now AsciiDoc end-to-end, except the GitHub-required CODE_OF_CONDUCT.md / SECURITY.md.

Verified

deno fmt --check, deno lint, deno task test (cartridge invariants + GUI smoke), deno task build (2/2 cartridges valid), and a live GUI probe — all green. No dangling links. Licence files untouched.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 27 commits June 18, 2026 10:30
…not translates

Canonical design spec for the comprehension/transfer engine: the
Concept/Form/Transition object model, the levels-of-objects strata, the
Dyadic+Echo formal carrier, and the Rosetta false-friends taxonomy
(cognate / false-friend / antonym / alien-realization / novel / vanished)
as graded Echo fibres.

Also records the engine<->cartridge division of labour, the
overlay-protocol / accessibility / PanLL-emit downstream contracts, and the
knot-theory honesty caveat. JTV grammar v2 is stubbed pending repo access.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…AID config

- Add the missing .machine_readable/6a2 manifests — AGENTIC, NEUROSYM,
  PLAYBOOK — completing the canonical six alongside STATE/META/ECOSYSTEM,
  tuned to the correspondence-engine identity (no-shame voice, classify-not-
  translate, toolchain-deferred build honesty, no-relicense guardrail).
- Add .github/workflows/static-analysis-gate.yml: panic-attack assail +
  hypatia scan + patch-bridge triage. Fails only on critical findings and
  skips gracefully when the binaries are unavailable in the runner.
- Add .machine_readable/ENSAID_CONFIG.a2ml: PanLL / eNSAID per-repo config
  with a correspondence-engine view-layer portfolio.
- Justfile: fix stale panic-attacker -> panic-attack references (tool renamed
  2026-02-08).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…nslate) engine

Bring the public + machine-readable identity into line with the merged
correspondence-model spec (docs/theory/CORRESPONDENCE-MODEL.adoc):

- README.adoc, EXPLAINME.adoc, ROADMAP.adoc — Duolingo/Rosetta-Stone-for-PLs
  framing: a comprehension+transfer engine that *classifies* cross-language
  correspondences (Concept/Form/Transition + six CorrespondenceKinds), not an
  IDE / linter / universal translator. Engine-vs-cartridge split; feeds PanLL;
  no-shame transfer-first pedagogy; HAS accessibility; toolchain honesty.
- CLAUDE.md, .claude/CLAUDE.md — corrected overview + notes; policy tables
  preserved (Deno/Justfile/Zig/Idris2; ReScript banned in new code).
- .machine_readable/{STATE,META,ECOSYSTEM}.a2ml (+ 6a2/ copies) — corrected
  identity/purpose/ADRs/related-projects; filled empty + corrupted fields.

Licence labels left untouched (no relicensing): the pre-existing PMPL badge,
"Palimpsest License (MPL-2.0)" text, and ROADMAP "MPL-2.0-or-later" are flagged
to the owner, not edited. No SPDX identifiers changed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…enceKinds

First slice of the abstraction-model pivot (track 2), authored as the formally-
typed ABI seam per the chosen "Idris2 ABI core first" approach:

- abi.ipkg — Idris2 package (sourcedir src/interface, depends base only)
- src/interface/Abi/Carrier.idr — Relation (refl/sym/trans + isEquivalence) and
  Residue (the Echo-fibre grades: None/Inverted/Lossy/AbsentSource/AbsentTarget)
- src/interface/Abi/Correspondence.idr — Concept/Form/Transition, the six
  CorrespondenceKinds, the Stratum ladder, total pedagogy + residueShape maps,
  and the precise false-friend signature (surface-corresponds AND intention-diverges)
- src/interface/Abi/README.adoc — seam overview + the cite-don't-import licence note

Licence: original MPL-2.0. Grounded in but NOT importing the Dyadic Relation
(proven-tests-and-benches, AGPL-3.0-or-later / son-shared) or the echo-types Echo
fibre — importing AGPL would relicense this MPL-2.0 repo by linkage, so the shapes
are re-expressed as fresh source. abi.ipkg depends on base only.

Verification deferred: no Idris2 in this environment; typecheck via
`idris2 --typecheck abi.ipkg` in a tooled session / CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
Second slice of the abstraction-model pivot (track 2): the Zig FFI side of the
seam, mirroring the Idris2 ABI (src/interface/Abi/) over a C boundary. Per the
estate pattern Idris2 owns the ABI/proofs and Zig owns the FFI; the two describe
one model and must agree.

- src/interface/ffi/src/main.zig — CorrespondenceKind / Pedagogy / Stratum C
  enums + nle_pedagogy_of (total map), nle_residue_is_iso, nle_kind_name,
  nle_is_false_friend (the false-friend signature) and nle_version; unit tests
  mirror the Idris2 semantics.
- src/interface/ffi/test/integration_test.zig — cross-checks against the model.
- src/interface/ffi/build.zig — minimal Zig 0.15.2+ scaffolding.
- src/interface/ffi/README.adoc — seam overview + cite-don't-import licence note.

Licence: original MPL-2.0, no AGPL/echo-types linkage.
Verification deferred: no Zig in this environment; run `zig test src/main.zig`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…fied)

The data-format half of the abstraction model: how community language packs
declare the correspondence FACTS the engine classifies. The kind / residue /
stratum vocabulary mirrors the Idris2 ABI (src/interface/Abi/Correspondence.idr)
and the Zig FFI.

- cartridges/correspondence-cartridge.schema.json — JSON Schema (draft 2020-12):
  transitions of concept / from / to / kind / residue / strata / narrative /
  witness, with enums mirroring the ABI.
- cartridges/reference/worked-examples.cartridge.json — reference pack: one
  transition per CorrespondenceKind (the canonical worked examples).
- cartridges/README.adoc — cartridge-authoring guide + engine/cartridge boundary.
- scripts/validate-cartridges.js — Deno + ajv validator (walks cartridges/).
- Justfile — `just validate-cartridges` recipe.

Verified locally: `deno run -A scripts/validate-cartridges.js` => 1/1 valid
(6 transitions, all six kinds). Fixed a schema bug found while verifying
($schema vs additionalProperties:false).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…-safe

- src/interface/Abi/README.adoc: the ABI typechecks clean under Idris2 0.8.0
  (idris2 --typecheck abi.ipkg; %default total, no escape hatches), verified
  locally — replacing the "not yet typechecked here" caveat.
- Justfile + scripts/validate-cartridges.js: run the validator with --no-lock
  so it no longer perturbs deno.lock.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
- .github/workflows/idris2-abi.yml: builds Idris2 v0.7.0 from source (Chez) and
  runs `idris2 --typecheck abi.ipkg` on ABI changes — turns the local typecheck
  into a CI gate (mirrors the verified-clean local run).
- src/interface/host/Correspondence.affine: the AffineScript host binding — it
  mirrors the ABI types (CorrespondenceKind/Pedagogy/Stratum/Form/Transition)
  and binds the Zig nle_* FFI symbols via `extern fn`. Authored ahead of the
  AffineScript compiler (compiler-gated; not yet compiled); syntax follows the
  estate .affine conventions.
- src/interface/host/README.adoc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
# Conflicts:
#	.github/workflows/idris2-abi.yml
#	cartridges/README.adoc
#	cartridges/correspondence-cartridge.schema.json
#	src/interface/ffi/README.adoc
#	src/interface/host/README.adoc
Replace the single-pane JS-analyser GUI with the browser multi-pane
correspondence workspace — the project's primary surface.

- gui/server.js: Deno server, cartridge-driven (reads cartridges/**/*.cartridge.json),
  no ReScript dependency. Serves the workspace + /api/cartridges.
- gui/app.html: 3-pane shell (index · forms · classification); light/dark;
  accessible (ARIA roles, keyboard nav, >=4.5:1 contrast, reduced-motion).
- gui/app.js: workspace logic + five overlay view-layers (side-by-side / focus /
  glyph / blocks / raw); kind + pedagogy + residue + per-stratum verdicts +
  no-shame narrative; false-friend-signature callout mirroring the ABI.
- gui/README.adoc + `just gui` recipe.

Verified locally (Deno): `deno lint` clean; server serves / and /app.js;
/api/cartridges returns 6 correspondences across all six kinds. Browser
rendering reviewed + lint-clean (headless-DOM test is a follow-up).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
The repo began as ReScript Evangeliser. The engine has been re-pointed to
the correspondence model (Idris2 ABI + Zig FFI + AffineScript host binding)
with a Deno + cartridge-data runtime surface, so the legacy ReScript host —
flagged by the governance anti-pattern check — is now removed.

Removed:
- All ReScript host sources: src/*.res, src/*.resi (Types, Glyphs, Narrative,
  Patterns, Scanner, Analyser, Output, Cli) and the six test/*_test.res suites
- rescript.json, scripts/rescript-build.sh, and the ReScript Deno tasks/imports
  in deno.json (plus nodeModulesDir)
- Dead .res/.resi entries in .gitignore / .editorconfig / .gitattributes
- deno.lock from the index (it is .gitignored; regenerated locally)

Replaced (Deno-only, no ReScript):
- bin/evangeliser.js — offline CLI reading the cartridges (--kind / --find / --json)
- test/run_all.js — cartridge invariant tests mirroring the Idris2 ABI
  (false-friend signature, residue direction, all six kinds) — 59 checks
- Justfile build/watch/clean/install/test/stats/validate-structure recipes
- deno.json tasks repointed (build = validate cartridges; gui; test)

Docs/manifests now state the host is removed while KEEPING ReScript as a
legacy *target* language in correspondence content (the vanished-`return`
example, the cartridge target, the Form examples): README, EXPLAINME,
ROADMAP, CLAUDE.md, .claude/CLAUDE.md, TOPOLOGY, TEST-NEEDS, Mustfile.epx,
config.ncl, CHANGELOG, and .machine_readable/*.

Verified locally with Deno 2.8.3: deno fmt --check, deno lint, deno task test
(59/59), deno task build/validate (1/1 cartridges), CLI + GUI live probe all
green. Licence files and SPDX headers left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
… gate)

SonarCloud flagged 7.1% duplication on new code: the cartridge-walk loader
was repeated across bin/evangeliser.js, test/run_all.js, gui/server.js, and
scripts/validate-cartridges.js. Extract one shared module
(src/cartridges.js: eachCartridgeFile / loadCartridges / verdict) and route
all four readers through it.

Verified (Deno 2.8.3): deno fmt --check, deno lint, deno task test (59/59),
deno task build (1/1 cartridges), CLI + GUI /api/cartridges live probe (6
transitions, all six kinds) — all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
The previous commit's deno-fmt pass rewrote the already-merged GUI files
(gui/app.html, gui/app.js, gui/server.js) wholesale, which SonarCloud then
counted as "new code" — and app.js's kind/strata constants duplicated the new
CLI/test, leaving duplication at 4.4% (> 3%).

Restore gui/app.html and gui/app.js to their merged (main) state, and keep
only the functional shared-loader change in gui/server.js and
scripts/validate-cartridges.js (route both through src/cartridges.js so the
cartridge walk lives in exactly one place). Narrow deno.json fmt.include to the
files this PR actually authors, so the merged GUI shell is no longer reformatted.

Verified (Deno 2.8.3): deno fmt --check, deno lint, deno task test (59/59),
deno task build (1/1), GUI /api/cartridges live probe — all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
Short "read me first" for the next session: current state (ReScript host
removed; Deno + cartridges runtime; Idris2/Zig/AffineScript spine under
src/interface/), how to run, toolchain notes, next steps from the roadmap,
the guardrails, and the open owner-only LICENSE SPDX item.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…uous

Several docs still described the long-dead TypeScript VS Code extension (npm,
Jest, Babel, "JS→ReScript patterns") — two host-generations out of date and
actively misleading.

Rewritten to current reality (correspondence engine; Deno + cartridges runtime;
Idris2 ABI + Zig FFI + AffineScript host spine; cartridge authoring as the
contribution model; no-shame voice):
- docs/RSR_COMPLIANCE.md -> docs/RSR_COMPLIANCE.adoc (accurate + honest; neutral
  licensing section that defers to LICENSE)
- docs/TPCF.md -> docs/TPCF.adoc (perimeter model reframed for cartridges)
- CONTRIBUTING.md rewritten in place (kept .md — GitHub-required file)

Removed (superseded by a clean .adoc twin):
- MAINTAINERS.md (MAINTAINERS.adoc is canonical)

References repointed: README badges + links, CODE_OF_CONDUCT.md, SECURITY.md,
.github/workflows/ci.yml + .gitlab-ci.yml doc checks, Justfile validate-docs.
deno fmt/lint/test/build all green; no dangling links remain.

Out of scope (flagged, deliberately untouched):
- Licence-label drift (config.ncl "MIT OR Palimpsest", README "Palimpsest
  License (MPL-2.0)", LICENSE-MIT/PALIMPSEST vs the MPL-2.0 classification) —
  owner-only per the licence guardrail.
- The CONTRIBUTING.md / CHANGELOG.md .md-vs-.adoc choice for GitHub-required files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…impsest

Per owner direction, make the repo's licensing consistent:
- Code SPDX is MPL-2.0; docs SPDX is CC-BY-SA-4.0. The dual remnants
  ("MPL-2.0 OR Palimpsest-0.8" headers, config.ncl "MIT OR Palimpsest-0.8") are gone.
- Root LICENSE stays the MPL-2.0 text, so GitHub labels the repo MPL-2.0.
- LICENSES/ already holds verbatim MPL-2.0.txt + CC-BY-SA-4.0.txt; the licence
  checks (ci.yml, .gitlab-ci.yml, Justfile validate-licenses) now point there.
- Removed the old dual-scheme files LICENSE-MIT.txt + LICENSE-PALIMPSEST.txt
  (MIT/Palimpsest are not this repo's licences; Palimpsest is reserved for the
  palimpsest repos per estate policy).

Touched: SPDX headers (Justfile, Mustfile.epx, config.ncl); config.ncl license
field; README label + badge link; QUICKSTART-MAINTAINER; .well-known/humans.txt
+ ai.txt; guix.scm -> (license mpl2.0); STATE.a2ml blocker cleared; HANDOFF.adoc
licensing note updated to resolved.

Verified: deno fmt/lint/test/build green; no tracked in-scope Palimpsest/MIT
licence-label drift remains (third-party node_modules left untouched per guardrail).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
…tes)

Per owner direction ("go adoc for all of those"), complete the doc-format
migration for the two remaining duplicates:
- CONTRIBUTING.adoc is now the full guide (ported from the .md); CONTRIBUTING.md removed.
- CHANGELOG.adoc is canonical (verified superset of the .md history); CHANGELOG.md removed.

Repointed every reference: README, CODE_OF_CONDUCT.md, SECURITY.md,
0-AI-MANIFEST.a2ml, .machine_readable/TRUST.contractile, docs/RSR_COMPLIANCE.adoc,
HANDOFF.adoc, and the doc-presence checks in .github/workflows/ci.yml +
.gitlab-ci.yml + Justfile validate-docs. (quality.yml already accepts either.)

Verified: deno fmt/lint/test green; no dangling .md links remain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
Three small follow-ups, done in turn:

1. Second example cartridge (cartridges/reference/python-ruby.cartridge.json) —
   6 Python->Ruby transitions across cognate / false-friend / alien-realization /
   novel / vanished, dogfooding the cartridge contract on a fresh language pair to
   show the engine is language-agnostic. Cartridge invariants: 59 -> 107 checks.

2. GUI smoke test (test/gui_smoke_test.js) — gui/server.js now exports
   handler + loadCartridges and opens a listener only under import.meta.main, so
   the handler is tested in-process (no socket): static shell, /app.js bundle,
   /api/cartridges shape, and a clean 404. Wired into `deno task test` (+ test:gui)
   and a `just test-gui` recipe.

3. Finished the .adoc migration: TOPOLOGY.md -> TOPOLOGY.adoc (data-flow section
   corrected from the old JS->migration-report framing to the cartridge pipeline)
   and TEST-NEEDS.md -> TEST-NEEDS.adoc (coverage refreshed). Root docs are now
   AsciiDoc except the GitHub-required CODE_OF_CONDUCT.md / SECURITY.md.

Verified: deno fmt --check, deno lint, deno task test (cartridge invariants + GUI
smoke), deno task build (2/2 cartridges), and a live GUI probe — all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1BaAhqxUjkgVb1yg1sZap
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 27, 2026 23:15
@hyperpolymath
hyperpolymath merged commit 57cfabf into main Jun 27, 2026
42 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dreamy-sagan-1ukmue branch June 27, 2026 23:15
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants