Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/docs-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Docs versions
on:
pull_request:
paths:
- '**/*.mdx'
- 'scripts/check-versions.py'
- 'cofhe/**/*.mdx'
- 'cofhe/scripts/check-versions.py'
- '.github/workflows/sample-compile.yml'
# Weekly, so a release upstream surfaces as an issue rather than waiting for
# someone to notice a stale install command.
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python3 scripts/check-versions.py --docs
- run: python3 cofhe/scripts/check-versions.py --docs

# This one does hit the network, and a new release upstream is not a reason to
# fail an unrelated pull request, so it never runs on one.
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Check npm
id: check
run: |
if python3 scripts/check-versions.py --npm > drift.txt 2>&1; then
if python3 cofhe/scripts/check-versions.py --npm > drift.txt 2>&1; then
echo "drifted=false" >> "$GITHUB_OUTPUT"
else
echo "drifted=true" >> "$GITHUB_OUTPUT"
Expand All @@ -69,8 +69,8 @@ jobs:
fs.readFileSync('drift.txt', 'utf8').trim(),
'```',
'',
'Update `get-started/introduction/compatibility.mdx`, then run',
'`python3 scripts/check-versions.py --docs` to find every pin that',
'Update `cofhe/get-started/introduction/compatibility.mdx`, then run',
'`python3 cofhe/scripts/check-versions.py --docs` to find every pin that',
'needs to move with it, including the package pins in',
'`.github/workflows/sample-compile.yml`.',
].join('\n');
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- '**/*.mdx'
- '**/*.md'
- 'docs.json'
- '.mintignore'
workflow_dispatch:

# A force-push supersedes the previous run; the site-wide checks take long
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sample-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Sample compile
on:
pull_request:
paths:
- '**/*.mdx'
- 'scripts/compile-samples.py'
- 'cofhe/**/*.mdx'
- 'cofhe/scripts/compile-samples.py'
- '.github/workflows/sample-compile.yml'
workflow_dispatch:

env:
# The Solidity dependency versions the docs tell readers to install; see
# get-started/introduction/compatibility.mdx. scripts/check-versions.py
# cofhe/get-started/introduction/compatibility.mdx. cofhe/scripts/check-versions.py
# --docs fails when these disagree with that page.
COFHE_CONTRACTS_VERSION: 1.0.0
CONFIDENTIAL_CONTRACTS_VERSION: 0.4.0
Expand All @@ -35,9 +35,9 @@ jobs:
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git diff --name-only --diff-filter=d \
"origin/${{ github.base_ref }}...HEAD" -- '*.mdx' > files.txt
"origin/${{ github.base_ref }}...HEAD" -- 'cofhe/*.mdx' 'cofhe/**/*.mdx' > files.txt
else
git ls-files '*.mdx' > files.txt
git ls-files 'cofhe/*.mdx' 'cofhe/**/*.mdx' > files.txt
fi
count=$(wc -l < files.txt | tr -d ' ')
echo "count=$count" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -74,4 +74,4 @@ jobs:
# checked; this check is Solidity only.
- name: Compile Solidity samples
if: steps.files.outputs.count != '0'
run: xargs -a files.txt python3 scripts/compile-samples.py
run: xargs -a files.txt python3 cofhe/scripts/compile-samples.py
2 changes: 1 addition & 1 deletion .github/workflows/update-cofhe-errors-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
},
{
role: 'user',
content: `Update the CoFHE errors documentation page with these error definitions from @fhenixprotocol/cofhe-errors v${version}:\n\n\`\`\`json\n${errorsJson}\n\`\`\`\n\nCreate/update a reference page with a table: Error Name, Selector, Signature, Source Contract, Parameters. Group by source contract.`
content: `Update the CoFHE errors documentation page with these error definitions from @fhenixprotocol/cofhe-errors v${version}:\n\n\`\`\`json\n${errorsJson}\n\`\`\`\n\nCreate/update a reference page with a table: Error Name, Selector, Signature, Source Contract, Parameters. Group by source contract. The page is cofhe/fhe-library/reference/cofhe-errors-reference.mdx; never create pages outside cofhe/.`
}
],
asDraft: false
Expand Down
10 changes: 10 additions & 0 deletions .mintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
AGENTS.md
CLAUDE.md
STYLE.md
**/AGENTS.md
**/CLAUDE.md
**/STYLE-*.md
RELEASE-CHECKLIST.md
local/
scripts/
cofhe/scripts/
37 changes: 11 additions & 26 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# Working on the CoFHE docs
# Working on the Fhenix docs

This repo is the Mintlify site behind cofhe-docs.fhenix.zone. It documents the live CoFHE system for external developers.
This repo is the Mintlify site behind docs.fhenix.io. Each product lives in its own folder (`cofhe/`, `wallet/`) and has its own `AGENTS.md` with product facts. Read both: the rules here apply to every product.

## The one rule that matters

STYLE.md is binding for all content. Read it before writing or editing any page. If a page you touch conflicts with STYLE.md, fix the page.
- `/` is the landing page (`index.mdx`), with one card per product.
- Product pages live under their folder and their URL prefix: `cofhe/...` is served at `/cofhe/...`.

## Facts
## The one rule that matters

- Never write a technical claim you have not verified against the current source of the relevant repo (cofhe, cofhesdk, teecryptor, zee-k-verifier, fhenix-confidential-contracts) or the published packages. Docs drift is the failure mode this project exists to fix.
- For the confidential token contracts (FHERC20, ERC20Confidential, the wrappers), verify against the Solidity under `contracts/` at the tag matching the version on the compatibility page, or the published npm package. The repo README lags the code; do not take API shapes from it.
- Current behavior and future plans never mix. Future work lives in `deep-dive/research/future-plans.mdx`, labeled as such.
- The TEE (Teecryptor) is the current decryption architecture. The Threshold Network is a future plan only.
- No internal names: hostnames, cloud project names, environment names, deployment bundle names, feature flags.
STYLE.md is binding for all content. Each product adds its own terms and diagram rules in its folder (for CoFHE: `cofhe/STYLE-cofhe.md`). Read it before writing or editing any page. If a page you touch conflicts with STYLE.md, fix the page.

## Mechanics

- Navigation lives in `docs.json`. A page not referenced there is invisible; check it when adding, renaming, or removing pages.
- Navigation lives in `docs.json`, under `navigation.products`: one product per folder. A page not referenced there is invisible; check it when adding, renaming, or removing pages.
- Renaming or removing a page requires a redirect entry.
- Diagrams are Mermaid blocks in the page (see STYLE.md, Diagrams). Sequence diagrams use the fixed lane order and zone bands in STYLE.md, "Sequence diagram lanes". Do not add or edit SVGs; designed SVGs come from the design pass and keep their Mermaid source in the repo.
- Diagrams are Mermaid blocks in the page (see STYLE.md, Diagrams). Each product sets its diagram lanes and colors in its own style file (for CoFHE: `cofhe/STYLE-cofhe.md`, "Sequence diagram lanes"). Do not add or edit SVGs; designed SVGs come from the design pass and keep their Mermaid source in the repo.
- Code samples must compile or run against the currently published versions before they ship.
- Product CI runs only on its folder: a workflow for one product filters on `paths: <product>/**`. Shared checks (`Docs style`, `Mint check`) run on every product.
- Mintlify renders the page H1 from the frontmatter `title`. Body headings start at `##` and never skip a level.
- Internal links are root-relative: `/fhe-library/core-concepts/access-control`, never `../` and never the full site URL.
- Internal links are root-relative: `/cofhe/fhe-library/core-concepts/access-control`, never `../` and never the full site URL.

## Linters

Expand All @@ -40,19 +36,8 @@ The `Docs style` action runs both on the `.mdx` files a pull request touches. Er

Neither linter can tell whether a claim is true. That stays your job.

## Samples

The `Sample compile` action compiles every ```solidity block on the pages a pull request touches, with forge, against the `@fhenixprotocol/cofhe-contracts` and `fhenix-confidential-contracts` versions pinned in `.github/workflows/sample-compile.yml`. A complete contract that fails blocks the merge; a fragment that fails only warns. Run it locally before opening a pull request:

```bash
npm install --no-save @fhenixprotocol/cofhe-contracts@0.2.0 fhenix-confidential-contracts@0.4.0
python3 scripts/compile-samples.py $FILES
```

Those pins follow the compatibility page. When it changes, move them too; `python3 scripts/check-versions.py --docs` fails until you do. The action does not deploy or run anything, so a sample that compiles can still be wrong. Library linking, for example, only fails at deploy time.

## Workflow

- Work is tracked in the Jira DOC project, one epic per site tab. Ticket summaries start with `[page-slug]`.
- Each product says in its own `AGENTS.md` where its docs work is tracked.
- Commit messages: single line, `[DOCS] <area>/<page-slug>: summary`.
- One page per commit on rewrite branches, so commits can be cherry-picked individually.
45 changes: 30 additions & 15 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
# Working on the CoFHE docs
# Working on the Fhenix docs

This repo is the Mintlify site behind cofhe-docs.fhenix.zone. It documents the live CoFHE system for external developers.
This repo is the Mintlify site behind docs.fhenix.io. Each product lives in its own folder (`cofhe/`, `wallet/`) and has its own `AGENTS.md` with product facts. Read both: the rules here apply to every product.

## The one rule that matters

STYLE.md is binding for all content. Read it before writing or editing any page. If a page you touch conflicts with STYLE.md, fix the page.
- `/` is the landing page (`index.mdx`), with one card per product.
- Product pages live under their folder and their URL prefix: `cofhe/...` is served at `/cofhe/...`.

## Facts
## The one rule that matters

- Never write a technical claim you have not verified against the current source of the relevant repo (cofhe, cofhesdk, teecryptor, zee-k-verifier, fhenix-confidential-contracts) or the published packages. Docs drift is the failure mode this project exists to fix.
- For the confidential token contracts (FHERC20, ERC20Confidential, the wrappers), verify against the Solidity under `contracts/` at the tag matching the version on the compatibility page, or the published npm package. The repo README lags the code; do not take API shapes from it.
- Current behavior and future plans never mix. Future work lives in `deep-dive/research/future-plans.mdx`, labeled as such.
- The TEE (Teecryptor) is the current decryption architecture. The Threshold Network is a future plan only.
- No internal names: hostnames, cloud project names, environment names, deployment bundle names, feature flags.
STYLE.md is binding for all content. Each product adds its own terms and diagram rules in its folder (for CoFHE: `cofhe/STYLE-cofhe.md`). Read it before writing or editing any page. If a page you touch conflicts with STYLE.md, fix the page.

## Mechanics

- Navigation lives in `docs.json`. A page not referenced there is invisible; check it when adding, renaming, or removing pages.
- Navigation lives in `docs.json`, under `navigation.products`: one product per folder. A page not referenced there is invisible; check it when adding, renaming, or removing pages.
- Renaming or removing a page requires a redirect entry.
- Diagrams are Mermaid blocks in the page (see STYLE.md, Diagrams). Do not add or edit SVGs; designed SVGs come from the design pass and keep their Mermaid source in the repo.
- Code samples must compile or run against the currently published versions before they ship. `scripts/compile-samples.py` compiles the Solidity ones; see AGENTS.md, Samples.
- Diagrams are Mermaid blocks in the page (see STYLE.md, Diagrams). Each product sets its diagram lanes and colors in its own style file (for CoFHE: `cofhe/STYLE-cofhe.md`, "Sequence diagram lanes"). Do not add or edit SVGs; designed SVGs come from the design pass and keep their Mermaid source in the repo.
- Code samples must compile or run against the currently published versions before they ship.
- Product CI runs only on its folder: a workflow for one product filters on `paths: <product>/**`. Shared checks (`Docs style`, `Mint check`) run on every product.
- Mintlify renders the page H1 from the frontmatter `title`. Body headings start at `##` and never skip a level.
- Internal links are root-relative: `/cofhe/fhe-library/core-concepts/access-control`, never `../` and never the full site URL.

## Linters

Two linters enforce the mechanical half of STYLE.md. Run both on what you changed before opening a pull request:

```bash
FILES=$(git diff --name-only --diff-filter=d origin/main...HEAD -- '*.mdx')
python3 scripts/lint-docs.py $FILES
vale $FILES
```

- `vale` covers prose: em dashes, decorative Unicode, filler, marketing adjectives, "simply" and "easy", idioms, terminology, Title Case headings. Rules live in `styles/Fhenix/`.
- `scripts/lint-docs.py` covers structure: frontmatter, manual H1 headings, skipped heading levels, code blocks with no language tag, link paths, alt text.

The `Docs style` action runs both on the `.mdx` files a pull request touches. Errors block the merge, warnings do not. Pages written before the linters existed still contain violations, so the action ignores files your branch did not touch. Fix a legacy page when you are already editing it, not in a sweep.

Neither linter can tell whether a claim is true. That stays your job.

## Workflow

- Work is tracked in the Jira DOC project, one epic per site tab. Ticket summaries start with `[page-slug]`.
- Each product says in its own `AGENTS.md` where its docs work is tracked.
- Commit messages: single line, `[DOCS] <area>/<page-slug>: summary`.
- One page per commit on rewrite branches, so commits can be cherry-picked individually.
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Fhenix Developer Documentation

Official documentation for Fhenix - the privacy-preserving blockchain platform that enables developers to build confidential smart contracts using Fully Homomorphic Encryption (FHE).
The documentation for Fhenix products, served at [docs.fhenix.io](https://docs.fhenix.io).

## About This Documentation

This repository contains the complete developer documentation for Fhenix, including:

- **Get Started** - Introduction to Fhenix and CoFHE, compatibility, support, and builder programs
- **Client SDK** - `@cofhe/sdk` for encrypting inputs, managing Access Control Permissions, and decrypting outputs, plus the Hardhat and Foundry plugins
- **FHE library** - `FHE.sol`, the Solidity library for working with encrypted data in smart contracts
- **Tutorials** - Step-by-step guides for building FHE-enabled applications
- **Deep Dive** - Technical architecture details, CoFHE components, and data flows
- **CoFHE** (`cofhe/`): the FHE coprocessor. Write Solidity contracts that compute on encrypted data. Covers Get Started, the Client SDK, the FHE library, Tutorials, and the Deep Dive.
- **Wallet Module** (`wallet/`): coming soon.

## Development

Expand All @@ -37,19 +30,24 @@ The documentation will be available at `http://localhost:3000`.
## Project Structure

```
fhenix-developer-docs/
├── get-started/ # Introduction and getting started guides
├── client-sdk/ # @cofhe/sdk, Hardhat plugin, and Foundry plugin docs
├── fhe-library/ # Solidity FHE library documentation
├── tutorials/ # Step-by-step tutorials
├── deep-dive/ # Architecture and technical deep dives
├── images/ # Images referenced from pages
├── scripts/ # Structure linter (lint-docs.py)
├── styles/ # Vale prose rules
fhenix-docs/
├── index.mdx # Landing page, one card per product
├── cofhe/ # CoFHE docs, served at /cofhe
│ ├── get-started/ client-sdk/ fhe-library/ tutorials/ deep-dive/
│ ├── images/
│ ├── scripts/ # CoFHE checks: versions, sample compile
│ ├── AGENTS.md # CoFHE facts for contributors and agents
│ └── STYLE-cofhe.md # CoFHE terms and diagram rules
├── wallet/ # Wallet Module docs, served at /wallet
├── scripts/ # Shared structure linter (lint-docs.py)
├── styles/ # Shared Vale prose rules
├── STYLE.md # Writing style guide, binding for all pages
└── docs.json # Mintlify configuration
├── AGENTS.md # Shared rules for contributors and agents
└── docs.json # Mintlify configuration: products, navigation, redirects
```

To add a product, create its folder, add it to `navigation.products` in `docs.json`, and add a card to `index.mdx`.

## Publishing Changes

Changes pushed to the default branch are automatically deployed to production through the Mintlify GitHub app integration.
Expand Down Expand Up @@ -80,11 +78,11 @@ We welcome contributions to improve the documentation. When making changes:
## Resources

- [Mintlify Documentation](https://mintlify.com/docs)
- [CoFHE documentation live site](https://cofhe-docs.fhenix.zone)
- [Fhenix documentation live site](https://docs.fhenix.io)

## Support

For questions and support:
- Join our [Telegram Support Channel](https://t.me/+OEO4CItQYh8xYzNh)
- Visit our [Discord](https://discord.com/invite/FuVgxrvJMY)
- Check the [Support and Feedback](get-started/introduction/support-and-feedback.mdx) documentation
- Check the [Support and Feedback](cofhe/get-started/introduction/support-and-feedback.mdx) documentation
4 changes: 2 additions & 2 deletions RELEASE-CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Docs pass per release
# CoFHE docs pass per release

Every release of cofhe, cofhe-contracts, cofhesdk, teecryptor, or zee-k-verifier requires this pass before the release announcement. The release owner opens one DOC ticket per release and links it to the release.

Expand All @@ -7,7 +7,7 @@ Every release of cofhe, cofhe-contracts, cofhesdk, teecryptor, or zee-k-verifier
1. Read the release changelog. List every change to a public surface: contract API, SDK API, wire fields, endpoints, error names, component names.
2. Map each change to its pages. Start from the Deep Dive component page, then the data flows, then guides and tutorials that name the surface.
3. Update the pages. Verify every claim against the released source, not the changelog text.
4. Update `get-started/introduction/compatibility.mdx` when a package version changed.
4. Update `cofhe/get-started/introduction/compatibility.mdx` when a package version changed.
5. Run the checks: `vale <changed pages>` and `python3 scripts/lint-docs.py <changed pages>`. CI runs link and sample checks on the PR.
6. Diagrams: when a component or flow changed, update the page `.mmd` source and re-run the archify build for that diagram.
7. Open one PR per release, one page per commit. Merge before the release announcement goes out.
Expand Down
Loading
Loading