Skip to content

Contributing, Security & Versioning Policy ​

Contributing to LatticeDX v0.4.2 follows clear monorepo module boundaries, automated CI and CodeQL verification, and private vulnerability disclosure to keep the Apache-2.0 Pure-OSI codebase clean and auditable.

Development Environment & Code Conventions ​

Local development requires Node.js 24.x (>=24 <25), pnpm 10.23.0, Git, tar, and Docker Compose v2+ (when validating container stacks). Install workspace dependencies from the locked manifest:

sh
git clone https://github.com/CTU-OpenPaw/lattice-dx.git
cd lattice-dx
pnpm install --frozen-lockfile

Contributors follow four structural rules when modifying the codebase:

RuleScopeTechnical Requirement
Directory layoutFull repositoryPlace standalone services under apps/, shared contracts under packages/, NocoBase extensions under plugins/nocobase/, and deployment files under infra/.
Modular boundariesapps/, packages/, plugins/Keep new source files focused (recommended under 300 lines per file). Never import internal source paths across apps/*; communicate via @dx/contracts or HTTP/REST APIs.
Generated files and purityGit working treeNever edit generated apps/web/next-env.d.ts, never add .gitmodules or upstream/ directories, and never commit .env, *.pem/*.key files, or credentials.
Licenses and SPDX headersAll new source filesInclude the 6-line @copyright (C) 2026 CTU-OpenPaw and SPDX-License-Identifier: Apache-2.0 header; every new dependency must be OSI-approved and added to NOTICE and docs/dependency-inventory.md.

Issue Tracking & Pull Request Workflow ​

The CTU-OpenPaw ecosystem separates repositories by responsibility: lattice-dx hosts the core platform, lattice-docs contains VitePress documentation, lattice-templates provides Solution Bundle v3 artifacts, and .github manages organization-level governance. Issues on CTU-OpenPaw/lattice-dx use structured templates under .github/ISSUE_TEMPLATE/:

Template / Config FilePurpose
.github/ISSUE_TEMPLATE/bug_report.ymlReproducible bug reports with environment, version, and minimal logs
.github/ISSUE_TEMPLATE/feature_request.ymlProposals for new capabilities, APIs, or studio blocks
.github/ISSUE_TEMPLATE/question_or_doc.mdTechnical questions or documentation improvements
.github/ISSUE_TEMPLATE/config.ymlDisables blank issues (blank_issues_enabled: false) and routes security reports to Security Advisories

Commit messages follow Conventional Commits (feat:, fix:, docs:, chore:, test:, refactor:).

Pre-Submission Pull Request Checklist ​

The .github/PULL_REQUEST_TEMPLATE.md template requires contributors to verify the following gates prior to review:

Verification GateAcceptance Criterion
SPDX headers & Pure-OSIPassing node scripts/source-headers.mjs --check and pnpm release:sbom -- --check
Pre-major 0.4.x lockVersion remains 0.4.2 with no unapproved bump to 1.0.0
NocoBase 2.2.50 boundaryPreserves Powered by NocoBase, "sdkProvidedByHost": true, and zero upstream/ or .gitmodules
Tenant isolation & RBACVerifies PostgreSQL 16 FORCE RLS policies and RBAC guards when touching models, migrations, or routes
Hygiene & test suitesZero secrets/PII, @sha256: pinned images, passing pnpm check and node --test
sh
pnpm check
node scripts/source-headers.mjs --check
pnpm release:sbom -- --check
pnpm audit --prod --audit-level=low

Automated CI & CodeQL Standards ​

Every Pull Request targeting main on CTU-OpenPaw/lattice-dx runs two automated workflows in .github/workflows/:

WorkflowJobVerification Scope
Check (ci.yml)checkRuns pnpm check (typecheck, vitest, build), source-headers.mjs --check, release:sbom -- --check, eval-vietnamese-nl-agent.mjs --min-pass=95, naming hygiene checks, and node --test across all 7 plugins
Check (ci.yml)dependency-auditExecutes pnpm audit --prod --audit-level=moderate and pnpm audit --prod --audit-level=low (0 unresolved production vulnerabilities)
Check (ci.yml)compose-validateRuns docker compose config --quiet across core.yml, nocobase.yml, native-rehearsal.yml, integration.yml, native-files.yml, uc1-sample.yml, iiot.yml, and all prod.yml profiles
Check (ci.yml)trivy-scanScans repository filesystem for vuln, misconfig, and secret findings at CRITICAL,HIGH severity via aquasecurity/trivy-action (ignore-unfixed: true)
CodeQL (codeql.yml)Analyze (javascript-typescript)Runs github/codeql-action/init@v4 with security-extended queries (build-mode: none) on pushes/PRs to main and weekly scheduled scans (0 3 * * 1), uploading SARIF reports

CI Hygiene and CodeQL SARIF Retention ​

The CodeQL workflow writes SARIF output to sarif-results/ and retains the build artifact for 14 days for security triage. For public repositories, SARIF findings upload directly to the GitHub Security tab (upload: always).

Beyond compilation and dependency audits, the check job enforces two automated repository hygiene checks:

  1. Rejects tracked .env files (other than .env.example), private key files (*.pem, *.key), or embedded credential tokens.
  2. Runs git grep naming hygiene checks across tracked files to ensure retired terminology does not reappear in product code or deployment configs.

Security Boundaries & Fixture Credentials Warning ​

Security patches are actively supported on the 0.4.x release line (main on CTU-OpenPaw/lattice-dx).

Loopback Fixture Credentials Warning ​

Default templates in .env.example and infra/compose/*.yml include public fixture credentials strictly for isolated 127.0.0.1 / localhost testing. Never expose these fixture values to untrusted networks or production data. Before any non-loopback deployment, operators must rotate every secret listed below and configure valid TLS certificates on Caddy:

Fixture VariableLoopback Fixture ValueProduction Requirement
POSTGRES_PASSWORD / POSTGRES_SUPERUSER_PASSWORDlocal-demo-passwordUnique strong passwords separating postgres from *_app roles
NOCOBASE_DB_PASSWORD / NOCOBASE_APP_DB_PASSWORDlocal-nocobase-passwordDistinct credentials for migration (nocobase) vs NOBYPASSRLS runtime (nocobase_app)
REDIS_PASSWORDlocal-redis-passwordHigh-entropy secret for Valkey 8.1 (CACHE_REDIS_URL, PUBSUB_ADAPTER_REDIS_URL, DB 2)
NOCOBASE_APP_KEY / NOCOBASE_ENCRYPTION_FIELD_KEYPublic fixture placeholder>=32-char / 32-byte keys used for JWT signing and AES-256-GCM key wrapping
APISIX_OIDC_CLIENT_SECRET / LATTICE_TRACK_VERIFY_SECRETSample integration valueProvisioned Keycloak dx-gateway secret and HMAC key for /v/track/:code QR proofs

Implemented Security Controls ​

Security LayerEnforcement Mechanism
Identity & sessionsFastify Core API validates Keycloak JWT signatures (OIDC_ISSUER / OIDC_JWKS_URL) and optimistic locking via expectedVersion. @latticedx/plugin-enterprise-auth enforces Authorization Code + PKCE S256 with Valkey DB 2 session revocation.
Row-level multi-tenancyPostgreSQL 16 enforces FORCE ROW LEVEL SECURITY across 56 static tables and dynamic latticeCustom* tables under the non-superuser nocobase_app role (NOBYPASSRLS), binding app.current_org per transaction.
Upload malware scanningapps/file-scanner streams uploaded attachments through ClamAV (clamav/clamav:1.5.5) over TCP before allowing object downloads from RustFS S3.
Container immutabilityAll 19 OCI container images in infra/compose/*.yml pin immutable @sha256: digests.

Private Vulnerability Disclosure ​

Never disclose security vulnerabilities, API tokens, .env files, or private keys in public GitHub Issues or Pull Requests.

Report security issues privately via GitHub Security Advisories:

text
https://github.com/CTU-OpenPaw/lattice-dx/security/advisories/new

Include a concise description of affected components, minimal reproduction steps, and the relevant commit SHA or version tag so maintainers can triage and coordinate remediation.

Pre-Major 0.x Versioning Policy (0.4.2) ​

LatticeDX follows pre-major (< 1.0.0) Semantic Versioning and is locked across the ecosystem at 0.4.2:

LatticeDX 0.x Pre-Major Versioning Rules
ParameterTypeDefaultDescription
0.4.2required
current—Current synchronized release across root package.json, all 7 NocoBase plugins, lattice-docs, and release tarballs.
0.4.x (PATCH)
compatible—Security patches, runtime fixes, and verification updates preserving compatibility with NocoBase 2.2.50 and Solution Bundle v3.
0.x.0 (MINOR)
breaking-pre-1—Reserved for schema changes, internal API evolutions, or plugin contract updates prior to stabilizing at 1.0.0.
< 1.0.0 lockrequired
policy—Releases remain below 1.0.0 until long-term public API stability guarantees are finalized across all repositories.

Every patch release in the 0.4.x line synchronizes version numbers across:

  • Root package.json ("version": "0.4.2").
  • All seven plugins/nocobase/*/package.json manifests ("version": "0.4.2").
  • lattice-docs/package.json ("version": "0.4.2").
  • COPYRIGHT.txt, docs/sbom-cyclonedx.json, and the source archive filename latticedx-0.4.2-src.tar.gz.

Pre-Release Verification Workflow ​

Before tagging a 0.4.x release commit, maintainers execute the full release verification sequence:

sh
pnpm check
node scripts/source-headers.mjs --check
pnpm release:sbom -- --check
pnpm audit --prod --audit-level=low
pnpm release:tarball --ref=HEAD

The generated output/release/latticedx-0.4.2-src.tar.gz archive and its .sha256 checksum file are extracted into a clean directory to verify standalone compilation without .git/ metadata.

Apache-2.0 · LatticeDX v0.4.2 · Powered by NocoBase · v2.2.50 · Apache-2.0 (Clause 5.2)