Skip to content

1 3 project conventions and contributing

TransCompilator edited this page Nov 26, 2026 · 1 revision

1.3 Project Conventions and Contributing

Source: https://deepwiki.com/PonvasanthPon/TransCompilator/1-3-project-conventions-and-contributing

Project Conventions and Contributing

Relevant source files

The following files were used as context for generating this wiki page:

Purpose and Scope

This page defines the engineering contracts, architectural invariants, contribution workflows, and governance rules for tc_r1 as specified across CONTRIBUTING.md, AGENTS.md, MANIFEST.md, SKILL.md, and CHANGELOG.md. It outlines the strict determinism rules, zero-network and zero-ML invariants, pre-commit validation gates, standard library authoring standards, and the review process enforced across the nine-crate Rust workspace.

Sources: [CONTRIBUTING.md:1-81(), AGENTS.md:1-14()]


Irreducible Core Principles & Architecture Rules

All development within tc_r1 adheres to five non-negotiable architectural rules enforced by workspace linters, test harnesses, and pre-commit gates.

  1. Zero External Crates: The workspace root Cargo.lock must contain exactly the nine local tc-* packages with zero source = or checksum = entries from external registries (AGENTS.md, CONTRIBUTING.md).
  2. Core-7 IR Irreducibility: Core-7 contains exactly seven primitive categories: typed values, raw memory, control flow, functions, aggregates, raw syscalls, and traps (AGENTS.md). Convenience opcodes (print, file, list, string, English nodes) are forbidden.
  3. Three Anti-Hardcoding Bans: Open-class verb behaviors must originate from generated OEWN/VerbNet provenance tables (tc-lexicon), library behaviors must follow compositional syntax and declared Phrase: signatures (tc-semantics), and intent classification must rely on grammar/tense rather than hardcoded banned-noun lists (AGENTS.md).
  4. Runtime-First Rule: Whole-program compile-time evaluators are prohibited. Algorithmic constructs must lower to explicit runtime Stmt::Loop and Stmt::If control-flow nodes (AGENTS.md).
  5. Exact 1-Based Spans: All diagnostics and normalizations must preserve 1-based source line and column mappings through contraction expansion and phrase rewriting (AGENTS.md).
graph TD
    subgraph "Natural Language Space"
        A["EnglishSource (.eng)"] --> B["Segmenter & Tokenizer"]
    end
    subgraph "Semantic & Type System Space"
        B --> C["tc_semantics::IntentGate"]
        C --> D["tc_typeck::TypeChecker"]
    end
    subgraph "Code Entity Space"
        D --> E["tc_ir::Core7Module"]
        E --> F["tc_codegen_x86::emit_x86_64"]
        F --> G["Static ELF64 Executable"]
    end
    
    style A fill:#fff,stroke:#000,stroke-width:1px
    style E fill:#fff,stroke:#000,stroke-width:1px
    style G fill:#fff,stroke:#000,stroke-width:1px
Loading

Diagram 1: Natural Language to Code Entity Pipeline

Sources: [CONTRIBUTING.md:64-81(), AGENTS.md:16-73()]


Nine-Crate Pipeline & Workspace Topology

The repository is structured as an acyclic, std-only Cargo workspace containing nine crates. Front ends invoke the compiler in-process.

Crate Path Role & Responsibilities
crates/tc-lexicon Zero-ML OEWN-2025/VerbNet-3.4 lexical evidence, morphology, closed-class tables
crates/tc-syntax Link Grammar FFI bindings, block segmentation, clause tree normalization
crates/tc-semantics Intent gate, discourse stack, clause graph, English-to-typed-AST lowering
crates/tc-typeck Module resolution, type checking, generics, demand-driven monomorphization
crates/tc-ir Core-7 IR data structures, verifier, formatter, reference interpreter
crates/tc-codegen-x86 Intel-syntax assembly generation, GNU as/ld integration, static ELF64
crates/tc-cli Command-line driver (tc build, tc run, tc interp, tc trace, tc paraphrase)
crates/tc-lsp std-only JSON-RPC language server for IDE integration
crates/tc-editor r1-editor terminal UI and in-process compiler parity runner

Sources: [CONTRIBUTING.md:64-81(), AGENTS.md:75-115()]


Development Workflow and Pre-Commit Gates

Contributors must execute local offline builds and mandatory verification checks before submitting patches. Network access is disabled by environment policy.

Prerequisites and Build Commands

git clone https://github.com/PonvasanthPon/TransCompilator.git
cd TransCompilator
export PATH="$HOME/.cargo/bin:$PATH"
export CARGO_NET_OFFLINE=true
make build
./target/debug/tc --selftest

Mandatory Verification Gates

Run all checks from the workspace root:

export PATH="$HOME/.cargo/bin:$PATH"
export CARGO_NET_OFFLINE=true

make fmt-check
make lint
make audit
make test
./target/debug/tc --audit
./target/debug/tc --selftest

For modifications to standard library modules (std/*.eng), additional purity and parity test suites must pass:

cargo test -p tc-semantics --test phase4_6_version2_english std_files_are_pure_version2_english
cargo test -p tc-semantics --test phase4_7_pure_english_polish std_files_are_pure_version2_english
cargo test -p tc-semantics --test phase4_stdlib_parity
cargo test -p tc-cli --test human_english_battletest

Sources: [CONTRIBUTING.md:36-149(), SKILL.md:14-37()]


Standard Library (std/*.eng) Contributor Rules

The standard library consists of eight readable English modules (core, alloc, io, string, list, fs, map, math) located in std/.

  • Pure Version 2 English: No symbolic comparators (<, >, ==), no colon-ended headers, no indented code blocks, no C type tokens (u64, ptr), no dot-field notation (p.x must be written as p's x), and no underscored internal identifiers.
  • Explicit Imports: std/*.eng modules do not receive automatic prelude injection. They must declare dependencies explicitly via Use core, alloc, and io. [SKILL.md:155-155]
  • ABI Preservation: Public function names, Phrase: signatures, Call this as aliases, record fields, parameter types, and return types must remain strictly unchanged.
  • Comment Classification: Module epigraphs and prose notes must classify as COMMENT_OMITTED with zero tc-lsp diagnostics.
graph TD
    subgraph "Standard Library Files"
        S1["std/core.eng"] --> D1["Explicit Use Declarations"]
        S2["std/alloc.eng"] --> D1
        S3["std/io.eng"] --> D1
    end
    subgraph "Compiler Validation"
        D1 --> P["std_files_are_pure_version2_english"]
        P --> V["tc_semantics::IntentGate"]
        V --> IR["tc_ir::Core7Module"]
    end
    
    style S1 fill:#fff,stroke:#000,stroke-width:1px
    style P fill:#fff,stroke:#000,stroke-width:1px
    style IR fill:#fff,stroke:#000,stroke-width:1px
Loading

Diagram 2: Standard Library Purity and Lowering Flow

Sources: [CONTRIBUTING.md:167-184(), AGENTS.md:117-133(), SKILL.md:144-200()]


Licensing, Governance, and Review Process

  • Licensing: The repository is proprietary and All Rights Reserved (Copyright (c) 2026 Ponvasanth. All Rights Reserved.) [CONTRIBUTING.md:5-9, LICENSE:1-1]. No permission is granted to copy, modify, or distribute without written authorization from the copyright holder. Third-party components retain their respective licenses (CMU Link Grammar 5.13.2 under LGPL-2.1-or-later, OEWN 2025 and VerbNet 3.4 under CC-BY-4.0, and zed_extension_api under Apache-2.0) [CONTRIBUTING.md:25-32].
  • Commit Messages: Follow imperative subject naming conventions (e.g., fix(semantics): preserve spans through contraction expansion, feat(std): add runtime text splitting helpers) [CONTRIBUTING.md:98-106].
  • Review Policy: History rewrites and force-pushes are prohibited. Pull requests must report exact test counts and known limitations [CONTRIBUTING.md:108-147].

Sources: [CONTRIBUTING.md:1-34(), CONTRIBUTING.md:98-147(), LICENSE:1-10()]


Clone this wiki locally