Skip to content

Commit 124c3d1

Browse files
committed
README: репозиторий называется flang — README теперь описывает flang
Заголовок был «FTS — Formal Type Surface», текст только по-английски, слово flang встречалось ровно один раз — при том что в репозитории лежит ядро FTS, написанное на самом flang, компиляторы в C и Go, команда `flang emit` и 1073 теста языка. Что сделано: - README переписан от языка. Отдельный раздел «How FTS and flang relate» объясняет отношение по коду: FTS — поверхность (эталон на TypeScript в src/, 3155 строк), flang — язык (flang/src/), FTS компилируется в flang мостом compat.mjs, а flang/core/ — это ядро FTS, переписанное на самом flang (3444 строки). Неоднозначность названа прямо: ядро на TS остаётся рабочей реализацией и эталоном сверки, flang/core/ его пока не заменяет. - Раздел Status переписан по фактическому прогону `npm test`, а не по старому тексту: core 59/59, tools 402 (10 пропусков), flang 1073 (23 пропуска), всего 1534 теста, ноль падений. Каждый пропуск — отсутствующий нативный тулчейн (Rust, C#, Elixir, Go), названный поимённо. Убрано утверждение «пакет приватен, пока приватен репозиторий»: репозиторий публичный, пакета в npm нет. - Инструментов в tools/ девять, а не три, как утверждал README. - Добавлен README.ru.md; в шапке обоих файлов взаимные ссылки. - Правило языков в документации: файл без суффикса — английский, X.ru.md — русский; README.md и SPEC.md рядом с кодом остаются под своими именами, потому что GitHub показывает их как титульную страницу каталога. По правилу переименованы docs/language.md и docs/how-it-works.md (написаны по-русски) в *.ru.md, ссылки на них поправлены во всех файлах. - package.json: добавлены repository, homepage, bugs на digitable-lol/flang; description говорит про flang; в bin и files добавлен сам flang, которого там не было. package-lock.json нёс license Apache-2.0 — пересобран. - Битая ссылка github.com/digitable/fts (404) в editors/tree-sitter-fts/package.json исправлена на digitable-lol/flang. - CONTRIBUTING.md требовал заметок в MIGRATION.md, которого нет с коммита 18b4a3b; требования заменены на действующие, добавлен раздел про flang. AGENTS.md утверждал, что в репозитории один язык. - docs/agents.md: путь к клону назывался fts, и было сказано «после публикации» без указания, что публикации ещё нет. LICENSE проверен: дословный текст BSD 2-Clause без преамбулы, GitHub определяет лицензию верно. Раздел License называет её правильно. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pTm6DHXmC7owGp2vQSvZe
1 parent ec89e78 commit 124c3d1

17 files changed

Lines changed: 632 additions & 138 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Agent guidance
22

3-
This repository implements the Formal Type Surface language.
3+
This repository holds two languages: **FTS**, the executable-specification
4+
surface (`.fts`, reference implementation in TypeScript under `src/`), and
5+
**flang**, the full language over it (`.flang`, implementation in `flang/src/`).
6+
Read the "How FTS and flang relate" section of `README.md` before changing either.
47

58
- Treat canonical JSON and diagnostic codes as compatibility surfaces.
6-
- Keep language semantics in `src/parser.ts`, `src/validate.ts`, and `src/interpreter.ts`; CLI and MCP are adapters.
7-
- Keep the core deterministic and free of runtime dependencies, filesystem access, and network access.
9+
- Keep FTS semantics in `src/parser.ts`, `src/validate.ts`, and `src/interpreter.ts`; CLI and MCP are adapters.
10+
- Keep flang semantics in `flang/src/`; `flang/bin/flang.mjs` is an adapter. Interpreter, emitters and `compat.mjs` must agree — the tests compare them, so a divergence is a failure, not a note.
11+
- The TypeScript core is the reference for `flang/core/`, not the other way round. A deliberate divergence goes into the debt list of `flang/core/SPEC.md`, never in silence.
12+
- Keep both cores deterministic and free of runtime dependencies, filesystem access, and network access.
813
- Add parser, validation, and pipeline tests for language changes.
9-
- Author and emit only `.fts` source; JSON is the sole interchange form.
10-
- Keep the tools in `tools/` (`ftsc`, `ftsvm`, `ftspec`) outside the core: they are ES modules that consume `dist/src` and are allowed the filesystem access the library is not.
11-
- Run `npm test` before completing changes.
14+
- Author only `.fts` and `.flang` source; JSON is the sole interchange form.
15+
- Keep the tools in `tools/` outside the core: they are ES modules that consume `dist/src` and are allowed the filesystem access the library is not.
16+
- Run `npm test` before completing changes — all three suites, zero failures. A test skipped for a missing native toolchain is not a passing test.

CONTRIBUTING.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,26 @@ npm install
77
npm test
88
```
99

10-
Language changes must include:
10+
`npm test` is three suites — `test:core` (the FTS core in TypeScript),
11+
`test:tools` (the tools in `tools/`), `test:flang` (the language). All three must
12+
pass. A test skipped for a missing native toolchain is not a passing test; set
13+
`FTS_REQUIRE_TOOLCHAINS` where the toolchain is supposed to exist.
14+
15+
Changes to the FTS surface must include:
1116

1217
- a canonical JSON representation;
1318
- parser and semantic-validation tests;
1419
- a schema update when the model changes;
15-
- compatibility notes in `MIGRATION.md`;
1620
- an example for user-visible syntax.
1721

22+
Changes to flang must include:
23+
24+
- the corresponding section of `flang/SPEC.md`, updated in the same change;
25+
- a type-checker or totality test, whichever the change touches;
26+
- matching behaviour in the interpreter and in every emitter — the emitter tests
27+
compare a compiled binary against the interpreter, so a divergence is a failure,
28+
not a note;
29+
- a debt entry in `flang/core/SPEC.md` when a divergence from the TypeScript core
30+
is left in deliberately.
31+
1832
Do not add product-specific structures, filesystem access, or network access to the core library. Build integrations as separate packages over the public `FtsDocument` API.

README.md

Lines changed: 257 additions & 115 deletions
Large diffs are not rendered by default.

README.ru.md

Lines changed: 315 additions & 0 deletions
Large diffs are not rendered by default.

docs/agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Build the repository, then configure an MCP client to launch:
1111
"mcpServers": {
1212
"fts": {
1313
"command": "node",
14-
"args": ["/absolute/path/to/fts/dist/src/mcp.js"]
14+
"args": ["/absolute/path/to/flang/dist/src/mcp.js"]
1515
}
1616
}
1717
}
1818
```
1919

20-
After npm publication, the command can be `fts-mcp`.
20+
The package is not published to npm yet, so the server is launched by path. After publication the command can be `fts-mcp`.
2121

2222
The server implements MCP revision `2025-06-18` over stdio and exposes only deterministic, read-only tools. It never reads paths supplied by a model; `.fts` source and context are passed explicitly as tool arguments.
2323

File renamed without changes.
File renamed without changes.

editors/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Everything needed to get `.fts` syntax highlighting in editors, on GitHub, and
44
on the Digitable courses site (Hugo/Chroma). Four independent grammars, kept
55
in sync by hand against the same three sources of truth:
66

7-
- `docs/language.md` (repo root) - the full language reference.
7+
- `docs/language.ru.md` (repo root) - the full language reference.
88
- `src/natural-parser.ts` (repo root) - the actual keyword list for both the
99
Russian and English natural surfaces. If you add/change a keyword there,
1010
update all four grammars below and re-run the checks in this README.
@@ -17,7 +17,7 @@ tolerate all three:
1717
1. **Natural surface** (Russian or English, indentation-significant) -
1818
`категория «Имя»` / `category Name` followed by an indented body of
1919
`объект`/`морфизм`/`теорема`/`утилита` blocks. This is the recommended,
20-
modern surface (see `docs/language.md`).
20+
modern surface (see `docs/language.ru.md`).
2121
2. **Legacy brace surface** - `category Name { structure X { a: string } }`,
2222
kept for backward compatibility (`examples/task-status.fts`,
2323
`examples/socrates.fts`).

editors/chroma/fts.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<rules>
1212
<!--
1313
FTS has three surfaces that appear in real .fts files (see
14-
docs/language.md and tools/ftsc/src/parse-module.mjs in the fts-upstream
14+
docs/language.ru.md and tools/ftsc/src/parse-module.mjs in the fts-upstream
1515
repo): the natural RU/EN indentation surface, the legacy brace/JSON-like
1616
surface, and the ftsc module/functor-mapping headers layered on top.
1717

editors/tree-sitter-fts/grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* tree-sitter grammar for FTS.
33
*
4-
* FTS has three surfaces that coexist in real files (see docs/language.md
4+
* FTS has three surfaces that coexist in real files (see docs/language.ru.md
55
* and tools/ftsc/src/parse-module.mjs upstream):
66
*
77
* 1. The natural, indentation-significant surface (Russian and English

0 commit comments

Comments
 (0)