Metadata-Version: 2.4
Name: synesis-help
Version: 0.4.0
Summary: Guia de referência rápida da linguagem Synesis, no espírito dos Norton Guides
Author-email: "De Britto, Christian Maciel" <chriseana@gmail.com>
License-Expression: LicenseRef-Synesis-AGPL-3.0-with-Data-Output-Exception
Project-URL: Repository, https://github.com/synesis-lang/synesis-help
Keywords: synesis,documentation,tui,reference,qualitative-research
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Documentation
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.exception
Requires-Dist: synesis>=0.16.0
Requires-Dist: textual>=3.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: ruff==0.15.17; extra == "dev"
Requires-Dist: mypy==1.16.0; extra == "dev"
Dynamic: license-file

# synesis-help

Quick reference guide to the Synesis language, offline and instant, for people
and for agents. Inspired by the
[Norton Guides](https://harbour.github.io/ng/c52g01b/menu.html) of the Clipper
ecosystem: syntax, description, example, see also.

**Version 0.4.0**: English-only content, a JSON contract for agents, and case
studies. See [CHANGELOG.md](CHANGELOG.md).

## Usage

```bash
synesis-help                                  # open the guide (TUI)
synesis-help lookup CHAIN                     # one entry in the terminal
synesis-help search bundle status             # full-text search
synesis-help list --category case_study       # what exists in a category
synesis-help build                            # rebuild the index
```

### For agents

Agents and scripts use `--format=json`:

```bash
synesis-help lookup E047 --format=json        # SYNESIS_E047 (short forms work)
synesis-help search "epistemic status" --format=json
synesis-help list --format=json
```

- Every answer carries `help_version`, `synesis_version` (the compiler the
  generated entries were derived from) and `locale`.
- `lookup` reports how it matched (`id`, `title`, `prefix`, `search`) and
  returns `suggestions` when nothing matches.
- Exit codes: `0` found, `1` not found, `2` usage error.

The Synesis Skill for Claude Code calls these commands before writing or
fixing a template.

### Keys

The active panel has a lit frame; the bottom bar shows the keys that work in
it.

| Key | Action |
|---|---|
| `↑` `↓` | move in the list / scroll the text |
| `Enter` | go forward (category → entries → text) |
| `F2` | open the cross-references ("See also") |
| `F3` or `/` | incremental search |
| `Backspace` | go back |
| `Tab` | switch panel |
| `Esc` | quit |

## Content

204 entries in English; see [INDEX.md](INDEX.md).

| Category | Entries | Origin |
|---|---|---|
| Overview | 8 | authored |
| Blocks | 10 | authored |
| Field types | 10 | generated from the compiler |
| Modifiers | 9 | authored |
| Linkage | 1 | generated from the compiler |
| Case studies | 9 | authored, compiled as projects |
| Ecosystem | 5 | captured from each module's `--help` |
| Diagnostics | 152 | generated from the compiler |

**Case studies** are complete projects (template, annotations, ontology,
project file, exports) adapted from real research: literature reviews, factor
reviews, exegesis of a term, news framing, linked assessments, survey
answers, topical indexes, participatory diagnosis, causation coding. Names,
sources and excerpts are fictitious; the designs are real. Start from
`GUIDE_CASE_STUDIES`.

## How the content is kept in sync

What the compiler knows about itself (type × property matrix, diagnostic
codes and messages) is **derived by probing it**, never copied, so the guide
cannot drift from the compiler. What takes methodological judgement (what a
type is for, how to design a template, the case studies) is authored and
lives apart.

```text
synesis_help/entries/
├── _generated/en/   generated from the compiler: never edit by hand
└── authored/en/     human content: this is where you write
```

The guide is English-only: one source, regenerated with every compiler
release. Agents translate for researchers who work in other languages.

Writing guide: `synesis-help docs`.

## Tools

```bash
python tools/generate_entries.py           # generate derived entries
python tools/generate_ecosystem.py         # capture the modules' --help
python tools/generate_entries.py --check   # fail on drift (CI)
python tools/generate_index.py             # write INDEX.md
python tools/validate_entries.py           # frontmatter, ids, links, English
python tools/check_examples.py             # examples and case studies compile
```

`check_examples.py` compiles every example against the installed `synesis`,
and builds each case study as a project and compiles it. It is what keeps an
example written today from rotting silently when the compiler evolves.

## Installation

```bash
pip install synesis-help
```

Requires Python 3.10+ and the `synesis` compiler, installed as a dependency;
the derived entries are generated by probing it.

From the repository:

```bash
git clone https://github.com/synesis-lang/synesis-help
cd synesis-help
pip install -e ".[dev]"
synesis-help build     # compile the index from the entries
```

The index (`guide.db`) is not versioned: it is built on first run, or by
`synesis-help build` after editing an entry.

## Relation to the ecosystem

Depends on [`synesis`](https://github.com/synesis-lang/synesis) and imports
`synesis.language_info` and `synesis.ast.results` as the derived source of
truth.

## License

Distributed under the **GNU Affero General Public License, version 3 only
(AGPL-3.0-only), with the Synesis Data-Output Exception**; see
[LICENSE](LICENSE) and [LICENSE.exception](LICENSE.exception).

SPDX identifier: `LicenseRef-Synesis-AGPL-3.0-with-Data-Output-Exception`

**What you take from the guide is yours.** Text you copy from an entry into
your template, script or paper is not covered by the AGPL and carries no
copyleft obligation towards Synesis. See `LICENSE.exception`.

The copyleft applies to the **guide as software**: modifying and distributing
it, or offering it as a network service, requires publishing the code under
the same license.

## How to cite

De Britto, C. M. (2026). *synesis-help: reference guide to the Synesis
language* (version 0.4.0) [Software]. https://github.com/synesis-lang/synesis-help

See [CITATION.cff](CITATION.cff); GitHub reads it and offers the citation.
