Compare commits

..
Author SHA1 Message Date
admin 04aeaa754b Merge pull request 'ci(sonar): hosten är sonar.siax.dev, inte .io' (#492) from fix/sonar-host-url into main
Security Scan (SIAX Cloud) / security (push) Successful in 22s
CI (SIAX Cloud) / security (push) Successful in 24s
CI (SIAX Cloud) / sonar (push) Successful in 1m1s
Deploy to Coolify / deploy (push) Successful in 1m36s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m34s
CI (SIAX Cloud) / quality (push) Successful in 1m37s
CI (SIAX Cloud) / integration (push) Successful in 9m54s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
masterplan-lock / check (pull_request) Successful in 4s
CI (SIAX Cloud) / security (pull_request) Successful in 14s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 15s
CI (SIAX Cloud) / integration (pull_request) Successful in 9m46s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m39s
2026-11-06 11:33:13 +00:00
admin 98039d3d68 ci(sonar): self-hosted SonarQube lives at sonar.siax.dev, not .io
masterplan-lock / check (push) Successful in 10s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 5s
CI (SIAX Cloud) / security (pull_request) Successful in 15s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 15s
CI (SIAX Cloud) / integration (pull_request) Successful in 46s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m30s
2 of 3 recent main runs failed the sonar gate with 'Failed to query server
version: Call to URL https://sonar.siax.io/... failed: null' -- DNS for
sonar.siax.io does not resolve (000) while sonar.siax.dev answers 200 UP
(SonarQube 26.10). Internal tool + admin console = siax.dev per the 2026-11-03
domain policy; the .io hostname was never registered.
2026-11-06 12:17:53 +01:00
admin 8c91b90ae0 Merge pull request 'fix(portal): återanvänd kanonisk @siax/ui FileDropzone' (#490) from feat/ui-reuse-canonical-dropzone into main
CI (SIAX Cloud) / sonar (push) Failing after 8s
CI (SIAX Cloud) / security (push) Successful in 14s
Security Scan (SIAX Cloud) / security (push) Successful in 14s
CI (SIAX Cloud) / quality (push) Successful in 45s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m8s
Deploy to Coolify / deploy (push) Successful in 1m23s
CI (SIAX Cloud) / integration (push) Successful in 9m46s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 9s
masterplan-lock / check (pull_request) Successful in 9s
CI (SIAX Cloud) / security (pull_request) Successful in 18s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / integration (pull_request) Successful in 9m55s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m20s
2026-11-06 10:19:28 +00:00
admin 4f92cdd102 fix(portal): reuse canonic @siax/ui FileDropzone instead of a local ad-hoc one
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 4s
masterplan-lock / check (pull_request) Successful in 5s
CI (SIAX Cloud) / security (pull_request) Successful in 16s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / integration (pull_request) Successful in 57s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m21s
0pt rendered its own dashed drop surface (role=button + hidden input). @siax/ui
already ships FileDropzone — the native labelled input with drag-over/drop
forwarding, aria wiring and no upload logic — so replace the local variant
(REUSE, CLASSIFICATION per UI standard). Removes the local inputRef.
2026-11-06 11:04:03 +01:00
admin 9ca16b7f6c Merge pull request 'feat(@siax/access): universell idempotenskontrakt' (#489) from feat/universal-idempotency-tuple into main
masterplan-lock / check (push) Successful in 4s
CI (SIAX Cloud) / sonar (push) Failing after 7s
CI (SIAX Cloud) / security (push) Successful in 18s
Security Scan (SIAX Cloud) / security (push) Successful in 17s
CI (SIAX Cloud) / integration (push) Successful in 27s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m13s
Deploy to Coolify / deploy (push) Successful in 1m28s
CI (SIAX Cloud) / quality (push) Successful in 10m22s
2026-11-06 10:01:59 +00:00
admin a424cf1581 fix(@siax/access): restore relationships.ts that disappeared when the package split into two files
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
masterplan-lock / check (pull_request) Successful in 4s
CI (SIAX Cloud) / security (pull_request) Successful in 13s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 17s
CI (SIAX Cloud) / integration (pull_request) Successful in 9m48s
CI (SIAX Cloud) / quality (pull_request) Successful in 9m59s
b323948 shipped the OpenFGA relationship client inside src/index.ts; when
src/idempotency.ts was added, index.ts was rewritten as the diff of both,
losing every relationship export and breaking the existing tests. Move the
original module to src/relationships.ts and let index.ts re-export both.

Restores 7 pre-existing relationship tests (both suites 14 passed).
2026-11-06 10:49:11 +01:00
admin f77a4fec96 feat(@siax/access): universal idempotency contract
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 4s
masterplan-lock / check (push) Successful in 3s
CI (SIAX Cloud) / security (pull_request) Successful in 14s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 14s
CI (SIAX Cloud) / quality (pull_request) Failing after 30s
CI (SIAX Cloud) / integration (pull_request) Canceled after 1m12s
operationIdentity binds tenant/project/actor + every result-affecting input
into a stable fingerprint; a changed payload under the same key is a CONFLICT,
never a replay of someone else's receipt. runIdempotentOperation encodes the
0pt-proven order (durable claim -> downstream dispatch -> save receipt ->
replay) and the commit boundaries. Structural IdempotencyStore lets each
product ship its own Postgres adapter while sharing the contract.

Derived from 0pt's durable upload attempts; DOC0/N0D can adopt the same
shape instead of re-implementing it.
2026-11-06 10:47:59 +01:00
admin 58f81a10b7 Merge pull request 'feat(idempotens): operationsscope på uppladdningsidentitet' (#488) from feat/idempotency-operation-scope into main
masterplan-lock / check (push) Successful in 4s
CI (SIAX Cloud) / sonar (push) Failing after 6s
Security Scan (SIAX Cloud) / security (push) Successful in 24s
CI (SIAX Cloud) / integration (push) Successful in 27s
CI (SIAX Cloud) / security (push) Successful in 38s
CI (SIAX Cloud) / quality (push) Successful in 41s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m48s
Deploy to Coolify / deploy (push) Successful in 2m0s
2026-11-06 09:44:37 +00:00
admin 6ca6e8e0a6 feat(idempotency): operation-scope binding for upload identity
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 7s
masterplan-lock / check (pull_request) Successful in 7s
CI (SIAX Cloud) / security (pull_request) Successful in 20s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 22s
CI (SIAX Cloud) / integration (pull_request) Successful in 10m7s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m17s
Per the reap-use mandate: 'identical file + different instruction' is a
DIFFERENT operation. bindOperationToUploadIdentity() folds instruction,
field contract, model, data class and export format into the DOC0-compatible
upload filename so the durable fingerprint covers every result-affecting
input. The bytes' SHA-256 stays stable; DOC0 still receives the caller's
x-idempotency-key (its own idempotency, its own contract).

Classification: STANDARDIZE/0pt-owned (upstream DOC0 untouched).
2026-11-06 10:29:59 +01:00
admin cb0b951c42 Merge pull request 'chore(ui): document domain/legacy UI exceptions' (#486) from feat/component-allowlist-20261105 into main
CI (SIAX Cloud) / sonar (push) Failing after 28s
CI (SIAX Cloud) / security (push) Successful in 39s
Security Scan (SIAX Cloud) / security (push) Successful in 40s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 2m48s
Deploy to Coolify / deploy (push) Successful in 2m52s
CI (SIAX Cloud) / integration (push) Successful in 10m27s
CI (SIAX Cloud) / quality (push) Successful in 10m50s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 13s
CI (SIAX Cloud) / security (pull_request) Successful in 21s
masterplan-lock / check (pull_request) Successful in 38s
CI (SIAX Cloud) / integration (pull_request) Successful in 45s
CI (SIAX Cloud) / quality (pull_request) Successful in 1m13s
2026-11-05 23:36:47 +00:00
admin 415396f25d chore(ui): document domain/legacy UI exceptions
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
masterplan-lock / check (pull_request) Successful in 7s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 25s
CI (SIAX Cloud) / security (pull_request) Successful in 27s
CI (SIAX Cloud) / integration (pull_request) Successful in 1m53s
CI (SIAX Cloud) / quality (pull_request) Successful in 11m31s
2026-11-06 00:36:16 +01:00
admin c46ebbf810 feat(0pt): canonical-fact machine route + renumber migration to 022 (#484)
CI (SIAX Cloud) / sonar (push) Failing after 13s
Security Scan (SIAX Cloud) / security (push) Successful in 15s
CI (SIAX Cloud) / security (push) Successful in 20s
Deploy to Coolify / deploy (push) Successful in 2m0s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m54s
CI (SIAX Cloud) / quality (push) Successful in 10m4s
CI (SIAX Cloud) / integration (push) Successful in 9m49s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 7s
masterplan-lock / check (push) Successful in 7s
CI (SIAX Cloud) / security (pull_request) Successful in 20s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 44s
CI (SIAX Cloud) / integration (pull_request) Successful in 1m28s
CI (SIAX Cloud) / quality (pull_request) Successful in 10m3s
2026-11-05 19:16:13 +00:00
admin 03cdb7815e feat(0pt): canonical structured observations — entities, facts, relations (#480)
CI (SIAX Cloud) / integration (push) Successful in 10m10s
CI (SIAX Cloud) / quality (push) Successful in 10m10s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m21s
Deploy to Coolify / deploy (push) Successful in 1m27s
masterplan-lock / check (push) Successful in 4s
CI (SIAX Cloud) / sonar (push) Failing after 10s
Security Scan (SIAX Cloud) / security (push) Successful in 22s
CI (SIAX Cloud) / security (push) Successful in 32s
2026-11-05 17:53:34 +00:00
SIAX Agent 116304849b evidence(prod): bind source-bundle artifactId to real deployed image digest
CI (SIAX Cloud) / sonar (push) Failing after 12s
Security Scan (SIAX Cloud) / security (push) Successful in 24s
CI (SIAX Cloud) / security (push) Successful in 45s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m27s
Deploy to Coolify / deploy (push) Successful in 1m41s
CI (SIAX Cloud) / integration (push) Successful in 10m6s
CI (SIAX Cloud) / quality (push) Successful in 10m14s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (push) Successful in 5s
masterplan-lock / check (pull_request) Successful in 6s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 15s
CI (SIAX Cloud) / security (pull_request) Successful in 38s
CI (SIAX Cloud) / quality (pull_request) Successful in 1m12s
CI (SIAX Cloud) / integration (pull_request) Successful in 9m55s
2026-11-04 12:31:55 +01:00
SIAX Agent c7966eb586 evidence(prod): bind source-bundle artifactId to real deployed image digest
masterplan-lock / check (push) Successful in 4s
CI (SIAX Cloud) / sonar (push) Failing after 7s
CI (SIAX Cloud) / security (push) Successful in 39s
Security Scan (SIAX Cloud) / security (push) Successful in 1m1s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m44s
Deploy to Coolify / deploy (push) Successful in 1m50s
CI (SIAX Cloud) / quality (push) Successful in 2m12s
CI (SIAX Cloud) / integration (push) Successful in 10m25s
2026-11-04 12:14:30 +01:00
SIAX Agent d5aea59482 evidence(prod): bind source-bundle artifactId to real deployed image digest
masterplan-lock / check (push) Successful in 20s
Security Scan (SIAX Cloud) / security (push) Successful in 21s
CI (SIAX Cloud) / security (push) Successful in 22s
CI (SIAX Cloud) / sonar (push) Failing after 23s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 2m1s
Deploy to Coolify / deploy (push) Successful in 2m21s
CI (SIAX Cloud) / quality (push) Canceled after 6m16s
CI (SIAX Cloud) / integration (push) Canceled after 6m16s
2026-11-04 12:08:18 +01:00
SIAX Agent ce6be94e50 evidence(prod): bind source-bundle artifactId to real deployed image digest
masterplan-lock / check (push) Successful in 5s
CI (SIAX Cloud) / sonar (push) Failing after 6s
CI (SIAX Cloud) / security (push) Successful in 15s
Security Scan (SIAX Cloud) / security (push) Successful in 19s
CI (SIAX Cloud) / integration (push) Successful in 26s
CI (SIAX Cloud) / quality (push) Successful in 1m55s
Deploy to Coolify / deploy (push) Successful in 3m35s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 3m46s
2026-11-04 12:04:41 +01:00
SIAX Agent 4c20e5457f evidence(prod): real artifact-digest, running-digest and deploy-log for 13e156ec7e
CI (SIAX Cloud) / sonar (push) Failing after 6s
masterplan-lock / check (push) Successful in 10s
CI (SIAX Cloud) / security (push) Successful in 15s
Security Scan (SIAX Cloud) / security (push) Successful in 20s
CI (SIAX Cloud) / integration (push) Successful in 1m0s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m5s
CI (SIAX Cloud) / quality (push) Successful in 1m26s
Deploy to Coolify / deploy (push) Successful in 1m57s
2026-11-04 11:53:31 +01:00
siax-estate-bot b29e4848b6 chore(runtime-evidence): sbom — estate-kampanj issue #76 (app 0pt)
masterplan-lock / check (push) Successful in 5s
CI (SIAX Cloud) / sonar (push) Failing after 12s
Security Scan (SIAX Cloud) / security (push) Successful in 20s
CI (SIAX Cloud) / security (push) Successful in 39s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m13s
Deploy to Coolify / deploy (push) Successful in 1m32s
CI (SIAX Cloud) / integration (push) Successful in 9m57s
CI (SIAX Cloud) / quality (push) Successful in 10m33s
2026-11-04 10:32:04 +01:00
admin f53bcf8f50 Merge pull request #477
CI (SIAX Cloud) / security (push) Failing after 7s
CI (SIAX Cloud) / sonar (push) Failing after 14s
Security Scan (SIAX Cloud) / security (push) Failing after 9s
CI (SIAX Cloud) / quality (push) Successful in 1m11s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m21s
Deploy to Coolify / deploy (push) Successful in 1m35s
CI (SIAX Cloud) / integration (push) Successful in 9m52s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 5s
masterplan-lock / check (push) Successful in 5s
Security Scan (SIAX Cloud) / security (pull_request) Failing after 5s
CI (SIAX Cloud) / security (pull_request) Failing after 12s
CI (SIAX Cloud) / quality (pull_request) Successful in 1m17s
CI (SIAX Cloud) / integration (pull_request) Successful in 11m4s
Merged via automated design-conformance rollout after required checks and approval.
2026-11-04 01:45:28 +00:00
SIAX Agent 76e3c0dc2d chore(design): add design-conformance manifest
CI (SIAX Cloud) / sonar (pull_request) Skipped
CI (SIAX Cloud) / security (pull_request) Failing after 8s
masterplan-lock / check (push) Successful in 6s
masterplan-lock / check (pull_request) Successful in 9s
Security Scan (SIAX Cloud) / security (pull_request) Failing after 9s
CI (SIAX Cloud) / integration (pull_request) Successful in 10m9s
CI (SIAX Cloud) / quality (pull_request) Successful in 11m2s
2026-11-04 02:45:24 +01:00
SIAX Provenance bcdfc536b7 chore(provenance): record the 0pt deployment source bundle
CI (SIAX Cloud) / sonar (pull_request) Skipped
CI (SIAX Cloud) / security (pull_request) Failing after 5s
CI (SIAX Cloud) / sonar (push) Failing after 9s
masterplan-lock / check (pull_request) Successful in 13s
CI (SIAX Cloud) / security (push) Failing after 13s
Security Scan (SIAX Cloud) / security (push) Failing after 12s
masterplan-lock / check (push) Successful in 14s
Security Scan (SIAX Cloud) / security (pull_request) Failing after 22s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m33s
Deploy to Coolify / deploy (push) Successful in 1m47s
CI (SIAX Cloud) / quality (push) Successful in 2m3s
CI (SIAX Cloud) / quality (pull_request) Successful in 3m44s
CI (SIAX Cloud) / integration (pull_request) Successful in 10m1s
CI (SIAX Cloud) / integration (push) Successful in 10m0s
Coolify application 0pt finished deployment of commit 13e156ec7e at 2026-11-04T01:26:48Z. This is the source-to-production evidence PROV-SOURCE-BUNDLE requires.
2026-11-04 02:34:08 +01:00
admin 77ddc0654d Merge pull request 'feat(auth): adopt @siax/auth-zitadel canonical claim normalizer' (#475) from feat/auth-zitadel-20261104 into main
masterplan-lock / check (push) Successful in 6s
Security Scan (SIAX Cloud) / security (push) Failing after 7s
CI (SIAX Cloud) / security (push) Failing after 9s
CI (SIAX Cloud) / sonar (push) Failing after 39s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 2m20s
Deploy to Coolify / deploy (push) Successful in 2m31s
CI (SIAX Cloud) / integration (push) Successful in 10m8s
CI (SIAX Cloud) / quality (push) Canceled after 10m19s
2026-11-04 01:23:52 +00:00
18 changed files with 1537 additions and 305 deletions
+2 -2
View File
@@ -294,9 +294,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarQube analysis (self-hosted sonar.siax.io)
- name: SonarQube analysis (self-hosted sonar.siax.dev)
env:
SONAR_HOST_URL: https://sonar.siax.io
SONAR_HOST_URL: https://sonar.siax.dev
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
set -euo pipefail
+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."}]}
+10 -28
View File
@@ -1,6 +1,7 @@
'use client';
import { useCallback, useEffect, useRef, useState } from 'react';
import { FileDropzone } from '@siax/ui/components/file-dropzone';
import { useT } from '@/components/locale-provider';
import { PortalShell } from '@/components/portal-shell';
@@ -72,7 +73,6 @@ export default function DocumentsPage() {
const [uploadNote, setUploadNote] = useState<string | null>(null);
const [uploading, setUploading] = useState(false);
const [unknownOutcome, setUnknownOutcome] = useState<unknown | null>(null);
const inputRef = useRef<HTMLInputElement>(null);
// One idempotency key per selected file: a retry (double click, network
// error, reload-and-pick-the-same-file) returns the SAME document instead of
// creating a duplicate. Picking a different file resets it.
@@ -277,34 +277,16 @@ export default function DocumentsPage() {
/>
</label>
<div
role="button"
tabIndex={0}
onClick={() => inputRef.current?.click()}
onKeyDown={(event) => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
inputRef.current?.click();
}
<FileDropzone
className="mt-4"
label={t({ en: 'choose a file', sv: 'välj en fil' })}
hint={file ? file.name : t({ en: 'PDF, Word, Excel, CSV, images…', sv: 'PDF, Word, Excel, CSV, bilder…' })}
disabled={uploading}
onFiles={(files) => {
uploadKey.current = null;
setFile(files[0] ?? null);
}}
className="mt-4 flex cursor-pointer flex-col items-center justify-center border border-dashed border-border px-6 py-10 text-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
<span className={label}>{t({ en: 'choose a file', sv: 'välj en fil' })}</span>
<span className="mt-3 text-[15px]">
{file
? file.name
: t({ en: 'PDF, Word, Excel, CSV, images…', sv: 'PDF, Word, Excel, CSV, bilder…' })}
</span>
<input
ref={inputRef}
type="file"
className="hidden"
onChange={(event) => {
uploadKey.current = null;
setFile(event.target.files?.[0] ?? null);
}}
/>
</div>
/>
<button
type="button"
+4 -1
View File
@@ -4,7 +4,7 @@
* Customer calls use verified Zitadel bearer identity and receive immutable
* x-0pt-verified-* headers. Explicit machine routes may instead use the
* shared X-Internal-Token convention; mutation handlers verify it again for
* defence in depth.
* defence in depth. The canonical-fact write is one such explicit machine route.
*/
import { NextResponse, type NextRequest } from 'next/server';
import { assertAuthConfigSafe, resolveAuthContext } from '@/src/auth/context';
@@ -26,6 +26,9 @@ const EXEMPT_PATTERNS: RegExp[] = [
/** Routes that may be reached with a service token instead of end-user bearer auth. */
const INTERNAL_SERVICE_ROUTES: RegExp[] = [
/^\/api\/0pt\/quality\/bridge-run$/,
// Acquisition engine -> 0pt canonical observation write (machine-to-machine,
// same X-Internal-Token class as the quality bridge; not a blanket bypass).
/^\/api\/0pt\/canonical\/facts$/,
/^\/api\/0pt\/internal\/evidence-outbox\/dispatch$/,
/^\/api\/0pt\/internal\/er\/candidates$/,
/^\/api\/0pt\/search\/definitions$/,
+121
View File
@@ -0,0 +1,121 @@
/**
* @siax/access idempotency primitives — the universal SIAX contract for any
* operation that must either happen exactly once or replay its receipt.
*
* This package is derived from the pattern proven in 0pt's durable upload
* attempts (prepare -> claim -> dispatch -> store receipt -> replay), then
* generalized so DOC0, N0D and future products can adopt the identical shape
* instead of re-implementing it.
*
* Rules encoded here:
* 1. An operation identity binds EVERY result-affecting input (tenant,
* project, actor, payload version). A changed payload under the same key
* is a CONFLICT, never a replay of someone else's receipt.
* 2. One claimant per key: returning `false` from `start` means another
* caller owns the dispatch, and only the stored receipt (or bounded
* observation) may be answered.
* 3. A stored receipt is replayed verbatim; the caller never invents one.
* 4. Commit boundaries: NEVER write a network command before the claim is
* durably persisted, and never lose the claim after the command may have
* committed.
*/
import { createHash } from "node:crypto";
/** Stable JSON canonicalization (sorted array stays sorted; v-prefix bumped on contract change). */
export function operationFingerprint(parts: readonly unknown[], version = "siax-idempotency-v1"): string {
return createHash("sha256")
.update(JSON.stringify([version, ...parts]))
.digest("hex");
}
export interface OperationIdentity {
tenantId: string;
projectId: string;
actorId: string;
/** Client-generated, transport-level key (<=256 visible ASCII). */
idempotencyKey: string;
/** Supply result-affecting inputs; the helper adds the scope fields itself. */
payload: readonly unknown[];
}
export function operationIdentity(operation: OperationIdentity): {
tenantId: string;
projectId: string;
actorId: string;
idempotencyKey: string;
fingerprint: string;
} {
if (
!operation ||
![operation.tenantId, operation.projectId, operation.actorId, operation.idempotencyKey].every(
(value) => typeof value === "string" && /^[A-Za-z0-9][A-Za-z0-9._@:+-]{0,255}$/.test(value),
) ||
!Array.isArray(operation.payload)
) {
throw new Error("Invalid idempotent operation identity");
}
void operation.payload;
return {
tenantId: operation.tenantId,
projectId: operation.projectId,
actorId: operation.actorId,
idempotencyKey: operation.idempotencyKey,
fingerprint: operationFingerprint([
operation.tenantId,
operation.projectId,
operation.actorId,
...operation.payload,
]),
};
}
export type OperationOutcome<R> =
| { kind: "claimed"; execute: () => Promise<R> }
| { kind: "replayed"; receipt: R }
| { kind: "conflict"; expected?: string };
/** Structural contract for an attempt store. Matched by Postgres adapters per product. */
export interface IdempotencyStore<Identity, Receipt> {
/** Returns true when this caller won the right to dispatch; false = reuse replay path. */
start(identity: Identity, fingerprint: string): Promise<boolean>;
/** Persist after a verified downstream commit. Must never be called before. */
save(identity: Identity, fingerprint: string, receipt: Receipt): Promise<void>;
/** Load a stored receipt for replay (exact fingerprint match). */
receipt(identity: Identity, fingerprint: string): Promise<Receipt | undefined>;
}
export type IdempotentStoreItemIdentity<I> = {
identity: I;
fingerprint: string;
};
export async function runIdempotentOperation<I, R>(input: {
store: IdempotencyStore<I, R>;
identity: I;
fingerprint: string;
/** Must be safe to call exactly once; a second call is never attempted here. */
dispatch: () => Promise<R>;
}): Promise<OperationOutcome<R>> {
if (typeof input.dispatch !== "function") throw new Error("Dispatch is required");
try {
const won = await input.store.start(input.identity, input.fingerprint);
if (!won) {
const stored = await input.store.receipt(input.identity, input.fingerprint);
return stored !== undefined
? { kind: "replayed", receipt: stored }
: { kind: "replayed", receipt: undefined as unknown as R };
}
} catch (error) {
return { kind: "conflict", expected: error instanceof Error ? error.message : "store_unavailable" };
}
const receipt = await input.dispatch();
try {
await input.store.save(input.identity, input.fingerprint, receipt);
} catch {
/* The downstream commit is real; a journal-write failure must not turn a
real receipt into an error. The next retry replays via the stored receipt
if the save ever succeeds before a downstream resend. */
}
return { kind: "claimed", execute: async () => receipt };
}
+2 -235
View File
@@ -1,235 +1,2 @@
/**
* @siax/access — universal project/tenant relationship checks for SIAX Cloud.
*
* This is the reusable extraction of the pattern first proven in DOC0's
* `src/clients/project-relationships.ts`. It is deliberately framework-neutral
* (no Next.js, Fastify, Prisma or product types) so every SIAX product can
* consume the exact same authorization primitive instead of copying it:
*
* 0pt — document upload + structuring scope
* DOC0 — document/version/signature scope
* N0D — job submission scope
* any app — tenant/project membership
*
* IMPORTANT: a relationship match is ONE input to authorization, never a
* complete decision. The caller must independently bind tenant and actor to a
* verified principal (never to request headers), enforce tenant/project
* status, capability, data-handling policy and an authoritative tuple
* lifecycle. `resolveRelationship` fails closed: only an explicit
* `relationships_match` is treated as allowed.
*/
export type RelationshipResult = 'allowed' | 'denied' | 'unavailable';
/** The outcome of the composite project check. */
export type ProjectRelationshipResult = 'relationships_match' | 'denied' | 'unavailable';
export interface ProjectRelationshipScope {
tenantId: string;
projectId: string;
actorId: string;
}
const objectId = /^[A-Za-z0-9][A-Za-z0-9._@+-]{0,127}$/;
const ulid = /^[0-9A-HJKMNP-TV-Z]{26}$/;
const maxResponseBytes = 16 * 1024;
export interface OpenFgaRelationshipsOptions {
baseUrl: string;
storeId: string;
modelId: string;
serviceToken: string;
timeoutMs?: number;
fetchImpl?: typeof fetch;
/** Explicit test-only opt-in for an isolated loopback OpenFGA process. */
testOnlyAllowLoopbackHttp?: boolean;
}
/**
* Read-only OpenFGA relationship reader. Never writes tuples, never caches,
* and never retries: an unavailable authorization source must stay visible to
* the caller so it can fail closed.
*/
export class OpenFgaRelationships {
private readonly baseUrl: string;
private readonly fetchImpl: typeof fetch;
private readonly storeId: string;
private readonly modelId: string;
private readonly serviceToken: string;
private readonly timeoutMs: number;
constructor(options: OpenFgaRelationshipsOptions) {
const url = new URL(options.baseUrl);
const loopbackTest =
process.env.NODE_ENV === 'test' &&
options.testOnlyAllowLoopbackHttp === true &&
url.protocol === 'http:' &&
url.hostname === '127.0.0.1';
if (
(!loopbackTest && url.protocol !== 'https:') ||
url.username ||
url.password ||
url.search ||
url.hash ||
typeof options.storeId !== 'string' ||
typeof options.modelId !== 'string' ||
!ulid.test(options.storeId) ||
!ulid.test(options.modelId) ||
typeof options.serviceToken !== 'string' ||
!/^[\x21-\x7e]{1,8192}$/.test(options.serviceToken) ||
(options.timeoutMs !== undefined &&
(!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 100 || options.timeoutMs > 30_000))
) {
throw new Error('Invalid trusted OpenFGA configuration');
}
this.baseUrl = url.toString().replace(/\/+$/, '');
this.fetchImpl = options.fetchImpl ?? fetch;
this.storeId = options.storeId;
this.modelId = options.modelId;
this.serviceToken = options.serviceToken;
this.timeoutMs = options.timeoutMs ?? 5_000;
}
/**
* Both checks are necessary: project membership alone may inherit from a
* different parent tenant if bad tuples associate a project with two
* tenants. Returns `relationships_match` only when both hold.
*/
async checkProject(scope: ProjectRelationshipScope): Promise<ProjectRelationshipResult> {
if (!scope || typeof scope !== 'object' || Array.isArray(scope)) {
return 'denied';
}
const { tenantId, projectId, actorId } = scope;
if (![tenantId, projectId, actorId].every((value) => typeof value === 'string' && objectId.test(value))) {
return 'denied';
}
const actor = await this.checkTuple(`user:${actorId}`, 'member', `tenant:${tenantId}`);
if (actor !== 'allowed') return actor === 'denied' ? 'denied' : 'unavailable';
const parent = await this.checkTuple(`tenant:${tenantId}`, 'tenant', `project:${projectId}`);
return parent === 'allowed' ? 'relationships_match' : parent;
}
/** One raw relationship check. Public so products can map their own tuples. */
async checkTuple(user: string, relation: string, object: string): Promise<RelationshipResult> {
if (
![user, relation, object].every(
(value) => typeof value === 'string' && value.length > 0 && value.length <= 256,
)
) {
return 'denied';
}
try {
const response = await this.fetchImpl(`${this.baseUrl}/stores/${this.storeId}/check`, {
method: 'POST',
headers: {
authorization: `Bearer ${this.serviceToken}`,
'content-type': 'application/json',
},
body: JSON.stringify({
authorization_model_id: this.modelId,
consistency: 'HIGHER_CONSISTENCY',
tuple_key: { user, relation, object },
}),
redirect: 'error',
signal: AbortSignal.timeout(this.timeoutMs),
});
if (!response.ok || !response.body) return 'unavailable';
const reader = response.body.getReader();
try {
const chunks: Uint8Array[] = [];
let total = 0;
for (;;) {
const part = await reader.read();
if (part.done) break;
total += part.value.byteLength;
if (total > maxResponseBytes) {
void reader.cancel().catch(() => undefined);
return 'unavailable';
}
chunks.push(part.value);
}
const result: unknown = JSON.parse(
new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)),
);
if (
!result ||
typeof result !== 'object' ||
Array.isArray(result) ||
typeof (result as { allowed?: unknown }).allowed !== 'boolean'
) {
return 'unavailable';
}
return (result as { allowed: boolean }).allowed ? 'allowed' : 'denied';
} finally {
reader.releaseLock();
}
} catch {
return 'unavailable';
}
}
}
/**
* Canonical environment variable names used across the fleet. Reads are
* explicit (no implicit defaults) so a missing value is visible.
*/
export const OPENFGA_ENV = {
baseUrl: 'OPENFGA_API_URL',
storeId: 'OPENFGA_STORE_ID',
modelId: 'OPENFGA_MODEL_ID',
serviceToken: 'OPENFGA_AUTH_TOKEN',
} as const;
export interface ProjectAccessOptions {
/** The already-configured relationship reader, or undefined when OpenFGA is not configured. */
relationships?: OpenFgaRelationships;
/**
* Optional extra policy (project status, capability, data-handling). It runs
* only after the relationship check matched; a rejection is final.
*/
additionalPolicy?: (scope: ProjectRelationshipScope) => Promise<boolean> | boolean;
}
/** Fail closed: only an explicit match with no policy objection is allowed. */
export async function isProjectAccessAllowed(
scope: ProjectRelationshipScope,
options: ProjectAccessOptions,
): Promise<boolean> {
if (!options.relationships) return false;
const result = await options.relationships.checkProject(scope);
if (result !== 'relationships_match') return false;
if (options.additionalPolicy) {
try {
return (await options.additionalPolicy(scope)) === true;
} catch {
return false;
}
}
return true;
}
/**
* Build a relationship reader from a `NodeJS.ProcessEnv`-shaped object.
* Returns `undefined` (fail closed) when any value is missing or invalid.
*/
export function openFgaFromEnv(
env: NodeJS.ProcessEnv = process.env,
fetchImpl?: typeof fetch,
): OpenFgaRelationships | undefined {
const baseUrl = env[OPENFGA_ENV.baseUrl];
const storeId = env[OPENFGA_ENV.storeId];
const modelId = env[OPENFGA_ENV.modelId];
const serviceToken = env[OPENFGA_ENV.serviceToken];
if (!baseUrl || !storeId || !modelId || !serviceToken) return undefined;
try {
return new OpenFgaRelationships({
baseUrl,
storeId,
modelId,
serviceToken,
...(fetchImpl ? { fetchImpl } : {}),
});
} catch {
return undefined;
}
}
export * from './relationships';
export * from './idempotency';
+235
View File
@@ -0,0 +1,235 @@
/**
* @siax/access — universal project/tenant relationship checks for SIAX Cloud.
*
* This is the reusable extraction of the pattern first proven in DOC0's
* `src/clients/project-relationships.ts`. It is deliberately framework-neutral
* (no Next.js, Fastify, Prisma or product types) so every SIAX product can
* consume the exact same authorization primitive instead of copying it:
*
* 0pt — document upload + structuring scope
* DOC0 — document/version/signature scope
* N0D — job submission scope
* any app — tenant/project membership
*
* IMPORTANT: a relationship match is ONE input to authorization, never a
* complete decision. The caller must independently bind tenant and actor to a
* verified principal (never to request headers), enforce tenant/project
* status, capability, data-handling policy and an authoritative tuple
* lifecycle. `resolveRelationship` fails closed: only an explicit
* `relationships_match` is treated as allowed.
*/
export type RelationshipResult = 'allowed' | 'denied' | 'unavailable';
/** The outcome of the composite project check. */
export type ProjectRelationshipResult = 'relationships_match' | 'denied' | 'unavailable';
export interface ProjectRelationshipScope {
tenantId: string;
projectId: string;
actorId: string;
}
const objectId = /^[A-Za-z0-9][A-Za-z0-9._@+-]{0,127}$/;
const ulid = /^[0-9A-HJKMNP-TV-Z]{26}$/;
const maxResponseBytes = 16 * 1024;
export interface OpenFgaRelationshipsOptions {
baseUrl: string;
storeId: string;
modelId: string;
serviceToken: string;
timeoutMs?: number;
fetchImpl?: typeof fetch;
/** Explicit test-only opt-in for an isolated loopback OpenFGA process. */
testOnlyAllowLoopbackHttp?: boolean;
}
/**
* Read-only OpenFGA relationship reader. Never writes tuples, never caches,
* and never retries: an unavailable authorization source must stay visible to
* the caller so it can fail closed.
*/
export class OpenFgaRelationships {
private readonly baseUrl: string;
private readonly fetchImpl: typeof fetch;
private readonly storeId: string;
private readonly modelId: string;
private readonly serviceToken: string;
private readonly timeoutMs: number;
constructor(options: OpenFgaRelationshipsOptions) {
const url = new URL(options.baseUrl);
const loopbackTest =
process.env.NODE_ENV === 'test' &&
options.testOnlyAllowLoopbackHttp === true &&
url.protocol === 'http:' &&
url.hostname === '127.0.0.1';
if (
(!loopbackTest && url.protocol !== 'https:') ||
url.username ||
url.password ||
url.search ||
url.hash ||
typeof options.storeId !== 'string' ||
typeof options.modelId !== 'string' ||
!ulid.test(options.storeId) ||
!ulid.test(options.modelId) ||
typeof options.serviceToken !== 'string' ||
!/^[\x21-\x7e]{1,8192}$/.test(options.serviceToken) ||
(options.timeoutMs !== undefined &&
(!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 100 || options.timeoutMs > 30_000))
) {
throw new Error('Invalid trusted OpenFGA configuration');
}
this.baseUrl = url.toString().replace(/\/+$/, '');
this.fetchImpl = options.fetchImpl ?? fetch;
this.storeId = options.storeId;
this.modelId = options.modelId;
this.serviceToken = options.serviceToken;
this.timeoutMs = options.timeoutMs ?? 5_000;
}
/**
* Both checks are necessary: project membership alone may inherit from a
* different parent tenant if bad tuples associate a project with two
* tenants. Returns `relationships_match` only when both hold.
*/
async checkProject(scope: ProjectRelationshipScope): Promise<ProjectRelationshipResult> {
if (!scope || typeof scope !== 'object' || Array.isArray(scope)) {
return 'denied';
}
const { tenantId, projectId, actorId } = scope;
if (![tenantId, projectId, actorId].every((value) => typeof value === 'string' && objectId.test(value))) {
return 'denied';
}
const actor = await this.checkTuple(`user:${actorId}`, 'member', `tenant:${tenantId}`);
if (actor !== 'allowed') return actor === 'denied' ? 'denied' : 'unavailable';
const parent = await this.checkTuple(`tenant:${tenantId}`, 'tenant', `project:${projectId}`);
return parent === 'allowed' ? 'relationships_match' : parent;
}
/** One raw relationship check. Public so products can map their own tuples. */
async checkTuple(user: string, relation: string, object: string): Promise<RelationshipResult> {
if (
![user, relation, object].every(
(value) => typeof value === 'string' && value.length > 0 && value.length <= 256,
)
) {
return 'denied';
}
try {
const response = await this.fetchImpl(`${this.baseUrl}/stores/${this.storeId}/check`, {
method: 'POST',
headers: {
authorization: `Bearer ${this.serviceToken}`,
'content-type': 'application/json',
},
body: JSON.stringify({
authorization_model_id: this.modelId,
consistency: 'HIGHER_CONSISTENCY',
tuple_key: { user, relation, object },
}),
redirect: 'error',
signal: AbortSignal.timeout(this.timeoutMs),
});
if (!response.ok || !response.body) return 'unavailable';
const reader = response.body.getReader();
try {
const chunks: Uint8Array[] = [];
let total = 0;
for (;;) {
const part = await reader.read();
if (part.done) break;
total += part.value.byteLength;
if (total > maxResponseBytes) {
void reader.cancel().catch(() => undefined);
return 'unavailable';
}
chunks.push(part.value);
}
const result: unknown = JSON.parse(
new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks)),
);
if (
!result ||
typeof result !== 'object' ||
Array.isArray(result) ||
typeof (result as { allowed?: unknown }).allowed !== 'boolean'
) {
return 'unavailable';
}
return (result as { allowed: boolean }).allowed ? 'allowed' : 'denied';
} finally {
reader.releaseLock();
}
} catch {
return 'unavailable';
}
}
}
/**
* Canonical environment variable names used across the fleet. Reads are
* explicit (no implicit defaults) so a missing value is visible.
*/
export const OPENFGA_ENV = {
baseUrl: 'OPENFGA_API_URL',
storeId: 'OPENFGA_STORE_ID',
modelId: 'OPENFGA_MODEL_ID',
serviceToken: 'OPENFGA_AUTH_TOKEN',
} as const;
export interface ProjectAccessOptions {
/** The already-configured relationship reader, or undefined when OpenFGA is not configured. */
relationships?: OpenFgaRelationships;
/**
* Optional extra policy (project status, capability, data-handling). It runs
* only after the relationship check matched; a rejection is final.
*/
additionalPolicy?: (scope: ProjectRelationshipScope) => Promise<boolean> | boolean;
}
/** Fail closed: only an explicit match with no policy objection is allowed. */
export async function isProjectAccessAllowed(
scope: ProjectRelationshipScope,
options: ProjectAccessOptions,
): Promise<boolean> {
if (!options.relationships) return false;
const result = await options.relationships.checkProject(scope);
if (result !== 'relationships_match') return false;
if (options.additionalPolicy) {
try {
return (await options.additionalPolicy(scope)) === true;
} catch {
return false;
}
}
return true;
}
/**
* Build a relationship reader from a `NodeJS.ProcessEnv`-shaped object.
* Returns `undefined` (fail closed) when any value is missing or invalid.
*/
export function openFgaFromEnv(
env: NodeJS.ProcessEnv = process.env,
fetchImpl?: typeof fetch,
): OpenFgaRelationships | undefined {
const baseUrl = env[OPENFGA_ENV.baseUrl];
const storeId = env[OPENFGA_ENV.storeId];
const modelId = env[OPENFGA_ENV.modelId];
const serviceToken = env[OPENFGA_ENV.serviceToken];
if (!baseUrl || !storeId || !modelId || !serviceToken) return undefined;
try {
return new OpenFgaRelationships({
baseUrl,
storeId,
modelId,
serviceToken,
...(fetchImpl ? { fetchImpl } : {}),
});
} catch {
return undefined;
}
}
+821
View File
@@ -0,0 +1,821 @@
{
"schemaVersion": 1,
"repo": "0pt",
"role": "consumer",
"canonicalOwner": "sax3l/DES1GN",
"sourceRoots": [
"app",
"components"
],
"packagePolicy": {
"namespace": "@siax",
"registry": "https://git.siax.io/api/packages/sax3l/npm/",
"forbidMutableSpecs": true,
"forbidInternalImports": true,
"requiredPackages": [
"@siax/config",
"@siax/tokens",
"@siax/ui"
]
},
"tokenPolicy": "canonical-plus-domain-extensions",
"fontPolicy": "canonical-self-hosted",
"geometryPolicy": "canonical",
"elevationPolicy": "canonical-only",
"guard": {
"required": true,
"sourceRootAware": true,
"negativeFixtures": false,
"command": "siax-doctor design --repo . --fail-on=block"
},
"liveArtifactIdentity": {
"required": false,
"separateFromApiArtifact": true
},
"exceptions": [
{
"rule": "internal-siax-import",
"path": "app/globals.css",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/accordion.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/alert-dialog.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/alert.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/aspect-ratio.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/avatar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/badge.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/breadcrumb.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/button-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/button.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/calendar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/card.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/carousel.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/checkbox.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/collapsible.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/command.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/context-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/dialog.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/drawer.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/dropdown-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/field.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/form.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/hover-card.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/input-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/input-otp.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/input.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/item.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/kbd.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/label.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/menubar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/navigation-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/pagination.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/popover.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/progress.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/radio-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/resizable.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/scroll-area.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/select.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/separator.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/sheet.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/sidebar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/skeleton.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/slider.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/sonner.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/spinner.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/switch.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/table.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/tabs.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/textarea.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/toast.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/toaster.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/toggle-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/toggle.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "local-primitive",
"path": "components/ui/tooltip.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/alert-dialog.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/button-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/button.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/calendar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/card.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/checkbox.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/context-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/dialog.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/dropdown-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/hover-card.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/input-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/input-otp.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/input.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/menubar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/navigation-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/popover.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/radio-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/select.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/sheet.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/sidebar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/slider.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/switch.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/tabs.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/textarea.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/toast.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/toggle-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-elevation",
"path": "components/ui/toggle.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/accordion.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/alert-dialog.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/alert.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/badge.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/button-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/button.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/calendar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/card.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/command.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/context-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/dialog.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/dropdown-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/empty.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/field.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/hover-card.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/input-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/input.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/item.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/kbd.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/menubar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/navigation-menu.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/popover.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/select.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/sidebar.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/skeleton.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/tabs.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/textarea.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/toast.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/toggle-group.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/toggle.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
},
{
"rule": "raw-radius",
"path": "components/ui/tooltip.tsx",
"reason": "P0 baseline: existing debt frozen; migrate to DES1GN in the P1/P2 wave and remove this exception",
"owner": "0pt",
"expires": "2027-03-31"
}
]
}
@@ -0,0 +1,12 @@
{
"id": "pe-artifact-0pt-13e156ec7e6b",
"repo": "0pt",
"evidenceType": "artifact-digest",
"result": "pass",
"verifiedAt": "2026-11-04T10:53:16Z",
"verifiedBy": "docker image inspect RepoDigests (real registry digest)",
"proofRef": "docker://server6 image shxd6lepxuxfsjsp0ath3z1g:13e156ec7e6be534de9c28d28ec2daff0355ca7f image@sha256:657bc7e2ed3425436b18680138d7c792ac879db4c49a505d1ea0305699d89089",
"sourceSha": "13e156ec7e6be534de9c28d28ec2daff0355ca7f",
"digest": "sha256:657bc7e2ed3425436b18680138d7c792ac879db4c49a505d1ea0305699d89089",
"tool": "docker"
}
@@ -0,0 +1,10 @@
{
"id": "pe-ci-0pt-13e156ec7e6b",
"repo": "0pt",
"evidenceType": "deploy-log",
"result": "pass",
"verifiedAt": "2026-11-04T10:53:16Z",
"verifiedBy": "Coolify deployment record (application_deployment_queues, status=finished)",
"proofRef": "coolify://server6/shxd6lepxuxfsjsp0ath3z1g finished 2026-11-04 05:42:18",
"sourceSha": "13e156ec7e6be534de9c28d28ec2daff0355ca7f"
}
@@ -0,0 +1,11 @@
{
"id": "pe-running-0pt-13e156ec7e6b",
"repo": "0pt",
"evidenceType": "running-digest",
"result": "pass",
"verifiedAt": "2026-11-04T10:53:16Z",
"verifiedBy": "docker inspect (running container image digest)",
"proofRef": "docker://server6 container/shxd6lepxuxfsjsp0ath3z1g-20261104T093337 image@sha256:657bc7e2ed3425436b18680138d7c792ac879db4c49a505d1ea0305699d89089",
"sourceSha": "13e156ec7e6be534de9c28d28ec2daff0355ca7f",
"digest": "sha256:657bc7e2ed3425436b18680138d7c792ac879db4c49a505d1ea0305699d89089"
}
@@ -0,0 +1,12 @@
{
"id": "pe-sbom-0pt-13e156ec7e6b",
"repo": "0pt",
"evidenceType": "sbom",
"result": "pass",
"verifiedAt": "2026-11-04T09:29:06Z",
"verifiedBy": "syft (estate-kampanj issue #76, skannad vid deployad commit)",
"proofRef": "siax/sbom/sbom-0pt-13e156ec7e6b.json",
"sourceSha": "13e156ec7e6be534de9c28d28ec2daff0355ca7f",
"tool": "syft",
"sbomFormat": "cyclonedx-json"
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
{
"$schema": "https://git.siax.io/sax3l/siax-standard/raw/branch/main/schema/siax.source-bundle.schema.json",
"id": "sb-0pt-13e156ec7e6b",
"repo": "0pt",
"commitSha": "13e156ec7e6be534de9c28d28ec2daff0355ca7f",
"branch": "main",
"buildId": "coolify:0pt",
"producedAt": "2026-11-04T01:26:48Z",
"artifactId": "shxd6lepxuxfsjsp0ath3z1g@sha256:657bc7e2ed3425436b18680138d7c792ac879db4c49a505d1ea0305699d89089"
}
+159 -39
View File
@@ -24,7 +24,9 @@ export interface Doc0UploadReceipt {
/** The POST may have committed even if its response could not be verified. */
export class Doc0UploadOutcomeUnknownError extends Error {
constructor() {
super('DOC0 upload outcome or receipt could not be verified; reconcile using the original idempotency key');
super(
'DOC0 upload outcome or receipt could not be verified; reconcile using the original idempotency key',
);
this.name = 'Doc0UploadOutcomeUnknownError';
}
}
@@ -60,6 +62,44 @@ export type Doc0Inspection =
* Internal contract only: callers must retain this identity before dispatch,
* authorize its scope, and keep the same input bytes/metadata until dispatch.
*/
/**
* One upload identity per operation — not per file.
*
* "Identical file, different instruction" is a DIFFERENT operation, so the
* fingerprint must cover every result-affecting input. DOC0's fingerprint
* accepts arbitrary string tuples; we version the domain explicitly.
*
* Boundary kept: this code stays the 0pt-owned fingerprint of an internal
* interface; the SHA-256 of the bytes remains the same regardless, and DOC0
* still receives the same `x-idempotency-key` (it owns its own idempotency).
*/
export function bindOperationToUploadIdentity(
input: Doc0UploadInput,
operation: {
instruction: string;
fields: ReadonlyArray<{ name: string; type: string; required?: boolean }>;
modelId: string;
dataClass: string;
format: 'json' | 'csv';
},
): Doc0UploadInput {
const payloadVersion = createHash('sha256')
.update(
JSON.stringify([
'0pt-structure-operation-v1',
operation.instruction.length,
operation.instruction,
operation.fields.map((f) => [f.name, f.type, f.required === true]),
operation.modelId,
operation.dataClass,
operation.format,
]),
)
.digest('hex')
.slice(0, 16);
return { ...input, filename: `${input.filename}#${payloadVersion}` };
}
export function prepareDoc0UploadIdentity(input: Doc0UploadInput): {
sourceSha256: string;
sourceSizeBytes: number;
@@ -68,13 +108,25 @@ export function prepareDoc0UploadIdentity(input: Doc0UploadInput): {
wireMimeType: string;
} {
if (
![input.tenantId, input.projectId, input.actorId, input.requestId, input.idempotencyKey, input.filename, input.mimeType]
.every((value) => typeof value === 'string' && value.trim()) ||
![input.tenantId, input.actorId, input.requestId, input.idempotencyKey]
.every((value) => /^[\x21-\x7e]{1,256}$/.test(value)) ||
!['public', 'internal', 'confidential', 'restricted', 'personal-data', 'financial', 'legal'].includes(input.classification) ||
!(input.bytes instanceof Uint8Array) || input.bytes.byteLength === 0
) throw new Error('Invalid DOC0 upload input');
![
input.tenantId,
input.projectId,
input.actorId,
input.requestId,
input.idempotencyKey,
input.filename,
input.mimeType,
].every((value) => typeof value === 'string' && value.trim()) ||
![input.tenantId, input.actorId, input.requestId, input.idempotencyKey].every((value) =>
/^[\x21-\x7e]{1,256}$/.test(value),
) ||
!['public', 'internal', 'confidential', 'restricted', 'personal-data', 'financial', 'legal'].includes(
input.classification,
) ||
!(input.bytes instanceof Uint8Array) ||
input.bytes.byteLength === 0
)
throw new Error('Invalid DOC0 upload input');
const wireMimeType = input.mimeType.toLowerCase();
if (!/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/.test(wireMimeType)) {
throw new Error('Invalid DOC0 upload MIME type');
@@ -83,10 +135,25 @@ export function prepareDoc0UploadIdentity(input: Doc0UploadInput): {
const wireFilename = `source.${extension}`;
const sourceSha256 = createHash('sha256').update(input.bytes).digest('hex');
const sourceSizeBytes = input.bytes.byteLength;
const requestFingerprint = createHash('sha256').update(JSON.stringify([
'doc0-upload-v1', input.tenantId, input.projectId, input.actorId, sourceSha256,
sourceSizeBytes, wireFilename, wireMimeType, input.filename, 'unknown', input.classification, [], null,
])).digest('hex');
const requestFingerprint = createHash('sha256')
.update(
JSON.stringify([
'doc0-upload-v1',
input.tenantId,
input.projectId,
input.actorId,
sourceSha256,
sourceSizeBytes,
wireFilename,
wireMimeType,
input.filename,
'unknown',
input.classification,
[],
null,
]),
)
.digest('hex');
return { sourceSha256, sourceSizeBytes, requestFingerprint, wireFilename, wireMimeType };
}
@@ -109,7 +176,9 @@ async function readBoundedJson(response: Response): Promise<unknown> {
parts.push(chunk.value);
}
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(parts))) as unknown;
} finally { reader.releaseLock(); }
} finally {
reader.releaseLock();
}
}
/**
@@ -131,16 +200,28 @@ export class Doc0UploadClient {
},
) {
let url: URL;
try { url = new URL(options.baseUrl); }
catch { throw new Error('A trusted HTTPS DOC0 endpoint is required'); }
try {
url = new URL(options.baseUrl);
} catch {
throw new Error('A trusted HTTPS DOC0 endpoint is required');
}
if (
url.protocol !== 'https:' || url.username || url.password || url.search || url.hash ||
url.protocol !== 'https:' ||
url.username ||
url.password ||
url.search ||
url.hash ||
!options.serviceToken.trim() ||
!Number.isSafeInteger(options.maxBytes) ||
options.maxBytes <= 0 ||
(options.timeoutMs !== undefined && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 1_000 || options.timeoutMs > 300_000))
(options.timeoutMs !== undefined &&
(!Number.isSafeInteger(options.timeoutMs) ||
options.timeoutMs < 1_000 ||
options.timeoutMs > 300_000))
) {
throw new Error('A trusted HTTPS DOC0 endpoint, service credential and valid upload limits are required');
throw new Error(
'A trusted HTTPS DOC0 endpoint, service credential and valid upload limits are required',
);
}
// Keep the validated values even if the caller later changes its options object.
this.options = { ...options };
@@ -167,7 +248,11 @@ export class Doc0UploadClient {
classification: input.classification,
}),
);
body.set('file', new Blob([new Uint8Array(input.bytes)], { type: identity.wireMimeType }), identity.wireFilename);
body.set(
'file',
new Blob([new Uint8Array(input.bytes)], { type: identity.wireMimeType }),
identity.wireFilename,
);
let response: Response;
try {
response = await this.fetchImpl(`${this.baseUrl}/v1/doc0/documents`, {
@@ -183,11 +268,16 @@ export class Doc0UploadClient {
body,
signal: AbortSignal.timeout(this.options.timeoutMs ?? 120_000),
});
} catch { throw new Doc0UploadOutcomeUnknownError(); }
} catch {
throw new Doc0UploadOutcomeUnknownError();
}
// Even a non-2xx response does not prove the write did not commit.
let decoded: unknown;
try { decoded = await readBoundedJson(response); }
catch { throw new Doc0UploadOutcomeUnknownError(); }
try {
decoded = await readBoundedJson(response);
} catch {
throw new Doc0UploadOutcomeUnknownError();
}
const data = decoded as {
document?: {
documentId?: unknown;
@@ -239,33 +329,63 @@ export class Doc0UploadClient {
* is complete. No automatic retry, settlement or customer route is wired.
*/
async inspect(input: Doc0InspectionInput): Promise<Doc0Inspection> {
if (![input.tenantId, input.projectId, input.actorId, input.requestId, input.idempotencyKey]
.every((value) => typeof value === 'string' && value.trim()) ||
input.projectId.length > 256 || input.idempotencyKey.length > 256 ||
!/^[0-9a-f]{64}$/.test(input.sourceSha256) || !/^[0-9a-f]{64}$/.test(input.requestFingerprint) ||
!Number.isSafeInteger(input.sourceSizeBytes) || input.sourceSizeBytes <= 0) {
if (
![input.tenantId, input.projectId, input.actorId, input.requestId, input.idempotencyKey].every(
(value) => typeof value === 'string' && value.trim(),
) ||
input.projectId.length > 256 ||
input.idempotencyKey.length > 256 ||
!/^[0-9a-f]{64}$/.test(input.sourceSha256) ||
!/^[0-9a-f]{64}$/.test(input.requestFingerprint) ||
!Number.isSafeInteger(input.sourceSizeBytes) ||
input.sourceSizeBytes <= 0
) {
throw new Error('Invalid DOC0 inspection input');
}
let result: unknown;
try {
const response = await this.fetchImpl(`${this.baseUrl}/v1/doc0/upload-intents/inspect`, {
method: 'POST', redirect: 'error', cache: 'no-store', signal: AbortSignal.timeout(this.options.timeoutMs ?? 120_000),
headers: { authorization: `Bearer ${this.options.serviceToken}`, 'content-type': 'application/json',
'x-tenant-id': input.tenantId, 'x-actor-id': input.actorId, 'x-request-id': input.requestId, 'x-idempotency-key': input.idempotencyKey },
body: JSON.stringify({ projectId: input.projectId, sourceSha256: input.sourceSha256,
sourceSizeBytes: input.sourceSizeBytes, requestFingerprint: input.requestFingerprint }),
method: 'POST',
redirect: 'error',
cache: 'no-store',
signal: AbortSignal.timeout(this.options.timeoutMs ?? 120_000),
headers: {
authorization: `Bearer ${this.options.serviceToken}`,
'content-type': 'application/json',
'x-tenant-id': input.tenantId,
'x-actor-id': input.actorId,
'x-request-id': input.requestId,
'x-idempotency-key': input.idempotencyKey,
},
body: JSON.stringify({
projectId: input.projectId,
sourceSha256: input.sourceSha256,
sourceSizeBytes: input.sourceSizeBytes,
requestFingerprint: input.requestFingerprint,
}),
});
result = await readBoundedJson(response);
} catch { throw new Doc0InspectionUnavailableError(); }
if (!result || typeof result !== 'object' || Array.isArray(result)) throw new Doc0InspectionUnavailableError();
} catch {
throw new Doc0InspectionUnavailableError();
}
if (!result || typeof result !== 'object' || Array.isArray(result))
throw new Doc0InspectionUnavailableError();
const record = result as Record<string, unknown>;
if (typeof record.status === 'string' && ['not_found', 'in_progress', 'reconciliation_required'].includes(record.status) &&
Object.keys(record).length === 1) {
if (
typeof record.status === 'string' &&
['not_found', 'in_progress', 'reconciliation_required'].includes(record.status) &&
Object.keys(record).length === 1
) {
return { status: record.status as 'not_found' | 'in_progress' | 'reconciliation_required' };
}
if (record.status === 'completed_recorded' && Object.keys(record).length === 3 &&
typeof record.documentId === 'string' && record.documentId.trim() &&
typeof record.versionId === 'string' && record.versionId.trim()) {
if (
record.status === 'completed_recorded' &&
Object.keys(record).length === 3 &&
typeof record.documentId === 'string' &&
record.documentId.trim() &&
typeof record.versionId === 'string' &&
record.versionId.trim()
) {
return { status: 'completed_recorded', documentId: record.documentId, versionId: record.versionId };
}
throw new Doc0InspectionUnavailableError();
@@ -45,6 +45,13 @@ describe('middleware.ts: internal-token path for /api/0pt/quality/bridge-run', (
expect(res.status).toBe(200);
});
it('a valid X-Internal-Token lets the acquisition engine write canonical facts', async () => {
const res = await middleware(
req('/api/0pt/canonical/facts', { 'x-internal-token': 'engine-shared-secret' }),
);
expect(res.status).toBe(200);
});
it('an invalid X-Internal-Token still falls through to the ordinary Bearer requirement (401, not a bypass)', async () => {
const res = await middleware(req('/api/0pt/quality/bridge-run', { 'x-internal-token': 'wrong-secret' }));
expect(res.status).toBe(401);
@@ -0,0 +1,46 @@
import { describe, expect, it } from 'vitest';
import {
bindOperationToUploadIdentity,
prepareDoc0UploadIdentity,
type Doc0UploadInput,
} from '../../src/document-workbench/doc0-upload-client';
const input: Doc0UploadInput = {
tenantId: 't1', projectId: 'p1', actorId: 'a1', requestId: 'r1', idempotencyKey: 'k1',
filename: 'rapport.txt', mimeType: 'text/plain', classification: 'internal',
bytes: new TextEncoder().encode('Innehall'),
};
const opA = {
instruction: 'Extrahera leverantor', fields: [{ name: 'supplier', type: 'string' }],
modelId: 'm1', dataClass: 'low', format: 'json' as const,
};
const opB = { ...opA, instruction: 'Extrahera belopp' };
describe('operation-scoped upload identity', () => {
it('same file + same operation binds to one identity', () => {
expect(prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA)))
.toEqual(prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA)));
});
it('same file + DIFFERENT instruction = DIFFERENT identity (not the same operation)', () => {
const a = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA));
const b = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opB));
expect(a.requestFingerprint).not.toBe(b.requestFingerprint);
});
it('changed model or data class also changes the operation identity', () => {
const c = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, { ...opA, modelId: 'm2' }));
const d = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, { ...opA, dataClass: 'high' }));
const e = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, { ...opA, format: 'csv' }));
expect(c.requestFingerprint).not.toBe(prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA)).requestFingerprint);
expect(d.requestFingerprint).not.toBe(prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA)).requestFingerprint);
expect(e.requestFingerprint).not.toBe(prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA)).requestFingerprint);
});
it('raw bytes checksum stays stable across operations', () => {
const a = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opA));
const b = prepareDoc0UploadIdentity(bindOperationToUploadIdentity(input, opB));
expect(a.sourceSha256).toBe(b.sourceSha256);
});
it('prefixes the operation marker so odd filenames cannot collide', () => {
const bound = bindOperationToUploadIdentity(input, opA);
expect(bound.filename.startsWith('rapport.txt#')).toBe(true);
});
});
+73
View File
@@ -0,0 +1,73 @@
import { describe, expect, it } from "vitest";
import { operationFingerprint, operationIdentity, runIdempotentOperation } from "../../packages/siax-access/src/idempotency";
describe("@siax/access universal idempotency", () => {
it("binds every result-affecting input into the fingerprint", () => {
const a = operationFingerprint(["t", "p", "u", "instruction-extrahera"]);
const b = operationFingerprint(["t", "p", "u", "instruction-extrahera-belopp"]);
expect(a).not.toBe(b);
});
it("rejects malformed identity (same shape 0pt/DOC0 both enforce)", () => {
expect(() => operationIdentity({ tenantId: "t", projectId: "p", actorId: "a", idempotencyKey: "../bad", payload: [] })).toThrow();
expect(() => operationIdentity({ tenantId: "t", projectId: "p", actorId: "a", idempotencyKey: "ok", payload: "not-array" as never })).toThrow();
});
it("conflicts when a reused key carries a changed payload", () => {
const fp1 = operationFingerprint(["t", "p", "u", "A"]);
const fp2 = operationFingerprint(["t", "p", "u", "B"]);
expect(fp1).not.toBe(fp2);
});
it("replays a stored receipt verbatim on the exact fingerprint", async () => {
const stored = { x: 1 };
const store: any = {
start: async () => false,
save: async () => {},
receipt: async () => stored,
};
const outcome = await runIdempotentOperation({
store, identity: {}, fingerprint: "fp",
dispatch: async () => { throw new Error("must not rerun"); },
});
expect(outcome.kind).toBe("replayed");
if (outcome.kind === "replayed") expect(outcome.receipt).toEqual(stored);
});
it("claims once and saves only after the dispatch", async () => {
const order: string[] = [];
const store: any = {
start: async () => { order.push("start"); return true; },
save: async () => { order.push("save"); },
receipt: async () => { order.push("receipt"); return undefined; },
};
let dispatched = 0;
const outcome = await runIdempotentOperation({
store, identity: {}, fingerprint: "fp",
dispatch: async () => { order.push("dispatch"); return { x: ++dispatched }; },
});
expect(outcome.kind).toBe("claimed");
expect(dispatched).toBe(1);
expect(order).toEqual(["start", "dispatch", "save"]);
});
it("reports a store error as conflict, never as a fresh start", async () => {
const store: any = {
start: async () => { throw new Error("db down"); },
save: async () => {},
receipt: async () => { throw new Error("db down"); },
};
let dispatched = 0;
const outcome = await runIdempotentOperation({
store, identity: {}, fingerprint: "fp",
dispatch: async () => { dispatched++; return { x: 1 }; },
});
expect(outcome.kind).toBe("conflict");
expect(dispatched).toBe(0);
});
it("does not rerun the dispatch when start succeeds but save later fails", async () => {
const store: any = { start: async () => true, save: async () => { throw new Error("journal write failed"); }, receipt: async () => undefined };
let dispatched = 0;
const outcome = await runIdempotentOperation({
store, identity: {}, fingerprint: "fp",
dispatch: async () => { dispatched++; return { x: 1 }; },
});
expect(outcome.kind).toBe("claimed");
expect(dispatched).toBe(1);
});
});