Prepare project for GitHub publication

- Add comprehensive README.md with examples and quick start
- Add SECURITY.md with API key safety guidelines
- Add MIT LICENSE
- Add .gitattributes for line ending normalization
- Create .env.example templates (root + ConfluentTranslator)
- Update .gitignore (remove unused rules, add .env variants)
- Archive work documents to docs/archive/
- Remove temporary files (nul, prompt-*.json)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
StillHammer 2025-12-10 08:57:43 +08:00
parent 0d3f938ca9
commit 5602ce50be
14 changed files with 1795 additions and 1499 deletions

9
.env.example Normal file
View File

@ -0,0 +1,9 @@
# ========================================
# Confluent Project - Environment Variables
# ========================================
# Copy this file to .env and fill in your actual API keys
# NEVER commit .env to Git - it contains secrets!
# LLM API Keys (required for translation)
ANTHROPIC_API_KEY=sk-ant-your-key-here
OPENAI_API_KEY=sk-proj-your-key-here

17
.gitattributes vendored Normal file
View File

@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Explicitly set line endings for specific file types
*.md text eol=lf
*.txt text eol=lf
*.json text eol=lf
*.js text eol=lf
*.sh text eol=lf
# Binary files
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.pdf binary

58
.gitignore vendored
View File

@ -1,3 +1,8 @@
# Environment variables (SECRETS!)
.env
.env.local
.env.production
# Node.js
node_modules/
dist/
@ -6,6 +11,7 @@ build/
.npm
.yarn/cache
.pnp.*
package-lock.json
# Python
__pycache__/
@ -14,64 +20,34 @@ __pycache__/
.venv/
venv/
env/
.env
*.egg-info/
.eggs/
*.egg
# IDE
.idea/
.vscode/
*.swp
*.swo
.claude/
# OS
.DS_Store
Thumbs.db
desktop.ini
# Logs
*.log
logs/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Test
# Test & Coverage
coverage/
.pytest_cache/
.coverage
htmlcov/
.nyc_output/
# Build artifacts
*.exe
*.dll
*.so
*.dylib
# Images
*.png
*.jpg
*.jpeg
*.gif
*.bmp
*.ico
*.svg
*.webp
*.tiff
*.tif
*.psd
# Audio
*.mp3
*.wav
*.flac
*.aac
*.ogg
*.wma
*.m4a
# Video
*.mp4
*.avi
*.mov
*.mkv
*.wmv
*.flv
*.webm
# Temporary files
*.tmp
*.temp
nul

View File

@ -1,14 +1,9 @@
# ConfluentTranslator Configuration
# Server
PORT=3000
# API Keys (LLM)
# LLM API Keys (required)
ANTHROPIC_API_KEY=sk-ant-your-key-here
OPENAI_API_KEY=sk-your-key-here
OPENAI_API_KEY=sk-proj-your-key-here
# Security (optionnel - utilisé pour JWT, peut être généré aléatoirement)
JWT_SECRET=changez-ce-secret-en-production
# Note: Les API keys pour le traducteur (authentication) sont gérées dans data/tokens.json
# Le token admin sera automatiquement créé au premier lancement et affiché dans les logs
# Server Configuration (optional)
PORT=3000
JWT_SECRET=your-random-secret-here

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Confluent Language Project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

184
README.md Normal file
View File

@ -0,0 +1,184 @@
# Confluent - Constructed Language Project
**Confluent** is a complete constructed language (conlang) created for the Civilization of the Confluence, a fictional civilization from the **civjdr** tabletop RPG project.
This repository contains:
- **Complete linguistic system**: phonology, morphology, grammar, syntax
- **Dual language variants**: Proto-Confluent (primitive) and Ancient Confluent (unified)
- **Translation API**: French to Confluent using LLMs (Claude/GPT)
- **Web interface**: Real-time translation with multiple models
- **Comprehensive documentation**: Full language reference
## Features
### Linguistic System
- **67 roots** (15 sacred, 52 standard) with consistent phonology
- **16 sacred liaisons** for word composition
- **Complete verbal system** (12 verbs + conjugators)
- **SOV syntax** with particles
- **Base-12 number system** (culturally anchored)
- **Metaphorical emotion system** (body-based expressions)
### Translation Tools
- **Multi-provider support**: Anthropic Claude, OpenAI GPT
- **Real-time translation**: French → Confluent with layer-by-layer breakdown
- **Bidirectional support**: Confluent → French translation
- **Batch processing**: Translate multiple words/phrases at once
- **Coverage analysis**: Pre-translation text analysis
## Quick Start
### Prerequisites
- Node.js 16+
- API key from Anthropic or OpenAI
### Installation
```bash
# Clone the repository
git clone https://github.com/yourusername/confluent.git
cd confluent
# Configure environment
cp .env.example .env
# Edit .env and add your API keys
# Install dependencies
cd ConfluentTranslator
npm install
# Start the server
npm start
```
Visit http://localhost:3000 to access the translation interface.
## Examples
### Word Formation
```
sili (sight/observation) + -i- (agent) + aska (free)
→ siliaska = "The ones who carry free sight"
→ Name of the civilization's people
```
### Translation
| French | Ancient Confluent | Meaning |
|--------|-------------------|---------|
| Les enfants des échos | nakukeko | Children of echoes (caste) |
| La Confluence | uraakota | The Confluence (sacred place) |
| Joie | koriasora | Heart-sun (emotion) |
| Observer | silitoki | To observe |
## Project Structure
```
confluent/
├── docs/ # Complete documentation
│ ├── langue/ # Linguistic reference
│ │ ├── 01-PHONOLOGIE.md # Phonology & sounds
│ │ ├── 02-MORPHOLOGIE.md # Roots & sacred liaisons
│ │ ├── 03-GRAMMAIRE.md # Verbs & conjugations
│ │ ├── 04-SYNTAXE.md # Syntax & sentence structure
│ │ └── 05-VOCABULAIRE.md # Complete lexicon
│ ├── culture/ # Cultural context
│ └── SYSTEM_PROMPT_LLM.md # LLM system prompt
├── data/
│ └── lexique.json # Structured language data
├── ConfluentTranslator/ # Translation API & web interface
│ ├── src/api/server.js # Express API
│ ├── public/index.html # Web UI
│ └── prompts/ # LLM prompts
├── ancien-confluent/ # Ancient Confluent variant data
└── proto-confluent/ # Proto-Confluent variant data
```
## Documentation
### Language Reference
1. [Phonology](docs/langue/01-PHONOLOGIE.md) - Sounds and phonetic rules
2. [Morphology](docs/langue/02-MORPHOLOGIE.md) - Word structure and liaisons
3. [Grammar](docs/langue/03-GRAMMAIRE.md) - Verbs and conjugations
4. [Syntax](docs/langue/04-SYNTAXE.md) - Sentence construction
5. [Vocabulary](docs/langue/05-VOCABULAIRE.md) - Complete lexicon
### Cultural Context
- [Civilization Context](docs/culture/CONTEXTE_CIVILISATION.md) - Values and culture
- [Reference Lexicon](docs/LEXIQUE_REFERENCE_CONFLUENCE.md) - Vocabulary to translate
### For Developers
- [LLM System Prompt](docs/SYSTEM_PROMPT_LLM.md) - Complete prompt for translation
- [API Documentation](ConfluentTranslator/README.md) - Translation API reference
## API Endpoints
The ConfluentTranslator API provides:
- `POST /translate` - French → Confluent translation
- `POST /api/translate/conf2fr` - Confluent → French translation
- `GET /api/search` - Search in lexicon
- `POST /api/analyze/coverage` - Text coverage analysis
- `POST /api/translate/batch` - Batch translation
See [API Documentation](ConfluentTranslator/README.md) for details.
## Language Variants
### Proto-Confluent
- Primitive language of early clans
- Reduced phonology: 4 vowels, 8 consonants
- Simple SOV syntax
- Isolated words, no fusion
### Ancient Confluent (Main)
- Unified civilization language
- Complete phonology: 5 vowels, 10 consonants
- 16 sacred liaisons for composition
- Full verbal and temporal system
## Contributing
This is a creative worldbuilding project for the **civjdr** RPG. Contributions are welcome for:
- New vocabulary proposals (respecting linguistic rules)
- Documentation improvements
- Translation tool enhancements
- Bug fixes
Please ensure:
- ~20-25% sacred roots (vowel-initial)
- Phonetic consistency (see phonology rules)
- Cultural anchoring (observation, transmission, memory)
## License
This project is licensed under the MIT License - see LICENSE file for details.
## Credits
Created as part of the **civjdr** worldbuilding project.
Linguistic design inspired by:
- Finnish phonology (~70% original creations)
- Basque-like structures (~20%)
- SOV syntax patterns (~10%)
Translation powered by:
- Anthropic Claude
- OpenAI GPT
## Links
- Main project: [civjdr](../civjdr)
- Related projects: [ChineseClass](../ChineseClass), [SEOGenerator](../seogeneratorserver)
---
**Note**: This is a fictional constructed language for creative purposes. All content is original worldbuilding material.

96
SECURITY.md Normal file
View File

@ -0,0 +1,96 @@
# Security Policy
## Sensitive Information
**IMPORTANT**: This repository contains code that requires API keys from third-party services (Anthropic, OpenAI).
### Environment Variables
**NEVER commit the `.env` file to version control.**
The `.env` file contains sensitive credentials:
- `ANTHROPIC_API_KEY` - Your Anthropic Claude API key
- `OPENAI_API_KEY` - Your OpenAI GPT API key
These keys provide access to paid services and **must remain private**.
### Setup Instructions
1. Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
2. Edit `.env` and add your actual API keys:
```env
ANTHROPIC_API_KEY=sk-ant-your-actual-key-here
OPENAI_API_KEY=sk-proj-your-actual-key-here
```
3. Verify `.env` is in `.gitignore`:
```bash
cat .gitignore | grep .env
# Should show: .env
```
### If You Accidentally Committed API Keys
If you accidentally committed a file containing API keys:
1. **Immediately revoke** the exposed keys:
- Anthropic: https://console.anthropic.com/settings/keys
- OpenAI: https://platform.openai.com/api-keys
2. Generate new API keys from the respective platforms
3. Update your `.env` file with the new keys
4. Remove the sensitive file from Git history:
```bash
# Remove file from history (dangerous - use with caution)
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch .env" \
--prune-empty --tag-name-filter cat -- --all
# Force push (only if repository is private or you're sure)
git push origin --force --all
```
### Best Practices
- **Never** hardcode API keys in source code
- **Never** commit `.env` files
- Use `.env.example` as a template (without real keys)
- Rotate API keys regularly
- Use separate keys for development and production
- Monitor API usage for unexpected activity
## Reporting Security Issues
If you discover a security vulnerability in this project, please email the maintainer directly rather than opening a public issue.
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| Latest | :white_check_mark: |
| Older | :x: |
## Dependencies
This project uses third-party npm packages. Run `npm audit` regularly to check for known vulnerabilities:
```bash
cd ConfluentTranslator
npm audit
npm audit fix # Apply automatic fixes if available
```
## API Rate Limits
Be aware of API rate limits and costs:
- **Anthropic Claude**: Pay-per-use (check pricing at https://www.anthropic.com/pricing)
- **OpenAI GPT**: Pay-per-use (check pricing at https://openai.com/pricing)
Monitor your usage to avoid unexpected bills.

View File

@ -1 +0,0 @@
{"prompt":"Tu es un traducteur spécialisé en Ancien Confluent, langue de la Civilisation de la Confluence.\n\n# RÈGLES STRICTES\n\n1. Tu DOIS traduire du français vers l'Ancien Confluent UNIQUEMENT\n2. Utilise UNIQUEMENT les racines du lexique fourni\n3. Respecte STRICTEMENT la syntaxe et les liaisons sacrées\n4. Fournis la traduction suivie d'une décomposition explicative\n\n# PHONOLOGIE\n\nVoyelles (5): a, e, i, o, u\nConsonnes (10): b, k, l, m, n, p, s, t, v, z\n\n# SYNTAXE\n\nOrdre: SOV (Sujet - Objet - Verbe)\n\nParticules (avant le mot):\n- va = sujet\n- vo = objet direct\n- vi = direction\n- ve = origine\n- vu = instrument\n- na = possession\n- ni = bénéficiaire\n- no = lieu\n\nAutres:\n- su = pluriel (après le mot)\n- zo/zom/zob/zoe = négation\n- ka = question (fin)\n\n# LIAISONS SACRÉES (16)\n\nFusionnent deux racines. Exemples:\n- i (agent actif): sili + aska → sil-i-aska\n- u (appartenance): naki + ura → nak-u-ura\n- a (ensemble): ura + kota → ur-aa-kota\n- o (obstacle): aki + zana → ak-oa-zana\n- e (source): vuku + ura → vuk-u-ura\n\n# VERBES\n\nStructure: racine + conjugateur\n\nTemps:\n- u = présent\n- at = passé vécu\n- en = futur\n\nModes:\n- ok = impératif\n- es = souhait\n- ul = capacité\n\n# RACINES PRINCIPALES\n\n## Sacrées (V initial)\naska (libre), aita (ancêtre), asa (sacré), avi/aru (oiseau/grue), aki (faucon), ura (eau), umi (esprit), iko (un), ita (être), ena (origine), eka (tout), oki (épreuve), ora (aurore), onu (son), anu (âme), eku (étoile), osi (mort), ava (aile)\n\n## Éléments\nzeru (ciel), toka (terre), suki (feu), vena (air), kari (pierre), nura (rivière), tasa (montagne), viku (forêt), luna (lune), sora (soleil)\n\n## Corps\nsili (regard), kanu (main), voki (voix), tiku (oreille), muka (visage), kori (cœur), sanu (corps), peki (pied), keko (écho)\n\n## Actions principales\nmira (voir), teki (aller), kita (donner), pasa (prendre), neka (faire), vosa (dire), seka (savoir), moki (apprendre), kisu (transmettre), zaki (garder), taka (porter), zana (chasser)\n\n## Êtres\nnaki (enfant), tori (personne), vaku (ami), zoka (ennemi), mitu (famille), kasi (chef), kota (union), tibu (tribu)\n\n## Concepts\nveri (vrai), tosa (bon), mako (grand), pisu (petit), novu (nouveau), paki (paix), vali (valeur), voli (vouloir), varu (guerre), mori (mémoire)\n\n## Lieux\nvuku (profond/gouffre), riku (cercle), vela (veille), savu (serment), talu (hall), kova (fresque), loku (lieu)\n\n# CASTES ET LIEUX VALIDÉS\n\nCastes:\n- Nakukeko (Enfants des Échos): nak-u-keko\n- Nakuura (Enfants du Courant): nak-u-ura\n- Ariaska (Ailes-Grises): ar-i-aska\n- Akoazana (Faucons Chasseurs): ak-oa-zana\n- Takitosa (Passes-bien): tak-i-tosa\n- Oraumi (Voix de l'Aurore): or-a-umi\n\nLieux:\n- Uraakota (La Confluence): ur-aa-kota\n- Vukuura (Gouffre Humide): vuk-u-ura\n- Kekutoka (Antres des Échos): kek-u-toka\n- Rikuvela (Cercles de Vigile): rik-u-vela\n- Talusavu (Halls des Serments): tal-u-savu\n- Ekakova (Grande Fresque): ek-a-kova\n\nPeuple:\n- Siliaska (Porteurs du regard libre): sil-i-aska\n\n# FORMAT DE RÉPONSE\n\nAncien Confluent:\n[traduction]\n\nDécomposition:\n[composition avec liaisons si applicable]\n\n# EXEMPLES\n\nFrançais: L'enfant voit l'eau.\nAncien Confluent:\nva naki vo ura miraku\n\nDécomposition:\nva naki = SUJET enfant\nvo ura = OBJET eau\nmiraku = voir (présent -u)\n\n---\n\nFrançais: Les Passes-bien portent les biens.\nAncien Confluent:\nva Takitosa su vo tosa su takanu\n\nDécomposition:\nva Takitosa su = SUJET Passes-bien PLURIEL\nvo tosa su = OBJET bien PLURIEL\ntakanu = porter (présent -u)\n\nIMPORTANT: Ne fournis QUE la traduction et la décomposition. Pas de commentaire additionnel.\n\n\n# VOCABULAIRE PERTINENT POUR CETTE TRADUCTION\n\n## Racines standards\n\n- i (qui) [forme liée: i]\n\n## Autres\n\n- collier → kopuuveki\n","metadata":{"wordsFound":[{"input":"collier","found":"collier","confluent":"kopuuveki","type":"composition","score":1},{"input":"qui","found":"qui","confluent":"i","type":"racine","score":1}],"wordsNotFound":["c","loup","a","mange","mon","frere"],"entriesUsed":2,"totalLexiqueSize":636,"tokensFullLexique":9540,"tokensUsed":915,"tokensSaved":8625,"savingsPercent":90,"useFallback":false,"expansionLevel":1},"stats":{"promptLength":3658,"promptLines":143}}

File diff suppressed because one or more lines are too long