Merge pull request 'fix(recovery): restore 0pt source and isolate integration writes' (#539) from codex/operator-source-recovery-20261110 into main
CI (SIAX Cloud) / Component conformance (blocking) (push) Successful in 9s
Security Scan (SIAX Cloud) / security (push) Successful in 16s
CI (SIAX Cloud) / security (push) Successful in 18s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m19s
CI (SIAX Cloud) / quality (push) Successful in 1m28s
Deploy to Coolify / deploy (push) Successful in 2m15s
CI (SIAX Cloud) / sonar (push) Successful in 2m17s
CI (SIAX Cloud) / integration (push) Successful in 9m46s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
CI (SIAX Cloud) / Component conformance (blocking) (pull_request) Successful in 8s
masterplan-lock / check (pull_request) Successful in 11s
CI (SIAX Cloud) / security (pull_request) Successful in 15s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 32s
CI (SIAX Cloud) / integration (pull_request) Successful in 9m47s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m7s

This commit was merged in pull request #539.
This commit is contained in:
2026-11-10 02:55:08 +00:00
959 changed files with 115912 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
# BACKLOG P6 (CI-16): lets a developer run `act` to execute .gitea/workflows
# (GitHub-Actions-compatible syntax) locally before pushing, instead of
# discovering a workflow bug only after a Gitea runner picks it up.
# https://github.com/nektos/act
#
# ubuntu-latest here maps to a real Docker image (act's default is a minimal
# image missing tools this repo's workflows expect, e.g. curl for the
# Trivy/gitleaks install steps) -- catthehacker's full image matches what
# GitHub-hosted (and this fleet's siax-runner-*) ubuntu-latest actually has.
-P ubuntu-latest=catthehacker/ubuntu:full-latest
-W .gitea/workflows
--container-architecture linux/amd64
+50
View File
@@ -0,0 +1,50 @@
/**
* BACKLOG P6 (ARK-14): import-boundary check. Advisory today (run manually /
* `pnpm run deps:check`) -- not wired as a blocking CI gate in this pass,
* so a first real run surfacing findings doesn't turn a green PR red
* unexpectedly. Wiring it into CI is a reasonable next step once the
* initial finding set (if any) has been triaged.
*
* Boundaries encoded, matching CLAUDE.md / docs/architecture/ARCHITECTURE.md:
* - `services/scrapers` and `services/api` are Python -- not traversed by
* this JS/TS dependency graph at all; no rule needed, they're simply
* out of dependency-cruiser's file-type scope.
* - `src/` (the capability layer, blocking-typechecked) must not import
* from `app/` or `components/` (the v0-generated UI layer, advisory-only)
* -- that would pull UI-layer assumptions into the tested backend layer.
* - Nothing may import from `tests/` (test helpers stay test-only).
*/
module.exports = {
forbidden: [
{
name: 'no-src-importing-app-or-components',
comment:
'src/ is the blocking-typechecked capability layer (tsconfig.check.json); app/ and components/ are the advisory v0-generated UI layer. src/ importing from them would pull unverified UI-layer code into the tested backend layer.',
severity: 'error',
from: { path: '^src' },
to: { path: '^(app|components)' },
},
{
name: 'no-importing-tests',
comment: 'Test helpers stay test-only -- application code must not depend on tests/.',
severity: 'error',
from: { pathNot: '^tests' },
to: { path: '^tests' },
},
{
name: 'no-circular',
comment: 'Circular imports make the module graph hard to reason about and can hide load-order bugs.',
severity: 'warn',
from: {},
to: { circular: true },
},
],
options: {
tsPreCompilationDeps: true,
tsConfig: { fileName: 'tsconfig.json' },
exclude: { path: 'node_modules|\\.next|services/(api|scrapers)|services/infra' },
reporterOptions: {
text: { highlightFocused: true },
},
},
};
+15
View File
@@ -0,0 +1,15 @@
{
"name": "0pt",
"image": "mcr.microsoft.com/devcontainers/javascript-node:22",
"postCreateCommand": "corepack enable && corepack prepare pnpm@9 --activate && pnpm install --frozen-lockfile",
"postStartCommand": "node scripts/siax-doctor.mjs || true",
"forwardPorts": [3000],
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "editorconfig.editorconfig"]
}
},
"remoteEnv": {
"AUTH_ENFORCE": "false"
}
}
+35
View File
@@ -0,0 +1,35 @@
# Keep the build context small + reproducible. Do NOT exclude app source dirs
# (app/, components/, hooks/, lib/, packages/, src/, styles/, public/) -- next
# build needs them.
node_modules
.next
out
build
.git
.gitea
.github
# local env / secrets -- never ship into an image
.env
.env.*
!.env.example
.vercel
*.tsbuildinfo
next-env.d.ts
# python services + their large sample dumps are not part of the Next build
**/__pycache__
*.pyc
services/scrapers/output
# editor / OS noise
.DS_Store
*.log
npm-debug.log*
.pnpm-debug.log*
# the Docker files themselves
Dockerfile
.dockerignore
+25
View File
@@ -0,0 +1,25 @@
# BACKLOG P6 (REPO-13). Matches .prettierrc.json's 2-space indent -- this is
# a floor for editors that don't run Prettier on save, not a replacement for
# it (quote style/semicolons/line width stay Prettier's job, not
# EditorConfig's). Note: `pnpm run format` currently reports ~300
# pre-existing style violations across this repo (verified 2026-08-11,
# out of this pass's scope) -- this file governs new edits, not a
# retroactive reformat.
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[*.py]
indent_size = 4
[Makefile]
indent_style = tab
+301
View File
@@ -0,0 +1,301 @@
# =============================================================================
# 0pt (edge plane) -- environment inventory / example environment
# =============================================================================
# Copy to `.env` (gitignored) and fill in real values. Never commit real values.
# Vercel env for the edge app; VPS .env (git-ignored) for infra/docker-compose.yml.
# See docs/08-infrastructure.md for the canonical description of each integration.
#
# Two provenance markers are used below and they mean different things:
# * "wired in code today" -- read via a `process.env.*` somewhere in
# this repo right now (grep-verified).
# * "documented target, not yet read" -- named in docs/08-infrastructure.md /
# docs/02-architecture.md but with no
# `process.env.*` read yet. Filling it in
# unblocks the integration; it does not by
# itself change behaviour.
#
# The app is designed to build and boot with all of these UNSET: lib/db.ts and
# lib/stripe.ts are lazy + env-guarded, and the storage/payment/doc routes return
# HTTP 501 ("not configured") until the relevant keys are provided.
# ---------------------------------------------------------------------------
# Core / public
# ---------------------------------------------------------------------------
# Public base URL of this app (used for absolute links / callbacks).
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Documented target (docs/08); no call site found reading it in this pass.
# NOTE: api.0pt.app is a dead hostname (falls through to wildcard Vercel ->
# DEPLOYMENT_NOT_FOUND). The app serves its own /api routes on the site
# origin, so the honest base URL is the live origin itself.
NEXT_PUBLIC_API_URL=https://0pt.app
# ---------------------------------------------------------------------------
# Database (Postgres) -- wired in code today: lib/db.ts, app/api/health
# ---------------------------------------------------------------------------
# Vercel Postgres sets POSTGRES_URL / POSTGRES_PRISMA_URL automatically when the
# integration is attached. First one set wins, in this order (lib/db.ts):
# DATABASE_URL -> POSTGRES_URL -> POSTGRES_PRISMA_URL.
DATABASE_URL=postgres://user:password@localhost:5432/opt
POSTGRES_URL=
POSTGRES_PRISMA_URL=
# ---------------------------------------------------------------------------
# Cache / queue (Redis) -- app/api/health only checks presence; no other call
# site found reading it in this pass (worker queue usage, if any, lives in
# services/api, outside this repo's scope).
# ---------------------------------------------------------------------------
REDIS_URL=redis://localhost:6379
# ---------------------------------------------------------------------------
# Auth -- session / dev-login / service-token secrets (wired in code today)
# ---------------------------------------------------------------------------
# Session-signing secret (generate a long random string).
AUTH_SECRET=change-me-long-random-string
# AUTH_URL is documented (docs/08) but not yet read by any route in this pass.
AUTH_URL=https://0pt.app
# Optional dev-only login shortcut key (leave UNSET in production).
DEV_LOGIN_KEY=
# Shared token for internal/service-to-service calls; sent as X-Internal-Token
# on every engineFetch() call (lib/engine.ts).
INTERNAL_TOKEN=change-me-internal-token
# Tenant authority for the internal-token principal. Comma-separated allowlist
# of tenants this deployment's engine is entitled to write for, e.g.
# "379976258701823235". This is the ONLY source of tenant authority for
# X-Internal-Token: a request header may never name a tenant. Empty/unset means
# the service principal has no tenant authority and tenant-scoped writes
# (canonical facts, quality bridge runs) are denied with 403. Exactly ONE
# tenant is supported: the shared token identifies one service process, not a
# set of principals. A multi-tenant list is refused (401) until a verified
# workload-identity binding exists.
INTERNAL_SERVICE_TENANTS=
# ---------------------------------------------------------------------------
# Zitadel / OIDC Bearer verification (Wave 2 hardening) -- wired in code today
# ---------------------------------------------------------------------------
# 0pt verifies inbound Bearer tokens against the fleet Zitadel IdP
# (src/auth/zitadel.ts, wired via middleware.ts). JWKS are discovered from
# <issuer>/.well-known/openid-configuration, falling back to <issuer>/oauth/v2/keys.
#
# Fleet Zitadel issuer (OIDC). Default when unset: https://id-customers.siax.io
ZITADEL_ISSUER=https://id-customers.siax.io
# Browser login (Authorization Code + PKCE). Create a Web application in the
# Zitadel project with redirect URI https://0pt.app/api/auth/callback.
ZITADEL_OIDC_CLIENT_ID=
ZITADEL_OIDC_CLIENT_SECRET=
# Enforcement is FAIL-CLOSED. Leave this UNSET (or set it to "true") and a
# valid, verified Bearer token is REQUIRED on /api/0pt/* -- 401 on
# missing/invalid, 403 when X-Tenant-Id disagrees with the token tenant.
# ONLY the literal value "false" disables authentication, and that value is
# REFUSED when NODE_ENV=production: the app throws at startup instead of
# serving openly. Use "false" for local development only.
AUTH_ENFORCE=true
# Optional override for the claim key that carries the SIAX tenant id. When
# unset, tenant derivation uses the documented precedence:
# urn:zitadel:iam:org:id -> urn:zitadel:iam:user:resourceowner:id -> tenant_id -> tenant.
ZITADEL_TENANT_CLAIM=
# ---------------------------------------------------------------------------
# Data engine bridge -- wired in code today: lib/engine.ts
# ---------------------------------------------------------------------------
# When set, edge route handlers defer to the FastAPI engine (services/api) as the
# single source of truth (orders/estimates/catalog/ai-parse). When unset, the edge
# computes locally / falls back to an honest heuristic -- see lib/engine.ts and
# app/api/ai/parse.
ENGINE_URL=http://localhost:8000
# ---------------------------------------------------------------------------
# SIAX platform clients
# ---------------------------------------------------------------------------
# WIRED FOR REAL since 2026-08-31: every factory in src/clients/* reads its
# *_URL from process.env when no constructor baseUrl is given. Under
# NODE_ENV=production an UNSET url is a hard boot failure
# (SiaxError DEPENDENCY_UNAVAILABLE) — production never silently falls back
# to the in-memory mocks (Master-DoD §3/§10). In dev/test, unset = documented
# local mock/no-op behaviour.
CL0UD_URL=
N0D_URL=
AUD0_URL=
# Optional service bearer tokens for the platform clients (machine identity).
# Values come from Infisical/secret refs — NEVER commit real values here.
CL0UD_SERVICE_TOKEN=
N0D_SERVICE_TOKEN=
AUD0_SERVICE_TOKEN=
ST0RE_SERVICE_TOKEN=
# INF0 (AI OS) -- documented target, not yet read by any code in this repo.
# Route AI-parsning / model calls through the gateway instead of raw provider keys.
INF0_URL=
# ST0RE_URL is the convention name for src/clients/st0re-client.ts /
# st0re-lakehouse-client.ts and is read by the real-infra test suite
# (tests/p0/*.realinfra.test.ts). The lakehouse write path was live-verified
# against ST0RE on 2026-07-13 with this set; unset, the clients fall back to
# their deterministic in-memory mocks.
ST0RE_URL=
# ---------------------------------------------------------------------------
# P0 Data-OS backends (src/search, src/analytics, src/metadata, src/features)
# ---------------------------------------------------------------------------
# OpenSearch — search projections ONLY, never canonical truth (§42). Unset in
# dev/test = search capability unavailable (typed error), never a fake.
OPENSEARCH_URL=
# ClickHouse — 0pt capability analytics (tenant-isolated metric events).
# HAS NO CONNECTION to b0ts pipelines or quarantined market data (legal).
CLICKHOUSE_URL=
# "user:password" for ClickHouse basic auth; from secret refs only.
CLICKHOUSE_AUTH=
# OpenMetadata — metadata PROJECTION target (canonical stays in 0pt).
OPENMETADATA_URL=
OPENMETADATA_TOKEN=
# Feast feature server (online features path).
FEAST_SERVER_URL=
# ---------------------------------------------------------------------------
# Payments (Stripe) -- wired in code today: app/api/payments/*,
# app/api/webhooks/stripe
# ---------------------------------------------------------------------------
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
# Documented target (docs/08); not yet read by any route in this pass.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
# ---------------------------------------------------------------------------
# Object storage -- Cloudflare R2 / S3-compatible
# ---------------------------------------------------------------------------
# R2_ENDPOINT / R2_BUCKET / R2_ACCESS_KEY_ID are read in code today; all three
# are required to enable /api/uploads, otherwise it returns 501.
# R2_ACCOUNT_ID and R2_SECRET_ACCESS_KEY are documented in docs/08 but were NOT
# found via a process.env.* read in this pass -- verify before assuming the R2
# client is fully wired.
R2_ENDPOINT=https://<accountid>.r2.cloudflarestorage.com
R2_BUCKET=opt-uploads
R2_ACCESS_KEY_ID=change-me
R2_ACCOUNT_ID=
R2_SECRET_ACCESS_KEY=
# Fallback local artifact store used when no object storage is configured
# (src/adapters/local-blob-store.ts). Leave unset in production.
OPT_LOCAL_BLOB_DIR=./.opt-blobs
# ---------------------------------------------------------------------------
# Document intelligence / OCR (Azure) -- wired in code today:
# src/services/document-extraction-service.ts. Unset => extraction
# "not configured".
# ---------------------------------------------------------------------------
DOC_INTELLIGENCE_ENDPOINT=https://<resource>.cognitiveservices.azure.com
DOC_INTELLIGENCE_KEY=change-me
DOC_INTELLIGENCE_API_VERSION=2024-11-30
# ---------------------------------------------------------------------------
# Customer DB-grant encryption -- wired in code today:
# /api/connections/db-grant
# ---------------------------------------------------------------------------
# 32-byte key, AES-GCM. Encrypts customer-supplied read-only connection strings
# at rest.
GRANT_ENC_KEY=change-me-32-byte-key
# ---------------------------------------------------------------------------
# External write-back targets
# ---------------------------------------------------------------------------
# Odoo base URL for the bills/write-back adapter.
ODOO_BASE_URL=https://<your-odoo-host>
# ---------------------------------------------------------------------------
# Email -- Resend (documented target, docs/08; no Resend call site found in
# this pass -- treat as not-yet-implemented, not just unconfigured)
# ---------------------------------------------------------------------------
RESEND_API_KEY=
# ---------------------------------------------------------------------------
# Embedded analytics (documented target, docs/08; no call site found in this
# pass)
# ---------------------------------------------------------------------------
METABASE_SITE_URL=
METABASE_SECRET_KEY=
NOCODB_BASE_URL=
NOCODB_API_TOKEN=
# ---------------------------------------------------------------------------
# Test-only (tests/p0 real-infra suite; not needed to run the app)
# ---------------------------------------------------------------------------
# ST0RE_TEST_TENANT_ID=
# ---------------------------------------------------------------------------
# Document workbench (upload -> DOC0 -> INF0 -> validated export -> credits)
# Wired in code today: app/api/0pt/documents/*, app/api/0pt/credits/*.
# Every value is optional to boot and mandatory to USE: a missing integration
# makes its route answer 503 "not configured" instead of fabricating success.
# ---------------------------------------------------------------------------
# DOC0 document service. URL must be absolute HTTPS; token is a service PAT.
DOC0_URL=https://doc0.siax.io
DOC0_SERVICE_TOKEN=
# The DOC0 service identity's own actor id (token subject). DOC0 rejects an
# x-actor-id it has no actor_grant for; 0pt keeps the end-user actor in its own
# journal and lets the DOC0 call act as the service.
DOC0_SERVICE_ACTOR_ID=
# Maximum accepted upload size (bytes). Default 25 MiB.
OPT_MAX_UPLOAD_BYTES=26214400
# Interim AI path: self-hosted Ollama on the SIAX decision server
# (server-decision-01). Internal only; no provider key and no per-token cost.
# Plain HTTP is accepted only for loopback/RFC1918/tailnet hosts.
DECISION_OLLAMA_URL=http://100.96.133.104:11434
DECISION_OLLAMA_MODEL=hermes-qwen3.5:9b
# INF0 AI gateway (model calls). No provider key is ever placed in this repo.
# Live path today: the LiteLLM gateway (OpenAI-compatible). The native
# /v1/inf0/* surface is contract-only; INF0_URL is used as a fallback.
INF0_GATEWAY_URL=https://ai-gateway.siax.io/v1
INF0_GATEWAY_LITELLM_KEY=
INF0_GATEWAY_PROVIDER_KIND=external
INF0_URL=https://api.inf0.siax.io
INF0_API_TOKEN=
# PAY0 (optional; Stripe is used directly for credit checkout today).
PAY0_URL=https://pay0.siax.io
PAY0_API_TOKEN=
# N0D / ST0RE (used by the broader pipeline; not required by the routes above).
N0D_URL=https://api.n0d.siax.io
N0D_API_TOKEN=
ST0RE_URL=https://api.st0re.siax.io
ST0RE_API_TOKEN=
# OpenFGA project authorization. Without all four values, document routes fail
# closed with PROJECT_AUTHORIZATION_NOT_CONFIGURED.
OPENFGA_API_URL=https://fga.siax.io
OPENFGA_STORE_ID=
OPENFGA_MODEL_ID=
OPENFGA_AUTH_TOKEN=
# Transitional, server-owned project grants used only when OpenFGA is not
# configured. JSON array; actorId "*" means every verified actor in the tenant.
# OPT_PROJECT_GRANTS=[{"tenantId":"379976258701823235","projectId":"prj_demo","actorId":"*"}]
OPT_PROJECT_GRANTS=
# Model policy for the document workbench. Without this, structuring answers
# MODEL_POLICY_NOT_CONFIGURED.
OPT_ALLOWED_MODELS=
OPT_ALLOWED_DATA_CLASSES=none,low
OPT_MODEL_DESTINATION=external
OPT_EXTERNAL_TRANSFER_ALLOWED=false
OPT_MODEL_MAX_INPUT_TOKENS=60000
OPT_MODEL_MAX_OUTPUT_TOKENS=4000
# Server-owned, versioned credit price book (JSON, one line). No price is ever
# read from a browser. Without it, credit packs/checkout/structuring answer
# PRICE_BOOK_NOT_CONFIGURED.
# {"version":"2026-11-01","currency":"SEK","packs":[{"id":"starter","credits":100,"amountMinor":9900}],"metering":{"pagesPerCredit":5,"inputTokensPerCredit":20000,"outputTokensPerCredit":4000}}
OPT_CREDIT_PRICE_BOOK=
# Pilot switch. `off` runs document structuring without a wallet; it is
# explicit (never a silent fallback), the response reports `credits: null`, and
# purchases stay disabled. Unset/`on` requires the price book + ledger.
OPT_CREDITS_MODE=
# One-time trial credits granted per tenant (server-owned, idempotent, NOT a
# payment). 0 disables. With OPT_CREDITS_MODE=on this lets reserve/settle run
# in production before any customer purchase.
OPT_TRIAL_CREDITS=0
# Central Keycloak (SIAX Portal)
KEYCLOAK_ISSUER=https://auth.portal.siax.dev/realms/portal
KEYCLOAK_EXPECTED_AUDIENCE=account
KEYCLOAK_AUTHORIZED_PARTY=siax-portal
+37
View File
@@ -0,0 +1,37 @@
# Normalize line endings for text files; keep binaries untouched.
* text=auto
# Source / config
*.ts text eol=lf
*.tsx text eol=lf
*.js text eol=lf
*.mjs text eol=lf
*.cjs text eol=lf
*.css text eol=lf
*.json text eol=lf
*.jsonc text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.py text eol=lf
*.md text eol=lf
*.sh text eol=lf
Dockerfile text eol=lf
*.dockerfile text eol=lf
# Binaries / generated — never text-normalized
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.webp binary
*.ico binary
*.svg text eol=lf
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary
*.pyc binary
*.pyo binary
# Lockfiles — keep exactly as generated
pnpm-lock.yaml -text
+11
View File
@@ -0,0 +1,11 @@
# CI-14 — CODEOWNERS bor i .gitea/, aldrig i .github/ (SEC-25).
# Granskning krävs särskilt för kontrakt, deploy och migrationer.
* @sax3l
/contracts/ @sax3l
/deploy/ @sax3l
/.gitea/ @sax3l
/siax.repo.json @sax3l
/siax.config.json @sax3l
# TODO: lägg till migrationskatalogen när den finns, t.ex.
# /packages/db/migrations/ @sax3l
+206
View File
@@ -0,0 +1,206 @@
name: Deploy to Coolify
# Follows the fleet-wide pattern used by sax3l/n0d and sax3l/st0re: push to
# main triggers a POST to Coolify's deploy endpoint for this app's UUID,
# authenticated with the COOLIFY_TOKEN repo secret. Coolify already has the
# Dockerfile (build_pack: dockerfile) -- this workflow only fires the
# rebuild+redeploy, it doesn't build or push an image itself.
#
# STATUS (verified 2026-11-02): LIVE. The Coolify application exists
# (dockerfile build pack, git.siax.io/sax3l/0pt, branch main) and its UUID is
# supplied by the repository variable COOLIFY_APP_ID; COOLIFY_TOKEN and the
# registry/cosign secrets are set. A push to main, or a manual
# workflow_dispatch of this file, has been proven to verify the signed
# attestation for the exact commit and then return HTTP 200 from Coolify.
# The placeholder guard below remains as a fail-closed guard, not as a TODO.
# Operational procedure and verification live in docs/runbook/deploy.md.
on:
push:
branches: [main]
workflow_dispatch:
# Never let two deploys race the same Coolify app. Unlike CI we do NOT cancel an
# in-flight deploy (it may already be restarting the container); the newest
# commit still wins because Coolify builds from the branch head.
concurrency:
group: deploy-0pt-main
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
COOLIFY_APP_ID: ${{ vars.COOLIFY_APP_ID || 'TODO-no-coolify-app-provisioned-yet' }}
IMAGE_REPO: git.cloud.siax.io/sax3l/0pt
steps:
# -----------------------------------------------------------------
# SIGNED-ARTIFACT GATE (added 2026-09-14, same pattern as
# sax3l/cl0ud + sax3l/st0re's fix/wire-signed-digest-to-deploy; this
# job's own wait-for-signed-artifact polling logic below predates and
# is independent of the 2026-09-15 G17 migration, and is KEPT as-is
# here -- it is a real, working, 0pt-specific mechanism, not part of
# what that migration delegates to siax-templates): once the guard
# step below stops failing (i.e. once a real Coolify app exists for
# 0pt and COOLIFY_APP_ID is filled in), this job will REFUSE to call
# Coolify at all unless a verified attestation exists in the registry
# for the EXACT commit being deployed. `.gitea/workflows/release.yml`
# is the piece that builds, SBOMs, scans, attests, and pushes that
# image (rewritten 2026-09-15 to delegate to sax3l/siax-templates'
# G17 reference hook -- see `.siax/hooks/README.md`).
#
# VERIFY STEP CHANGED 2026-09-15 (part of the G17 migration): the old
# release.yml called `cosign sign` on the bare digest, so this job's
# gate used `cosign verify`. The new release.yml calls `cosign attest`
# instead -- a full DSSE-signed in-toto Statement binding digest +
# source SHA + build identity + environment + SBOM hash (ADR-W16-003
# bar items 4/5), not just a bare-digest signature. `cosign verify`
# against a `cosign attest`-only artifact fails with "no matching
# signatures" (attestations and signatures are stored/verified
# separately in cosign's model) -- so this step now calls
# `cosign verify-attestation --type <predicate-type>` instead, the
# same command `.siax/hooks/G17.sh` itself already runs and requires
# to PASS before it will submit evidence to AUD0.
#
# HONEST LIMITATION (identical to cl0ud/st0re/h0st's writeup):
# `siax.config.json`'s `deploy.target: "coolify"` and this file's own
# `/api/v1/deploy` call assume a `dockerfile` build-pack Application
# once provisioned -- same as cl0ud/st0re/h0st, Coolify would clone
# this repo and run its OWN independent `docker build`, never pulling
# the image release.yml pushed and signed, and `/api/v1/deploy` has no
# digest parameter. True digest-pinning would need 0pt's eventual
# Coolify app migrated to the separate "Docker Image" resource type --
# a production infrastructure decision that hasn't been made yet
# (0pt isn't even provisioned on Coolify at all as of this writing;
# see the guard step below and docs/runbook/deploy.md §1), not
# something this CI-YAML change can or should decide.
#
# So: what this DOES guarantee, from the day 0pt's Coolify app exists
# -- Coolify is only ever told to rebuild+redeploy a commit whose
# release-chain artifact was built, SBOM'd, signed, and had its
# signature RE-verified in THIS job. What it does NOT guarantee --
# bit-identical bytes between the signed image and whatever Coolify's
# own rebuild produces from the same source.
# -----------------------------------------------------------------
- name: Guard against unset token / placeholder app id
run: |
if [ -z "${{ secrets.COOLIFY_TOKEN }}" ]; then
echo "::error::COOLIFY_TOKEN secret is not set on this repo -- cannot redeploy."
exit 1
fi
if [ "$COOLIFY_APP_ID" = "TODO-no-coolify-app-provisioned-yet" ]; then
echo "::error::No Coolify app has been provisioned for 0pt yet. Create the app in the Coolify UI (cloud.siax.io), copy its UUID into COOLIFY_APP_ID in this file, and set the COOLIFY_TOKEN repo secret before this workflow can deploy anything."
exit 1
fi
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve this commit's release-chain tag (same scheme as release.yml)
id: sha
run: |
set -euo pipefail
short="$(git rev-parse --short=12 HEAD)"
echo "short=$short" >> "$GITHUB_OUTPUT"
echo "image_ref=${IMAGE_REPO}:sha-$short" >> "$GITHUB_OUTPUT"
- name: Docker login (git.cloud.siax.io) — read access to check release.yml's output
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
registry_host="$(echo "$IMAGE_REPO" | cut -d/ -f1)"
echo "$REGISTRY_TOKEN" | docker login "$registry_host" -u "$REGISTRY_USER" --password-stdin
- name: Install cosign v3.1.3 (pinned, checksum-verified — never :latest)
run: |
set -euo pipefail
cd /tmp
curl -fsSL -O https://github.com/sigstore/cosign/releases/download/v3.1.3/cosign-linux-amd64
curl -fsSL -O https://github.com/sigstore/cosign/releases/download/v3.1.3/cosign_checksums.txt
grep 'cosign-linux-amd64$' cosign_checksums.txt | sha256sum -c -
install -m 0755 cosign-linux-amd64 /usr/local/bin/cosign
cosign version
- name: Wait for release.yml's signed artifact for THIS commit, then verify (fail closed)
id: verify
env:
IMAGE_REF: ${{ steps.sha.outputs.image_ref }}
SHORT: ${{ steps.sha.outputs.short }}
PREDICATE_TYPE: https://siax.io/attestations/g17-release-evidence/v1
run: |
set -euo pipefail
test -f cosign.pub || { echo "::error::cosign.pub not found at repo root — cannot verify, refusing to deploy"; exit 1; }
# release.yml runs as a SEPARATE workflow triggered by the same push
# (Gitea/GitHub Actions has no cross-workflow-file `needs:`), so this
# job cannot depend on that job directly — it polls the registry for
# the artifact release.yml produces instead. Bounded: a genuinely
# broken/skipped release run fails this job loudly rather than
# hanging forever.
#
# The loop retries TWO distinct not-ready states (measured live on
# run 2265dbb 2026-09-15, under the OLD bare-signature gate — the
# same race applies to attestation-attach timing today): tag not
# pushed yet (release still building) vs. tag pushed but the
# attestation not attached yet (release between push and
# `cosign attest`).
attempt=0
max_attempts=40
digest=""
while true; do
attempt=$((attempt + 1))
if [ "$attempt" -ge "$max_attempts" ]; then
echo "::error::no signed image found at $IMAGE_REF after $max_attempts attempts (10 min) — release.yml has not produced a signed artifact for sha-$SHORT. Refusing to deploy an unverified rebuild."
cat /tmp/pull.log 2>/dev/null || true
cat /tmp/verify.log 2>/dev/null || true
exit 1
fi
if ! docker pull "$IMAGE_REF" >/tmp/pull.log 2>&1; then
echo "image not yet available at $IMAGE_REF (attempt $attempt/$max_attempts) — waiting for release.yml..."
sleep 15
continue
fi
# Read back the digest the registry actually stored for this tag —
# same filter release.yml itself uses (RepoDigests can hold multiple
# entries; never trust index 0) — and verify THAT digest, never the
# mutable tag alone, so a tag reassigned after signing can't slip past.
repo_digest="$(docker inspect --format='{{json .RepoDigests}}' "$IMAGE_REF" \
| node -e "const rd=JSON.parse(require('fs').readFileSync(0,'utf8')); const prefix=process.env.IMAGE_REPO+'@'; const m=rd.find(r=>r.startsWith(prefix)); if(!m){console.error('no RepoDigests entry starting with '+prefix+' among: '+JSON.stringify(rd));process.exit(1);} console.log(m);")"
digest="${repo_digest##*@}"
echo "$digest" | grep -Eq '^sha256:[0-9a-f]{64}$' || { echo "::error::unexpected digest shape: $digest"; exit 1; }
echo "verifying cosign attestation on ${IMAGE_REPO}@${digest} ..."
if cosign verify-attestation --key cosign.pub --type "$PREDICATE_TYPE" "${IMAGE_REPO}@${digest}" >/tmp/verify.log 2>&1; then
break
fi
if grep -qE "no matching (attestations|signatures)( found)?" /tmp/verify.log; then
echo "image present but attestation not attached yet (attempt $attempt/$max_attempts) — waiting for release.yml's cosign attest..."
sleep 15
continue
fi
echo "::error::cosign verify-attestation FAILED for ${IMAGE_REPO}@${digest} (not a not-ready state — refusing to deploy)"
cat /tmp/verify.log
exit 1
done
echo "digest=$digest" >> "$GITHUB_OUTPUT"
echo "SIGNED ARTIFACT VERIFIED: ${IMAGE_REPO}@${digest} — authorizing Coolify redeploy of sha-$SHORT"
- name: Trigger Coolify redeploy
env:
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
VERIFIED_DIGEST: ${{ steps.verify.outputs.digest }}
run: |
# See the SIGNED-ARTIFACT GATE comment above: Coolify's /deploy has
# no digest/image param to pass, so $VERIFIED_DIGEST is not (and
# cannot be) sent to Coolify — it is recorded here as the
# provenance proof that authorized this specific redeploy call.
echo "authorized by verified digest: $VERIFIED_DIGEST"
curl -fsS -X POST \
"https://cloud.siax.io/api/v1/deploy?uuid=${COOLIFY_APP_ID}&force=false" \
-H "Authorization: Bearer $COOLIFY_TOKEN" \
-o /dev/null -w 'coolify deploy HTTP %{http_code}\n'
+330
View File
@@ -0,0 +1,330 @@
name: CI (SIAX Cloud)
# Self-hosted CI on SIAX Cloud (Gitea Actions, runners siax-runner-1/2).
# Quality gate for the Next.js 16 web console + the 0pt capability layer.
#
# * typecheck (BLOCKING) -> `tsc -p tsconfig.check.json` over src/ + tests/.
# * test (BLOCKING) -> `vitest run`.
# * lint (ADVISORY) -> `eslint src tests` (legacy v0-generated noise
# is inherited debt; continue-on-error so it never blocks).
# * build (BLOCKING) -> `next build`.
#
# * security (BLOCKING) -> `trivy fs` over the repo; fails the build on
# HIGH/CRITICAL vulns or detected secrets. This is a REQUIRED
# protected-branch context -- see the job's own comment.
#
# Nightly re-runs live in nightly.yml; security.yml is the dedicated
# push/PR/weekly scanner (this file is push/PR-only).
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
# One run per ref; a branch push that also updates a PR used to start two full
# quality runs (and, on main, two deploy chains). Cancel the superseded one.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Enable corepack + pin pnpm@9 (pnpm-lock.yaml is lockfileVersion 9.0)
run: |
corepack enable
corepack prepare pnpm@9 --activate
- name: Install (frozen lockfile)
run: pnpm install --frozen-lockfile
- name: Typecheck (tsc over src/ + tests/ -- blocking)
run: pnpm run typecheck
# UI-09: 0pt carried 82 axe color-contrast violations (impact=serious), the
# estate's largest single a11y defect, and every one came from a Tailwind
# alpha modifier on a text colour. The unmodified token measures 4.73:1
# light / 7.63:1 dark and passes AA; every faded variant fails. Blocking,
# because a contrast regression is invisible in review.
- name: Text contrast shape (WCAG 2.2 AA 1.4.3 -- blocking)
run: pnpm run check:contrast
- name: Test (vitest -- blocking)
run: pnpm run test
- name: Lint (eslint -- advisory; legacy tree has pre-existing noise)
continue-on-error: true
run: pnpm run lint
- name: Build (next build -- blocking quality gate)
run: pnpm run build
# REAL-DEPENDENCY integration tests (Master-DoD §48: "integration tests ...
# Mocks alone count as insufficient"; §10 Search/Analytics). Runs
# tests/integration/* against a LIVE OpenSearch + LIVE ClickHouse started as
# service containers.
#
# SERVICE-CONTAINER DISCIPLINE is copied from sax3l/st0re's ci.yml, which
# documents three measured defects on these runners (alias collision across
# repos, sibling-run collision behind one alias, and DNS round-robin):
# * repo-unique aliases (opt-ci-opensearch / opt-ci-clickhouse),
# * SELF-IDENTIFYING containers — OpenSearch carries a run-unique
# cluster.name; ClickHouse carries run-unique credentials — so the
# select step can positively identify THIS run's container,
# * enumerate every IP behind the alias (getent ahostsv4), keep the one
# that proves the run identity, freeze it into the URL env var,
# * no match = hard failure, never a silent fallback or skip.
integration:
# Gitea currently ignores workflow concurrency. A branch push followed by
# its PR synchronize event otherwise starts TWO 512 MiB OpenSearch JVMs
# and ClickHouse suites on the same runner fleet at once; both timed out
# creating their first index (runs 28904/28906). Keep the blocking LIVE
# integration proof on every PR, on main push, and on manual dispatch;
# ordinary branch pushes still run blocking quality/security.
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 45
services:
opt-ci-opensearch:
image: opensearchproject/opensearch:2.11.1
env:
discovery.type: single-node
DISABLE_SECURITY_PLUGIN: "true"
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
# Identity badge: only THIS run's container answers with this
# cluster_name (the OpenSearch image maps dotted env keys to
# settings).
cluster.name: opt_ci_${{ github.run_id }}_${{ github.run_attempt }}
# Throwaway CI cluster: never let the runner's disk fill turn indices
# read-only (the 403 index_create_block_exception seen in run 388536).
cluster.routing.allocation.disk.threshold_enabled: "false"
# `--workdir` is REQUIRED (measured 2026-08-31, PR #25 CI run 7745,
# job "integration"): this runner's act_runner (v0.6.1) merges the
# JOB's WorkingDir (`/workspace/sax3l/0pt`) into every SERVICE
# container's config, clobbering the image's own `WORKDIR
# /usr/share/opensearch`. OpenSearch's ENTRYPOINT is the
# WORKDIR-relative `./opensearch-docker-entrypoint.sh`, so with the
# wrong cwd the container failed with "exec:
# \"./opensearch-docker-entrypoint.sh\": stat ...: no such file or
# directory" before it ever bound a port. ClickHouse's entrypoint is
# an absolute path, so it was unaffected by the same defect — do not
# assume a green ClickHouse service means service-container options
# are fine in general.
options: >-
--workdir /usr/share/opensearch
--health-cmd "curl -fsS http://localhost:9200/_cluster/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 60
opt-ci-clickhouse:
image: clickhouse/clickhouse-server:24.12
env:
CLICKHOUSE_USER: opt_ci
# Identity badge: run-unique password — an authenticated SELECT only
# succeeds against THIS run's container. CI-scoped throwaway value,
# not a secret (exists only for the lifetime of the job).
CLICKHOUSE_PASSWORD: ci_${{ github.run_id }}_${{ github.run_attempt }}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: "1"
options: >-
--health-cmd "wget -qO- http://localhost:8123/ping || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Enable corepack + pin pnpm@9
run: |
corepack enable
corepack prepare pnpm@9 --activate
- name: Install (frozen lockfile)
run: pnpm install --frozen-lockfile
- name: Select THIS run's OpenSearch by identity (st0re ci.yml pattern)
run: |
set -eu
WANT="opt_ci_${{ github.run_id }}_${{ github.run_attempt }}"
FOUND=""
for ip in $(getent ahostsv4 opt-ci-opensearch | awk '{print $1}' | sort -u); do
NAME=$(curl -fsS --max-time 5 "http://$ip:9200/" | sed -n 's/.*"cluster_name" *: *"\([^"]*\)".*/\1/p' || true)
echo "candidate $ip cluster_name=${NAME:-<none>}"
if [ "$NAME" = "$WANT" ]; then FOUND="$ip"; fi
done
[ -n "$FOUND" ] || { echo "FATAL: no OpenSearch behind the alias identifies as $WANT"; exit 1; }
# The single-node test cluster inherits the runner's disk watermark.
# On a busy runner the flood-stage watermark makes every new index
# read-only and the suite fails with HTTP 403
# index_create_block_exception (measured on run 388536). The container
# is throwaway CI state, so disable the disk threshold and PROVE that
# index creation works before the blocking tests run.
for attempt in 1 2 3 4 5; do
# Disabling the watermark alone does NOT clear a cluster that is
# already read-only: the flood stage sets
# cluster.blocks.read_only_allow_delete and every write keeps
# returning 403. Clear that block explicitly every attempt.
curl -sS --max-time 10 -X PUT "http://$FOUND:9200/_cluster/settings" \
-H 'Content-Type: application/json' \
-d '{"persistent":{"cluster.routing.allocation.disk.threshold_enabled":false,"cluster.blocks.read_only_allow_delete":null}}' >/tmp/os-settings.json || true
cat /tmp/os-settings.json 2>/dev/null || true
probe_status=$(curl -sS --max-time 10 -o /tmp/os-probe.json -w '%{http_code}' -X PUT "http://$FOUND:9200/opt-ci-probe-${{ github.run_id }}")
if [ "$probe_status" = "200" ]; then
curl -fsS --max-time 10 -X DELETE "http://$FOUND:9200/opt-ci-probe-${{ github.run_id }}" >/dev/null || true
echo "OpenSearch accepts index creation"
break
fi
echo "index creation not ready (attempt $attempt/5, HTTP $probe_status) — waiting"
cat /tmp/os-probe.json 2>/dev/null || true
[ "$attempt" = "5" ] && { echo "FATAL: OpenSearch still refuses index creation"; exit 1; }
sleep 10
done
echo "OPENSEARCH_URL=http://$FOUND:9200" >> "$GITHUB_ENV"
- name: Select THIS run's ClickHouse by identity
run: |
set -eu
PASS="ci_${{ github.run_id }}_${{ github.run_attempt }}"
FOUND=""
for ip in $(getent ahostsv4 opt-ci-clickhouse | awk '{print $1}' | sort -u); do
OK=$(curl -fsS --max-time 5 -u "opt_ci:$PASS" "http://$ip:8123/?query=SELECT%201" || true)
echo "candidate $ip auth_select=${OK:-<denied>}"
if [ "$OK" = "1" ]; then FOUND="$ip"; fi
done
[ -n "$FOUND" ] || { echo "FATAL: no ClickHouse behind the alias accepts this run's credentials"; exit 1; }
echo "CLICKHOUSE_URL=http://$FOUND:8123" >> "$GITHUB_ENV"
echo "CLICKHOUSE_AUTH=opt_ci:$PASS" >> "$GITHUB_ENV"
# The anti-skip guard here used to grep vitest's HUMAN output:
#
# grep -qE "skipped" && ! grep -qE "Tests [0-9]+ passed"
#
# vitest colours that summary, so the real line on this runner is
# ESC[2m Tests ESC[22m ESC[1mESC[32m97 passedESC[39m ... — ANSI escapes
# sit between "Tests " and the digits, so the two-spaces-then-digit
# pattern can never match. The first grep still matched "skipped", so
# the guard fired on ANY run containing a single skipped test while
# printing "integration suites skipped instead of running" — a false
# statement. Measured 2026-09-08, run 13911 job 31183: 13 files / 97
# tests PASSED, 1 file / 2 tests skipped → FATAL anyway.
#
# It survived review because it is correct locally: redirecting to a
# file disables vitest's colour, so the pattern matches on a developer
# machine and only misfires under CI.
#
# Replaced with the JSON reporter — structured and colourless. A/B
# measured on real reports, BOTH directions:
# all-skipped (0 passed / 99 pending) → RED (protection preserved)
# 945 passed + 184 skipped → GREEN (false red removed)
- name: Integration tests against LIVE OpenSearch + ClickHouse (blocking)
run: |
set -eu
# Env MUST be present here — the suites self-skip without it, and a
# skipped suite must never masquerade as a green integration gate
# (Master-DoD §56 status honesty).
[ -n "${OPENSEARCH_URL:-}" ] && [ -n "${CLICKHOUSE_URL:-}" ]
pnpm vitest run tests/integration \
--reporter=default \
--reporter=json --outputFile.json=/tmp/itest.json
node -e '
const fs = require("fs");
const p = "/tmp/itest.json";
if (!fs.existsSync(p)) {
console.error("FATAL: vitest produced no JSON report"); process.exit(1);
}
const r = JSON.parse(fs.readFileSync(p, "utf8"));
console.log(`integration: ${r.numPassedTests} passed, ${r.numPendingTests} skipped, ${r.numFailedTests} failed, ${r.numTotalTests} total`);
if (r.numFailedTests > 0) {
console.error("FATAL: integration tests failed"); process.exit(1);
}
if (r.numPassedTests === 0) {
console.error("FATAL: no integration test actually executed — every suite skipped");
process.exit(1);
}
'
# BLOCKING. This job publishes the protected-branch status check context
# "CI (SIAX Cloud) / security (push)", which branch protection on `main`
# lists as required alongside "CI (SIAX Cloud) / quality (push)".
#
# It previously ran Trivy with `--exit-code 0`, which made the REQUIRED
# context incapable of ever reporting failure. Measured 2026-09-08 on
# main @4514d97: a planted CRITICAL secret (AWS secret access key) was
# DETECTED by the scanner and the job still exited 0 -- i.e. the gate
# reported success while holding a critical finding in hand. The same
# command with `--exit-code 1` exits 1 on that planted secret and exits 0
# on the clean tree, so this flag is the whole difference between a real
# gate and a decorative one.
#
# KNOWN COVERAGE GAP (not fixed here, needs an owner decision):
# services/scrapers/requirements.txt pins nothing (`>=` ranges only), so
# Trivy's pip scanner cannot resolve versions and silently omits the file
# from the scan entirely -- it is not a target in the report at all.
# Pinning those same floors with `==` surfaces 3 HIGH findings today
# (aiohttp CVE-2025-69223, aiohttp CVE-2026-69244, lxml CVE-2026-41066).
# Do NOT paper over this with `--skip-dirs`; that would convert a
# measurable blind spot into declared policy.
security:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Trivy
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
# `siax/sbom/` är CycloneDX-evidenens för REDAN BYGGDA images (release-kedjan),
# inte källberoenden. Att scanna dem här återrapporterar gamla image-versioner
# (next 16.3.x, sharp 0.35.4) och blockerar källfixar som redan är patchade.
# Image-SBOM:erna verifieras i release/image-pipelinen.
- name: Trivy scan (vuln + secrets -- BLOCKING, fails on HIGH/CRITICAL)
run: |
trivy fs --scanners vuln,secret --severity HIGH,CRITICAL --exit-code 1 --skip-dirs 'siax/sbom' .
sonar:
# SonarQube Community Build har inget separat PR-analysläge (en enda "main"-gren
# per projekt) — en analys från en PR-branch eller en tagg-push som inte pekar på
# main skulle skriva över kvalitetshistoriken. Kör därför bara
# vid push till main.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarQube analysis (self-hosted sonar.siax.dev)
env:
SONAR_HOST_URL: https://sonar.siax.dev
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
set -euo pipefail
test -n "$SONAR_TOKEN" || { echo "::error::SONAR_TOKEN repo secret missing"; exit 1; }
# Jobbet kör i en container på act_runner; "docker run -v \"\$PWD:...\""
# skulle montera VÄRDENS (tomma) sökväg. Kopiera in källträdet istället.
cid=$(docker create -e SONAR_HOST_URL -e SONAR_TOKEN -w /usr/src \
sonarsource/sonar-scanner-cli:latest \
sonar-scanner -Dsonar.projectKey=0pt -Dsonar.host.url="$SONAR_HOST_URL")
trap 'docker rm -f "$cid" >/dev/null 2>&1 || true' EXIT
docker cp . "$cid":/usr/src
docker start -a "$cid"
design-conformance:
name: Component conformance (blocking)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Checkout canonical siax-standard (SSOT)
uses: actions/checkout@v4
with:
repository: admin/siax-standard
token: ${{ secrets.SIAX_CI_TOKEN }}
path: siax-standard-ssot
- name: Component conformance (blocking)
run: |
node --input-type=module -e "import('./siax-standard-ssot/packages/doctor/src/commands/component-conformance.mjs').then(m=>{process.exit(m.run(['--repo', process.env.GITHUB_WORKSPACE, '--allow-path-prefix', 'siax-standard-ssot/', '--fail-on=block']))})"
+18
View File
@@ -0,0 +1,18 @@
name: Health Check (SIAX Cloud)
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * 1"
jobs:
health:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Required files
run: |
for f in README.md LICENSE .gitignore; do [ -f "$f" ] || echo "::warning file=$f,title=Missing::$f is missing"; done
[ -f .gitea/workflows/ci.yml ] || echo "::warning title=No CI::No CI workflow found"
- name: Install Trivy
run: curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- name: Secret scan
run: trivy fs --scanners secret --exit-code 0 .
+22
View File
@@ -0,0 +1,22 @@
name: masterplan-lock
# Fails the build if this repo's copy of the SIAX Non-Platform masterplan
# (PLAN/MASTERPLAN_INDEX.md) is deleted or its locked architecture
# principles are stripped out. Dependency-free (POSIX sh) so it needs no
# language toolchain. See scripts/check-masterplan-lock.sh and
# sax3l/siax-masterplan.
on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Masterplan lock check
run: sh scripts/check-masterplan-lock.sh
+56
View File
@@ -0,0 +1,56 @@
name: Nightly (SIAX Cloud)
# Nightly full-gate re-run so CI exercises the repo even without pushes:
# quality gate + advisory security scan. Fails loudly on regressions
# introduced outside push-triggered runs (e.g. dependency drift).
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # daily 04:00 UTC
concurrency:
group: nightly-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Enable corepack + pin pnpm@9
run: |
corepack enable
corepack prepare pnpm@9 --activate
- name: Install (frozen lockfile)
run: pnpm install --frozen-lockfile
- name: Typecheck (blocking)
run: pnpm run typecheck
- name: Test (blocking)
run: pnpm run test
- name: Lint (advisory)
continue-on-error: true
run: pnpm run lint
- name: Build (blocking)
run: pnpm run build
security:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install Trivy
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
# A nightly scan exists to catch CVEs published against code that did
# not change. With `--exit-code 0` it could never report failure, so it
# could never raise that alarm -- the one job whose entire purpose is
# detection was the one guaranteed to stay green. Fixed 2026-09-08.
- name: Trivy fs scan (vuln + secrets -- fails on HIGH/CRITICAL)
run: |
trivy fs --scanners vuln,secret --severity HIGH,CRITICAL --exit-code 1 --skip-dirs 'siax/sbom' .
+77
View File
@@ -0,0 +1,77 @@
name: Production smoke (0pt.app)
# Automated end-to-end delivery verification. Every 30 minutes (and on demand)
# this checks that the live service is actually ready and that the running
# container is the commit that main points at — so a green deploy is never
# confused with a healthy, current service.
on:
workflow_dispatch:
schedule:
- cron: "*/30 * * * *"
concurrency:
group: prod-smoke
cancel-in-progress: true
jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Readiness (retry on a fresh deploy)
run: |
set -eu
for attempt in 1 2 3 4 5 6; do
body="$(curl -fsS --max-time 15 https://0pt.app/api/ready || true)"
echo "attempt $attempt: ${body:-<no response>}"
if printf '%s' "$body" | grep -q '"ready":true'; then
exit 0
fi
sleep 20
done
echo "::error::0pt.app/api/ready never reported ready:true"
exit 1
- name: Health envelope
run: |
set -eu
body="$(curl -fsS --max-time 15 https://0pt.app/api/health)"
echo "$body"
printf '%s' "$body" | grep -q '"db":"ok"' || { echo "::error::database is not ok"; exit 1; }
printf '%s' "$body" | grep -q '"stripe":"ok"' || { echo "::error::stripe is not ok"; exit 1; }
- name: Deployed commit equals main
env:
SIAX_CI_TOKEN: ${{ secrets.SIAX_CI_TOKEN }}
run: |
set -eu
version="$(curl -fsS --max-time 15 https://0pt.app/api/version)"
echo "$version"
running="$(printf '%s' "$version" | sed -n 's/.*"commit":"\([0-9a-f]*\)".*/\1/p')"
[ -n "$running" ] || { echo "::error::/api/version returned no commit"; exit 1; }
if [ -z "${SIAX_CI_TOKEN:-}" ]; then
echo "::warning::SIAX_CI_TOKEN is not set — cannot compare with main; commit $running is live"
exit 0
fi
expected="$(curl -fsS --max-time 15 \
-H "Authorization: token ${SIAX_CI_TOKEN}" \
"https://git.siax.io/api/v1/repos/admin/0pt/commits?limit=1" \
| python3 -c 'import sys,json; print(json.load(sys.stdin)[0]["sha"])')"
echo "running=$running expected(main)=$expected"
[ -n "$expected" ] || { echo "::error::could not read main SHA from Gitea"; exit 1; }
[ "$running" = "$expected" ] || {
echo "::error::production is $running but main is $expected — deploy did not land"
exit 1
}
- name: Document pipeline surface responds (auth required, never 404/5xx)
run: |
set -eu
for path in /api/0pt/documents/upload /api/0pt/documents/structure /api/0pt/documents/models /api/0pt/credits/balance; do
code="$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 -X POST "https://0pt.app${path}")"
echo "$path -> $code"
case "$code" in
401|405) ;; # unauthenticated or method guard: the route exists
*) echo "::error::$path returned $code (expected 401/405)"; exit 1 ;;
esac
done
+184
View File
@@ -0,0 +1,184 @@
name: Release chain (G17, ADR-W16-003)
# Builds + pushes the 0pt image, then hands off to the shared
# sax3l/siax-templates G17 reference hook for every ADR-W16-003 bar item
# 1-7 (pinned-tool install, SBOM, blocking vuln scan, in-toto attestation,
# scoped-key signing, pubkey verification, AUD0/ST0RE evidence storage).
#
# REPLACES this repo's own ad hoc "P007 pattern" release chain (added
# 2026-09-14). An audit (2026-09-15) found that chain failed most of the
# real promotion bar it claimed to meet: syft/cosign installed via a `curl`
# + freshly-refetched checksums file (not a pinned, out-of-band-verified
# digest -- see siax-templates' `lib/pinned-tools.sh` header for exactly
# why that is not a verified digest), NO vulnerability scan of the built
# digest at all, `cosign sign` on the bare digest only (no in-toto/SLSA
# statement, no source-SHA/build-identity/environment/SBOM-hash bound
# together, no scoped key identity), and evidence committed straight back
# into this same mutable repo (`siax/production-evidence/*.json`,
# `siax/source-bundles/*.json` -- nine such commits already existed in this
# repo's history before this change; deleted in this same PR, superseded by
# the real AUD0 write below). This file keeps ONLY what is genuinely
# 0pt-specific (image name, tag scheme, registry push, Dockerfile) and
# delegates everything else to `.siax/hooks/G17.sh` -> the shared reference
# implementation. See `.siax/hooks/README.md` for the pin status and
# required secrets (none of which were provisioned for the old gate either
# -- see that file's own note).
#
# DELIBERATELY ONE JOB. Gitea 1.26 on this fleet resolves org-level
# secrets (SIAX_CI_TOKEN below is org-level) only for the FIRST job of a
# workflow file -- learned the hard way on sax3l/h0st's and sax3l/aud0's
# own G17 migrations. 0pt does not wire a G20 post-deploy step in this
# pass at all (see `.siax/hooks/README.md` "G20 -- deliberately not wired
# yet": the app is now provisioned and `/api/version` exists, but G20 is still
# not wired in this pass), so the single-job constraint that forces G20 into its own
# workflow file elsewhere does not yet bite here -- documented anyway so a
# future PR adding G20 does not repeat the mistake.
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
env:
IMAGE_REPO: git.cloud.siax.io/sax3l/0pt
DOCKERFILE: Dockerfile
SIAX_TEMPLATES_REPO: sax3l/siax-templates
# PIN STATUS 2026-09-15: sax3l/siax-templates PR #51
# (feat/g17-signed-deploy-gate-adr-w16-003) MERGED to main, plus three
# real follow-up fixes on top -- #56/#57 (SPDX compound-license-
# expression evaluation, exercised live by this repo's own
# G17_LICENSE_ALLOW policy in .siax/hooks/G17.sh) and #59 (G20 retry
# logic -- not used by 0pt yet, but the pin picks up main's current tip
# rather than an older commit, matching what a fresh migration reviews).
#
# Re-pin 2026-09-25 (medveten, granskad): 9a3a0aa -> 09504e3a. Deltaet ar
# EN merge, siax-templates #138 "Upload complete release evidence and
# validate artifact receipt". Enda berorda filer under ci/v2 ar
# reference-hooks/{G17.sh, G17-ADR-W16-003.md, lib/emit-release-evidence.py,
# lib/test_emit_release_evidence.py}. Andringen ar bakatkompatibel by
# design: ST0RE-uppladdningen ar OPT-IN via G17_REQUIRE_ST0RE (default 0),
# sa en AUD0-only-konsument som 0pt kor exakt samma vag som forut.
#
# Deliberately NO branch name here: the pinned commit is checked out
# DIRECTLY (see the step below). The previous shape -- clone `main`, then
# require its HEAD to equal this pin -- turned every unrelated merge in
# siax-templates into a red release chain here (CD-03 / CI-RED-02) while
# nothing was actually unsafe. Checking the pin out directly keeps the pin
# a real supply-chain control (the gate runs exactly this reviewed commit,
# or it fails) without coupling it to someone else's branch tip.
SIAX_TEMPLATES_PINNED_SHA: 09504e3a593ee8ce0eaba606df31c349a3d52277
SIAX_TEMPLATES_DIR: /tmp/siax-templates-g17-ref
jobs:
release:
name: Build, push, G17 (SBOM/scan/attest/verify/evidence)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: https://git.siax.io/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4, mirrored + SHA-pinned (SUP-06, same pin n0d/cl0ud/st0re/h0st already use)
with:
fetch-depth: 0
# --- fetch the shared G17 reference implementation -----------------
# Same authenticated-fetch-at-runtime mechanism this repo's OLD
# release.yml already used SIAX_CI_TOKEN for (the evidence-commit
# push a prior PR deleted) -- see .siax/hooks/G17.sh's header for why
# NOT a `uses:` reusable workflow / submodule / vendored copy. Fails
# closed if the exact commit this adapter was reviewed against cannot
# be checked out (removed or rewritten upstream); an unrelated merge
# on siax-templates' own main is NOT a failure and never was a real
# signal.
- name: Fetch siax-templates G17 reference (pinned commit)
env:
SIAX_CI_TOKEN: ${{ secrets.SIAX_CI_TOKEN }}
run: |
set -euo pipefail
rm -rf "$SIAX_TEMPLATES_DIR"
mkdir -p "$SIAX_TEMPLATES_DIR"
git -C "$SIAX_TEMPLATES_DIR" init --quiet
git -C "$SIAX_TEMPLATES_DIR" remote add origin \
"https://oauth2:${SIAX_CI_TOKEN}@git.siax.io/${SIAX_TEMPLATES_REPO}.git"
# Ask for the pinned commit by SHA -- one shallow commit, no branch
# involved. A server with uploadpack.allowReachableSHA1InWant off
# refuses that, so fall back to fetching the branches and taking the
# same commit out of them. Either way the work tree ends up at
# exactly $SIAX_TEMPLATES_PINNED_SHA, never at a branch tip.
if ! git -C "$SIAX_TEMPLATES_DIR" fetch --quiet --depth 1 origin "$SIAX_TEMPLATES_PINNED_SHA"; then
echo "note: server refused a by-SHA fetch; falling back to fetching all branches"
git -C "$SIAX_TEMPLATES_DIR" fetch --quiet origin
fi
if ! git -C "$SIAX_TEMPLATES_DIR" -c advice.detachedHead=false \
checkout --quiet --detach "$SIAX_TEMPLATES_PINNED_SHA"; then
echo "::error::siax-templates commit $SIAX_TEMPLATES_PINNED_SHA not found in $SIAX_TEMPLATES_REPO -- the reviewed commit was removed or rewritten upstream. Re-review siax-templates and update SIAX_TEMPLATES_PINNED_SHA deliberately."
exit 1
fi
actual_sha="$(git -C "$SIAX_TEMPLATES_DIR" rev-parse HEAD)"
if [ "$actual_sha" != "$SIAX_TEMPLATES_PINNED_SHA" ]; then
echo "::error::checked-out siax-templates HEAD is $actual_sha, expected the pinned $SIAX_TEMPLATES_PINNED_SHA -- refusing to run an unreviewed version of the gate."
exit 1
fi
chmod +x "$SIAX_TEMPLATES_DIR/ci/v2/reference-hooks/"*.sh "$SIAX_TEMPLATES_DIR/ci/v2/reference-hooks/lib/"*.sh
echo "siax-templates G17 reference @ $actual_sha (pinned commit, checked out directly)"
- name: Resolve SHA + tag (never :latest)
id: sha
run: |
set -euo pipefail
full="$(git rev-parse HEAD)"
short="$(git rev-parse --short=12 HEAD)"
echo "full=$full" >> "$GITHUB_OUTPUT"
echo "short=$short" >> "$GITHUB_OUTPUT"
echo "image_tag=sha-$short" >> "$GITHUB_OUTPUT"
- name: Docker login (git.cloud.siax.io)
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
registry_host="$(echo "$IMAGE_REPO" | cut -d/ -f1)"
echo "$REGISTRY_TOKEN" | docker login "$registry_host" -u "$REGISTRY_USER" --password-stdin
- name: Build
env:
IMAGE_TAG: ${{ steps.sha.outputs.image_tag }}
run: |
set -euo pipefail
docker build -f "$DOCKERFILE" -t "${IMAGE_REPO}:${IMAGE_TAG}" .
- name: Push (immutable sha-<12> tag, never :latest)
env:
IMAGE_TAG: ${{ steps.sha.outputs.image_tag }}
run: docker push "${IMAGE_REPO}:${IMAGE_TAG}"
# --- G17: everything else, delegated -------------------------------
- name: G17 (bar items 1-7, delegated to siax-templates)
env:
ARTIFACT_COMMIT_SHA: ${{ steps.sha.outputs.full }}
ARTIFACT_IMAGE_TAG: ${{ steps.sha.outputs.image_tag }}
CI_RUN_ID: ${{ github.run_id }}
CI_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
G17_COSIGN_KEY: /tmp/0pt-g17-cosign.key
G17_COSIGN_KEY_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
AUD0_INGEST_TOKEN: ${{ secrets.AUD0_INGEST_TOKEN }}
AUD0_TENANT_ID: ${{ secrets.AUD0_TENANT_ID }}
run: |
set -euo pipefail
echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > "$G17_COSIGN_KEY"
trap 'rm -f "$G17_COSIGN_KEY"' EXIT
bash .siax/hooks/G17.sh
# NOTE: deliberately NO `actions/upload-artifact@v4` step here.
# sax3l/cl0ud's release.yml (run 23340, 2026-09-14) documents that
# this Gitea instance's act_runner does not reliably support
# upload-artifact@v4 even with continue-on-error: true, and that it
# can abort the whole job before later steps run. G17.sh's own AUD0
# submission (bar item 7, step above) is already the durable evidence
# record; a convenience local copy is not worth re-triggering that
# known breakage.
+43
View File
@@ -0,0 +1,43 @@
name: Security Scan (SIAX Cloud)
# Security scanning on every push/PR + weekly re-run.
#
# This job runs the same Trivy invocation as ci.yml's `security` job and
# previously carried the same defect: `--exit-code 0` meant it could report
# success while holding a CRITICAL finding (measured 2026-09-08 with a
# planted AWS secret key -- detected, still exit 0). Its context
# "Security Scan (SIAX Cloud) / security" is NOT in branch protection's
# required list, so this one never gated a merge either way; it is fixed
# here so a green tick on this workflow means what a reader assumes it
# means. See ci.yml's `security` job for the measurement and for the
# services/scrapers unpinned-requirements coverage gap.
#
# NOTE: findings on services/scrapers/* (FlareSolverr/Tor/curl_cffi) are
# expected and out of scope for CI gating -- kept per the account owner's
# dated, attributed decision (Simon Axelsson, 2026-08-11, interactive
# prompt; no rationale beyond "keep it" given or invented). See SECURITY.md
# and docs/compliance/GOLDEN-STANDARD-REPORT.md control C6 for full context.
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 5 * * 1" # weekly Monday re-scan
concurrency:
group: security-${{ github.ref }}
cancel-in-progress: true
jobs:
security:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Trivy
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- name: Trivy fs scan (vuln + secrets -- fails on HIGH/CRITICAL)
run: |
trivy fs --scanners vuln,secret --severity HIGH,CRITICAL --exit-code 1 --skip-dirs 'siax/sbom' .
+44
View File
@@ -0,0 +1,44 @@
name: VehIQ OLTP extractor (0pt ingestion)
# P070 — scheduled poll of app.dealer_stock_entry/app.deal (VehIQ, server10)
# into opt_dataset_projection (ClickHouse), via the watermark extractor in
# src/ingestion/vehiq-oltp-ingest-runner.ts. See docs/P070_VEHIQ_OLTP_
# EXTRACTOR.md for the full design and "what activating this requires".
#
# SAFE BY DEFAULT: VEHIQ_INGEST_MODE defaults to "preview" (read-only, never
# commits a checkpoint, never writes) below. With no VEHIQ_SOURCE_DATABASE_URL
# secret configured on this repo, the script logs "not_configured" and exits
# 0 — this workflow can be left enabled indefinitely with zero effect on
# anything until BOTH the secret is added AND VEHIQ_INGEST_MODE is changed
# to "run". Neither is done by this workflow file itself.
on:
workflow_dispatch:
schedule:
- cron: "*/15 * * * *"
jobs:
extract:
runs-on: ubuntu-latest
env:
VEHIQ_SOURCE_DATABASE_URL: ${{ secrets.VEHIQ_SOURCE_DATABASE_URL }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
OPT_ANALYTICS_CLICKHOUSE_BASE_URL: ${{ secrets.OPT_ANALYTICS_CLICKHOUSE_BASE_URL }}
OPT_ANALYTICS_CLICKHOUSE_BASIC_AUTH: ${{ secrets.OPT_ANALYTICS_CLICKHOUSE_BASIC_AUTH }}
OPT_ANALYTICS_CLICKHOUSE_DATABASE: opt_analytics
# Activation gate — see docs/P070_VEHIQ_OLTP_EXTRACTOR.md. Flip to
# "run" only once steps 1-4 in that doc's "What activating this
# requires" section are actually done.
VEHIQ_INGEST_MODE: preview
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Enable corepack + pin pnpm@9
run: |
corepack enable
corepack prepare pnpm@9 --activate
- name: Install (frozen lockfile)
run: pnpm install --frozen-lockfile
- name: Run the extractor (preview mode unless activated)
run: pnpm run vehiq:oltp-ingest
+59
View File
@@ -0,0 +1,59 @@
name: CI
# Quality gate: typecheck + test on every PR and non-main push.
# 0pt previously relied solely on the Vercel build with no pre-merge gate.
# Build is intentionally NOT run here because it needs runtime secrets
# (POSTGRES_URL, ENGINE_URL, STRIPE, RESEND) — Vercel owns the build; CI owns
# the static gate.
#
# Updated by the GitHub<->Gitea unification merge (2026-07-28). The note that
# used to sit here — "lint is not a step because this repo has no eslint
# dependency or config wired" — is no longer true: the Gitea line's Wave 2
# hardening added eslint + typescript-eslint + a flat config and repointed the
# "lint" script at `eslint src tests`. Lint now runs, ADVISORY
# (continue-on-error), matching .gitea/workflows/ci.yml: the v0-generated
# legacy tree carries pre-existing lint noise, so it must not block merges.
#
# `typecheck` (BLOCKING) is tsc over tsconfig.check.json = src/ + tests/.
# `typecheck:app` (ADVISORY) is the whole-repo tsc this workflow used to run as
# its blocking step. It was green on the GitHub line alone but reports 9
# pre-existing errors on the unified tree (app/api/0pt/* route handlers, where
# the Wave 2 Zod schemas type fields as plain `string` while the services want
# narrower unions). It is kept running, and kept visible, rather than deleted —
# see package.json's "//scripts" note. Flip it back to blocking once those 9
# are cleared.
#
# Python engine (services/api) is gated separately if/when a Python workflow
# is added.
on:
pull_request:
push:
branches-ignore: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
gate:
name: Typecheck + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Enable corepack (pnpm)
run: corepack enable
- name: Install (frozen lockfile)
run: pnpm install --frozen-lockfile
- name: Typecheck (tsc over src/ + tests/ -- blocking)
run: pnpm run typecheck
- name: Test (vitest -- blocking)
run: pnpm run test
- name: Typecheck whole repo (advisory -- 9 pre-existing app/ errors)
continue-on-error: true
run: pnpm run typecheck:app
- name: Lint (eslint -- advisory; legacy tree has pre-existing noise)
continue-on-error: true
run: pnpm run lint
+57
View File
@@ -0,0 +1,57 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
# next.js
/.next/
/out/
# production
/build
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files
.env*
!.env.example
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
# pnpm local store (created when store-dir defaults into the project)
.pnpm-store/
# interim LocalBlobStore output (src/adapters/local-blob-store.ts)
.data/
# local blob storage (document artifacts when no object storage configured)
.opt-blobs/
# python (engine + scrapers) -- runtime artifacts, never source
__pycache__/
*.pyc
*.pyo
.venv/
.pytest_cache/
# analytics / database files
*.duckdb
*.duckdb.wal
# scraper run output (local dumps written by services/scrapers/*.py, never source)
services/scrapers/output/
# local-only environment overrides (all real values live in Infisical)
.env.local
.env.production
# parallel git worktrees (policy: hidden inside the repo, never committed)
/.worktrees/
+8
View File
@@ -0,0 +1,8 @@
verify-deps-before-run=false
include-workspace-root=true
confirmModulesPurge=false
# SIAX Cloud publishes @siax/* packages from Gitea's own npm registry.
# Only scoped @siax/* names resolve here; everything else stays on the
# public npm registry.
@siax:registry=https://git.siax.io/api/packages/sax3l/npm/
+11
View File
@@ -0,0 +1,11 @@
# Build output and local worktrees are not source.
.next/
out/
build/
dist/
node_modules/
.worktrees/
coverage/
*.min.js
*.min.css
pnpm-lock.yaml
+6
View File
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 110
}
+30
View File
@@ -0,0 +1,30 @@
{
"exemptions": [
{
"control": "REPO-01",
"paths": [
"siax/sbom/sbom-0pt-2026-09-29.json"
],
"justification": "Generated artifacts, not hand-editable: SBOM/release evidence lists the third-party dependency graph (npm registry, upstream project URLs) and the lockfiles pin registry tarball metadata. Rewriting them would falsify supply-chain evidence."
},
{
"control": "REPO-01",
"paths": [
"AGENTS.md",
"CLAUDE.md",
"ONBOARDING.md",
"PRODUCTION_EVIDENCE.json",
"SECURITY.md",
"docs/02-architecture.md",
"docs/06-data-engine.md",
"docs/07-dependencies.md",
"docs/08-infrastructure.md",
"docs/09-build-plan.md",
"docs/P0_QUERY_SOURCE_FLOW.md",
"docs/compliance/INVENTORY.md",
"docs/compliance/SLUTRAPPORT.md"
],
"justification": "Documentation prose. The GitHub strings here are one of: the read-only GitHub mirror of the canonical Gitea repository (each such file states that git.siax.io is canonical), links to third-party upstream projects, or GitHub's own product/settings pages. None of them configures or names a SIAX git remote."
}
]
}
+1
View File
@@ -0,0 +1 @@
{"allow":[{"pathPrefix":"components/states.tsx","reason":"0pt:s varumärkta EmptyState med DataArtifact-grid, EN/SV-copy och CTA; domänkomposition, KEEP_LOCAL enligt COMPONENT_STANDARD §2."},{"pathPrefix":"components/theme-provider.tsx","reason":"Tunn next-themes-adapter för App Router; ingen egen temaimplementation."},{"pathPrefix":"components/ui/toaster.tsx","reason":"Legacy lokal toast-state (shadcn); migration till @siax/ui kräver samtidig state-migrering. KEEP_LOCAL med backlog."}]}
+14
View File
@@ -0,0 +1,14 @@
{
"schemaVersion": "1.0",
"repo": "0pt",
"generatedAt": "2026-09-23T21:12:27.075Z",
"standard": {
"canonicalRemote": "https://git.siax.io/sax3l/siax-standard.git",
"ref": "main",
"sha": "0000000000000000000000000000000000000000"
},
"repoRole": "LEGACY",
"schemaBundleDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
"ownerRegistryDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
"productFirewallDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
}
+8
View File
@@ -0,0 +1,8 @@
# GENERATED by siax-doctor repo-contract --apply (repo-contract-gate/v2 — 2026-09-23T21:12:27.075Z); template-fil, redigera via siax-templates - EJ handredigering. Saknas en rad här upptäcks det av RC-lagret.
# decision-usage — 0pt
schemaVersion: siax.decision-usage/v1
repo: 0pt
generatedAt: 2026-09-23T21:12:27.075Z
owners: [[email protected]]
decisions: []
notes: GENERATED stub - tomt ar den arliga 'inga beslut materialiserade'-formen; varje beslut under osakerhet listas har (required/advisory/shadow), produkter anropar aldrig Jev/providers direkt.
+12
View File
@@ -0,0 +1,12 @@
# GENERATED by siax-doctor repo-contract --apply (repo-contract-gate/v2 — 2026-09-23T21:12:27.075Z); template-fil, redigera via siax-templates - EJ handredigering. Saknas en rad här upptäcks det av RC-lagret.
# des1gn-consumer — 0pt (GENERATED neutral baseline; anpassa via siax-templates)
schemaVersion: siax.des1gn-consumer/v1
repo: 0pt
generatedAt: 2026-09-23T21:12:27.075Z
consumes:
'@siax/0pt-decision': 'härlett ur package.json (deklarerad workspace:*)'
'@siax/config': 'härlett ur package.json (deklarerad ^0.2.1)'
'@siax/tokens': 'härlett ur package.json (deklarerad ^0.1.2)'
'@siax/ui': 'härlett ur package.json (deklarerad ^0.4.1)'
localPrimitives: []
notes: GENERATED stub - tomt ar den arliga baseline-formen; konsumerade kanoniska DES1GN-paket (pinned) listas under consumes, kvarvarande lokala primitives motiveras i notes.
+24
View File
@@ -0,0 +1,24 @@
# GENERATED by siax-doctor repo-contract --apply (repo-contract-gate/v2 — 2026-09-23T21:12:27.074Z); template-fil, redigera via siax-templates - EJ handredigering. Saknas en rad här upptäcks det av RC-lagret.
# dev-profile — 0pt (neutral, kanoniskt giltig baseline; anpassa per repo via siax-templates)
schemaVersion: siax.dev-profile/v1
repoType: library
riskDefault: L2
capabilities:
stateful: false
deployable: false
publicApi: false
aiEnabled: false
userFacing: false
tenantScoped: false
handlesSecrets: false
gates:
realDatabase: required_when_changed
migrationUpgrade: required_when_changed
e2e: required_when_changed
accessibility: required_when_changed
visualRegression: required_when_changed
mutation: required_when_changed
performance: required_when_changed
release:
owner: sax3l
strategy: same-digest-promotion
+9
View File
@@ -0,0 +1,9 @@
# GENERATED by siax-doctor repo-contract --apply (repo-contract-gate/v2 — 2026-09-23T21:12:27.075Z); template-fil, redigera via siax-templates - EJ handredigering. Saknas en rad här upptäcks det av RC-lagret.
# feature-packs — 0pt
schemaVersion: siax.feature-packs/v1
repo: 0pt
generatedAt: 2026-09-23T21:12:27.075Z
packs:
permissions: []
states: []
notes: GENERATED stub - tomt ar den arliga baseline-formen; varje pack binder 'version owner backendOwner' (kanonisk backend-agare, aldrig kopierad implementation).
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More