fix(recovery): restore source removed by production documentation merge

This commit is contained in:
2026-11-10 03:42:10 +01:00
parent 585bdd4b44
commit 3d2fc6f913
957 changed files with 115754 additions and 0 deletions
+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
+141
View File
@@ -0,0 +1,141 @@
#!/usr/bin/env bash
# 0pt's G17 (Artifact security) hook adapter.
#
# 0pt's OWN release chain (`.gitea/workflows/release.yml`, added 2026-09-14
# as "P007 pattern") had a signing/SBOM chain -- but an audit (2026-09-15)
# found it failed most of the real ADR-W16-003 promotion bar it claimed to
# meet: syft/cosign installed via a `curl` + freshly-refetched checksums
# file (not a pinned digest), NO vulnerability scan of the built digest at
# all, `cosign sign` on the bare digest only (not source-SHA/build-identity/
# environment/SBOM-hash bound together), no in-toto/SLSA statement, and
# evidence committed straight back into this same mutable repo
# (`EVIDENCE_DIR="siax"` -> `siax/production-evidence/*.json`,
# `siax/source-bundles/*.json`, pushed with a SIAX_CI_TOKEN-authenticated
# `git push` on every release -- nine such commits already sit in this
# repo's history). This adapter, plus the rewritten `release.yml`, replaces
# that chain; the previous `siax/production-evidence/` and
# `siax/source-bundles/` trees are deleted in this same change (superseded,
# not left dangling -- see the PR description for exactly what a `git log`
# on those paths still shows for history).
#
# This adapter owns ONLY 0pt-specific values -- 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) is
# implemented ONCE in sax3l/siax-templates and executed here unmodified, per
# that reference file's own header: "This file is starting material a
# consumer repo copies to `.siax/hooks/G17.sh` and adapts -- it owns only
# the adapter ... `siax-templates` remains the sole owner of the G17
# CONTRACT and this reference implementation."
#
# --- Composition mechanism: checkout-at-CI-runtime, not a vendored copy ---
# `.gitea/workflows/release.yml` clones sax3l/siax-templates at a pinned
# commit into $SIAX_TEMPLATES_DIR before calling this file, authenticated
# with the SIAX_CI_TOKEN org secret 0pt's OWN release.yml already had wired
# for a DIFFERENT cross-repo write (the evidence-commit push this same
# change deletes) -- so the token and the auth idiom
# (`https://oauth2:${SIAX_CI_TOKEN}@git.siax.io/...`) are not new to this
# repo, only their use for a `git clone` of a sibling repo is. Picked over
# vendoring (the mechanism sax3l/st0re, sax3l/cl0ud and sax3l/api0's own
# G17 migrations used) because 0pt has ZERO prior vendored-copy convention
# anywhere in this repo (`grep -rl vendor .gitea/workflows/ .siax/` finds
# nothing, confirmed before writing this file) -- introducing one now, for
# this alone, would be a bigger repo-shape change than reusing the
# SIAX_CI_TOKEN pattern 0pt already has proof it can authenticate with.
# Matches sax3l/aud0 and sax3l/h0st's own G17 migrations, which
# independently made the same choice for the same reason. See
# `ci/shim/ci.yml` in siax-templates for why NOT a native
# `uses: sax3l/siax-templates/...@ref` reusable workflow (Gitea Actions
# clones a called repo ANONYMOUSLY, so this 404s on every private sax3l
# repo).
#
# GOTCHA LEARNED FROM sax3l/h0st's OWN MIGRATION (its
# `cl0ud-real-policy.yml` header, and independently from sax3l/aud0's):
# Gitea 1.26 on this fleet resolves ORG-level secrets (SIAX_CI_TOKEN is
# org-level) only for the FIRST job of a multi-job workflow file. That is
# exactly why `release.yml` (this file's caller) is a single-job workflow.
# 0pt does not wire a G20 (live-digest-equality) post-deploy step in this
# pass -- see `.siax/hooks/README.md` "G20 -- deliberately not wired yet"
# for why (no Coolify application provisioned for 0pt at all, and no
# `/version` endpoint for a live check to poll -- both genuine
# infrastructure gaps, not something this CI adapter can close).
#
# PIN STATUS (2026-09-15): sax3l/siax-templates PR #51
# (`feat/g17-signed-deploy-gate-adr-w16-003`) is MERGED to main, plus three
# real follow-up fixes already on top of that merge as of this pin --
# bf0c157/#56 "evaluate compound SPDX license expressions per SPDX
# semantics", 794546f/#57 "skip bare SPDX operator tokens emitted as their
# own license entry" (both exercised live below via G17_LICENSE_ALLOW
# against 0pt's real SBOM), and e1230a1/#59 "retry on observed-but-
# different sha" (a G20 fix; 0pt does not use G20 yet, but the pin still
# picks up main's current tip rather than an older commit, matching what a
# fresh migration reviews). Pinned at
# 384e35060b91ea78ec045e14af114abf5d5eb23b -- the exact ref lives in
# `.gitea/workflows/release.yml` (SIAX_TEMPLATES_PINNED_SHA, which is
# fetched and checked out DIRECTLY by SHA -- no branch is consulted, so an
# unrelated merge on siax-templates' main does not fail this gate; a pinned
# commit that no longer exists upstream does).
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
: "${SIAX_TEMPLATES_DIR:?set by the calling workflow step to the path siax-templates was checked out to}"
REFERENCE_G17="$SIAX_TEMPLATES_DIR/ci/v2/reference-hooks/G17.sh"
[ -x "$REFERENCE_G17" ] || {
echo "0pt G17 adapter: FAIL: $REFERENCE_G17 not found/executable -- was the siax-templates checkout step run first, and did chmod +x survive the clone?" >&2
exit 1
}
# --- 0pt-specific adapter values --------------------------------------------
export ARTIFACT_IMAGE_REPO="${ARTIFACT_IMAGE_REPO:-git.cloud.siax.io/sax3l/0pt}"
export ARTIFACT_COMMIT_SHA="${ARTIFACT_COMMIT_SHA:?set by release.yml to the full 40-hex commit SHA this image was built from}"
export ARTIFACT_IMAGE_TAG="${ARTIFACT_IMAGE_TAG:?set by release.yml, e.g. sha-<12-hex> -- never :latest}"
export G17_ENVIRONMENT="production"
export G17_KEY_IDENTITY="siax-svc-g17/0pt/production"
# The reference script's own default for G17_COSIGN_PUBKEY assumes it was
# COPIED to .siax/hooks/G17.sh inside the consumer repo (relative path
# lands at the consumer's own root). This adapter instead runs the
# reference script from a SEPARATE checkout ($SIAX_TEMPLATES_DIR) -- that
# default would resolve inside siax-templates' own checkout, not 0pt's --
# so it must be pointed explicitly at 0pt's own committed key.
export G17_COSIGN_PUBKEY="$REPO_ROOT/cosign.pub"
# G17_COSIGN_KEY / G17_COSIGN_KEY_PASSWORD / AUD0_INGEST_TOKEN /
# AUD0_TENANT_ID are Infisical-injected repo secrets -- release.yml exports
# them from `secrets.*` before calling this file. This adapter deliberately
# never reads, echoes or forwards a raw secret value itself; it only relies
# on them already being present in the environment the reference script
# inherits.
# License policy -- measured 2026-09-15 against 0pt's OWN real signed
# artifact SBOM (280 components; real local-registry verification run
# performed during this migration, not copied from another repo's policy):
# * G17_LICENSE_ALLOW_UNKNOWN=1 -- 177/280 components declare no license
# field at all in their packed metadata (transitive npm packages --
# next/react/sharp's own dependency tree -- there is no fix for
# third-party metadata from this repo). Same opt-in st0re/aud0/h0st
# already record; visible in the attestation evidence, not silent.
# * G17_LICENSE_ALLOW below is the exact, minimal set of SPDX ids AND
# compound-expression branches 0pt's real SBOM needs once unknowns are
# allowed -- every id was individually present in the real scan
# output (`python3 -c "..." verify-work/e2e-out/sbom.cdx.json` run
# during this migration), not a broad copy of a sibling repo's list.
# GPL-2.0-only/GPL-2.0-or-later/GPL-3.0-or-later/LGPL-2.1-or-later/
# LGPL-3.0-or-later/Zlib/OpenSSL-Exception/NCSA cover alpine's own base
# packages this image's `RUN apk add --no-cache libc6-compat wget` (+
# the deps/sharp/build stages' own libc6-compat installs) pull in --
# the OS substrate node:22-alpine ships, not a dependency 0pt chose.
# NCSA specifically is gcompat's real declared license (a first real
# finding this migration's initial run caught and triaged: the OLD ad
# hoc gate never scanned licenses at all, so this had never been
# checked before). MIT/BSD-2-Clause/BSD-3-Clause/ISC/0BSD/Apache-2.0/
# CC0-1.0/BlueOak-1.0.0/MPL-2.0 cover the Next.js/React/sharp npm
# dependency tree's own real declared licenses, including the compound
# "MPL-2.0 AND MIT" and "GPL-2.0-or-later AND LGPL-2.1-or-later"
# expressions actually present in the SBOM (evaluated per real SPDX
# AND/OR semantics -- the two 2026-09-15 siax-templates fixes #56/#57
# this pin includes).
export G17_LICENSE_ALLOW_UNKNOWN="1"
export G17_LICENSE_ALLOW="${G17_LICENSE_ALLOW:-BlueOak-1.0.0,GPL-2.0-only,GPL-2.0-or-later,GPL-3.0-or-later,LGPL-2.1-or-later,LGPL-3.0-or-later,Zlib,OpenSSL-Exception,NCSA,MIT,BSD-2-Clause,BSD-3-Clause,ISC,0BSD,Apache-2.0,CC0-1.0,MPL-2.0}"
echo "0pt G17 adapter: delegating to $REFERENCE_G17 for artifact $ARTIFACT_IMAGE_REPO:$ARTIFACT_IMAGE_TAG"
exec bash "$REFERENCE_G17"
+117
View File
@@ -0,0 +1,117 @@
# `.siax/hooks/` -- 0pt's G17 (signed-deploy gate) adapter
## What this is
`G17.sh` in this directory is a thin **adapter**: it sets 0pt-specific
values (image repo, environment, key identity, license policy) and then
`exec`s the real, reviewed reference implementation checked out at CI
runtime from `sax3l/siax-templates` (`ci/v2/reference-hooks/G17.sh`). This
repo does not own, fork, or duplicate any of the ADR-W16-003 bar-item logic
itself -- see `G17.sh`'s own header for the full rationale and the audit
that motivated replacing 0pt's prior ad hoc gate.
## Composition mechanism: pinned-commit checkout at CI runtime
`.gitea/workflows/release.yml` clones `sax3l/siax-templates` at a pinned
commit into a scratch directory before invoking `.siax/hooks/G17.sh`,
authenticated with the `SIAX_CI_TOKEN` org secret. This was chosen over a
vendored copy under `.siax/hooks/vendor/` (the mechanism `st0re`, `cl0ud`
and `api0` used for their own G17 migrations) because 0pt has **no existing
vendored-copy convention anywhere in this repo** -- confirmed by searching
`.gitea/workflows/` and `.siax/` for any prior "vendor" pattern before
choosing -- while it **does** already reference `SIAX_CI_TOKEN` with the
exact same `git.siax.io` authenticated-clone idiom this change reuses (the
now-deleted evidence-commit-push step in the old `release.yml` used the
identical `x-access-token`/`oauth2` bearer pattern for a different
cross-repo write). Reusing a pattern this repo already has proof it can
authenticate with is a smaller, lower-risk change than introducing a new
vendoring convention for this alone. `sax3l/aud0` and `sax3l/h0st`'s own
G17 migrations independently reached the same conclusion for the same
reason.
## Why not a `uses:` reusable workflow
Gitea Actions on this fleet resolves a called repository **anonymously**
regardless of the caller's own auth, so `uses: sax3l/siax-templates/...@ref`
404s against any private `sax3l` repo. See `ci/shim/ci.yml` in
`siax-templates` for the fuller writeup. Checkout-at-runtime with an
authenticated clone is the only mechanism that works against a private
template repo on this Gitea instance.
## Pin status
Pinned to `sax3l/siax-templates` main at
`384e35060b91ea78ec045e14af114abf5d5eb23b` (2026-09-15) -- PR #51
(`feat/g17-signed-deploy-gate-adr-w16-003`) merged, plus follow-up fixes
#56/#57 (SPDX compound-license-expression evaluation, exercised live by
this adapter's own `G17_LICENSE_ALLOW` policy) and #59 (G20 retry logic;
not used by 0pt yet, see below). `.gitea/workflows/release.yml` fetches
and checks out `SIAX_TEMPLATES_PINNED_SHA` **directly by SHA** and refuses
to run if that exact commit cannot be checked out (removed or rewritten
upstream) -- bumping the pin is a reviewed, source-controlled diff to that
one line, never a silent re-resolution. It deliberately does **not**
compare the pin against `main`: that branch tip moves whenever anything
unrelated merges in `siax-templates`, and failing this chain on that said
nothing about whether the reviewed gate was safe (CD-03 / CI-RED-02). The
authoritative pin value is the one in `release.yml`.
## G20 (live-digest-equality) -- deliberately not wired yet
The reference implementation's bar item 8 proxy (`G20`, "does the running
service's own `/version` endpoint report the sha that was actually signed")
needs two things 0pt does not have today, confirmed live before writing
this file:
1. **A provisioned Coolify application.** `.gitea/workflows/cd.yml`'s own
guard step already fails closed on a literal `COOLIFY_APP_ID` placeholder
-- 0pt has never been deployed to the fleet.
2. **A `/version` (or equivalent) endpoint.** `app/api/` has `health/` and
`ready/` routes but no route reporting a build SHA, and the Dockerfile
declares no `ARG GIT_SHA`/`ARG BUILD_TIME` to bake one in.
Wiring G20 against nothing live would be decorative, not a real check --
the exact anti-pattern this whole migration replaces. Once both exist
(Simon provisions the Coolify app; a follow-up adds a `/api/version` route
and the Dockerfile `ARG`s, the same small change `h0st`'s own migration
made), copy `G20.sh` + its own single-job `.gitea/workflows/
g20-live-verify.yml` from `h0st` or `aud0`'s repo as the starting point --
**as its own workflow file**, not a second job appended to `cd.yml`: Gitea
1.26 on this fleet resolves org-level secrets (`SIAX_CI_TOKEN`,
`AUD0_INGEST_TOKEN`) only for the **first** job of a multi-job workflow
file (learned the hard way on `h0st`'s and `aud0`'s own migrations).
## Required secrets (not yet set on `sax3l/0pt` as of this migration)
Same prerequisite every prior migration needed before its `release.yml`
went green:
- `REGISTRY_USER` / `REGISTRY_TOKEN` -- `git.cloud.siax.io` push (already
required by the OLD release.yml too; unchanged).
- `COSIGN_PRIVATE_KEY` / `COSIGN_PASSWORD` -- the private half of this
repo's `cosign.pub` (UNCHANGED by this migration -- see below). Per the
old `release.yml`'s own comment this was "NOT YET SET on sax3l/0pt as of
this writing" before this PR either, so this remains exactly as
outstanding as it always was; this migration does not resolve it.
**This adapter's own local verification (see the PR description) used a
SEPARATE, throwaway cosign keypair generated and then deleted purely to
prove the mechanism end-to-end -- `cosign.pub` at this repo's root was
deliberately left untouched.** Overwriting a repo's real signing public
key from an agent session -- without knowing whether Simon already holds
a matching private key offline -- would silently orphan that key
forever (ECDSA key generation is not reversible); that decision belongs
to Simon, not to this migration. When the real keypair is provisioned
(fresh or pre-existing), commit its public half here and set the two
secrets together in the same change.
- `AUD0_INGEST_TOKEN` / `AUD0_TENANT_ID` -- new requirement vs. the old
gate (which never wrote to AUD0 at all). Needs a `siax-svc-g17`
workload-identity client provisioned in Zitadel, same open item every
prior migration recorded (see `G17-ADR-W16-003.md` "What this pass could
not test against production, and why" in `siax-templates`).
- `SIAX_CI_TOKEN` -- already exists on this repo (used previously for the
now-deleted evidence-commit push); reused here for the `siax-templates`
checkout.
Until these are set, `release.yml` fails closed on its first real run --
same honest behaviour as the gate it replaces, and the same prerequisite
`cl0ud`/`st0re`/`aud0`/`api0`/`h0st` each had before their own `release.yml`
went green.
+14
View File
@@ -0,0 +1,14 @@
# 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.
# product-blueprint — 0pt
schemaVersion: siax.product-blueprint/v1
repo: 0pt
generatedAt: 2026-09-23T21:12:27.075Z
productClass: unspecified
archetypes: [unspecified]
surfaces: [web]
users: []
packs:
decisions: []
visualDna: siax
compliance: []
notes: GENERATED stub - unspecified-vardena ar arliga platshaltere tills riktig klassning (PROMPT-031); blueprinet ska driva factory, tests, release och live verification.
+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.
# reuse-manifest — 0pt
schemaVersion: siax.reuse-manifest/v1
repo: 0pt
generatedAt: 2026-09-23T21:12:27.075Z
policy: reuse-before-build
consumes: []
rebuilt: []
notes: GENERATED stub - tomma listor ar giltiga; konsumtion av plattforms-capabilities och VARJE medveten aterbyggnad (med motivering) listas har.
+7
View File
@@ -0,0 +1,7 @@
{
"schemaVersion": "siax.skills-lock/v1",
"repo": "0pt",
"generatedAt": "2026-09-23T21:12:27.075Z",
"skills": [],
"notes": "GENERATED stub - tomt ar den arliga 'inga skills deklarerade'-formen; fyll i via siax-templates."
}
+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.
# state-flow-manifest — 0pt
schemaVersion: siax.state-flow-manifest/v1
repo: 0pt
generatedAt: 2026-09-23T21:12:27.075Z
states: [initial, loading, success, empty, error, forbidden]
flows: [happy, cancel, back, validation, timeout, network-loss, resume, rollback]
owner: [email protected]
notes: GENERATED stub - standard-baslinje ur PROMPT-015; komplettera med tillampiga partial/stale/offline/degraded-varianter per yta.
+15
View File
@@ -0,0 +1,15 @@
{
"schemaVersion": "siax.template-pin/v1",
"repo": "0pt",
"profiles": ["base", "node", "ui", "deployable"],
"templateRepo": "sax3l/siax-templates",
"templateRef": "1feb97cd1d6da58bb4b420d860109285c47c741d",
"pinnedAt": "2026-09-14T23:10:00Z",
"pins": {
"mise": "task-entry i mise.toml (repot rot)",
"node": "22.13.0",
"pnpm": "9.15.9",
"lefthook": "1.x (aktiveras med npx lefthook install)"
},
"notes": "0pt = pnpm-repo (pnpm-lock.yaml v9). Python-tjansterna (services/api, services/scrapers) kor requirements.txt - uv-adoption ar DEFERRED tills lock skapats i separat migrering. Makefile = legacy-alias (thin wrappers), städas i separat PR med deleteBy."
}