Prepare verified laboratory 6 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 470d9d6f1e
commit 7d56e52fd0
335 changed files with 31206 additions and 72 deletions
@@ -0,0 +1,2 @@
Running as unit: run-p1742892-i22721527.scope; invocation ID: ff3a9d63997445f09c0afdd80043a532
{"checked_at":"2026-11-15T18:20:20.031Z","results":[{"stopped_instance":"e2c60b02-8da8-41d8-a330-fab5e07042f8","surviving_instance":"64f893b5-f40e-44a2-afa6-442a888ba874","session_preserved":true,"confirmed_messages":2,"transient_retries":0,"recovery_observed_ms":33},{"stopped_instance":"64f893b5-f40e-44a2-afa6-442a888ba874","surviving_instance":"e6eade67-a16c-44ec-9cda-f4f97067248c","session_preserved":true,"confirmed_messages":4,"transient_retries":0,"recovery_observed_ms":84}]}
+21
View File
@@ -0,0 +1,21 @@
{
"checked_at": "2026-11-15T18:20:20.031Z",
"results": [
{
"stopped_instance": "e2c60b02-8da8-41d8-a330-fab5e07042f8",
"surviving_instance": "64f893b5-f40e-44a2-afa6-442a888ba874",
"session_preserved": true,
"confirmed_messages": 2,
"transient_retries": 0,
"recovery_observed_ms": 33
},
{
"stopped_instance": "64f893b5-f40e-44a2-afa6-442a888ba874",
"surviving_instance": "e6eade67-a16c-44ec-9cda-f4f97067248c",
"session_preserved": true,
"confirmed_messages": 4,
"transient_retries": 0,
"recovery_observed_ms": 84
}
]
}
@@ -0,0 +1,18 @@
Running as unit: run-p1718878-i22662643.scope; invocation ID: 210d0e94dee949fa9ab5a5f3ed915455
python3 tests/resilience.py --mode persistence --action-script "./scripts/restart.sh" --base-url "http://127.0.0.1:28206"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
1 | import {resolve} from 'node:path';
2 | const root=resolve(import.meta.dir,'..'),base='http://127.0.0.1:28206';
3 | if(Bun.argv.includes('--dry-run')){console.log('Valid isolated two-replica acceptance; no reads or writes');process.exit(0)}
4 | function compose(...args:string[]){const r=Bun.spawnSync([resolve(root,'scripts/compose.sh'),...args],{cwd:root,stdout:'pipe',stderr:'pipe'});if(r.exitCode!==0)throw new Error('isolated compose failed');return new TextDecoder().decode(r.stdout).trim()}
5 | async function call(path:string,method='GET',body?:unknown,token?:string,auth?:string){const r=await fetch(base+path,{method,headers:{'Content-Type':'application/json','Idempotency-Key':crypto.randomUUID(),...(token?{Authorization:'Bearer '+token}:{}),...(auth?{Authorization:auth}:{})},body:body===undefined?undefined:JSON.stringify(body),signal:AbortSignal.timeout(2500)});const b=await r.json();if(!r.ok)throw new Error('HTTP acceptance failed '+r.status);return{body:b,instance:r.headers.get('X-Instance-Id')}}
TypeError: ECONNRESET: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()
path: "http://127.0.0.1:28206/api/v1/chats/18b90457-28de-4602-bcdd-455a9c681f93/messages",
errno: 0,
code: "ECONNRESET"
at async call (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/both-replicas.ts:5:102)
Bun v1.4.4 (Linux x64)
@@ -0,0 +1,198 @@
Running as unit: run-p1668283-i22609494.scope; invocation ID: 438af4d8411b4dfd8806633e6cf2d5b4
Image mtuci-vp6:local Building
#1 [internal] load local bake definitions
#1 reading from stdin 573B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile:
#2 transferring dockerfile: 839B done
#2 DONE 0.4s
#3 resolve image config for docker-image://docker.io/docker/dockerfile:1
#3 DONE 1.2s
#4 docker-image://docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e
#4 resolve docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e
#4 resolve docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e 0.3s done
#4 CACHED
#5 [internal] load metadata for docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#5 DONE 1.3s
#6 [internal] load metadata for docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d
#6 DONE 1.4s
#7 [internal] load .dockerignore
#7 transferring context:
#7 transferring context: 115B done
#7 DONE 0.3s
#8 [internal] load build context
#8 DONE 0.0s
#9 [stage-1 1/4] FROM docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#9 resolve docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#9 ...
#10 [build 1/4] FROM docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d
#10 resolve docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d 0.6s done
#10 DONE 0.6s
#9 [stage-1 1/4] FROM docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#9 resolve docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f 0.6s done
#9 DONE 0.7s
#8 [internal] load build context
#8 transferring context: 529.23kB 0.1s done
#8 DONE 0.5s
#11 [build 2/4] WORKDIR /src
#11 CACHED
#12 [build 3/4] COPY backend/ ./
#12 DONE 0.9s
#13 [build 4/4] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go build -trimpath -ldflags='-s -w' -o /out/messenger ./cmd/app && go build -trimpath -ldflags='-s -w' -o /out/worker ./cmd/worker
#13 1.491 go: downloading go.opentelemetry.io/otel v1.47.0
#13 1.512 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.23.0
#13 1.512 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0
#13 1.513 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0
#13 1.513 go: downloading go.opentelemetry.io/otel/log v1.47.0
#13 1.539 go: downloading go.opentelemetry.io/otel/metric v1.47.0
#13 1.619 go: downloading go.opentelemetry.io/otel/sdk/log v1.47.0
#13 1.620 go: downloading go.opentelemetry.io/otel/sdk/metric v1.47.0
#13 1.620 go: downloading go.opentelemetry.io/otel/sdk v1.47.0
#13 1.620 go: downloading go.opentelemetry.io/otel/trace v1.47.0
#13 2.105 go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0
#13 2.914 go: downloading github.com/go-logr/logr v1.4.4
#13 2.914 go: downloading github.com/go-logr/stdr v1.2.2
#13 2.914 go: downloading go.opentelemetry.io/auto/sdk v1.2.1
#13 2.938 go: downloading go.opentelemetry.io/proto/otlp v1.11.0
#13 2.939 go: downloading google.golang.org/protobuf v1.36.12
#13 2.939 go: downloading github.com/cenkalti/backoff/v5 v5.0.3
#13 2.939 go: downloading google.golang.org/grpc v1.85.0
#13 3.260 go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0
#13 3.837 go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c
#13 3.907 go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c
#13 DONE 35.6s
#14 [stage-1 2/4] RUN apt-get update && apt-get install -y --no-install-recommends imagemagick ca-certificates && apt-get clean
#14 CACHED
#15 [stage-1 3/4] COPY --from=build /out/messenger /messenger
#15 DONE 1.1s
#16 [stage-1 4/4] COPY --from=build /out/worker /worker
#16 DONE 1.2s
#17 exporting to image
#17 exporting layers
#17 exporting layers 2.6s done
#17 exporting manifest sha256:4b2b720fcacba8d490d3580872a36fe28ee55da5abb0b0c5e49f3311a7b2c7a3
#17 exporting manifest sha256:4b2b720fcacba8d490d3580872a36fe28ee55da5abb0b0c5e49f3311a7b2c7a3 0.2s done
#17 exporting config sha256:425ab155de414f8b5a26b9842da216bd695a390b05e8adb4cc879421d64ef420
#17 exporting config sha256:425ab155de414f8b5a26b9842da216bd695a390b05e8adb4cc879421d64ef420 0.2s done
#17 exporting attestation manifest sha256:29a7dd838d10a0c849a8cc0969991ddc81b7d5b5605cc480b34ee23ad2ebbe97
#17 exporting attestation manifest sha256:29a7dd838d10a0c849a8cc0969991ddc81b7d5b5605cc480b34ee23ad2ebbe97 0.3s done
#17 exporting manifest list sha256:498ba79ce92239a7494eff9e542b2b77c4b1b2f1640cbf7109d1774debcdc18e
#17 exporting manifest list sha256:498ba79ce92239a7494eff9e542b2b77c4b1b2f1640cbf7109d1774debcdc18e 0.3s done
#17 naming to docker.io/library/mtuci-vp6:local
#17 naming to docker.io/library/mtuci-vp6:local 0.0s done
#17 unpacking to docker.io/library/mtuci-vp6:local
#17 unpacking to docker.io/library/mtuci-vp6:local 1.4s done
#17 DONE 5.4s
#18 resolving provenance for metadata file
#18 DONE 0.5s
Image mtuci-vp6:local Built
Volume mtuci-vp6-medvedev_valkey Creating
Volume mtuci-vp6-medvedev_valkey Creating
Volume mtuci-vp6-medvedev_s3 Creating
Volume mtuci-vp6-medvedev_s3 Creating
Volume mtuci-vp6-medvedev_postgres Creating
Volume mtuci-vp6-medvedev_postgres Creating
Network mtuci-vp6-medvedev_private Creating
Network mtuci-vp6-medvedev_private Creating
Volume mtuci-vp6-medvedev_valkey Created
Volume mtuci-vp6-medvedev_valkey Created
Volume mtuci-vp6-medvedev_postgres Created
Volume mtuci-vp6-medvedev_postgres Created
Volume mtuci-vp6-medvedev_s3 Created
Volume mtuci-vp6-medvedev_s3 Created
Network mtuci-vp6-medvedev_private Created
Network mtuci-vp6-medvedev_private Created
Container mtuci-vp6-medvedev-valkey-1 Creating
Container mtuci-vp6-medvedev-s3-1 Creating
Container mtuci-vp6-medvedev-postgres-1 Creating
Container mtuci-vp6-medvedev-s3-1 Created
Container mtuci-vp6-medvedev-valkey-1 Created
Container mtuci-vp6-medvedev-postgres-1 Created
Container mtuci-vp6-medvedev-postgres-1 Starting
Container mtuci-vp6-medvedev-s3-1 Starting
Container mtuci-vp6-medvedev-valkey-1 Starting
Container mtuci-vp6-medvedev-postgres-1 Started
Container mtuci-vp6-medvedev-s3-1 Started
Container mtuci-vp6-medvedev-valkey-1 Started
Container mtuci-vp6-medvedev-postgres-1 Running
Container mtuci-vp6-medvedev-postgres-1 Waiting
Container mtuci-vp6-medvedev-postgres-1 Healthy
Container mtuci-vp6-medvedev-migrate-run-15f60e1d9ccc Creating
Container mtuci-vp6-medvedev-migrate-run-15f60e1d9ccc Created
2026/11/15 18:14:46 OK 00001_core.sql (51.59ms)
2026/11/15 18:14:46 OK 00002_idempotency.sql (8.31ms)
2026/11/15 18:14:46 OK 00003_attachments.sql (19.54ms)
2026/11/15 18:14:46 OK 00005_replay_audit.sql (8.24ms)
2026/11/15 18:14:46 OK 00006_slo_facts.sql (8.27ms)
2026/11/15 18:14:46 goose: successfully migrated database to version: 6
Container mtuci-vp6-medvedev-s3-1 Running
Container mtuci-vp6-medvedev-s3-1 Waiting
Container mtuci-vp6-medvedev-s3-1 Healthy
Container mtuci-vp6-medvedev-bootstrap-run-b5838fca2e67 Creating
Container mtuci-vp6-medvedev-bootstrap-run-b5838fca2e67 Created
Container mtuci-vp6-medvedev-s3-1 Running
Container mtuci-vp6-medvedev-postgres-1 Running
Container mtuci-vp6-medvedev-valkey-1 Running
Network mtuci-vp6-medvedev_edge Creating
Container mtuci-vp6-medvedev-migrate-1 Creating
Network mtuci-vp6-medvedev_edge Creating
Container mtuci-vp6-medvedev-bootstrap-1 Creating
Network mtuci-vp6-medvedev_edge Created
Network mtuci-vp6-medvedev_edge Created
Container mtuci-vp6-medvedev-migrate-1 Created
Container mtuci-vp6-medvedev-bootstrap-1 Created
Container mtuci-vp6-medvedev-worker-1 Creating
Container mtuci-vp6-medvedev-api-2 Creating
Container mtuci-vp6-medvedev-api-1 Creating
Container mtuci-vp6-medvedev-api-1 Created
Container mtuci-vp6-medvedev-api-2 Created
Container mtuci-vp6-medvedev-lb-1 Creating
Container mtuci-vp6-medvedev-worker-1 Created
Container mtuci-vp6-medvedev-lb-1 Created
Container mtuci-vp6-medvedev-s3-1 Waiting
Container mtuci-vp6-medvedev-postgres-1 Waiting
Container mtuci-vp6-medvedev-postgres-1 Healthy
Container mtuci-vp6-medvedev-s3-1 Healthy
Container mtuci-vp6-medvedev-bootstrap-1 Starting
Container mtuci-vp6-medvedev-migrate-1 Starting
Container mtuci-vp6-medvedev-bootstrap-1 Started
Container mtuci-vp6-medvedev-migrate-1 Started
Container mtuci-vp6-medvedev-bootstrap-1 Waiting
Container mtuci-vp6-medvedev-migrate-1 Waiting
Container mtuci-vp6-medvedev-bootstrap-1 Waiting
Container mtuci-vp6-medvedev-migrate-1 Waiting
Container mtuci-vp6-medvedev-bootstrap-1 Exited
Container mtuci-vp6-medvedev-bootstrap-1 Exited
Container mtuci-vp6-medvedev-migrate-1 Exited
Container mtuci-vp6-medvedev-migrate-1 Exited
Container mtuci-vp6-medvedev-worker-1 Starting
Container mtuci-vp6-medvedev-api-1 Starting
Container mtuci-vp6-medvedev-worker-1 Started
Container mtuci-vp6-medvedev-api-1 Started
Container mtuci-vp6-medvedev-api-2 Starting
Container mtuci-vp6-medvedev-api-2 Started
Container mtuci-vp6-medvedev-lb-1 Starting
Container mtuci-vp6-medvedev-lb-1 Started
Ready: 2 API process(es)
python3 tests/smoke.py --base-url "http://127.0.0.1:28206"
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
+21
View File
@@ -0,0 +1,21 @@
Running as unit: run-p1689172-i22672178.scope; invocation ID: 0b969306f27042c6be7571ade54fcce0
? backend/cmd/app [no test files]
? backend/cmd/worker [no test files]
? backend/db [no test files]
ok backend/integration (cached)
ok backend/internal/adapter/handler (cached)
ok backend/internal/adapter/imagefile (cached)
? backend/internal/adapter/password [no test files]
ok backend/internal/adapter/queue (cached)
ok backend/internal/adapter/repository/postgres (cached)
? backend/internal/adapter/repository/postgres/queries [no test files]
ok backend/internal/adapter/storage (cached)
ok backend/internal/adapter/telemetry 1.041s
ok backend/internal/application/usecase (cached)
ok backend/internal/config (cached)
ok backend/internal/domain/model (cached)
? backend/internal/domain/port [no test files]
? backend/internal/domain/repository [no test files]
? backend/pkg/logger [no test files]
ok backend/pkg/server (cached)
0 issues.
+125
View File
@@ -0,0 +1,125 @@
Running as unit: run-p1975802-i22962859.scope; invocation ID: 197ef6dffcc14d44ba8a11698b6d8dcf
Image mtuci-vp6:local Building
#1 [internal] load local bake definitions
#1 reading from stdin 573B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 839B 0.0s done
#2 DONE 0.1s
#3 resolve image config for docker-image://docker.io/docker/dockerfile:1
#3 DONE 1.4s
#4 docker-image://docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e
#4 resolve docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e
#4 resolve docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e 0.3s done
#4 CACHED
#5 [internal] load metadata for docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d
#5 ...
#6 [internal] load metadata for docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#6 DONE 5.0s
#5 [internal] load metadata for docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d
#5 DONE 5.1s
#7 [internal] load .dockerignore
#7 transferring context:
#7 transferring context: 115B 0.0s done
#7 DONE 0.1s
#8 [internal] load build context
#8 DONE 0.0s
#9 [stage-1 1/4] FROM docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#9 resolve docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f
#9 resolve docker.io/library/debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f 0.5s done
#9 DONE 0.5s
#10 [build 1/4] FROM docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d
#10 resolve docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d
#10 resolve docker.io/library/golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d 0.5s done
#10 DONE 0.6s
#8 [internal] load build context
#8 transferring context: 26.71kB 0.0s done
#8 DONE 0.1s
#11 [build 2/4] WORKDIR /src
#11 CACHED
#12 [build 3/4] COPY backend/ ./
#12 DONE 0.8s
#13 [build 4/4] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go build -trimpath -ldflags='-s -w' -o /out/messenger ./cmd/app && go build -trimpath -ldflags='-s -w' -o /out/worker ./cmd/worker
#13 DONE 26.8s
#14 [stage-1 2/4] RUN apt-get update && apt-get install -y --no-install-recommends imagemagick ca-certificates && apt-get clean
#14 CACHED
#15 [stage-1 3/4] COPY --from=build /out/messenger /messenger
#15 DONE 1.2s
#16 [stage-1 4/4] COPY --from=build /out/worker /worker
#16 DONE 1.5s
#17 exporting to image
#17 exporting layers
#17 exporting layers 2.6s done
#17 exporting manifest sha256:d18286cc6cc3cd86560d1443bae98511303fb73899fb1629479b012c2804c59b
#17 exporting manifest sha256:d18286cc6cc3cd86560d1443bae98511303fb73899fb1629479b012c2804c59b 0.2s done
#17 exporting config sha256:a8f3553e330dd22b33988874071e73a9a2cf439c64523dfe25fea35ffb915df8
#17 exporting config sha256:a8f3553e330dd22b33988874071e73a9a2cf439c64523dfe25fea35ffb915df8 0.2s done
#17 exporting attestation manifest sha256:c07423eabcdb2bc9a3c8cba8cc3c2bdfa2dadf997f51f0e0c3188bd4e4f26126
#17 exporting attestation manifest sha256:c07423eabcdb2bc9a3c8cba8cc3c2bdfa2dadf997f51f0e0c3188bd4e4f26126 0.2s done
#17 exporting manifest list sha256:85d8c67f24d1861aa1d5664dfef6a730b5a23d28d9f6ee62b0b0bf82428c67e8
#17 exporting manifest list sha256:85d8c67f24d1861aa1d5664dfef6a730b5a23d28d9f6ee62b0b0bf82428c67e8 0.2s done
#17 naming to docker.io/library/mtuci-vp6:local
#17 naming to docker.io/library/mtuci-vp6:local 0.0s done
#17 unpacking to docker.io/library/mtuci-vp6:local
#17 unpacking to docker.io/library/mtuci-vp6:local 1.3s done
#17 DONE 5.2s
#18 resolving provenance for metadata file
#18 DONE 0.0s
Image mtuci-vp6:local Built
Container mtuci-vp6-medvedev-valkey-1 Running
Container mtuci-vp6-medvedev-postgres-1 Running
Container mtuci-vp6-medvedev-s3-1 Running
Container mtuci-vp6-medvedev-migrate-1 Recreate
Container mtuci-vp6-medvedev-bootstrap-1 Recreate
Container mtuci-vp6-medvedev-bootstrap-1 Recreated
Container mtuci-vp6-medvedev-migrate-1 Recreated
Container mtuci-vp6-medvedev-api-1 Recreate
Container mtuci-vp6-medvedev-api-2 Recreate
Container mtuci-vp6-medvedev-worker-1 Recreate
Container mtuci-vp6-medvedev-api-2 Recreated
Container mtuci-vp6-medvedev-api-1 Recreated
Container mtuci-vp6-medvedev-worker-1 Recreated
Container mtuci-vp6-medvedev-s3-1 Waiting
Container mtuci-vp6-medvedev-postgres-1 Waiting
Container mtuci-vp6-medvedev-s3-1 Healthy
Container mtuci-vp6-medvedev-bootstrap-1 Starting
Container mtuci-vp6-medvedev-postgres-1 Healthy
Container mtuci-vp6-medvedev-migrate-1 Starting
Container mtuci-vp6-medvedev-bootstrap-1 Started
Container mtuci-vp6-medvedev-migrate-1 Started
Container mtuci-vp6-medvedev-bootstrap-1 Waiting
Container mtuci-vp6-medvedev-migrate-1 Waiting
Container mtuci-vp6-medvedev-migrate-1 Waiting
Container mtuci-vp6-medvedev-bootstrap-1 Waiting
Container mtuci-vp6-medvedev-bootstrap-1 Exited
Container mtuci-vp6-medvedev-bootstrap-1 Exited
Container mtuci-vp6-medvedev-migrate-1 Exited
Container mtuci-vp6-medvedev-migrate-1 Exited
Container mtuci-vp6-medvedev-api-1 Starting
Container mtuci-vp6-medvedev-worker-1 Starting
Container mtuci-vp6-medvedev-api-1 Started
Container mtuci-vp6-medvedev-api-2 Starting
Container mtuci-vp6-medvedev-worker-1 Started
Container mtuci-vp6-medvedev-api-2 Started
Ready: 2 API process(es)
python3 tests/smoke.py --base-url "http://127.0.0.1:28206"
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
+21
View File
@@ -0,0 +1,21 @@
Running as unit: run-p1835057-i22819359.scope; invocation ID: 3bc9bccf92a2496c92873c413f754b13
? backend/cmd/app [no test files]
? backend/cmd/worker [no test files]
? backend/db [no test files]
ok backend/integration (cached)
ok backend/internal/adapter/handler 1.045s
ok backend/internal/adapter/imagefile (cached)
? backend/internal/adapter/password [no test files]
ok backend/internal/adapter/queue (cached)
ok backend/internal/adapter/repository/postgres (cached)
? backend/internal/adapter/repository/postgres/queries [no test files]
ok backend/internal/adapter/storage (cached)
ok backend/internal/adapter/telemetry 1.045s
ok backend/internal/application/usecase (cached)
ok backend/internal/config (cached)
ok backend/internal/domain/model (cached)
? backend/internal/domain/port [no test files]
? backend/internal/domain/repository [no test files]
? backend/pkg/logger [no test files]
ok backend/pkg/server (cached)
0 issues.
@@ -0,0 +1,17 @@
# OO6-LIFECYCLE-1
Source review established that the real browser entrypoint acquired browser/context/page before its protected block, and a RESULT write could prevent close. Existing source357/ZIPc0c132 remain historical. No browser or workload is rerun for this fix.
| Case | Required result |
|---|---|
| Acquired browser, context/page setup rejects | Close the same owned browser exactly once |
| Successful work, result reporting rejects | Close exactly once and preserve the reporting error |
| Work and result reporting both reject | Preserve the work error; report the secondary error separately |
| Work and close reject; secondary reporter also rejects | Preserve the original work error; secondary reporting stays best effort |
| Successful work, close rejects | Fail with the close error and separately report it |
| Acquisition rejects | No nonexistent resource is closed |
| Missing required ports | Reject before acquisition |
| Thrown undefined plus close failure | Preserve that primary thrown value using an explicit failure flag |
| Success | Close once before result reporting, then return the result |
The RED factory extracts the old ordering (acquire → setup/work → result reporting → close). Tests call only this separate factory with mandatory fake ports; the production browser entrypoint is never invoked with optional fakes. The final composition places context/page setup and all business work inside the factory's protected run. The existing lab7 lifecycle contract was read as reference; lab6 has its own implementation and no cross-subject runtime import.
+13
View File
@@ -0,0 +1,13 @@
# Full Grafana startup
| Case | Expected behavior |
|---|---|
| First owner credential | Encrypt and verify archive before publishing the runtime file |
| Archive failure | No runtime credential published; startup fails closed |
| Existing owner credential | Preserve password and verify encrypted archive; no rotation |
| Cached image/plugin mismatch or incompatible scheduler group | Abort before starting Grafana |
| HTTP200 dashboard/rules metadata empty or mismatched | Reject missing/duplicate/wrong configured dashboard panel IDs/titles or rule UIDs |
| Fresh volumes with current source | Own core, three signals, datasources, dashboard and native rules start successfully |
| Native cold SQLite initialization exceeds120s with continuing successful migrations | Bounded600s startup convergence; retain previous deadline FAIL and verify a new empty-volume run |
The credential factory is tested with mandatory explicit ports; no test invokes the production entrypoint with fake arguments.
@@ -0,0 +1,14 @@
# Captured incident oracle correction
The original native command remains FAIL. This delta only reads its immutable data; it does not repeat faults or change alert conditions.
| Class | Expected result |
|---|---|
| Alert during worker stop with complete owned late-job cohort | Recognized |
| Alert after process restart while the same backlog is still recovering | Recognized |
| Missing/mismatched jobs, timely jobs, malformed timestamps | Rejected |
| Alert outside acceptance-to-last-ready plus 30s cohort +10s evaluation +2s export +2s observation budget | Rejected |
| Empty/NaN/nonzero queue samples | Not drained |
| At least one finite zero queue sample, all zero | Drained |
The production source used a phase-name-only oracle. Its extracted RED implementation preserves that behavior; the new regression fails on post-start recovery, missing-job validation and empty queue observations.
+12
View File
@@ -0,0 +1,12 @@
# Minimal required worker retry trace
| Boundary | Required observation |
|---|---|
| Worker paused, valid PNG accepted |202 plus durable owned job/traceparent; image bytes match the repository fixture |
| Only that synthetic staging object temporarily absent | Original bytes retained before removal; restore registered before mutation; S3 itself remains running |
| First durable unsuccessful processing attempt | Same job queued with processing_failed, attempt≥1, not completed; restore exact bytes before subsequent processing |
| Automatic retry | Same accepted job becomes ready with attempt≥2, original bytes unchanged and variants published |
| Actual telemetry | Same trace contains error S3 child, multiple publish/process spans with valid parents, worker.job retry and ready logs, positive jobs_processed retry and ready counters |
| Any failure | Restore the exact owned object when needed and restart the same guarded worker; revoke the synthetic session; retain distinct primary/cleanup status |
This closes the original README6 requirement to show the upload→worker chain including retry. It does not repeat the DB/queue SLO experiment or introduce a permanent-failure workload.
+7
View File
@@ -0,0 +1,7 @@
{
"checkedAt": "2026-11-16T05:17:48.022Z",
"baselineManifestSHA256": "0afe0f624bbe58a9acb8a711efd03d76edd19be6d11f8be943edb9cd015c7ff6",
"sourceFiles": 95,
"changed": [],
"unchanged": true
}
+58
View File
@@ -0,0 +1,58 @@
{
"checkedAt": "2026-11-16T04:29:21.890Z",
"traceId": "33513303fdb8cdefbd4ff24c8394f3d3",
"requestId": "3cfa3390-ed20-4116-aa2f-9edefd0b38ab",
"logToTrace": {
"http": 200,
"uniqueSpans": 42,
"parents": 41
},
"traceToLogs": {
"http": 200,
"rows": 1,
"actualQuery": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '33513303fdb8cdefbd4ff24c8394f3d3'",
"start_time": 1794784791672000,
"end_time": 1794784792825000,
"from": 0,
"size": 200,
"sql_mode": "full"
},
"selectedSpan": [
{
"_o2_ingest_ts": 1794784794044381,
"_timestamp": 1794784791672290,
"duration": 1153117,
"end_time": 1794784792825407500,
"events": "[]",
"flags": 1,
"links": "[]",
"operation_name": "attachment.process",
"reference_parent_span_id": "769b5b6b63493d8e",
"reference_parent_trace_id": "33513303fdb8cdefbd4ff24c8394f3d3",
"reference_ref_type": "ChildOf",
"service_deployment_environment_name": "lab",
"service_name": "messenger-worker",
"service_service_instance_id": "755e3021-48c8-4f21-a325-52536c5f982e",
"service_service_version": "lab6-v1",
"span_id": "243b77c284a30715",
"span_kind": "5",
"span_status": "UNSET",
"start_time": 1794784791672290000,
"status_code": 0,
"status_message": "",
"trace_id": "33513303fdb8cdefbd4ff24c8394f3d3"
}
],
"events": [
"worker.job"
],
"requestIdFound": false
},
"nativeClicks": [
"View trace 33513303fdb8cdefbd4ff24c8394f3d3",
"attachment.process (1.15s)",
"View logs for trace 33513303fdb8cdefbd4ff24c8394f3d3"
],
"passed": true
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

+92
View File
@@ -0,0 +1,92 @@
{
"checkedAt": "2026-11-16T03:50:00.353Z",
"results": [
{
"name": "prom-backend",
"http": 200,
"receivedBytes": 509,
"complete": true,
"readError": false,
"jsonParsed": true,
"frames": [
{
"fields": [
{
"name": "Time",
"type": "time"
},
{
"name": "Value",
"type": "number"
}
],
"rows": [
1,
1
],
"maxStringLength": 0
}
]
},
{
"name": "plugin-backend-positive",
"http": 200,
"receivedBytes": 455,
"complete": true,
"readError": false,
"jsonParsed": true,
"frames": [
{
"fields": [
{
"name": "_timestamp",
"type": "time"
},
{
"name": "event",
"type": "string"
},
{
"name": "trace_id",
"type": "string"
}
],
"rows": [
1,
1,
1
],
"maxStringLength": 32
}
]
},
{
"name": "plugin-proxy-positive",
"http": 200,
"receivedBytes": 529,
"complete": true,
"readError": false,
"jsonParsed": true,
"hits": 1
},
{
"name": "plugin-proxy-cap",
"http": 502,
"receivedBytes": 35,
"complete": true,
"readError": false,
"jsonParsed": true
},
{
"name": "plugin-backend-cap",
"http": 400,
"receivedBytes": 144,
"complete": true,
"readError": false,
"jsonParsed": true,
"resultError": "OpenObserve returned 502: {\"error\":\"query_response_boundary\"}",
"frames": []
}
],
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-query-be220891-0f1c-40f6-8a24-406580e8e614"
}
@@ -0,0 +1,93 @@
{
"checkedAt": "2026-11-16T03:21:04.548Z",
"results": [
{
"name": "prom-backend",
"http": 200,
"receivedBytes": 509,
"complete": true,
"readError": false,
"jsonParsed": true,
"frames": [
{
"fields": [
{
"name": "Time",
"type": "time"
},
{
"name": "Value",
"type": "number"
}
],
"rows": [
1,
1
],
"maxStringLength": 0
}
]
},
{
"name": "plugin-backend-positive",
"http": 200,
"receivedBytes": 455,
"complete": true,
"readError": false,
"jsonParsed": true,
"frames": [
{
"fields": [
{
"name": "_timestamp",
"type": "time"
},
{
"name": "event",
"type": "string"
},
{
"name": "trace_id",
"type": "string"
}
],
"rows": [
1,
1,
1
],
"maxStringLength": 32
}
]
},
{
"name": "plugin-proxy-positive",
"http": 200,
"receivedBytes": 529,
"complete": true,
"readError": false,
"jsonParsed": true,
"hits": 1
},
{
"name": "plugin-proxy-cap",
"http": 200,
"receivedBytes": 2097625,
"complete": true,
"readError": false,
"jsonParsed": true,
"hits": 1
},
{
"name": "plugin-backend-cap",
"http": 400,
"receivedBytes": 180,
"complete": true,
"readError": false,
"jsonParsed": true,
"resultError": "reading OpenObserve response: error: http: response body too large, response limit is set to: 1048576",
"frames": []
}
],
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-query-98d01036-04ee-404e-a09b-28325304cfad"
}
@@ -0,0 +1,3 @@
Running as unit: run-p3141366-i28308794.scope; invocation ID: b454b801d70d4f29acd5b9ffc3e3850e
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
@@ -0,0 +1,54 @@
{
"checkedAt": "2026-11-16T05:49:11.398Z",
"finding": "OO6-LIFECYCLE-1",
"oldSourceManifest": "15373c507047ace82d1490f9f78083ab5d165a7fe1c84191c5fd4f7105345bbd",
"oldBrowserSHA256": "1220e07fa3f9f9eaa8b6503cf5eff41799ea154a7117b2bc0900d772545a255a",
"newBrowserSHA256": "c36c72e62c75a57b93111f449cdc64c4dcec7b7e9c63bf3a7d903390ae9d0aa1",
"businessScenarioCoreSHA256": "92b93aa9d8ff40151543220b8ef68bea06e3f472c6f3655dddeff12131e4fab8",
"businessScenarioCoreByteIdentical": true,
"sourceChanges": [
"student-tests/grafana-browser.ts",
"scripts/lib/browser-lifecycle.ts",
"student-tests/browser-lifecycle.test.ts"
],
"newContextAndPageInsideProtectedRun": true,
"resultReportingAfterClose": true,
"primaryPreservedWithSeparateBestEffortSecondaryFailures": true,
"nativeRED": {
"tests": 10,
"pass": 1,
"fail": 9,
"exitCode": 1,
"evidence": "browser-lifecycle-red-native-finalcase.txt"
},
"nativeGREEN": {
"tests": 10,
"pass": 10,
"assertions": 48,
"exitCode": 0,
"evidence": "browser-lifecycle-green-native.txt"
},
"fullNativeUnit": {
"tests": 41,
"assertions": 136,
"exitCode": 0,
"evidence": "browser-lifecycle-full-unit-native.txt"
},
"nativeTypecheck": {
"files": 60,
"exitCode": 0,
"evidence": "browser-lifecycle-typecheck-native.json"
},
"nonwritingEntrypointCheck": {
"command": "bun student-tests/grafana-browser.ts --check",
"exitCode": 0,
"credentialsRead": false,
"browserLaunched": false
},
"originalContractCheck": {
"exitCode": 0,
"evidence": "browser-lifecycle-contract-check.txt"
},
"browserOrProducerRerun": false,
"oldRuntimeEvidencePreserved": true
}
@@ -0,0 +1,64 @@
Running as unit: run-p3141220-i28055114.scope; invocation ID: 0e70d098ddc949e6ac47850cbee85c37
bun test v1.4.4 (38afee6c8)
student-tests/incident-readback.test.ts:
(pass) recognizes firing while the same accepted backlog is recovering after process start [0.33ms]
(pass) accepts firing during worker stop and requires the complete owned late-job cohort [0.04ms]
(pass) rejects an unrelated later alert or timely successful workload [0.03ms]
(pass) queue drain needs actual finite samples rather than empty NoData [0.06ms]
student-tests/grafana-credential.test.ts:
(pass) archives and verifies a new owner credential before publishing the runtime file [0.26ms]
(pass) does not publish a credential when encrypted archival fails [0.13ms]
(pass) preserves the existing owner and archives it without rotating or rewriting [0.07ms]
student-tests/openobserve-bootstrap.test.ts:
(pass) first received credential survives a second account creation failure [0.50ms]
(pass) resume reuses one persisted credential instead of repeating its account POST [0.09ms]
(pass) resume recovers a valid captured response without repeating account POST [0.12ms]
(pass) uncertain intent without recoverable native JSON fails closed without POST retry [0.10ms]
(pass) stale search token401 prevents derived publication and successful continuation [0.16ms]
(pass) unavailable ingest503 prevents derived publication and successful continuation [0.03ms]
(pass) rotation401 is not the required403 denial prevents derived publication and successful continuation [0.02ms]
(pass) healthy initial bootstrap checkpoints ingest before starting query creation [0.08ms]
(pass) healthy saved index revalidates both native identities without new account POST [0.05ms]
student-tests/grafana-scheduler.test.ts:
(pass) rejects actual provisioning failure1s under native13.3.1 scheduler10s [0.11ms]
(pass) rejects zero and nonmultiple intervals before native startup [0.05ms]
(pass) accepts native10s and its20s multiple [0.04ms]
student-tests/openobserve-account-http.test.ts:
(pass) malformed one-time response is captured before JSON decoding fails [2.32ms]
(pass) partial response is retained as uncertain when body reading fails [0.16ms]
(pass) oversized response retains bounded available bytes before reporting its cap [0.20ms]
(pass) network failure records uncertain request without retry [0.11ms]
(pass) valid response is captured before it is returned to the create caller [0.13ms]
student-tests/grafana-provisioning.test.ts:
(pass) accepts the actual configured dashboard and exact rule UID set [0.19ms]
(pass) rejects empty or mismatched dashboard payload despite successful HTTP status [0.06ms]
(pass) rejects absent, duplicated or wrong rule UIDs even when counts match [0.03ms]
student-tests/owned-fault.test.ts:
(pass) restores the acquired owned lease after successful exercise [0.15ms]
(pass) restores owned lease even when its mutation or traffic fails [0.11ms]
(pass) preserves primary failure separately from failed restoration [0.11ms]
(pass) does not restore anything when ownership acquisition fails [0.06ms]
student-tests/browser-lifecycle.test.ts:
(pass) context setup rejection closes the acquired owned browser [0.31ms]
(pass) page setup rejection closes the acquired owned browser [0.05ms]
(pass) result-write rejection still closes and remains the primary failure [0.09ms]
(pass) work failure survives simultaneous result-write failure [0.07ms]
(pass) primary failure survives close and secondary-reporter failures [0.07ms]
(pass) close failure after success remains a separately reported failure [0.06ms]
(pass) acquisition failure does not close a nonexistent browser [0.05ms]
(pass) missing required ports fail before acquisition [0.03ms]
(pass) thrown undefined is preserved when cleanup also fails [0.08ms]
(pass) successful work closes before reporting and returns its value [0.05ms]
41 pass
0 fail
136 expect() calls
Ran 41 tests across 8 files. [13.00ms]
@@ -0,0 +1,19 @@
Running as unit: run-p3132471-i28307831.scope; invocation ID: f1f363255c35463fafb1168c97f81eb1
bun test v1.4.4 (38afee6c8)
student-tests/browser-lifecycle.test.ts:
(pass) context setup rejection closes the acquired owned browser [0.53ms]
(pass) page setup rejection closes the acquired owned browser [0.07ms]
(pass) result-write rejection still closes and remains the primary failure [0.11ms]
(pass) work failure survives simultaneous result-write failure [0.08ms]
(pass) primary failure survives close and secondary-reporter failures [0.06ms]
(pass) close failure after success remains a separately reported failure [0.05ms]
(pass) acquisition failure does not close a nonexistent browser [0.08ms]
(pass) missing required ports fail before acquisition [0.04ms]
(pass) thrown undefined is preserved when cleanup also fails [0.08ms]
(pass) successful work closes before reporting and returns its value [0.06ms]
10 pass
0 fail
48 expect() calls
Ran 10 tests across 1 file. [4.00ms]
@@ -0,0 +1,18 @@
bun test v1.4.4 (38afee6c8)
student-tests/browser-lifecycle.test.ts:
(pass) context setup rejection closes the acquired owned browser [0.48ms]
(pass) page setup rejection closes the acquired owned browser [0.05ms]
(pass) result-write rejection still closes and remains the primary failure [0.06ms]
(pass) work failure survives simultaneous result-write failure [0.05ms]
(pass) primary failure survives close and secondary-reporter failures [0.03ms]
(pass) close failure after success remains a separately reported failure [0.03ms]
(pass) acquisition failure does not close a nonexistent browser [0.04ms]
(pass) missing required ports fail before acquisition [0.03ms]
(pass) thrown undefined is preserved when cleanup also fails [0.03ms]
(pass) successful work closes before reporting and returns its value [0.04ms]
10 pass
0 fail
48 expect() calls
Ran 10 tests across 1 file. [10.00ms]
@@ -0,0 +1,153 @@
Running as unit: run-p3124894-i28303798.scope; invocation ID: 81773b4a1f514bbc9d9bd455799ee95c
bun test v1.4.4 (38afee6c8)
student-tests/browser-lifecycle.test.ts:
3 | const primary=Object.hasOwn(flags,'primary')?flags.primary:new Error(flags.setup??'WORK'),reportError=new Error('RESULT_WRITE'),closeError=new Error('CLOSE'),resource={id:'synthetic-browser'},events:string[]=[],secondary:{kind:string;error:unknown}[]=[];let closes=0,acquires=0;
4 | const run=createBrowserLifecycle({acquire:async()=>{acquires++;if(flags.acquire)throw primary;return resource},run:async received=>{expect(received).toBe(resource);events.push('run');if(flags.setup||Object.hasOwn(flags,'primary'))throw primary;return 17},close:async received=>{expect(received).toBe(resource);closes++;events.push('close');if(flags.close)throw closeError},reportResult:async(result,failure)=>{events.push('report');if(flags.report)throw reportError;if(flags.setup||Object.hasOwn(flags,'primary'))expect(failure?.error).toBe(primary);else expect(result).toBe(17)},reportSecondaryFailure:async(kind,error)=>{secondary.push({kind,error});if(flags.secondaryReport)throw Error('SECONDARY_REPORT')}});
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:8:162)
(fail) context setup rejection closes the acquired owned browser [0.50ms]
4 | const run=createBrowserLifecycle({acquire:async()=>{acquires++;if(flags.acquire)throw primary;return resource},run:async received=>{expect(received).toBe(resource);events.push('run');if(flags.setup||Object.hasOwn(flags,'primary'))throw primary;return 17},close:async received=>{expect(received).toBe(resource);closes++;events.push('close');if(flags.close)throw closeError},reportResult:async(result,failure)=>{events.push('report');if(flags.report)throw reportError;if(flags.setup||Object.hasOwn(flags,'primary'))expect(failure?.error).toBe(primary);else expect(result).toBe(17)},reportSecondaryFailure:async(kind,error)=>{secondary.push({kind,error});if(flags.secondaryReport)throw Error('SECONDARY_REPORT')}});
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:9:156)
(fail) page setup rejection closes the acquired owned browser [0.08ms]
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:10:165)
(fail) result-write rejection still closes and remains the primary failure [0.17ms]
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:11:226)
(fail) work failure survives simultaneous result-write failure [0.12ms]
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:12:253)
(fail) primary failure survives close and secondary-reporter failures [0.10ms]
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toEqual(expected)
- [
- {
- "error": [Error: CLOSE],
- "kind": "close",
- },
- ]
+ []
- Expected - 6
+ Received + 1
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:13:230)
(fail) close failure after success remains a separately reported failure [0.20ms]
(pass) acquisition failure does not close a nonexistent browser [0.05ms]
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
^
error: expect(received).toThrow(expected)
Expected substring: "BROWSER_LIFECYCLE_PORTS_REQUIRED"
Received function did not throw
Received value: [AsyncFunction]
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:15:105)
(fail) missing required ports fail before acquisition [0.06ms]
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
16 | test('thrown undefined is preserved when cleanup also fails',async()=>{const f=fixture({primary:undefined,close:true}),result=await captured(f.run);expect(result.threw).toBe(true);expect(result.error).toBeUndefined();expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:16:237)
(fail) thrown undefined is preserved when cleanup also fails [0.08ms]
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
16 | test('thrown undefined is preserved when cleanup also fails',async()=>{const f=fixture({primary:undefined,close:true}),result=await captured(f.run);expect(result.threw).toBe(true);expect(result.error).toBeUndefined();expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
17 | test('successful work closes before reporting and returns its value',async()=>{const f=fixture();expect(await f.run()).toBe(17);expect(f.closes()).toBe(1);expect(f.events).toEqual(['run','close','report']);expect(f.secondary).toEqual([])});
^
error: expect(received).toEqual(expected)
[
"run",
- "close",
"report",
+ "close",
]
- Expected - 1
+ Received + 1
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:17:173)
(fail) successful work closes before reporting and returns its value [0.10ms]
1 pass
9 fail
31 expect() calls
Ran 10 tests across 1 file. [4.00ms]
@@ -0,0 +1,133 @@
Running as unit: run-p3114908-i28113997.scope; invocation ID: bdcf2768eb024a49b30a52ecd3660e62
bun test v1.4.4 (38afee6c8)
student-tests/browser-lifecycle.test.ts:
3 | const primary=Object.hasOwn(flags,'primary')?flags.primary:new Error(flags.setup??'WORK'),reportError=new Error('RESULT_WRITE'),closeError=new Error('CLOSE'),resource={id:'synthetic-browser'},events:string[]=[],secondary:{kind:string;error:unknown}[]=[];let closes=0,acquires=0;
4 | const run=createBrowserLifecycle({acquire:async()=>{acquires++;if(flags.acquire)throw primary;return resource},run:async received=>{expect(received).toBe(resource);events.push('run');if(flags.setup||Object.hasOwn(flags,'primary'))throw primary;return 17},close:async received=>{expect(received).toBe(resource);closes++;events.push('close');if(flags.close)throw closeError},reportResult:async(result,failure)=>{events.push('report');if(flags.report)throw reportError;if(flags.setup||Object.hasOwn(flags,'primary'))expect(failure?.error).toBe(primary);else expect(result).toBe(17)},reportSecondaryFailure:async(kind,error)=>{secondary.push({kind,error});if(flags.secondaryReport)throw Error('SECONDARY_REPORT')}});
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:8:162)
(fail) context setup rejection closes the acquired owned browser [0.50ms]
4 | const run=createBrowserLifecycle({acquire:async()=>{acquires++;if(flags.acquire)throw primary;return resource},run:async received=>{expect(received).toBe(resource);events.push('run');if(flags.setup||Object.hasOwn(flags,'primary'))throw primary;return 17},close:async received=>{expect(received).toBe(resource);closes++;events.push('close');if(flags.close)throw closeError},reportResult:async(result,failure)=>{events.push('report');if(flags.report)throw reportError;if(flags.setup||Object.hasOwn(flags,'primary'))expect(failure?.error).toBe(primary);else expect(result).toBe(17)},reportSecondaryFailure:async(kind,error)=>{secondary.push({kind,error});if(flags.secondaryReport)throw Error('SECONDARY_REPORT')}});
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:9:156)
(fail) page setup rejection closes the acquired owned browser [0.08ms]
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:10:165)
(fail) result-write rejection still closes and remains the primary failure [0.12ms]
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:11:226)
(fail) work failure survives simultaneous result-write failure [0.10ms]
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:12:253)
(fail) primary failure survives close and secondary-reporter failures [0.08ms]
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toEqual(expected)
- [
- {
- "error": [Error: CLOSE],
- "kind": "close",
- },
- ]
+ []
- Expected - 6
+ Received + 1
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:13:230)
(fail) close failure after success remains a separately reported failure [0.17ms]
(pass) acquisition failure does not close a nonexistent browser [0.04ms]
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
^
error: expect(received).toThrow(expected)
Expected substring: "BROWSER_LIFECYCLE_PORTS_REQUIRED"
Received function did not throw
Received value: [AsyncFunction]
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:15:105)
(fail) missing required ports fail before acquisition [0.06ms]
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
16 | test('thrown undefined is preserved when cleanup also fails',async()=>{const f=fixture({primary:undefined,close:true}),result=await captured(f.run);expect(result.threw).toBe(true);expect(result.error).toBeUndefined();expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/browser-lifecycle.test.ts:16:237)
(fail) thrown undefined is preserved when cleanup also fails [0.08ms]
(pass) successful work returns its value and closes exactly once [0.04ms]
2 pass
8 fail
31 expect() calls
Ran 10 tests across 1 file. [4.00ms]
+132
View File
@@ -0,0 +1,132 @@
bun test v1.4.4 (38afee6c8)
student-tests/browser-lifecycle.test.ts:
3 | const primary=Object.hasOwn(flags,'primary')?flags.primary:new Error(flags.setup??'WORK'),reportError=new Error('RESULT_WRITE'),closeError=new Error('CLOSE'),resource={id:'synthetic-browser'},events:string[]=[],secondary:{kind:string;error:unknown}[]=[];let closes=0,acquires=0;
4 | const run=createBrowserLifecycle({acquire:async()=>{acquires++;if(flags.acquire)throw primary;return resource},run:async received=>{expect(received).toBe(resource);events.push('run');if(flags.setup||Object.hasOwn(flags,'primary'))throw primary;return 17},close:async received=>{expect(received).toBe(resource);closes++;events.push('close');if(flags.close)throw closeError},reportResult:async(result,failure)=>{events.push('report');if(flags.report)throw reportError;if(flags.setup||Object.hasOwn(flags,'primary'))expect(failure?.error).toBe(primary);else expect(result).toBe(17)},reportSecondaryFailure:async(kind,error)=>{secondary.push({kind,error});if(flags.secondaryReport)throw Error('SECONDARY_REPORT')}});
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:8:162)
(fail) context setup rejection closes the acquired owned browser [0.82ms]
4 | const run=createBrowserLifecycle({acquire:async()=>{acquires++;if(flags.acquire)throw primary;return resource},run:async received=>{expect(received).toBe(resource);events.push('run');if(flags.setup||Object.hasOwn(flags,'primary'))throw primary;return 17},close:async received=>{expect(received).toBe(resource);closes++;events.push('close');if(flags.close)throw closeError},reportResult:async(result,failure)=>{events.push('report');if(flags.report)throw reportError;if(flags.setup||Object.hasOwn(flags,'primary'))expect(failure?.error).toBe(primary);else expect(result).toBe(17)},reportSecondaryFailure:async(kind,error)=>{secondary.push({kind,error});if(flags.secondaryReport)throw Error('SECONDARY_REPORT')}});
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:9:156)
(fail) page setup rejection closes the acquired owned browser [0.10ms]
5 | return{run,primary,reportError,closeError,events,secondary,closes:()=>closes,acquires:()=>acquires};
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:10:165)
(fail) result-write rejection still closes and remains the primary failure [0.10ms]
6 | }
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:11:226)
(fail) work failure survives simultaneous result-write failure [0.07ms]
7 | async function captured(run:()=>Promise<unknown>){try{return{threw:false,value:await run(),error:undefined}}catch(error){return{threw:true,value:undefined,error}}}
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:12:253)
(fail) primary failure survives close and secondary-reporter failures [0.06ms]
8 | test('context setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newContext'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
9 | test('page setup rejection closes the acquired owned browser',async()=>{const f=fixture({setup:'newPage'}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.primary)});
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toEqual(expected)
- [
- {
- "error": [Error: CLOSE],
- "kind": "close",
- },
- ]
+ []
- Expected - 6
+ Received + 1
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:13:230)
(fail) close failure after success remains a separately reported failure [2.23ms]
(pass) acquisition failure does not close a nonexistent browser [0.03ms]
10 | test('result-write rejection still closes and remains the primary failure',async()=>{const f=fixture({report:true}),result=await captured(f.run);expect(f.closes()).toBe(1);expect(result.error).toBe(f.reportError)});
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
^
error: expect(received).toThrow(expected)
Expected substring: "BROWSER_LIFECYCLE_PORTS_REQUIRED"
Received function did not throw
Received value: [AsyncFunction]
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:15:105)
(fail) missing required ports fail before acquisition [0.22ms]
11 | test('work failure survives simultaneous result-write failure',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,report:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'report',error:f.reportError}])});
12 | test('primary failure survives close and secondary-reporter failures',async()=>{const primary=new Error('ORIGINAL'),f=fixture({primary,close:true,secondaryReport:true}),result=await captured(f.run);expect(result.error).toBe(primary);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
13 | test('close failure after success remains a separately reported failure',async()=>{const f=fixture({close:true}),result=await captured(f.run);expect(result.error).toBe(f.closeError);expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
14 | test('acquisition failure does not close a nonexistent browser',async()=>{const f=fixture({acquire:true}),result=await captured(f.run);expect(result.error).toBe(f.primary);expect(f.closes()).toBe(0)});
15 | test('missing required ports fail before acquisition',()=>{expect(()=>createBrowserLifecycle({}as any)).toThrow('BROWSER_LIFECYCLE_PORTS_REQUIRED')});
16 | test('thrown undefined is preserved when cleanup also fails',async()=>{const f=fixture({primary:undefined,close:true}),result=await captured(f.run);expect(result.threw).toBe(true);expect(result.error).toBeUndefined();expect(f.closes()).toBe(1);expect(f.secondary).toEqual([{kind:'close',error:f.closeError}])});
^
error: expect(received).toBe(expected)
Expected: 1
Received: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/browser-lifecycle.test.ts:16:237)
(fail) thrown undefined is preserved when cleanup also fails [0.06ms]
(pass) successful work returns its value and closes exactly once [0.03ms]
2 pass
8 fail
31 expect() calls
Ran 10 tests across 1 file. [16.00ms]
@@ -0,0 +1,9 @@
{
"checkedAt": "2026-11-16T05:46:54.726Z",
"compiler": "TypeScript7.0.2 via existing Bun1.4.4",
"files": 60,
"network": false,
"exit": 0,
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/typecheck-22244655-708f-45d9-b23c-9613552bbf81"
}
@@ -0,0 +1,7 @@
1 | import{mkdir,readFile,writeFile}from'node:fs/promises';import{resolve}from'node:path';
2 | const args=process.argv.slice(2);if(args.some(a=>/^--(?:only|filter|debug|skip)/.test(a)))throw Error('Partial/debug filters are forbidden for final browser acceptance');if(args.includes('--check')){console.log('Three-scenario native browser acceptance validated without credentials or launch');process.exit(0)}
^
error: Partial/debug filters are forbidden for final browser acceptance
at /Users/rey/mtuci/vp/lab6/student-tests/grafana-browser.ts:2:97
Bun v1.4.4 (macOS arm64)
@@ -0,0 +1,96 @@
{
"checkedAt": "2026-11-16T05:00:10.819Z",
"scope": "three actual authenticated Chromium UI scenarios, no filters or manually reconstructed reverse link",
"expectedScenarios": [
"canonical-log-to-trace",
"canonical-trace-to-logs",
"retry-trace-render"
],
"executedScenarios": [
"canonical-log-to-trace",
"canonical-trace-to-logs",
"retry-trace-render"
],
"complete": true,
"stage": "retry-trace-render",
"canonicalTraceId": "33513303fdb8cdefbd4ff24c8394f3d3",
"retryTraceId": "3b58d0b8144926719059857bf888bada",
"wires": [
{
"id": 1,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\"='33513303fdb8cdefbd4ff24c8394f3d3' ORDER BY \"_timestamp\" ASC LIMIT 100",
"start_time": 1794784790437000,
"end_time": 1794784793825000,
"from": 0,
"size": 200,
"sql_mode": "full"
},
"hits": 3,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
},
{
"id": 2,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '33513303fdb8cdefbd4ff24c8394f3d3' ORDER BY \"_timestamp\" ASC",
"start_time": 1794784790437000,
"end_time": 1794784793825000,
"from": 0,
"size": 1000,
"sql_mode": "full"
},
"hits": 42,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
},
{
"id": 3,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '33513303fdb8cdefbd4ff24c8394f3d3'",
"start_time": 1794784791672000,
"end_time": 1794784792825000,
"from": 0,
"size": 200,
"sql_mode": "full"
},
"hits": 1,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
},
{
"id": 4,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '3b58d0b8144926719059857bf888bada' ORDER BY \"_timestamp\" ASC",
"start_time": 1794804888955000,
"end_time": 1794804896674000,
"from": 0,
"size": 1000,
"sql_mode": "full"
},
"hits": 58,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
}
],
"rawConsoleRecords": [],
"rawNetworkErrors": [
{
"stage": "canonical-logs",
"kind": "requestfailed",
"path": "/public/build/img/icons/unicons/sync.svg",
"resourceType": "fetch",
"reason": "net::ERR_ABORTED",
"reasonSHA256": "7ba7a1709a2d7d220e120c927e0a7e90adf45c88b09ba912b237d705090d1d4e"
}
],
"expectedOptional404Count": 0,
"unexpectedConsoleErrors": 0,
"unexpectedNetworkErrors": 1,
"passed": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-browser-cd425829-68b6-4827-aab6-1efc2acaa3c3"
}
@@ -0,0 +1,93 @@
{
"checkedAt": "2026-11-16T04:58:36.524Z",
"scope": "three actual authenticated Chromium UI scenarios, no filters or manually reconstructed reverse link",
"expectedScenarios": [
"canonical-log-to-trace",
"canonical-trace-to-logs",
"retry-trace-render"
],
"executedScenarios": [
"canonical-log-to-trace",
"canonical-trace-to-logs",
"retry-trace-render"
],
"complete": true,
"stage": "retry-trace-render",
"canonicalTraceId": "33513303fdb8cdefbd4ff24c8394f3d3",
"retryTraceId": "3b58d0b8144926719059857bf888bada",
"wires": [
{
"id": 1,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\"='33513303fdb8cdefbd4ff24c8394f3d3' ORDER BY \"_timestamp\" ASC LIMIT 100",
"start_time": 1794784790437000,
"end_time": 1794784793825000,
"from": 0,
"size": 200,
"sql_mode": "full"
},
"hits": 3,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
},
{
"id": 2,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '33513303fdb8cdefbd4ff24c8394f3d3' ORDER BY \"_timestamp\" ASC",
"start_time": 1794784790437000,
"end_time": 1794784793825000,
"from": 0,
"size": 1000,
"sql_mode": "full"
},
"hits": 42,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
},
{
"id": 3,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '33513303fdb8cdefbd4ff24c8394f3d3'",
"start_time": 1794784791672000,
"end_time": 1794784792825000,
"from": 0,
"size": 200,
"sql_mode": "full"
},
"hits": 1,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
},
{
"id": 4,
"status": 200,
"contentType": "application/json",
"query": {
"sql": "SELECT * FROM \"messenger\" WHERE \"trace_id\" = '3b58d0b8144926719059857bf888bada' ORDER BY \"_timestamp\" ASC",
"start_time": 1794804888955000,
"end_time": 1794804896674000,
"from": 0,
"size": 1000,
"sql_mode": "full"
},
"hits": 58,
"path": "/api/datasources/proxy/uid/openobserve/api/default/_search"
}
],
"rawConsoleRecords": [],
"rawNetworkErrors": [
{
"stage": "canonical-logs",
"kind": "requestfailed",
"path": "/public/build/img/icons/unicons/sync.svg"
}
],
"expectedOptional404Count": 0,
"unexpectedConsoleErrors": 0,
"unexpectedNetworkErrors": 1,
"passed": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-browser-ba3c0f85-b258-4e59-a4a5-0028fac8a0db"
}
+22
View File
@@ -0,0 +1,22 @@
{
"checkedAt": "2026-11-16T03:06:42.735Z",
"downloadReceipt": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-approved-31251471-ca6a-4d2e-b823-8e42ff9fefa5/DOWNLOAD-READY.json",
"alias": "docker.io/library/mtuci-vp6-grafana-cache:13.3.1",
"imageID": "sha256:1c88285f1dd391a62232c010e6c224846e6a73bdc583b3365be2eba614b7919e",
"platform": "linux/amd64",
"nativeVersionOutput": "grafana version 13.3.1",
"nativeVersionExit": 0,
"imported": true,
"pluginArchive": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-approved-31251471-ca6a-4d2e-b823-8e42ff9fefa5/openobserve-1.0.1.zip",
"pluginArchiveSHA256": "e0c2cbcc7cf6d05bcfaa606db39e52249eb0dd234376e45a3f896353831c2fd5",
"pluginDirectory": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-plugins/openobserve",
"pluginId": "openobserve",
"pluginVersion": "1.0.1",
"pluginRequiresGrafana": ">=12.4.0",
"filesSHA256": {
"plugin.json": "8bec0fc6e3069122c970decc8f62b002cce63441fe8592a1b17349becbea844f",
"module.js": "7c43a8842a97f722e2de0ff2ff4512d84e5cd91a7d75594b10c2677c7d63fe0c",
"gpx_openobserve_linux_amd64": "dc91fdfaf25708cb2573c4e533754cb5cc5ecd02d43beb7ee21bee06fbc09c50"
},
"upstreamUnmodified": true
}
+111
View File
@@ -0,0 +1,111 @@
{
"checkedAt": "2026-11-16T05:22:22.991Z",
"staticAndRuntimeBinds": [
{
"service": "lb",
"path": "config/haproxy.cfg",
"kind": "public source included in archive",
"entries": [
"config/haproxy.cfg"
]
},
{
"service": "otel-collector",
"path": "config/otel-collector.yaml",
"kind": "public source included in archive",
"entries": [
"config/otel-collector.yaml"
]
},
{
"service": "grafana",
"path": "config/grafana/provisioning",
"kind": "public source included in archive",
"entries": [
"config/grafana/provisioning/datasources/datasources.yaml",
"config/grafana/provisioning/alerting/rules.yaml",
"config/grafana/provisioning/dashboards/dashboards.yaml"
]
},
{
"service": "grafana",
"path": "config/grafana/dashboards",
"kind": "public source included in archive",
"entries": [
"config/grafana/dashboards/messenger.json"
]
},
{
"service": "grafana",
"path": ".local/grafana-plugins",
"kind": "excluded verified public plugin runtime dependency",
"sourceOfPreparation": "IMAGE-MANIFEST.json + RUNBOOK.md + scripts/preflight-openobserve-images.ts"
},
{
"service": "observe-query",
"path": "config/openobserve-query.cfg",
"kind": "public source included in archive",
"entries": [
"config/openobserve-query.cfg"
]
}
],
"secretInputs": [
{
"name": "pg_password",
"path": ".local/pg_password",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "database_url",
"path": ".local/database_url",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "cache_url",
"path": ".local/cache_url",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "valkey_conf",
"path": ".local/valkey.conf",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "s3_access",
"path": ".local/s3_access",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "s3_secret",
"path": ".local/s3_secret",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "s3_root",
"path": ".local/s3_root",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "s3_credentials",
"path": ".local/s3_credentials",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "grafana_password",
"path": ".local/grafana_password",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "openobserve_ingest_auth",
"path": ".local/openobserve_sa_ingest_auth",
"kind": "generated private runtime file; excluded from source archive"
},
{
"name": "openobserve_query_users",
"path": ".local/openobserve_query_users.cfg",
"kind": "generated private runtime file; excluded from source archive"
}
],
"passed": true
}
+7
View File
@@ -0,0 +1,7 @@
{
"checkedAt": "2026-11-16T04:34:14.799Z",
"root": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6",
"exit": 0,
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/current-up-9eddf625-247a-4dbc-97a0-95724f28dc4f"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

+272
View File
@@ -0,0 +1,272 @@
[
{
"id": 1,
"title": "RPS",
"expr": "sum(rate(http_requests[30s]))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 1.0490127053294251,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 2,
"title": "5xx ratio",
"expr": "(sum(rate(http_requests{status_class=\"5xx\"}[30s])) or vector(0)) / clamp_min(sum(rate(http_requests[30s])),0.001)",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 0,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 3,
"title": "API p50",
"expr": "histogram_quantile(0.50, sum by(le)(rate(http_duration_bucket[30s])))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 7,
"nonfiniteSamples": 9,
"min": 0.004301818123549536,
"max": 0.004589393222579283,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 4,
"title": "API p95",
"expr": "histogram_quantile(0.95, sum by(le)(rate(http_duration_bucket[30s])))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 7,
"nonfiniteSamples": 9,
"min": 0.08555361894188182,
"max": 0.09446530637165847,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 5,
"title": "API p99",
"expr": "histogram_quantile(0.99, sum by(le)(rate(http_duration_bucket[30s])))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 7,
"nonfiniteSamples": 9,
"min": 0.09711072378837636,
"max": 0.2064125248025097,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 6,
"title": "Oldest queued job",
"expr": "max((queue_oldest_age_seconds and (timestamp(queue_oldest_age_seconds) > time()-10)))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 0.8785,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 7,
"title": "Queue depth",
"expr": "max((queue_depth and (timestamp(queue_depth) > time()-10)))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 1,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 8,
"title": "DB pool usage",
"expr": "sum((db_pool_used and (timestamp(db_pool_used) > time()-10))) / clamp_min(sum((db_pool_capacity and (timestamp(db_pool_capacity) > time()-10))),1)",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 0,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 9,
"title": "Worker saturation",
"expr": "sum((worker_busy and (timestamp(worker_busy) > time()-10))) / clamp_min(sum((worker_capacity and (timestamp(worker_capacity) > time()-10))),1)",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 1,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 10,
"title": "Job outcomes",
"expr": "sum by(outcome)(rate(jobs_processed[30s]))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 0.03571434311233714,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 11,
"title": "Job p95",
"expr": "histogram_quantile(0.95,sum by(le)(rate(job_duration_bucket[30s])))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 6,
"nonfiniteSamples": 10,
"min": 0.9749999999999999,
"max": 0.9750000000000001,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 12,
"title": "Time to ready p95",
"expr": "histogram_quantile(0.95,sum by(le)(rate(time_to_ready_bucket[30s])))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 6,
"nonfiniteSamples": 10,
"min": 0.976821202689633,
"max": 0.9768278560089629,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 13,
"title": "DB pending acquires",
"expr": "sum((db_pool_pending_acquires and (timestamp(db_pool_pending_acquires) > time()-10)))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 0,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 14,
"title": "DB acquire p95",
"expr": "histogram_quantile(0.95,sum by(le)(rate(db_pool_acquire_duration_bucket[30s])))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0.0009499999999999999,
"max": 0.0009500000000000001,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 15,
"title": "Database observer available",
"expr": "min((database_observer_up and (timestamp(database_observer_up) > time()-10)))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 1,
"max": 1,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 16,
"title": "Missed ready deadline (matured5m cohort)",
"expr": "max((((ready_slo_matured_300s - on(service_name,service_instance_id) ready_slo_timely_300s) / on(service_name,service_instance_id) clamp_min(ready_slo_matured_300s,1)) and on(service_name,service_instance_id) (database_observer_up == 1)) and on(service_name,service_instance_id) (timestamp(ready_slo_matured_300s) > time()-10) and on(service_name,service_instance_id) (timestamp(database_observer_up) > time()-10))",
"http": 200,
"error": false,
"frames": 1,
"finiteSamples": 16,
"nonfiniteSamples": 0,
"min": 0,
"max": 0,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 17,
"title": "Process RSS",
"expr": "sum by(service_name)((process_resident_memory_bytes and (timestamp(process_resident_memory_bytes) > time()-10)))",
"http": 200,
"error": false,
"frames": 2,
"finiteSamples": 32,
"nonfiniteSamples": 0,
"min": 32276480,
"max": 194490368,
"canvas": 1,
"noData": false,
"pass": true
},
{
"id": 18,
"title": "Process CPU (cores)",
"expr": "sum by(service_name)(rate(process_cpu[30s]))",
"http": 200,
"error": false,
"frames": 2,
"finiteSamples": 32,
"nonfiniteSamples": 0,
"min": 0.0013742459754225059,
"max": 0.018518803625076408,
"canvas": 1,
"noData": false,
"pass": true
}
]
+82
View File
@@ -0,0 +1,82 @@
{
"checkedAt": "2026-11-16T03:03:52.692Z",
"stage": "verified_download_complete",
"networkBytes": 559001001,
"networkBudget": 600000000,
"networkBudgetRespected": true,
"descriptorBytes": 506207527,
"manifestDigest": "sha256:1c88285f1dd391a62232c010e6c224846e6a73bdc583b3365be2eba614b7919e",
"configDigest": "sha256:bc5ca66188ced0ed137172d30a53944c7f13e183c099cae842da777103feedaa",
"alias": "docker.io/library/mtuci-vp6-grafana-cache:13.3.1",
"archive": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-approved-31251471-ca6a-4d2e-b823-8e42ff9fefa5/grafana.oci.tar",
"plugin": {
"repository": "Windforce17/openobserve-grafana-plugin",
"version": "1.0.1",
"bytes": 52781711,
"sha256": "e0c2cbcc7cf6d05bcfaa606db39e52249eb0dd234376e45a3f896353831c2fd5",
"path": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-approved-31251471-ca6a-4d2e-b823-8e42ff9fefa5/openobserve-1.0.1.zip"
},
"fetched": [
{
"digest": "sha256:bc5ca66188ced0ed137172d30a53944c7f13e183c099cae842da777103feedaa",
"bytes": 6672,
"shaVerified": true
},
{
"digest": "sha256:7b229517ed222597277036d94892173207d01a731ab3a88eeb1de2e963a2c788",
"bytes": 3853109,
"shaVerified": true
},
{
"digest": "sha256:c3926f3184bf3b13365155de5245c1c4349cd02c9bc302611ff5ca9f3381d69c",
"bytes": 139,
"shaVerified": true
},
{
"digest": "sha256:49c884504785adb1f3a656055a0e342304df2035a5e823bbb0cc325bcd0b6a79",
"bytes": 6007060,
"shaVerified": true
},
{
"digest": "sha256:b61d3c1695c81416a4ce662673a25186a30d5f6cccca4cdcc9303a07466943bb",
"bytes": 8734579,
"shaVerified": true
},
{
"digest": "sha256:d68823287cc88a6ca8c444bb34c83d62d100eebb9e3310e9d2b2c901b62acfee",
"bytes": 79102,
"shaVerified": true
},
{
"digest": "sha256:566bd34831162fa49b87b18ac7623b4fc49147af34bb71808c51d56a9782af1c",
"bytes": 33819,
"shaVerified": true
},
{
"digest": "sha256:f6eb8669328945d3ed4b97455cc0490c9d27d5d45fcbbe6972a0989023914610",
"bytes": 296278919,
"shaVerified": true
},
{
"digest": "sha256:1966baf73b6b0c1c7c19318ea9351c3363097afe799e6f3de45e7bbb4c62a1b7",
"bytes": 191212511,
"shaVerified": true
},
{
"digest": "sha256:b191399e0c4e2c3e913e30073df10906a670a67fd50fb34645c410f6c671edd0",
"bytes": 182,
"shaVerified": true
},
{
"digest": "sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1",
"bytes": 32,
"shaVerified": true
},
{
"digest": "sha256:084a12273e91bb39f4c55978eaa4b10e389d6bbbe04ae62a13f9ce2315374c88",
"bytes": 1403,
"shaVerified": true
}
],
"imported": false
}
+74
View File
@@ -0,0 +1,74 @@
{
"scope": "Final maintained source checks after the full functional runtime; ordinary correctness checks, no benchmark or new downloads",
"nativeEnvironment": {
"host": "omarchy",
"directory": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6",
"Bun": "1.4.4",
"TypeScript": "7.0.2",
"priority": "background.slice CPUWeight10 IOWeight10 nice15"
},
"originalContractCheck": {
"command": "make check",
"exitCode": 0,
"result": "offline skeleton structure, local refs and original Python syntax; application not tested by this command"
},
"publicRuntimeSmoke": {
"command": "make test BASE_URL=http://127.0.0.1:28206",
"exitCode": 0,
"evidence": "fresh-volume-green.json",
"scope": "original smoke on the genuinely new-volume stack"
},
"nativeUnit": {
"command": "bun test student-tests",
"exitCode": 0,
"tests": 41,
"assertions": 136,
"files": 8,
"evidence": "browser-lifecycle-full-unit-native.txt",
"scope": "Original31 tests plus10 required-port lifecycle cases; no production entrypoint with optional fakes"
},
"nativeTypecheck": {
"command": "bun .local/operations/check-types.ts",
"exitCode": 0,
"files": 60,
"receipt": "browser-lifecycle-typecheck-native.json",
"reproducibleOperationSource": "offline-typecheck-source.ts.txt",
"network": false
},
"cachedRuntimePreflight": {
"command": "bun scripts/preflight-openobserve-images.ts --grafana",
"exitCode": 0,
"verifiedImages": 3,
"pulled": false,
"scope": "exact image/platform IDs, public plugin source/binary hashes and10s scheduler group validation"
},
"backend95": {
"command": "bun scripts/check-backend-unchanged.ts",
"exitCode": 0,
"receipt": "backend95-final.json",
"sourceChanged": false
},
"originalAssignments": {
"command": "git diff --exit-code HEAD -- README.md COURSE.md CONTRIBUTING.md Makefile contracts tests examples .env.example compose.example.yaml scripts/check_contract.py scripts/validate_openapi.py .github/workflows .github/pull_request_template.md",
"exitCode": 0,
"baselineSkeleton": "470d9d6f1e4fe4f594e37c2ba59550ee5ca54fc1"
},
"reviewedSourceGuard": "reviewed-source-guards.json",
"strictProvisioning": "provisioning-strict-native-green.json",
"wholeBrowser": {
"functionalScenarios": 3,
"expectedScenarios": 3,
"consoleErrorsAndWarnings": 0,
"aggregateExitCode": 1,
"knownLimit": "one canceled sync.svg static asset fetch; actual CacheAPI initiator, precise cleanup cause unknown; not clean-network PASS",
"evidence": "browser-three-functional-icon-aborted.json"
},
"ownedTeardown": "final-stop.json",
"archiveVerification": "Performed separately after immutable final source review",
"browserLifecycleDelta": "browser-lifecycle-delta.json",
"sourceReviewClosure": {
"reportSHA256": "c65a5a1ac7d83eb65bd2f8e171e8aed5b2ab9ca4fa61dc41f94c3e4a36693c87",
"scope": "Independent source+targeted lifecycle closure; separate final archive readback pending",
"externalReport": "/Users/rey/mtuci/evidence/review-openobserve-grafana-lab6.md"
}
}
+8
View File
@@ -0,0 +1,8 @@
{
"checkedAt": "2026-11-16T05:18:35.098Z",
"ownRunningContainers": [],
"ownListeningEndpoints": [],
"ownBrowserProcessCount": 0,
"preserved": "All existing/current/fresh volumes, private receipts, encrypted identities and verified caches retained; shared7/runner untouched",
"passed": true
}
@@ -0,0 +1,33 @@
{
"checkedAt": "2026-11-16T04:43:57.449Z",
"project": "mtuci-vp6-fresh-c3182079",
"canonical": "mtuci-vp6-medvedev",
"fresh": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/source",
"commands": [
{
"label": "stop-only-canonical6-preserve-volumes",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/1-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/1-stderr.private"
},
{
"label": "fresh-full-up",
"exit": 1,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/2-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/2-stderr.private"
},
{
"label": "stop-only-fresh6-preserve-volumes",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/3-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a/3-stderr.private"
}
],
"failureStage": "fresh-full-up",
"failure": "OwnedFaultFailure",
"ownFreshRunningContainers": 0,
"canonicalRunningContainers": 0,
"preservedVolumes": true,
"passed": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-c3182079-997f-4827-93b2-e36792fd902a"
}
+61
View File
@@ -0,0 +1,61 @@
{
"checkedAt": "2026-11-16T04:48:17.259Z",
"project": "mtuci-vp6-fresh-adf8b95f",
"canonical": "mtuci-vp6-medvedev",
"fresh": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/source",
"commands": [
{
"label": "stop-only-canonical6-preserve-volumes",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/1-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/1-stderr.private"
},
{
"label": "fresh-full-up",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/2-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/2-stderr.private"
},
{
"label": "original-make-check",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/3-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/3-stderr.private"
},
{
"label": "original-public-smoke",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/4-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/4-stderr.private"
},
{
"label": "fresh-three-signals-and-parent-units",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/5-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/5-stderr.private"
},
{
"label": "fresh-grafana-datasources-dashboard-rules",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/6-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/6-stderr.private"
},
{
"label": "fresh-backend95-guard",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/7-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/7-stderr.private"
},
{
"label": "stop-only-fresh6-preserve-volumes",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/8-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172/8-stderr.private"
}
],
"ownFreshRunningContainers": 0,
"canonicalRunningContainers": 0,
"preservedVolumes": true,
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-adf8b95f-22bc-4726-9e1e-5ed9d726d172"
}
@@ -0,0 +1,33 @@
{
"checkedAt": "2026-11-16T04:39:27.860Z",
"project": "mtuci-vp6-fresh-65dd122a",
"canonical": "mtuci-vp6-medvedev",
"fresh": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/source",
"commands": [
{
"label": "stop-only-canonical6-preserve-volumes",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/1-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/1-stderr.private"
},
{
"label": "fresh-full-up",
"exit": 1,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/2-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/2-stderr.private"
},
{
"label": "stop-only-fresh6-preserve-volumes",
"exit": 0,
"stdout": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/3-stdout.private",
"stderr": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6/3-stderr.private"
}
],
"failureStage": "stop-only-fresh6-preserve-volumes",
"failure": "OwnedFaultFailure",
"ownFreshRunningContainers": 0,
"canonicalRunningContainers": 0,
"preservedVolumes": true,
"passed": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/fresh-volume-65dd122a-be1f-4a51-87e8-095253b711d6"
}
@@ -0,0 +1,10 @@
import{resolve}from'node:path';import{mkdir,readFile,writeFile,cp,symlink,statfs,readdir}from'node:fs/promises';import{createOwnedFaultRunner}from'../../scripts/lib/owned-fault';
if(process.argv.includes('--check')){console.log('Owned fresh-volume operation validated without files, Docker or credentials');process.exit(0)}if(process.platform!=='linux')throw Error('Native only');
const root='/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6',id=crypto.randomUUID(),out=resolve(root,'.local/fresh-volume-'+id),fresh=resolve(out,'source'),project='mtuci-vp6-fresh-'+id.slice(0,8),canonical='mtuci-vp6-medvedev',bun='/home/rey/.local/share/mise/installs/bun/1.4.4/bin/bun';let stage='claim',failure:string|undefined,cleanupFailure:string|undefined,failureStage:string|undefined;const commands:any[]=[];
await mkdir(out,{mode:0o700});await writeFile(resolve(out,'CLAIM.json'),JSON.stringify({id,root,fresh,project,canonical,createdAt:new Date().toISOString()})+'\n',{flag:'wx',mode:0o600});
function readCommand(args:string[]){const r=Bun.spawnSync(args,{stdout:'pipe',stderr:'pipe'});if(r.exitCode!==0)throw Error('Read-only ownership guard failed');return new TextDecoder().decode(r.stdout).trim()}
function guardProject(name:string,expectedRoot:string){const ids=readCommand(['docker','ps','-aq','--filter','label=com.docker.compose.project='+name]).split('\n').filter(Boolean);for(const cid of ids){const c=JSON.parse(readCommand(['docker','inspect',cid]))[0];if(c.Config.Labels['com.docker.compose.project']!==name||c.Config.Labels['com.docker.compose.project.working_dir']!==expectedRoot)throw Error('Project ownership mismatch')}return ids;}
async function run(args:string[],cwd:string,label:string){stage=label;const number=commands.length+1,stdout=resolve(out,number+'-stdout.private'),stderr=resolve(out,number+'-stderr.private');await writeFile(stdout,'',{flag:'wx',mode:0o600});await writeFile(stderr,'',{flag:'wx',mode:0o600});const child=Bun.spawn(args,{cwd,env:{...process.env,PATH:'/home/rey/.local/share/mise/installs/bun/1.4.4/bin:'+process.env.PATH},stdout:Bun.file(stdout),stderr:Bun.file(stderr)}),exit=await child.exited;commands.push({label,exit,stdout,stderr});if(exit!==0){failureStage=label;throw Error('Operation failed at '+label);}}
try{stage='disk-capacity';const disk=await statfs(root);if(disk.bavail*disk.bsize<2_000_000_000)throw Error('Insufficient owned disk reserve');stage='copy-source';await mkdir(fresh,{mode:0o700});for(const entry of await readdir(root)){if(!['.local','.git','.venv','node_modules'].includes(entry))await cp(resolve(root,entry),resolve(fresh,entry),{recursive:true});}const wrapper=resolve(fresh,'scripts/compose.sh'),wrapperText=await readFile(wrapper,'utf8');if(!wrapperText.includes('-p '+canonical+' '))throw Error('Pinned wrapper source mismatch');await writeFile(wrapper,wrapperText.replace('-p '+canonical+' ','-p '+project+' '));const provisioner=resolve(fresh,'scripts/provision-openobserve-accounts.ts'),provisionerSource=await readFile(provisioner,'utf8');if((provisionerSource.match(/mtuci-vp6-medvedev/g)??[]).length!==2)throw Error('Expected exact startup ownership guards');await writeFile(provisioner,provisionerSource.replaceAll(canonical,project));const configFile=resolve(fresh,'compose.yaml'),config=Bun.YAML.parse(await readFile(configFile,'utf8'));if(config.name!==canonical||config.networks['grafana-query'].name!==canonical+'_grafana-query-v2')throw Error('Canonical Compose attribution mismatch');config.name=project;config.networks['grafana-query'].name=project+'_grafana-query';await writeFile(configFile,JSON.stringify(config)+'\n');await mkdir(resolve(fresh,'.local'),{mode:0o700});await symlink(resolve(root,'.local/grafana-plugins'),resolve(fresh,'.local/grafana-plugins'));await writeFile(resolve(out,'SOURCE-DELTA.json'),JSON.stringify({canonicalBackend:'unchanged95',copiedWithout:['.local','.git','.venv','node_modules'],changedOnly:['scripts/compose.sh project selector','compose.yaml project and dedicated Grafana network name','scripts/provision-openobserve-accounts.ts matching literal owned-project guard'],freshCredentials:true,freshNamedVolumes:true,loopbackPorts:'same previously owned6 ports after canonical stop; never parallel bind',plugin:'read-only symlink to verified unchanged cached public plugin'})+'\n',{flag:'wx',mode:0o600});
await createOwnedFaultRunner({acquire:async()=>{stage='canonical-live-ownership';guardProject(canonical,root);if(guardProject(project,fresh).length)throw Error('Fresh project unexpectedly exists');return{project,fresh}},exercise:async()=>{await run(['sh','scripts/stop.sh'],root,'stop-only-canonical6-preserve-volumes');await run(['sh','scripts/up.sh'],fresh,'fresh-full-up');await run(['make','check'],fresh,'original-make-check');await run(['make','test','BASE_URL=http://127.0.0.1:28206'],fresh,'original-public-smoke');await Bun.sleep(5000);await run([bun,'student-tests/openobserve-signals.ts'],fresh,'fresh-three-signals-and-parent-units');await run([bun,'student-tests/grafana-preflight.ts'],fresh,'fresh-grafana-datasources-dashboard-rules');await run([bun,'scripts/check-backend-unchanged.ts'],fresh,'fresh-backend95-guard');},restore:async lease=>{stage='fresh-live-ownership-before-stop';guardProject(lease.project,lease.fresh);await run(['sh','scripts/stop.sh'],lease.fresh,'stop-only-fresh6-preserve-volumes');}})();
}catch(e){failureStage??=stage;failure=e?.constructor?.name??'Error';if(e?.cleanup!==undefined)cleanupFailure='Owned fresh stand cleanup failed';}finally{stage='final-live-readback';const remaining=readCommand(['docker','ps','-q','--filter','label=com.docker.compose.project='+project]),canonicalRemaining=readCommand(['docker','ps','-q','--filter','label=com.docker.compose.project='+canonical]);if(remaining||canonicalRemaining)cleanupFailure='Owned6 running containers remain';const result={checkedAt:new Date().toISOString(),project,canonical,fresh,commands,failureStage,failure,cleanupFailure,ownFreshRunningContainers:remaining?remaining.split('\n').length:0,canonicalRunningContainers:canonicalRemaining?canonicalRemaining.split('\n').length:0,preservedVolumes:true,passed:!failure&&!cleanupFailure,out};await writeFile(resolve(out,'RESULT.json'),JSON.stringify(result,null,2)+'\n',{flag:'wx',mode:0o600});console.log(JSON.stringify(result));if(!result.passed)process.exitCode=1;}
@@ -0,0 +1,11 @@
bun test v1.4.4 (38afee6c8)
student-tests/grafana-credential.test.ts:
(pass) archives and verifies a new owner credential before publishing the runtime file [0.47ms]
(pass) does not publish a credential when encrypted archival fails [0.08ms]
(pass) preserves the existing owner and archives it without rotating or rewriting [0.04ms]
3 pass
0 fail
7 expect() calls
Ran 3 tests across 1 file. [8.00ms]
@@ -0,0 +1,49 @@
bun test v1.4.4 (38afee6c8)
student-tests/grafana-credential.test.ts:
1 | import{test,expect}from'bun:test';import{createGrafanaCredentialBootstrap}from'../scripts/lib/grafana-credential';
2 | const value='Aa1!synthetic-fixture-credential';
3 | test('archives and verifies a new owner credential before publishing the runtime file',async()=>{const order:string[]=[];await createGrafanaCredentialBootstrap({read:async()=>undefined,generate:()=>value,archive:async v=>{expect(v).toBe(value);order.push('archive')},publish:async()=>{order.push('publish')}})();expect(order).toEqual(['archive','publish'])});
^
error: expect(received).toEqual(expected)
[
- "archive",
"publish",
]
- Expected - 1
+ Received + 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-credential.test.ts:3:327)
(fail) archives and verifies a new owner credential before publishing the runtime file [2.15ms]
1 | import{test,expect}from'bun:test';import{createGrafanaCredentialBootstrap}from'../scripts/lib/grafana-credential';
2 | const value='Aa1!synthetic-fixture-credential';
3 | test('archives and verifies a new owner credential before publishing the runtime file',async()=>{const order:string[]=[];await createGrafanaCredentialBootstrap({read:async()=>undefined,generate:()=>value,archive:async v=>{expect(v).toBe(value);order.push('archive')},publish:async()=>{order.push('publish')}})();expect(order).toEqual(['archive','publish'])});
4 | test('does not publish a credential when encrypted archival fails',async()=>{let published=0;await expect(createGrafanaCredentialBootstrap({read:async()=>undefined,generate:()=>value,archive:async()=>{throw Error('archive failed')},publish:async()=>{published++}})()).rejects.toThrow();expect(published).toBe(0)});
^
error: expect(received).rejects.toThrow(expected)
Expected promise that rejects
Received promise that resolved: Promise { <resolved> }
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-credential.test.ts:4:277)
(fail) does not publish a credential when encrypted archival fails [0.11ms]
1 | import{test,expect}from'bun:test';import{createGrafanaCredentialBootstrap}from'../scripts/lib/grafana-credential';
2 | const value='Aa1!synthetic-fixture-credential';
3 | test('archives and verifies a new owner credential before publishing the runtime file',async()=>{const order:string[]=[];await createGrafanaCredentialBootstrap({read:async()=>undefined,generate:()=>value,archive:async v=>{expect(v).toBe(value);order.push('archive')},publish:async()=>{order.push('publish')}})();expect(order).toEqual(['archive','publish'])});
4 | test('does not publish a credential when encrypted archival fails',async()=>{let published=0;await expect(createGrafanaCredentialBootstrap({read:async()=>undefined,generate:()=>value,archive:async()=>{throw Error('archive failed')},publish:async()=>{published++}})()).rejects.toThrow();expect(published).toBe(0)});
5 | test('preserves the existing owner and archives it without rotating or rewriting',async()=>{let generated=0,published=0,archived='';await createGrafanaCredentialBootstrap({read:async()=>value,generate:()=>{generated++;return value},archive:async v=>{archived=v},publish:async()=>{published++}})();expect(archived).toBe(value);expect(generated).toBe(0);expect(published).toBe(0)});
^
error: expect(received).toBe(expected)
Expected: "Aa1!synthetic-fixture-credential"
Received: ""
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-credential.test.ts:5:315)
(fail) preserves the existing owner and archives it without rotating or rewriting [0.08ms]
0 pass
3 fail
3 expect() calls
Ran 3 tests across 1 file. [10.00ms]
@@ -0,0 +1,11 @@
bun test v1.4.4 (38afee6c8)
student-tests/grafana-provisioning.test.ts:
(pass) accepts the actual configured dashboard and exact rule UID set [0.23ms]
(pass) rejects empty or mismatched dashboard payload despite successful HTTP status [0.04ms]
(pass) rejects absent, duplicated or wrong rule UIDs even when counts match [0.02ms]
3 pass
0 fail
11 expect() calls
Ran 3 tests across 1 file. [9.00ms]
@@ -0,0 +1,34 @@
bun test v1.4.4 (38afee6c8)
student-tests/grafana-provisioning.test.ts:
(pass) accepts the actual configured dashboard and exact rule UID set [0.05ms]
1 | import{test,expect}from'bun:test';import{dashboardMatches,rulesMatch}from'../scripts/lib/grafana-provisioning';
2 | const expected={uid:'messenger',panels:[{id:1,title:'RPS'},{id:2,title:'API p95'}]};
3 | test('accepts the actual configured dashboard and exact rule UID set',()=>{expect(dashboardMatches({dashboard:expected},expected)).toBe(true);expect(rulesMatch([{uid:'b'},{uid:'a'}],['a','b'])).toBe(true)});
4 | test('rejects empty or mismatched dashboard payload despite successful HTTP status',()=>{expect(dashboardMatches({},expected)).toBe(false);expect(dashboardMatches({dashboard:{uid:'other',panels:expected.panels}},expected)).toBe(false);expect(dashboardMatches({dashboard:{...expected,panels:[]}},expected)).toBe(false);expect(dashboardMatches({dashboard:{...expected,panels:[expected.panels[0],expected.panels[0]]}},expected)).toBe(false);expect(dashboardMatches({dashboard:{...expected,panels:[expected.panels[0],{id:2,title:'Wrong signal'}]}},expected)).toBe(false)});
error: expect(received).toBe(expected)
Expected: false
Received: true
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-provisioning.test.ts:4:128)
(fail) rejects empty or mismatched dashboard payload despite successful HTTP status [0.14ms]
1 | import{test,expect}from'bun:test';import{dashboardMatches,rulesMatch}from'../scripts/lib/grafana-provisioning';
2 | const expected={uid:'messenger',panels:[{id:1,title:'RPS'},{id:2,title:'API p95'}]};
3 | test('accepts the actual configured dashboard and exact rule UID set',()=>{expect(dashboardMatches({dashboard:expected},expected)).toBe(true);expect(rulesMatch([{uid:'b'},{uid:'a'}],['a','b'])).toBe(true)});
4 | test('rejects empty or mismatched dashboard payload despite successful HTTP status',()=>{expect(dashboardMatches({},expected)).toBe(false);expect(dashboardMatches({dashboard:{uid:'other',panels:expected.panels}},expected)).toBe(false);expect(dashboardMatches({dashboard:{...expected,panels:[]}},expected)).toBe(false);expect(dashboardMatches({dashboard:{...expected,panels:[expected.panels[0],expected.panels[0]]}},expected)).toBe(false);expect(dashboardMatches({dashboard:{...expected,panels:[expected.panels[0],{id:2,title:'Wrong signal'}]}},expected)).toBe(false)});
5 | test('rejects absent, duplicated or wrong rule UIDs even when counts match',()=>{expect(rulesMatch([],['a','b'])).toBe(false);expect(rulesMatch([{uid:'a'},{uid:'a'}],['a','b'])).toBe(false);expect(rulesMatch([{uid:'a'},{uid:'c'}],['a','b'])).toBe(false);expect(rulesMatch([],[])).toBe(false)});
^
error: expect(received).toBe(expected)
Expected: false
Received: true
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-provisioning.test.ts:5:115)
(fail) rejects absent, duplicated or wrong rule UIDs even when counts match [0.04ms]
1 pass
2 fail
4 expect() calls
Ran 3 tests across 1 file. [10.00ms]
+46
View File
@@ -0,0 +1,46 @@
bun test v1.4.4 (38afee6c8)
student-tests/owned-fault.test.ts:
(pass) restores the acquired owned lease after successful exercise [0.25ms]
(pass) restores owned lease even when its mutation or traffic fails [0.80ms]
(pass) preserves primary failure separately from failed restoration [0.09ms]
(pass) does not restore anything when ownership acquisition fails [0.05ms]
student-tests/openobserve-bootstrap.test.ts:
(pass) first received credential survives a second account creation failure [0.56ms]
(pass) resume reuses one persisted credential instead of repeating its account POST [0.11ms]
(pass) resume recovers a valid captured response without repeating account POST [0.10ms]
(pass) uncertain intent without recoverable native JSON fails closed without POST retry [0.13ms]
(pass) stale search token401 prevents derived publication and successful continuation [1.25ms]
(pass) unavailable ingest503 prevents derived publication and successful continuation [0.02ms]
(pass) rotation401 is not the required403 denial prevents derived publication and successful continuation [0.01ms]
(pass) healthy initial bootstrap checkpoints ingest before starting query creation [0.07ms]
(pass) healthy saved index revalidates both native identities without new account POST [0.04ms]
student-tests/openobserve-account-http.test.ts:
(pass) malformed one-time response is captured before JSON decoding fails [4.84ms]
(pass) partial response is retained as uncertain when body reading fails [0.15ms]
(pass) oversized response retains bounded available bytes before reporting its cap [0.09ms]
(pass) network failure records uncertain request without retry [0.06ms]
(pass) valid response is captured before it is returned to the create caller [0.07ms]
student-tests/grafana-credential.test.ts:
(pass) archives and verifies a new owner credential before publishing the runtime file [0.14ms]
(pass) does not publish a credential when encrypted archival fails [0.06ms]
(pass) preserves the existing owner and archives it without rotating or rewriting [0.04ms]
student-tests/incident-readback.test.ts:
(pass) recognizes firing while the same accepted backlog is recovering after process start [0.22ms]
(pass) accepts firing during worker stop and requires the complete owned late-job cohort [0.12ms]
(pass) rejects an unrelated later alert or timely successful workload [0.04ms]
(pass) queue drain needs actual finite samples rather than empty NoData [0.07ms]
student-tests/grafana-scheduler.test.ts:
(pass) rejects actual provisioning failure1s under native13.3.1 scheduler10s [0.55ms]
(pass) rejects zero and nonmultiple intervals before native startup [0.04ms]
(pass) accepts native10s and its20s multiple [0.02ms]
28 pass
0 fail
77 expect() calls
Ran 28 tests across 6 files. [35.00ms]
@@ -0,0 +1,196 @@
{
"checkedAt": "2026-11-16T04:10:44.819Z",
"scope": "exact actual browser supplementary histogram SQL/shape, native consumer compared to query gateway; no query rewriting",
"actualProducerMissingSize": true,
"query": {
"sql": "SELECT histogram(\"_timestamp\") AS zo_sql_key, count(*) AS zo_sql_num FROM \"messenger\" WHERE \"trace_id\"='33513303fdb8cdefbd4ff24c8394f3d3' GROUP BY zo_sql_key ORDER BY zo_sql_key",
"start_time": 1794784790000000,
"end_time": 1794784794000000,
"from": 0,
"sql_mode": "full"
},
"results": [
{
"id": "missing",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": true,
"pass": null
},
{
"id": "missing",
"stage": "gateway",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": true,
"pass": true
},
{
"id": "zero",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": true,
"pass": null
},
{
"id": "zero",
"stage": "gateway",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": true,
"pass": true
},
{
"id": "one",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 1,
"count": 1,
"validCase": true,
"pass": null
},
{
"id": "one",
"stage": "gateway",
"http": 200,
"contentType": "application/json",
"rows": 1,
"count": 1,
"validCase": true,
"pass": true
},
{
"id": "negative",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": false,
"pass": null
},
{
"id": "negative",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "fraction",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "fraction",
"stage": "gateway",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "string",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "string",
"stage": "gateway",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "null",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "null",
"stage": "gateway",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "too-large",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": false,
"pass": null
},
{
"id": "too-large",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "object",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "object",
"stage": "gateway",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
}
],
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/native-histogram-6c134f4d-e9ec-44cb-964f-d2d97ad7d13e"
}
+196
View File
@@ -0,0 +1,196 @@
{
"checkedAt": "2026-11-16T03:57:57.196Z",
"scope": "exact actual browser supplementary histogram SQL/shape, native consumer compared to query gateway; no query rewriting",
"actualProducerMissingSize": true,
"query": {
"sql": "SELECT histogram(\"_timestamp\") AS zo_sql_key, count(*) AS zo_sql_num FROM \"messenger\" WHERE \"trace_id\"='33513303fdb8cdefbd4ff24c8394f3d3' GROUP BY zo_sql_key ORDER BY zo_sql_key",
"start_time": 1794784790000000,
"end_time": 1794784794000000,
"from": 0,
"sql_mode": "full"
},
"results": [
{
"id": "missing",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": true,
"pass": null
},
{
"id": "missing",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": true,
"pass": false
},
{
"id": "zero",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": true,
"pass": null
},
{
"id": "zero",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": true,
"pass": false
},
{
"id": "one",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 1,
"count": 1,
"validCase": true,
"pass": null
},
{
"id": "one",
"stage": "gateway",
"http": 200,
"contentType": "application/json",
"rows": 1,
"count": 1,
"validCase": true,
"pass": true
},
{
"id": "negative",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": false,
"pass": null
},
{
"id": "negative",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "fraction",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "fraction",
"stage": "gateway",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "string",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "string",
"stage": "gateway",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "null",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "null",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "too-large",
"stage": "native-consumer",
"http": 200,
"contentType": "application/json",
"rows": 2,
"count": 3,
"validCase": false,
"pass": null
},
{
"id": "too-large",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
},
{
"id": "object",
"stage": "native-consumer",
"http": 422,
"contentType": "text/plain; charset=utf-8",
"rows": 0,
"count": 0,
"validCase": false,
"pass": null
},
{
"id": "object",
"stage": "gateway",
"http": 400,
"contentType": "text/html",
"rows": 0,
"count": 0,
"validCase": false,
"pass": true
}
],
"passed": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/native-histogram-0851ad16-622a-46c3-9248-828bff1b46e2"
}
+53
View File
@@ -0,0 +1,53 @@
{
"checkedAt": "2026-11-16T04:36:58.403Z",
"wire": [
{
"phase": "cold",
"path": "/apis/userstorage.grafana.app/v0alpha1/namespaces/default/user-storage/grafana-page-history:bg4fowucaheyoa",
"method": "GET",
"status": 404,
"contentType": "application/json",
"bytes": 365
},
{
"phase": "cold",
"path": "/apis/userstorage.grafana.app/v0alpha1/namespaces/default/user-storage/grafana-page-history:bg4fowucaheyoa",
"method": "GET",
"status": 404,
"contentType": "application/json",
"bytes": 365
},
{
"phase": "cold",
"path": "/apis/userstorage.grafana.app/v0alpha1/namespaces/default/user-storage/",
"method": "POST",
"status": 201,
"contentType": "application/json",
"bytes": 1440
},
{
"phase": "reload",
"path": "/apis/userstorage.grafana.app/v0alpha1/namespaces/default/user-storage/grafana-page-history:bg4fowucaheyoa",
"method": "GET",
"status": 200,
"contentType": "application/json",
"bytes": 1440
}
],
"issues": [
{
"phase": "cold",
"type": "error",
"text": "Failed to load resource: the server responded with a status of 404 (Not Found)"
},
{
"phase": "cold",
"type": "error",
"text": "Failed to load resource: the server responded with a status of 404 (Not Found)"
}
],
"source": "actual shipped pageHistorySrv/userStorage delivered sourcemap; GET404 is missing resource, not storage failure",
"normalUIWrite": true,
"readAfterPersist": true,
"unexpectedReloadIssues": 0
}
@@ -0,0 +1,302 @@
import { type Location } from 'history';
import { throttle } from 'lodash';
import { distinctUntilChanged } from 'rxjs';
import * as z from 'zod';
import { type NavModelItem } from '@grafana/data';
import { locationService } from '@grafana/runtime';
import { UserStorage } from '@grafana/runtime/internal';
import { type AppChromeService, getPageTitle } from 'app/core/components/AppChrome/AppChromeService';
import { isUrlRewrite } from 'app/core/navigation/urlRewrite';
import impressionSrv from 'app/core/services/impression_srv';
import { parseJsonWithSchema } from 'app/core/utils/parseJsonWithSchema';
import { isRenderTarget } from 'app/features/dashboard/services/isRenderTarget';
import { classifyPage, recordableSearch } from './classifyPage';
import { hasNothingToResume } from './hasNothingToResume';
import {
clearHistory,
EMPTY_HISTORY,
fitsEntryCap,
type HistorySnapshot,
type HistoryState,
mergeStored,
PAGE_HISTORY_MAX_PER_KIND,
recordTitle,
recordVisit,
toStored,
} from './pageHistoryState';
import { type PageHistoryEntry } from './types';
const STORAGE_SERVICE = 'grafana-page-history';
/** One envelope per user; the user-storage namespace already separates orgs. */
const STORAGE_KEY = 'history';
/** Ordinary URL changes coalesce into one write per window; hiding the tab and `clear()` write at once. */
export const PAGE_HISTORY_PERSIST_MS = 30_000;
/** JS `Date` range; larger values are not instants. */
const MAX_EPOCH_MS = 8.64e15;
/** Persisted row. The page identity is derived from the pathname on load, so a rule change reclassifies old rows. */
const StoredEntrySchema = z.object({
pathname: z
.string()
.startsWith('/')
.refine((pathname) => !pathname.startsWith('//')),
search: z.string().refine((search) => search === '' || search.startsWith('?')),
lastVisited: z.number().int().min(0).max(MAX_EPOCH_MS).optional(),
title: z.string().optional(),
});
/** Everything stored under the key. `clearedAt` is the epoch ms of the last clear, 0 when never cleared. */
const StoredSchema = z.object({
clearedAt: z.number().int().min(0).max(MAX_EPOCH_MS),
entries: z.array(z.unknown()),
});
/**
* Validates the stored copy row by row so one bad or oversized entry drops only itself. Rows that no longer
* classify are dropped. Anything but the envelope loads as empty.
*/
function parseStored(raw: string | null): HistorySnapshot {
const { clearedAt, entries: rows } = parseJsonWithSchema(raw, StoredSchema, { clearedAt: 0, entries: [] });
const entries: PageHistoryEntry[] = [];
for (const row of rows) {
const result = StoredEntrySchema.safeParse(row);
if (!result.success || !fitsEntryCap(result.data)) {
continue;
}
const page = classifyPage(result.data.pathname, result.data.search);
if (page) {
entries.push({ ...result.data, ...page });
}
}
return { clearedAt, entries };
}
function serialize({ clearedAt, entries }: HistoryState): string {
return JSON.stringify({ clearedAt, entries: entries.map(toStored) });
}
/**
* Records the pages the user visits (with their URL state) so the homepage can link back to them.
* One envelope per user and org in `UserStorage`. Every write merges with the stored copy under a version check,
* so tabs and browsers converge; localStorage is used only for signed-out users and is not a fallback for
* failed requests. The merge rules live in `pageHistoryState`; this class wires events and storage to them.
*
* Request policy: ordinary URL changes coalesce into one write at most every `PAGE_HISTORY_PERSIST_MS` per tab;
* hiding the tab and `clear()` write immediately; every `getEntries()` and the startup load each cost one read.
* A write is one read plus one write, plus one more pair per version conflict. A failed write is retried by the
* next change or tab hide, never on a timer. Overlapping operations in one tab serialize on `UserStorage`'s
* lock; a change made while a write is in flight is picked up by the next one. The write on tab hide is a plain
* request, so closing the tab can lose the changes of the current window.
*/
export class PageHistorySrv {
private state = EMPTY_HISTORY;
/** Memory holds a change that storage has not confirmed. */
private dirty = false;
private readonly storage = new UserStorage(STORAGE_SERVICE);
private ready: Promise<void> | undefined;
/**
* Changes made before the stored copy is in, replayed in order once it is. A visit that only refreshes a
* page's row (a menu destination, a rewrite) has to see the stored row, or it finds none and changes nothing.
*/
private pending: Array<() => void> | undefined = [];
/** The menu as it is now, read per visit: items come and go with permissions, plugins and bookmarks. */
private navTree: () => NavModelItem[] = () => [];
private readonly scheduleWrite = throttle(() => this.write(), PAGE_HISTORY_PERSIST_MS, {
leading: false,
trailing: true,
});
/**
* Starts recording. `navTree` is read on every visit to tell menu destinations from pages worth a row. Returns a
* function that stops recording and drops any pending write. Renderer sessions record nothing.
*/
start(chrome: AppChromeService, navTree: () => NavModelItem[]): () => void {
// Image-renderer and report captures load pages as the user; their visits are not the user's.
if (isRenderTarget()) {
return () => {};
}
this.ready = this.load();
this.navTree = navTree;
// `history.listen` never emits the landing page.
this.apply(locationService.getLocation(), false);
const unlisten = locationService
.getHistory()
.listen((location, action) => this.apply(location, action === 'REPLACE' && isUrlRewrite(location.state)));
// Pages set their nav after they render, so the title arrives after the navigation was recorded. Only a nav
// change is a page setting its nav; other chrome updates keep the previous page's nav objects.
const chromeSubscription = chrome.state
.pipe(distinctUntilChanged((a, b) => a.sectionNav === b.sectionNav && a.pageNav === b.pageNav))
.subscribe((state) => this.setTitle(getPageTitle(state)));
const onVisibilityChange = () => {
if (document.visibilityState === 'hidden' && this.dirty) {
void this.writeNow();
}
};
document.addEventListener('visibilitychange', onVisibilityChange);
return () => {
unlisten();
chromeSubscription.unsubscribe();
document.removeEventListener('visibilitychange', onVisibilityChange);
this.pending = undefined;
this.scheduleWrite.cancel();
};
}
/** Newest first, including what other tabs and browsers recorded. Empty until recording has started. */
async getEntries(): Promise<PageHistoryEntry[]> {
if (!this.ready) {
return [];
}
await this.ready;
await this.sync(false);
return [...this.state.entries];
}
/**
* Forgets every recorded page, in every tab and browser, and persists right away. Resolves after the first
* attempt whether or not it reached storage; a failed attempt is retried like any other change.
*/
async clear(): Promise<void> {
if (!this.ready) {
return;
}
await this.ready;
this.state = clearHistory(this.state, Date.now());
this.dirty = true;
await this.writeNow();
}
private async load(): Promise<void> {
// An unreachable store must not seed: it may well hold a history already.
if ((await this.sync(false)) === 'empty') {
await this.seed();
}
const pending = this.pending;
this.pending = undefined;
pending?.forEach((change) => change());
}
/**
* First use for this user and org: carries the newest dashboards over from the recently-viewed impressions.
* They have no visit time, so they sort after every recorded page and are the first to be evicted. A bridge
* for users who had a Recent tab before page history; remove once that is a few releases back.
*/
private async seed(): Promise<void> {
let uids: string[] = [];
try {
uids = await impressionSrv.getDashboardOpened();
} catch (e) {
console.warn('Page history: seed failed', e);
}
const seeded: PageHistoryEntry[] = uids
.slice(0, PAGE_HISTORY_MAX_PER_KIND)
.map((uid) => ({ kind: 'dashboard', uid, pathname: `/d/${uid}`, search: '' }));
this.state = mergeStored(this.state, { clearedAt: 0, entries: seeded });
this.persist();
}
/**
* Merges the stored copy into memory and, with `persist`, stores the result when it differs. `empty`: nothing
* has ever been stored for this user and org. `unreachable`: a request failed and nothing was stored.
*/
private async sync(persist: boolean): Promise<'merged' | 'empty' | 'unreachable'> {
let outcome: 'merged' | 'empty' = 'empty';
try {
await this.storage.updateItem(STORAGE_KEY, (raw) => {
outcome = raw === null ? 'empty' : 'merged';
// Runs again after a version conflict; `mergeStored` is idempotent, so that is safe.
this.state = mergeStored(this.state, parseStored(raw));
const next = serialize(this.state);
return persist && next !== raw ? next : undefined;
});
return outcome;
} catch (e) {
console.warn('Page history: storage unavailable', e);
return 'unreachable';
}
}
/** Hash deliberately ignored. */
private apply(location: Location, isRewrite: boolean): void {
const page = classifyPage(location.pathname, location.search);
if (!page) {
return;
}
// A page with nothing to resume gets no row, but a row it has is refreshed to where the user left it.
const refreshOnly = isRewrite || hasNothingToResume(page, location.search, this.navTree());
const search = recordableSearch(page, location.search);
const at = Date.now();
this.record(() => recordVisit(this.state, page, search, at, refreshOnly));
}
/**
* Stamps the chrome's title onto the row of the page the user is on, if that page has one. The chrome does not
* say which page a nav belongs to and keeps the previous page's nav across a navigation within one route
* (dashboard to dashboard, one app page to another), so a new row stays untitled until its own page sets its
* nav. A nav the departed page sets after the navigation still lands on the new row; the page's own nav
* replaces it once set.
*/
private setTitle(title: string | undefined): void {
if (!title) {
return;
}
const { pathname, search } = locationService.getLocation();
const page = classifyPage(pathname, search);
if (page) {
const at = Date.now();
this.record(() => recordTitle(this.state, page, title, at));
}
}
/**
* Applies `change` to the state, after the stored copy is in. Stamps are taken when the change is made, so a
* replay keeps the order of events; the write it arms waits for the load as every write does.
*/
private record(change: () => HistoryState): void {
if (this.pending) {
this.pending.push(() => this.update(change()));
this.persist();
return;
}
this.update(change());
}
/** Adopts a change made in this tab, if `next` is one: written at the end of the current window. */
private update(next: HistoryState): void {
if (next === this.state) {
return;
}
this.state = next;
this.persist();
}
/** Something changed: written at the end of the current window. */
private persist(): void {
this.dirty = true;
this.scheduleWrite();
}
/** Writes now instead of at the end of the window. */
private writeNow(): Promise<void> {
this.scheduleWrite.cancel();
return this.write();
}
private async write(): Promise<void> {
// Never overwrite the stored copy before it has been merged in.
await this.ready;
// Cleared first so a change made while this write is in flight stays pending.
this.dirty = false;
if ((await this.sync(true)) === 'unreachable') {
this.dirty = true;
}
}
}
export const pageHistorySrv = new PageHistorySrv();
@@ -0,0 +1,18 @@
{
"scope": "actual shipped frontend from the verified Grafana13.3.1 image; public tag source is not substituted",
"imageID": "sha256:1c88285f1dd391a62232c010e6c224846e6a73bdc583b3365be2eba614b7919e",
"reportedCommit": "da3aa3ff574e7dbbf808c66b6daa744defed0441",
"bundle": {"path":"/usr/share/grafana/public/build/18631.ceb2a2734f477243.js","bytes":3030265,"sha256":"b71e20545a118a186841598d30573cb34c7949ce89527e9b4ca8e451ef919458"},
"map": {"path":"/usr/share/grafana/public/build/18631.ceb2a2734f477243.js.map","bytes":15209200,"sha256":"45ffad904b41b1d9901f400215b9efcac88e9a98baa0fb0fb9378407f8a56b8c"},
"deliveredSources": [
{"path":"packages/grafana-runtime/src/utils/userStorage.tsx","file":"history-user-storage-source.txt","sha256":"aee99a03048c1d7e639ad16e80d874508033a18f32c18955914dfc96624d1e28","reader":"fetchResource: status404 returns null; other failures throw; apiRequest sets showErrorAlert:false"},
{"path":"public/app/core/services/pageHistory/pageHistorySrv.ts","file":"history-page-service-source.txt","sha256":"a8970b0388671b359a1721a6d6eb9913a5df4d30251fd40cb37621cfd0f5a2a2","reader":"start->load->sync(false); missing null means empty, then seed; ordinary writes throttled30000ms"}
],
"exactOwnedRoute":"/apis/userstorage.grafana.app/v0alpha1/namespaces/default/user-storage/grafana-page-history:bg4fowucaheyoa",
"nativePositive":"history-normal-ui.json",
"rawColdConsole404Count":2,
"normalUIWriteHTTP":201,
"sameKeyReloadGET":200,
"unexpectedReloadErrors":0,
"exception":"Only this proven expected missing-state GET404; no blanket404/403 whitelist and no claim that raw console errors were absent"
}
@@ -0,0 +1,306 @@
import { get, noop } from 'lodash';
import { useRef } from 'react';
import { lastValueFrom } from 'rxjs';
import { usePluginContext, type UserStorage as UserStorageType, store } from '@grafana/data';
import { config } from '../config';
import { type BackendSrvRequest, getBackendSrv } from '../services';
const baseURL = `/apis/userstorage.grafana.app/v0alpha1/namespaces/${config.namespace}/user-storage`;
// Per resourceName (e.g. "plugin-id:user-uid"): the spec, or `null` once a GET returned 404.
// Only touched under the operation lock, so it never has to hold a pending load.
const storageCache = new Map<string, UserStorageSpec | null>();
// Per resourceName: settles once the last queued operation has finished.
const operationLocks = new Map<string, Promise<void>>();
// Each attempt costs one GET and one write; this bounds the cost of a key many tabs fight over.
const WRITE_ATTEMPTS = 3;
/**
* Clears the global storage cache. Used for testing purposes.
* @internal
*/
export function _clearStorageCache() {
if (process.env.NODE_ENV !== 'test') {
throw new Error('clearStorageCache() function can only be called from tests.');
}
storageCache.clear();
operationLocks.clear();
}
interface RequestOptions extends BackendSrvRequest {
// rtk codegen sets this
body?: BackendSrvRequest['data'];
}
type UserStorageSpec = {
data: { [key: string]: string };
};
type UserStorageResource = {
metadata: { resourceVersion: string };
spec: UserStorageSpec;
};
async function apiRequest<T>(requestOptions: RequestOptions) {
try {
const { data: responseData, ...meta } = await lastValueFrom(
getBackendSrv().fetch<T>({
...requestOptions,
url: baseURL + requestOptions.url,
data: requestOptions.body,
showErrorAlert: false,
})
);
return { data: responseData, meta };
} catch (error) {
return { error };
}
}
/**
* A class for interacting with the backend user storage.
* Exposed internally only to avoid misuse (wrong service name).
*
* Two failure policies coexist on purpose. `getItem`, `setItem`, `deleteItem` and `allItems` fall back to
* localStorage when a request fails, so a plugin keeps working. `updateItem` rejects instead: its callers
* merge against the stored copy, and a merge over a copy the server never saw is worse than no write.
*/
export class UserStorage implements UserStorageType {
private service: string;
private resourceName: string;
private userUID: string;
private canUseUserStorage: boolean;
constructor(service: string) {
this.service = service;
this.userUID = config.bootData.user.uid === '' ? config.bootData.user.id.toString() : config.bootData.user.uid;
this.resourceName = `${service}:${this.userUID}`;
this.canUseUserStorage = config.bootData.user.isSignedIn;
}
private localKey(key: string) {
return `${this.resourceName}:${key}`;
}
/** Runs `operation` once every earlier operation on this resourceName has settled, whether it succeeded or threw. */
private runExclusive<T>(operation: () => Promise<T>): Promise<T> {
const previous = operationLocks.get(this.resourceName) ?? Promise.resolve();
const result = previous.then(operation);
const tail = result.then(noop, noop);
operationLocks.set(this.resourceName, tail);
tail.then(() => {
if (operationLocks.get(this.resourceName) === tail) {
operationLocks.delete(this.resourceName);
}
});
return result;
}
/** The stored resource, `null` when none exists yet (404). Throws on any other failure. */
private async fetchResource(): Promise<UserStorageResource | null> {
const response = await apiRequest<UserStorageResource>({ url: `/${this.resourceName}`, method: 'GET' });
if ('error' in response) {
if (get(response.error, 'status') === 404) {
return null;
}
throw response.error;
}
return response.data;
}
private createResource(data: UserStorageSpec['data']) {
return apiRequest<UserStorageResource>({
url: `/`,
method: 'POST',
body: {
metadata: { name: this.resourceName, labels: { user: this.userUID, service: this.service } },
spec: { data },
},
});
}
/** Merge-patch; a `null` value deletes that key. With `metadata.resourceVersion` the server rejects a stale write. */
private patchResource(body: {
metadata?: { resourceVersion: string };
spec: { data: Record<string, string | null> };
}) {
return apiRequest<UserStorageResource>({
headers: { 'Content-Type': 'application/merge-patch+json' },
url: `/${this.resourceName}`,
method: 'PATCH',
body,
});
}
/** Fills the cache on first use. Runs under the lock, so nothing reads the cache mid-load. Returns the load error, if any. */
private async init(): Promise<unknown> {
if (storageCache.has(this.resourceName)) {
return;
}
try {
storageCache.set(this.resourceName, (await this.fetchResource())?.spec ?? null);
} catch (error) {
return error;
}
return;
}
async getItem(key: string): Promise<string | null> {
if (!this.canUseUserStorage) {
return store.get(this.localKey(key)) ?? null;
}
return this.runExclusive(async () => {
await this.init();
const spec = storageCache.get(this.resourceName);
if (!spec) {
// No resource yet, or the load failed: fall back to localStorage
return store.get(this.localKey(key)) ?? null;
}
return spec.data[key] ?? null;
});
}
async setItem(key: string, value: string): Promise<void> {
if (!this.canUseUserStorage) {
store.set(this.localKey(key), value);
return;
}
return this.runExclusive(async () => {
const error = await this.init();
if (error) {
store.set(this.localKey(key), value);
return;
}
const spec = storageCache.get(this.resourceName);
const result = spec
? await this.patchResource({ spec: { data: { [key]: value } } })
: await this.createResource({ [key]: value });
if ('error' in result) {
store.set(this.localKey(key), value);
return;
}
storageCache.set(this.resourceName, { data: { ...spec?.data, [key]: value } });
});
}
/**
* Read-modify-write of one item against what is stored right now. `update` gets the stored value
* (`null` when there is none) and returns the value to store, or `undefined` to store nothing.
* Signed in: fetches the resource fresh, writes with its `metadata.resourceVersion` so the server
* rejects a write over a copy it has not seen, and on that rejection re-reads and re-runs `update`
* (`WRITE_ATTEMPTS` times). Every snapshot it fetches refreshes the cache, so a later `getItem` sees the
* fresh value even when the write fails. Rejects when a request fails; nothing is written to localStorage.
* Signed out: localStorage. There is no cross-tab lock, so two tabs updating at the same instant can drop
* one update; the next update merges from storage again.
*/
async updateItem(key: string, update: (current: string | null) => string | undefined): Promise<void> {
if (!this.canUseUserStorage) {
const next = update(store.get(this.localKey(key)) ?? null);
if (next !== undefined) {
store.set(this.localKey(key), next);
}
return;
}
return this.runExclusive(async () => {
for (let attempt = 0; attempt < WRITE_ATTEMPTS; attempt++) {
const resource = await this.fetchResource();
storageCache.set(this.resourceName, resource?.spec ?? null);
const next = update(resource?.spec.data[key] ?? null);
if (next === undefined) {
return;
}
const result = resource
? await this.patchResource({
metadata: { resourceVersion: resource.metadata.resourceVersion },
spec: { data: { [key]: next } },
})
: await this.createResource({ [key]: next });
if ('error' in result) {
// Stale version, or another client created the resource first: re-read and run `update` again.
if (get(result.error, 'status') === 409) {
continue;
}
throw result.error;
}
storageCache.set(this.resourceName, { data: { ...resource?.spec.data, [key]: next } });
return;
}
throw new Error('User storage: conflicting writes');
});
}
async deleteItem(key: string): Promise<void> {
if (!this.canUseUserStorage) {
store.delete(this.localKey(key));
return;
}
return this.runExclusive(async () => {
const error = await this.init();
const spec = storageCache.get(this.resourceName);
if (error || !spec) {
// Nothing to delete server-side (load failed or no resource); clear the localStorage fallback instead
store.delete(this.localKey(key));
return;
}
const result = await this.patchResource({ spec: { data: { [key]: null } } });
if ('error' in result) {
store.delete(this.localKey(key));
return;
}
const { [key]: _, ...data } = spec.data;
storageCache.set(this.resourceName, { data });
});
}
async allItems(): Promise<Record<string, string>> {
if (!this.canUseUserStorage) {
return store.all(`${this.resourceName}:`);
}
return this.runExclusive(async () => {
await this.init();
const spec = storageCache.get(this.resourceName);
return spec ? { ...spec.data } : store.all(`${this.resourceName}:`);
});
}
}
// This is a type alias to avoid breaking changes
export interface PluginUserStorage extends UserStorageType {}
/**
* A hook for interacting with the backend user storage (or local storage if not enabled).
* @returns An scoped object for a plugin and a user with getItem and setItem functions.
* @alpha Experimental
*/
export function usePluginUserStorage(): PluginUserStorage {
const context = usePluginContext();
const ref = useRef<[id: string, PluginUserStorage] | undefined>(undefined);
if (!context) {
throw new Error(`No PluginContext found. The usePluginUserStorage() hook can only be used from a plugin.`);
}
if (!ref.current || ref.current[0] !== context.meta.id) {
ref.current = [context.meta.id, new UserStorage(context.meta.id)];
}
return ref.current[1];
}
/**
* Internal Grafana-core only interface for constructing a UserStorage instance in a
* react component.
*/
export function useUserStorage(service: string): UserStorageType {
const ref = useRef<[service: string, UserStorageType] | undefined>(undefined);
if (!ref.current || ref.current[0] !== service) {
ref.current = [service, new UserStorage(service)];
}
return ref.current[1];
}
@@ -0,0 +1,44 @@
{
"checkedAt": "2026-11-16T05:07:43.720Z",
"scope": "exactly one logs initialization; passive observer returns the original fetch Promise without modifying arguments/behavior; only sync.svg native AbortSignal observed; no API/worker/Collector producer",
"signal": [],
"network": [
{
"kind": "request",
"requestId": "2845531.128",
"timestamp": 330948.284458,
"wallTime": 1794805663.357699,
"type": "Fetch",
"initiator": [
{
"functionName": "fetchFromPersistentCache",
"url": "http://127.0.0.1:28306/public/build/69375.40e3294b3bba01ca.js",
"lineNumber": 90,
"columnNumber": 86587
}
]
},
{
"kind": "loadingFailed",
"requestId": "2845531.128",
"timestamp": 330948.362807,
"wallTimeMs": 1794805663436.048,
"errorText": "net::ERR_ABORTED",
"canceled": true,
"type": "Fetch"
}
],
"intentions": [
{
"kind": "single-initial-navigation",
"wallTime": 1794805661390
}
],
"assetPositive": {
"status": 200,
"contentType": "image/svg+xml",
"bytes": 343
},
"causalMarkerPresent": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/icon-cancel-07aea867-0893-4fe3-a394-e4d687ea46a0"
}
@@ -0,0 +1,8 @@
import{mkdir,readFile,writeFile}from'node:fs/promises';import{resolve}from'node:path';if(process.argv.includes('--check')){console.log('Single-target passive icon observer validated without browser or credentials');process.exit(0)}if(process.platform!=='linux')throw Error('Native only');const root='/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6',out=resolve(root,'.local/icon-cancel-'+crypto.randomUUID());await mkdir(out,{mode:0o700});const modulePath='/home/rey/.bun/install/cache/playwright-core@1.63.0@@@1/index.mjs',{chromium}=await import(modulePath),browser=await chromium.launch({executablePath:'/usr/bin/chromium',headless:true,args:['--no-sandbox','--disable-dev-shm-usage','--disable-background-networking']}),context=await browser.newContext({viewport:{width:1600,height:1100}}),page=await context.newPage(),cdp=await context.newCDPSession(page),events:any[]=[],intentions:any[]=[];let failure:string|undefined;
try{const password=(await readFile(resolve(root,'.local/grafana_password'),'utf8')).trim();if((await context.request.post('http://127.0.0.1:28306/login',{data:{user:'admin',password}})).status()!==200)throw Error('Owner login failed');
await page.addInitScript(()=>{const original=window.fetch,observations:any[]=[];(window as any).__vp6IconObservations=observations;window.fetch=function(input:any,init?:any){try{const path=new URL(typeof input==='string'?input:input instanceof URL?input.href:input.url,location.href).pathname,signal=init?.signal??(input instanceof Request?input.signal:undefined);if(path==='/public/build/img/icons/unicons/sync.svg'&&signal instanceof AbortSignal){observations.push({kind:'signal-attached',wallTime:Date.now(),performanceTime:performance.now(),path,alreadyAborted:signal.aborted});signal.addEventListener('abort',()=>{observations.push({kind:'native-signal-abort',wallTime:Date.now(),performanceTime:performance.now(),path,reason:signal.reason instanceof DOMException?signal.reason.name:'other',stack:(new Error().stack??'').split('\n').filter(l=>l.includes('http://127.0.0.1:28306/public/build/')).slice(0,10)})},{once:true})}}catch{}return Reflect.apply(original,this,[input,init]);};});
await cdp.send('Network.enable');let resolveFailed:(v:any)=>void=()=>{};const failed=new Promise(resolve=>{resolveFailed=resolve}),requests=new Map<string,any>();
cdp.on('Network.requestWillBeSent',(e:any)=>{if(new URL(e.request.url).pathname!=='/public/build/img/icons/unicons/sync.svg')return;const record={kind:'request',requestId:e.requestId,timestamp:e.timestamp,wallTime:e.wallTime,type:e.type,initiator:(e.initiator?.stack?.callFrames??[]).filter((f:any)=>f.url.startsWith('http://127.0.0.1:28306/public/build/')).slice(0,6).map((f:any)=>({functionName:/^[A-Za-z0-9_$]{0,80}$/.test(f.functionName)?f.functionName:'withheld',url:f.url,lineNumber:f.lineNumber,columnNumber:f.columnNumber}))};requests.set(e.requestId,record);events.push(record)});
cdp.on('Network.loadingFailed',(e:any)=>{const request=requests.get(e.requestId);if(!request)return;const record={kind:'loadingFailed',requestId:e.requestId,timestamp:e.timestamp,wallTimeMs:request.wallTime*1000+(e.timestamp-request.timestamp)*1000,errorText:['net::ERR_ABORTED','net::ERR_FAILED'].includes(e.errorText)?e.errorText:'withheld',canceled:e.canceled,type:e.type};events.push(record);resolveFailed(record)});
const trace='33513303fdb8cdefbd4ff24c8394f3d3',query={refId:'A',queryType:'logs',streamType:'logs',stream:'messenger',organization:'default',query:'SELECT * FROM "messenger" WHERE "trace_id"=\''+trace+'\' ORDER BY "_timestamp" ASC LIMIT 100',sqlMode:true,displayMode:'logs'},url='http://127.0.0.1:28306/explore?schemaVersion=1&panes='+encodeURIComponent(JSON.stringify({qa:{datasource:'openobserve',queries:[query],range:{from:'2026-11-15T23:19:50.000Z',to:'2026-11-15T23:19:54.000Z'}}}))+'&orgId=1';intentions.push({kind:'single-initial-navigation',wallTime:Date.now()});await page.goto(url,{waitUntil:'domcontentloaded',timeout:60000});await page.waitForFunction(()=>document.body.innerText.includes('http.request')&&document.body.innerText.includes('worker.job'),undefined,{timeout:30000});await Promise.race([failed,Bun.sleep(5000)]);const signal=await page.evaluate(()=>(window as any).__vp6IconObservations??[]),asset=await context.request.get('http://127.0.0.1:28306/public/build/img/icons/unicons/sync.svg'),assetBytes=(await asset.body()).length;
const result={checkedAt:new Date().toISOString(),scope:'exactly one logs initialization; passive observer returns the original fetch Promise without modifying arguments/behavior; only sync.svg native AbortSignal observed; no API/worker/Collector producer',signal,network:events,intentions,assetPositive:{status:asset.status(),contentType:asset.headers()['content-type'],bytes:assetBytes},causalMarkerPresent:signal.some((s:any)=>s.kind==='native-signal-abort'&&s.stack.length)&&events.some(e=>e.kind==='loadingFailed'&&e.errorText==='net::ERR_ABORTED'&&e.canceled===true),out};await writeFile(resolve(out,'RESULT.json'),JSON.stringify(result,null,2)+'\n',{flag:'wx',mode:0o600});console.log(JSON.stringify(result));}catch(e){failure=e?.constructor?.name??'Error';console.log(JSON.stringify({out,failure}))}finally{intentions.push({kind:'intentional-browser-close',wallTime:Date.now()});await browser.close();await writeFile(resolve(out,'TEARDOWN.json'),JSON.stringify({closedAt:new Date().toISOString(),intentions})+'\n',{flag:'wx',mode:0o600});if(failure)process.exitCode=1}
@@ -0,0 +1,91 @@
{
"checkedAt": "2026-11-16T04:32:43.578Z",
"scope": "read-only correlation of SAME captured actual app5xx, without a new producer or fault",
"source": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-incidents-911a5f98-78fd-498b-b562-69052bd3192a",
"request": {
"phase": "db_sustained_degradation",
"kind": "business",
"at": "2026-11-16T04:13:02.533Z",
"elapsedMs": 1003,
"status": 503,
"requestId": "b360af47-0659-44d8-b29d-d99dd6e5a61a"
},
"logs": [
{
"_timestamp": 1794802383534271,
"trace_id": "cf21b614d547d90c56cb711880bdc50d",
"span_id": "95a26d56b24dbfd1",
"request_id": "b360af47-0659-44d8-b29d-d99dd6e5a61a",
"event": "http.request",
"service_name": "messenger-api"
}
],
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spans": [
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "beff318378745cff",
"parentSpanId": "95a26d56b24dbfd1",
"operation": "postgres.query",
"service": "messenger-api",
"status": "ERROR",
"durationMs": 1000.213
},
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "0cac12da5df14ddc",
"parentSpanId": "95a26d56b24dbfd1",
"operation": "postgres.acquire",
"service": "messenger-api",
"status": "UNSET",
"durationMs": 0.003
},
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "012c9a899ef45f80",
"parentSpanId": "95a26d56b24dbfd1",
"operation": "postgres.query",
"service": "messenger-api",
"status": "UNSET",
"durationMs": 0.166
},
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "e4cdb748adea6b5c",
"parentSpanId": "95a26d56b24dbfd1",
"operation": "postgres.acquire",
"service": "messenger-api",
"status": "UNSET",
"durationMs": 0.005
},
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "411c183ac18d8238",
"parentSpanId": "95a26d56b24dbfd1",
"operation": "postgres.query",
"service": "messenger-api",
"status": "UNSET",
"durationMs": 0.153
},
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "1f7c4a683e5ff758",
"parentSpanId": "95a26d56b24dbfd1",
"operation": "postgres.acquire",
"service": "messenger-api",
"status": "UNSET",
"durationMs": 0.01
},
{
"traceId": "cf21b614d547d90c56cb711880bdc50d",
"spanId": "95a26d56b24dbfd1",
"operation": "GET /api/v1/chats/{chat_id}/messages",
"service": "messenger-api",
"status": "ERROR",
"durationMs": 1000.804
}
],
"databaseFailure": true,
"apiFailure": true,
"passed": true
}
@@ -0,0 +1,240 @@
[
{
"id": "2c3310bc-5b6e-49d7-8ee4-cfe040d2cf6d",
"status": "ready",
"accepted_at": "2026-11-16T04:14:33.794053+00:00",
"ready_seconds": 48.600246,
"first_ready_at": "2026-11-16T04:15:22.394299+00:00"
},
{
"id": "f9115e78-abe6-42f8-8b08-a5ac3997f27a",
"status": "ready",
"accepted_at": "2026-11-16T04:14:34.872547+00:00",
"ready_seconds": 48.770058,
"first_ready_at": "2026-11-16T04:15:23.642605+00:00"
},
{
"id": "e0309de9-c8ad-4030-bbb0-d6c3e7e3c133",
"status": "ready",
"accepted_at": "2026-11-16T04:14:35.665526+00:00",
"ready_seconds": 49.400323,
"first_ready_at": "2026-11-16T04:15:25.065849+00:00"
},
{
"id": "cc8f4db5-52a7-43c3-bab1-cc8bf35ba328",
"status": "ready",
"accepted_at": "2026-11-16T04:14:36.617835+00:00",
"ready_seconds": 50.142988,
"first_ready_at": "2026-11-16T04:15:26.760823+00:00"
},
{
"id": "7e8a063b-df78-4294-924e-924659a5e5f7",
"status": "ready",
"accepted_at": "2026-11-16T04:14:37.618707+00:00",
"ready_seconds": 50.692696,
"first_ready_at": "2026-11-16T04:15:28.311403+00:00"
},
{
"id": "d2390c75-af58-4c07-9c5e-3479bf7e731c",
"status": "ready",
"accepted_at": "2026-11-16T04:14:39.629878+00:00",
"ready_seconds": 51.352502,
"first_ready_at": "2026-11-16T04:15:30.98238+00:00"
},
{
"id": "56b69ded-ce18-43ea-aac4-c589a6231a55",
"status": "ready",
"accepted_at": "2026-11-16T04:14:59.638215+00:00",
"ready_seconds": 53.4918,
"first_ready_at": "2026-11-16T04:15:53.130015+00:00"
},
{
"id": "f69d2350-e24b-400b-9a1e-25b3018c7413",
"status": "ready",
"accepted_at": "2026-11-16T04:15:03.629513+00:00",
"ready_seconds": 51.833749,
"first_ready_at": "2026-11-16T04:15:55.463262+00:00"
},
{
"id": "79015cfd-58e9-434d-8b5b-576b3d1fe573",
"status": "ready",
"accepted_at": "2026-11-16T04:14:31.626555+00:00",
"ready_seconds": 47.89558,
"first_ready_at": "2026-11-16T04:15:19.522135+00:00"
},
{
"id": "d3d45d5a-d52a-4933-92f9-10248506487a",
"status": "ready",
"accepted_at": "2026-11-16T04:14:32.768845+00:00",
"ready_seconds": 48.327879,
"first_ready_at": "2026-11-16T04:15:21.096724+00:00"
},
{
"id": "76bea1f9-bb27-4e30-bcb7-5e23ce7c3936",
"status": "ready",
"accepted_at": "2026-11-16T04:14:38.629034+00:00",
"ready_seconds": 50.979697,
"first_ready_at": "2026-11-16T04:15:29.608731+00:00"
},
{
"id": "47d63023-14b7-4427-a297-d9f6601c97ea",
"status": "ready",
"accepted_at": "2026-11-16T04:14:42.635308+00:00",
"ready_seconds": 52.834404,
"first_ready_at": "2026-11-16T04:15:35.469712+00:00"
},
{
"id": "d3363b7c-b8f1-44c3-a635-2d04ee1f1b82",
"status": "ready",
"accepted_at": "2026-11-16T04:14:46.644074+00:00",
"ready_seconds": 54.768982,
"first_ready_at": "2026-11-16T04:15:41.413056+00:00"
},
{
"id": "ed83c961-515c-401d-9db0-97296f206ba2",
"status": "ready",
"accepted_at": "2026-11-16T04:14:50.641386+00:00",
"ready_seconds": 54.726361,
"first_ready_at": "2026-11-16T04:15:45.367747+00:00"
},
{
"id": "b3fe8642-2342-4713-a440-b529aa366e42",
"status": "ready",
"accepted_at": "2026-11-16T04:14:53.642804+00:00",
"ready_seconds": 55.210172,
"first_ready_at": "2026-11-16T04:15:48.852976+00:00"
},
{
"id": "9a03ebc6-991f-4169-8be9-193d42b164d7",
"status": "ready",
"accepted_at": "2026-11-16T04:14:57.62626+00:00",
"ready_seconds": 54.144733,
"first_ready_at": "2026-11-16T04:15:51.770993+00:00"
},
{
"id": "ab261624-0255-4a8c-b7bc-6e5fd3ebb2a7",
"status": "ready",
"accepted_at": "2026-11-16T04:14:40.682126+00:00",
"ready_seconds": 52.43441,
"first_ready_at": "2026-11-16T04:15:33.116536+00:00"
},
{
"id": "e7304e79-13a3-4cc0-9b0b-7bb7e3d0305a",
"status": "ready",
"accepted_at": "2026-11-16T04:14:44.640145+00:00",
"ready_seconds": 53.794631,
"first_ready_at": "2026-11-16T04:15:38.434776+00:00"
},
{
"id": "13ec3a81-3d1e-491a-8df8-89733fe5699b",
"status": "ready",
"accepted_at": "2026-11-16T04:14:45.632634+00:00",
"ready_seconds": 54.716111,
"first_ready_at": "2026-11-16T04:15:40.348745+00:00"
},
{
"id": "482a7da0-7913-4e98-ace4-ec5834b1d687",
"status": "ready",
"accepted_at": "2026-11-16T04:14:47.628314+00:00",
"ready_seconds": 54.866049,
"first_ready_at": "2026-11-16T04:15:42.494363+00:00"
},
{
"id": "7ae599a9-2cbc-40ee-82df-d16bd989d153",
"status": "ready",
"accepted_at": "2026-11-16T04:14:54.644927+00:00",
"ready_seconds": 54.702838,
"first_ready_at": "2026-11-16T04:15:49.347765+00:00"
},
{
"id": "cb585d39-cfbe-4599-b626-a4f244039319",
"status": "ready",
"accepted_at": "2026-11-16T04:14:56.69192+00:00",
"ready_seconds": 54.233307,
"first_ready_at": "2026-11-16T04:15:50.925227+00:00"
},
{
"id": "7c35dc4d-f9d4-421a-916d-3bd458e2585d",
"status": "ready",
"accepted_at": "2026-11-16T04:14:55.629098+00:00",
"ready_seconds": 54.306776,
"first_ready_at": "2026-11-16T04:15:49.935874+00:00"
},
{
"id": "22a23bf5-4377-4744-a68a-6a22361794f7",
"status": "ready",
"accepted_at": "2026-11-16T04:15:01.242483+00:00",
"ready_seconds": 52.649567,
"first_ready_at": "2026-11-16T04:15:53.89205+00:00"
},
{
"id": "4dc88468-27e1-4bad-9959-3fd71c7f3675",
"status": "ready",
"accepted_at": "2026-11-16T04:14:41.640281+00:00",
"ready_seconds": 52.925109,
"first_ready_at": "2026-11-16T04:15:34.56539+00:00"
},
{
"id": "319daf78-61d9-4dbf-8c28-065e8e4266fd",
"status": "ready",
"accepted_at": "2026-11-16T04:14:43.637293+00:00",
"ready_seconds": 53.222651,
"first_ready_at": "2026-11-16T04:15:36.859944+00:00"
},
{
"id": "d724a587-dafb-4265-95d3-69cd21d62f2c",
"status": "ready",
"accepted_at": "2026-11-16T04:14:48.638641+00:00",
"ready_seconds": 55.027617,
"first_ready_at": "2026-11-16T04:15:43.666258+00:00"
},
{
"id": "8443ed5e-b740-45cd-87e7-0e1d2c27cbcb",
"status": "ready",
"accepted_at": "2026-11-16T04:14:49.631148+00:00",
"ready_seconds": 55.007471,
"first_ready_at": "2026-11-16T04:15:44.638619+00:00"
},
{
"id": "cb1b1173-93df-4e16-a440-ce6d8ce4314c",
"status": "ready",
"accepted_at": "2026-11-16T04:14:58.74914+00:00",
"ready_seconds": 53.725689,
"first_ready_at": "2026-11-16T04:15:52.474829+00:00"
},
{
"id": "a771cb38-e0b3-4bf1-abac-48a65e76c240",
"status": "ready",
"accepted_at": "2026-11-16T04:14:51.798195+00:00",
"ready_seconds": 54.517117,
"first_ready_at": "2026-11-16T04:15:46.315312+00:00"
},
{
"id": "376f3100-43f4-46d5-83de-245953eaf944",
"status": "ready",
"accepted_at": "2026-11-16T04:14:52.756042+00:00",
"ready_seconds": 54.380022,
"first_ready_at": "2026-11-16T04:15:47.136064+00:00"
},
{
"id": "909de33d-4412-42e3-8331-3879b26276bc",
"status": "ready",
"accepted_at": "2026-11-16T04:15:01.643325+00:00",
"ready_seconds": 52.878639,
"first_ready_at": "2026-11-16T04:15:54.521964+00:00"
},
{
"id": "d12701b1-260a-4b41-aa87-013d3a830db9",
"status": "ready",
"accepted_at": "2026-11-16T04:15:02.637029+00:00",
"ready_seconds": 52.338286,
"first_ready_at": "2026-11-16T04:15:54.975315+00:00"
},
{
"id": "c506f7b2-f853-483c-97ef-1b1f15e9130f",
"status": "ready",
"accepted_at": "2026-11-16T04:15:04.639738+00:00",
"ready_seconds": 51.318514,
"first_ready_at": "2026-11-16T04:15:55.958252+00:00"
}
]
@@ -0,0 +1,12 @@
bun test v1.4.4 (38afee6c8)
student-tests/incident-readback.test.ts:
(pass) recognizes firing while the same accepted backlog is recovering after process start [0.74ms]
(pass) accepts firing during worker stop and requires the complete owned late-job cohort [0.03ms]
(pass) rejects an unrelated later alert or timely successful workload [0.02ms]
(pass) queue drain needs actual finite samples rather than empty NoData [0.04ms]
4 pass
0 fail
9 expect() calls
Ran 4 tests across 1 file. [5.00ms]
@@ -0,0 +1,48 @@
bun test v1.4.4 (38afee6c8)
student-tests/incident-readback.test.ts:
1 | import{test,expect}from'bun:test';import{readyIncidentObserved,drained}from'../scripts/lib/incident-readback';
2 | const fact={id:'own',status:'ready',accepted_at:'2026-11-16T04:14:31Z',first_ready_at:'2026-11-16T04:15:22Z',ready_seconds:51},stop='2026-11-16T04:14:30Z',start='2026-11-16T04:15:16Z';
3 | const sample=(at:string,phase='worker_recovery')=>({at,phase,rules:[{name:'MessengerReadyErrorBudgetBurn',state:'Alerting'}]});
4 | test('recognizes firing while the same accepted backlog is recovering after process start',()=>{expect(readyIncidentObserved([sample('2026-11-16T04:15:19Z')],[fact],['own'],stop,start)).toBe(true)});
^
error: expect(received).toBe(expected)
Expected: true
Received: false
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/incident-readback.test.ts:4:187)
(fail) recognizes firing while the same accepted backlog is recovering after process start [0.25ms]
1 | import{test,expect}from'bun:test';import{readyIncidentObserved,drained}from'../scripts/lib/incident-readback';
2 | const fact={id:'own',status:'ready',accepted_at:'2026-11-16T04:14:31Z',first_ready_at:'2026-11-16T04:15:22Z',ready_seconds:51},stop='2026-11-16T04:14:30Z',start='2026-11-16T04:15:16Z';
3 | const sample=(at:string,phase='worker_recovery')=>({at,phase,rules:[{name:'MessengerReadyErrorBudgetBurn',state:'Alerting'}]});
4 | test('recognizes firing while the same accepted backlog is recovering after process start',()=>{expect(readyIncidentObserved([sample('2026-11-16T04:15:19Z')],[fact],['own'],stop,start)).toBe(true)});
5 | test('accepts firing during worker stop and requires the complete owned late-job cohort',()=>{expect(readyIncidentObserved([sample('2026-11-16T04:15:10Z','worker_stopped')],[fact],['own'],stop,start)).toBe(true);expect(readyIncidentObserved([sample('2026-11-16T04:15:10Z','worker_stopped')],[],['own'],stop,start)).toBe(false)});
^
error: expect(received).toBe(expected)
Expected: false
Received: true
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/incident-readback.test.ts:5:316)
(fail) accepts firing during worker stop and requires the complete owned late-job cohort [0.06ms]
(pass) rejects an unrelated later alert or timely successful workload [0.02ms]
2 | const fact={id:'own',status:'ready',accepted_at:'2026-11-16T04:14:31Z',first_ready_at:'2026-11-16T04:15:22Z',ready_seconds:51},stop='2026-11-16T04:14:30Z',start='2026-11-16T04:15:16Z';
3 | const sample=(at:string,phase='worker_recovery')=>({at,phase,rules:[{name:'MessengerReadyErrorBudgetBurn',state:'Alerting'}]});
4 | test('recognizes firing while the same accepted backlog is recovering after process start',()=>{expect(readyIncidentObserved([sample('2026-11-16T04:15:19Z')],[fact],['own'],stop,start)).toBe(true)});
5 | test('accepts firing during worker stop and requires the complete owned late-job cohort',()=>{expect(readyIncidentObserved([sample('2026-11-16T04:15:10Z','worker_stopped')],[fact],['own'],stop,start)).toBe(true);expect(readyIncidentObserved([sample('2026-11-16T04:15:10Z','worker_stopped')],[],['own'],stop,start)).toBe(false)});
6 | test('rejects an unrelated later alert or timely successful workload',()=>{expect(readyIncidentObserved([sample('2026-11-16T04:17:19Z')],[fact],['own'],stop,start)).toBe(false);expect(readyIncidentObserved([sample('2026-11-16T04:15:19Z')],[{...fact,ready_seconds:2}],['own'],stop,start)).toBe(false)});
7 | test('queue drain needs actual finite samples rather than empty NoData',()=>{expect(drained([])).toBe(false);expect(drained([0])).toBe(true);expect(drained([0,1])).toBe(false);expect(drained([NaN])).toBe(false)});
^
error: expect(received).toBe(expected)
Expected: false
Received: true
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/incident-readback.test.ts:7:98)
(fail) queue drain needs actual finite samples rather than empty NoData [0.06ms]
1 pass
3 fail
6 expect() calls
Ran 4 tests across 1 file. [8.00ms]
@@ -0,0 +1,498 @@
{
"checkedAt": "2026-11-16T04:25:13.040Z",
"scope": "bounded readback of the SAME captured native incident; original command remains FAIL; no repeated fault or changed thresholds",
"source": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-incidents-911a5f98-78fd-498b-b562-69052bd3192a",
"hashes": {
"RESULT.json": "38d3084dd8225f376152df798b2714527854c9bb3e0c26062d56cc7c0888a0ae",
"VALIDATIONS.json": "5b7489355539a954172e99ca04bef460bbf10d4478b7acbae58a95883bb1608d",
"snapshots.json": "9c058d99c5e64b11ee117d805529b64f3b823a5f461949b1adf15ccceae32e92",
"requests.json": "63885e5ff99c1f46833432ebf627fe5c2778f41050e60df8c468a181878519ed",
"attachment-facts.json": "bb0f8c3d242998a7f93b02eb12c0337c380df76524b9ebd33cdf175fae946c16",
"events.jsonl": "424a44ded96922386b4e9b75b6774888dccd01499860ea395a9407e8a44bd4e0"
},
"originalCommandPassed": false,
"originalFailure": "One or more mandatory native incident observations missing",
"originalCleanupFailure": null,
"correctedReadyBurnObserved": true,
"acceptedJobs": 34,
"readyJobs": 34,
"readySeconds": {
"min": 47.89558,
"max": 55.210172
},
"workerStoppedAt": "2026-11-16T04:14:30.543Z",
"workerProcessStartedAt": "2026-11-16T04:15:16.526Z",
"lastBusinessReadyAt": "2026-11-16T04:15:55.958Z",
"causalWindowBudgetSeconds": {
"initialReadiness": 10,
"cohort": 30,
"evaluation": 10,
"export": 2,
"observation": 2
},
"metric": {
"A": {
"error": false,
"values": [
87
]
},
"B": {
"error": false,
"values": [
0
]
},
"C": {
"error": false,
"values": [
0
]
}
},
"changes": [
{
"at": "2026-11-16T04:11:41.913Z",
"phase": "healthy_baseline",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:12:32.766Z",
"phase": "db_short_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Pending"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:12:42.835Z",
"phase": "db_short_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:13:10.460Z",
"phase": "db_sustained_degradation",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Pending"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:13:12.475Z",
"phase": "db_sustained_degradation",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Pending"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Pending"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:13:22.566Z",
"phase": "db_sustained_degradation",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Alerting"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Pending"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:13:30.617Z",
"phase": "db_sustained_degradation",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Alerting"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Alerting"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:14:00.740Z",
"phase": "db_sustained_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Alerting"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:14:02.752Z",
"phase": "db_sustained_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:14:35.122Z",
"phase": "worker_stopped",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Pending"
}
]
},
{
"at": "2026-11-16T04:14:44.503Z",
"phase": "worker_stopped",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:14:56.672Z",
"phase": "worker_stopped",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Pending"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:14:59.114Z",
"phase": "worker_stopped",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Pending"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Pending"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:15:06.421Z",
"phase": "worker_stopped",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Alerting"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Pending"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:15:19.275Z",
"phase": "worker_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Alerting"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Alerting"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:15:39.294Z",
"phase": "worker_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Alerting"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
},
{
"at": "2026-11-16T04:16:07.400Z",
"phase": "worker_recovery",
"rules": [
{
"name": "MessengerHighErrorRate",
"state": "Normal"
},
{
"name": "MessengerFastErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerQueueLag",
"state": "Normal"
},
{
"name": "MessengerReadyErrorBudgetBurn",
"state": "Normal"
},
{
"name": "MessengerDatabaseObserverUnavailable",
"state": "Normal"
}
]
}
],
"passed": true
}
@@ -0,0 +1,62 @@
{
"checkedAt": "2026-11-16T04:16:37.789Z",
"project": "mtuci-vp6-medvedev",
"scope": "real native Grafana rules and ordinary business workload; correctness/fault experiment, not performance benchmark",
"phases": [
{
"name": "healthy_baseline",
"startAt": "2026-11-16T04:11:41.575Z",
"endAt": "2026-11-16T04:12:22.369Z",
"startElapsedMs": 255,
"durationMs": 40794
},
{
"name": "db_short_spike",
"startAt": "2026-11-16T04:12:22.621Z",
"endAt": "2026-11-16T04:12:26.626Z",
"startElapsedMs": 41302,
"durationMs": 4005
},
{
"name": "db_short_recovery",
"startAt": "2026-11-16T04:12:26.720Z",
"endAt": "2026-11-16T04:13:01.959Z",
"startElapsedMs": 45400,
"durationMs": 35239
},
{
"name": "db_sustained_degradation",
"startAt": "2026-11-16T04:13:02.032Z",
"endAt": "2026-11-16T04:13:43.553Z",
"startElapsedMs": 80713,
"durationMs": 41521
},
{
"name": "db_sustained_recovery",
"startAt": "2026-11-16T04:13:43.626Z",
"endAt": "2026-11-16T04:14:28.753Z",
"startElapsedMs": 122307,
"durationMs": 45127
},
{
"name": "worker_stopped",
"startAt": "2026-11-16T04:14:30.543Z",
"endAt": "2026-11-16T04:15:15.565Z",
"startElapsedMs": 169223,
"durationMs": 45022
},
{
"name": "worker_recovery",
"startAt": "2026-11-16T04:15:16.526Z",
"endAt": "2026-11-16T04:16:37.434Z",
"startElapsedMs": 215206,
"durationMs": 80908
}
],
"requests": 613,
"acceptedUploads": 34,
"primaryFailure": "One or more mandatory native incident observations missing",
"retainedSyntheticData": "Owned user/chat/attachments retained intentionally for course trace/metric defense; session revoked; no password/token persisted",
"passed": false,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-incidents-911a5f98-78fd-498b-b562-69052bd3192a"
}
@@ -0,0 +1,38 @@
{
"checkedAt": "2026-11-16T04:16:37.685Z",
"validations": {
"baselineNormal": true,
"dbHighErrorAlerting": true,
"dbBurnAlerting": true,
"dbRecoveredNormal": true,
"queueAlerting": true,
"readyBurnAlerting": false,
"workerRecoveredNormal": true,
"acceptedUploads": true,
"allAcceptedReady": true,
"app5xxObserved": true,
"dbPingRemainedHealthy": true,
"native5xxMetric": true,
"queueDrained": true
},
"metric": {
"A": {
"error": false,
"values": [
87
]
},
"B": {
"error": false,
"values": [
0
]
},
"C": {
"error": false,
"values": [
0
]
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

@@ -0,0 +1,46 @@
{
"checkedAt": "2026-11-16T03:17:10.654Z",
"checks": [
{
"name": "server",
"http": 200,
"version": "13.3.1",
"database": "ok",
"pass": true
},
{
"name": "metrics-source",
"http": 200,
"status": "OK",
"pass": true
},
{
"name": "plugin-source",
"http": 200,
"status": "OK",
"pass": true
},
{
"name": "provisioned-dashboard",
"http": 200,
"uid": "messenger",
"panels": 18,
"pass": true
},
{
"name": "rules",
"http": 200,
"count": 5,
"uids": [
"vp6-high-error",
"vp6-fast-burn",
"vp6-queue-lag",
"vp6-ready-burn",
"vp6-observer-down"
],
"pass": true
}
],
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-native-e1806d53-ec76-41a1-a907-29ec8e710243"
}
@@ -0,0 +1,9 @@
{
"checkedAt": "2026-11-16T05:17:47.083Z",
"compiler": "TypeScript7.0.2 via existing Bun1.4.4",
"files": 58,
"network": false,
"exit": 0,
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/typecheck-4f422f39-5e5d-473e-b114-657ed93fc80d"
}
@@ -0,0 +1 @@
import{mkdir,writeFile,symlink,readdir}from'node:fs/promises';import{resolve}from'node:path';const root='/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6';if(process.argv.includes('--check')){console.log('Offline source typecheck wrapper validated without mutation');process.exit(0)}const out=resolve(root,'.local/typecheck-'+crypto.randomUUID());await mkdir(resolve(out,'node_modules/@types'),{recursive:true,mode:0o700});await symlink('/home/rey/.bun/install/cache/bun-types@1.4.4@@@1',resolve(out,'node_modules/bun-types'));await symlink('/home/rey/.bun/install/cache/@types/node@26.6.5@@@1',resolve(out,'node_modules/@types/node'));const files:string[]=[];async function walk(path:string){for(const entry of await readdir(path,{withFileTypes:true})){const p=resolve(path,entry.name);if(entry.isDirectory())await walk(p);else if(entry.name.endsWith('.ts'))files.push(p)}}await walk(resolve(root,'scripts'));await walk(resolve(root,'student-tests'));await writeFile(resolve(out,'tsconfig.json'),JSON.stringify({compilerOptions:{target:'ESNext',module:'ESNext',moduleResolution:'bundler',moduleDetection:'force',noEmit:true,skipLibCheck:true,strict:false,types:['bun-types'],typeRoots:[resolve(out,'node_modules'),resolve(out,'node_modules/@types')]},files}),{flag:'wx',mode:0o600});const r=Bun.spawnSync(['/home/rey/.local/share/mise/installs/bun/1.4.4/bin/bun','/home/rey/.bun/install/cache/typescript@7.0.2@@@1/lib/tsc.js','-p',resolve(out,'tsconfig.json')],{stdout:'pipe',stderr:'pipe'});await writeFile(resolve(out,'stdout.txt'),r.stdout,{flag:'wx',mode:0o600});await writeFile(resolve(out,'stderr.txt'),r.stderr,{flag:'wx',mode:0o600});const result={checkedAt:new Date().toISOString(),compiler:'TypeScript7.0.2 via existing Bun1.4.4',files:files.length,network:false,exit:r.exitCode,passed:r.exitCode===0,out};await writeFile(resolve(out,'RESULT.json'),JSON.stringify(result,null,2)+'\n',{flag:'wx',mode:0o600});console.log(JSON.stringify(result));if(r.exitCode)console.log(new TextDecoder().decode(r.stdout));process.exitCode=r.exitCode;
+12
View File
@@ -0,0 +1,12 @@
bun test v1.4.4 (38afee6c8)
student-tests/owned-fault.test.ts:
(pass) restores the acquired owned lease after successful exercise [0.21ms]
(pass) restores owned lease even when its mutation or traffic fails [0.94ms]
(pass) preserves primary failure separately from failed restoration [0.10ms]
(pass) does not restore anything when ownership acquisition fails [0.06ms]
4 pass
0 fail
10 expect() calls
Ran 4 tests across 1 file. [7.00ms]
+63
View File
@@ -0,0 +1,63 @@
bun test v1.4.4 (38afee6c8)
student-tests/owned-fault.test.ts:
1 | import{test,expect}from'bun:test';import{createOwnedFaultRunner,OwnedFaultFailure}from'../scripts/lib/owned-fault';
2 | test('restores the acquired owned lease after successful exercise',async()=>{const lease={id:'synthetic'},restored:unknown[]=[];const result=await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>7,restore:async l=>{restored.push(l)}})();expect(result).toBe(7);expect(restored).toEqual([lease]);});
^
error: expect(received).toEqual(expected)
- [
- {
- "id": "synthetic",
- },
- ]
+ []
- Expected - 5
+ Received + 1
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/owned-fault.test.ts:2:295)
(fail) restores the acquired owned lease after successful exercise [1.77ms]
1 | import{test,expect}from'bun:test';import{createOwnedFaultRunner,OwnedFaultFailure}from'../scripts/lib/owned-fault';
2 | test('restores the acquired owned lease after successful exercise',async()=>{const lease={id:'synthetic'},restored:unknown[]=[];const result=await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>7,restore:async l=>{restored.push(l)}})();expect(result).toBe(7);expect(restored).toEqual([lease]);});
3 | test('restores owned lease even when its mutation or traffic fails',async()=>{const lease={id:'synthetic'},failure=new Error('fixture failed'),restored:unknown[]=[];let result;try{await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>{throw failure},restore:async l=>{restored.push(l)}})()}catch(e){result=e}expect(restored).toEqual([lease]);expect(result).toBeInstanceOf(OwnedFaultFailure);expect((result as OwnedFaultFailure).primary).toBe(failure);});
^
error: expect(received).toEqual(expected)
- [
- {
- "id": "synthetic",
- },
- ]
+ []
- Expected - 5
+ Received + 1
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/owned-fault.test.ts:3:343)
(fail) restores owned lease even when its mutation or traffic fails [0.13ms]
1 | import{test,expect}from'bun:test';import{createOwnedFaultRunner,OwnedFaultFailure}from'../scripts/lib/owned-fault';
2 | test('restores the acquired owned lease after successful exercise',async()=>{const lease={id:'synthetic'},restored:unknown[]=[];const result=await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>7,restore:async l=>{restored.push(l)}})();expect(result).toBe(7);expect(restored).toEqual([lease]);});
3 | test('restores owned lease even when its mutation or traffic fails',async()=>{const lease={id:'synthetic'},failure=new Error('fixture failed'),restored:unknown[]=[];let result;try{await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>{throw failure},restore:async l=>{restored.push(l)}})()}catch(e){result=e}expect(restored).toEqual([lease]);expect(result).toBeInstanceOf(OwnedFaultFailure);expect((result as OwnedFaultFailure).primary).toBe(failure);});
4 | test('preserves primary failure separately from failed restoration',async()=>{const first=new Error('exercise'),second=new Error('cleanup');let result;try{await createOwnedFaultRunner({acquire:async()=>({id:'owned'}),exercise:async()=>{throw first},restore:async()=>{throw second}})()}catch(e){result=e}expect(result).toBeInstanceOf(OwnedFaultFailure);expect((result as OwnedFaultFailure).primary).toBe(first);expect((result as OwnedFaultFailure).cleanup).toBe(second);});
^
error: expect(received).toBeInstanceOf(expected)
Expected constructor: [class OwnedFaultFailure extends Error]
Received value: 1 | import{test,expect}from'bun:test';import{createOwnedFaultRunner,OwnedFaultFailure}from'../scripts/lib/owned-fault';
2 | test('restores the acquired owned lease after successful exercise',async()=>{const lease={id:'synthetic'},restored:unknown[]=[];const result=await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>7,restore:async l=>{restored.push(l)}})();expect(result).toBe(7);expect(restored).toEqual([lease]);});
3 | test('restores owned lease even when its mutation or traffic fails',async()=>{const lease={id:'synthetic'},failure=new Error('fixture failed'),restored:unknown[]=[];let result;try{await createOwnedFaultRunner({acquire:async()=>lease,exercise:async()=>{throw failure},restore:async l=>{restored.push(l)}})()}catch(e){result=e}expect(restored).toEqual([lease]);expect(result).toBeInstanceOf(OwnedFaultFailure);expect((result as OwnedFaultFailure).primary).toBe(failure);});
4 | test('preserves primary failure separately from failed restoration',async()=>{const first=new Error('exercise'),second=new Error('cleanup');let result;try{await createOwnedFaultRunner({acquire:async()=>({id:'owned'}),exercise:async()=>{throw first},restore:async()=>{throw second}})()}catch(e){result=e}expect(result).toBeInstanceOf(OwnedFaultFailure);expect((result as OwnedFaultFailure).primary).toBe(first);expect((result as OwnedFaultFailure).cleanup).toBe(second);});
^
error: exercise
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/owned-fault.test.ts:4:95)
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/owned-fault.test.ts:4:319)
(fail) preserves primary failure separately from failed restoration [0.45ms]
(pass) does not restore anything when ownership acquisition fails [0.05ms]
1 pass
3 fail
6 expect() calls
Ran 4 tests across 1 file. [12.00ms]
@@ -0,0 +1,79 @@
{
"checkedAt": "2026-11-16T04:54:50.489Z",
"checks": [
{
"name": "server",
"http": 200,
"version": "13.3.1",
"database": "ok",
"contentMatches": true,
"pass": true
},
{
"name": "metrics-source",
"http": 200,
"status": "OK",
"contentMatches": true,
"pass": true
},
{
"name": "plugin-source",
"http": 200,
"status": "OK",
"contentMatches": true,
"pass": true
},
{
"name": "provisioned-dashboard",
"http": 200,
"uid": "messenger",
"panels": 18,
"contentMatches": true,
"pass": true
},
{
"name": "rules",
"http": 200,
"count": 5,
"uids": [
"vp6-high-error",
"vp6-fast-burn",
"vp6-queue-lag",
"vp6-ready-burn",
"vp6-observer-down"
],
"contentMatches": true,
"pass": true
}
],
"expectedDashboardUID": "messenger",
"expectedPanelIDs": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18
],
"expectedRuleUIDs": [
"vp6-high-error",
"vp6-fast-burn",
"vp6-queue-lag",
"vp6-ready-burn",
"vp6-observer-down"
],
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-native-43a6f822-fbf2-4202-8dcd-7d25dc499800"
}
@@ -0,0 +1,136 @@
{
"checkedAt": "2026-11-16T03:49:59.178Z",
"base": "http://127.0.0.1:28906",
"baseline": false,
"nativeRole": "service_account",
"nativeReadOnly": false,
"results": [
{
"name": "query native search",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "query native PromQL",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "editor organizations",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "editor streams",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "editor values",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "values over1000 limit denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "values over1hour window denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "PromQL bounded range with fractional epoch",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "PromQL over1hour window denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "editor schema",
"expected": 200,
"actual": 200,
"pass": true
},
{
"name": "query principal cannot ingest",
"expected": 403,
"actual": 403,
"pass": true
},
{
"name": "query principal cannot read admin users",
"expected": 403,
"actual": 403,
"pass": true
},
{
"name": "query principal cannot select another organization",
"expected": 403,
"actual": 403,
"pass": true
},
{
"name": "query principal cannot write stream settings",
"expected": 403,
"actual": 403,
"pass": true
},
{
"name": "ingest principal cannot use query gateway",
"expected": 401,
"actual": 401,
"pass": true
},
{
"name": "anonymous cannot use query gateway",
"expected": 401,
"actual": 401,
"pass": true
},
{
"name": "zero result limit denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "over1000 result limit denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "inverted time window denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "over1hour time window denied",
"expected": 400,
"actual": 400,
"pass": true
},
{
"name": "oversized search body denied",
"expected": 413,
"actual": 413,
"pass": true
}
],
"output": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/openobserve-gateway-96c17323-df3e-4fca-a7da-aaa287601a76"
}
@@ -0,0 +1,310 @@
{
"checkedAt": "2026-11-16T03:45:47.052Z",
"configSHA256": "8aa801e8f842fde3cb5fa0badd944ddbd33d50bfda3521b671e779d1962a65f5",
"scope": "native HAProxy recognized Content-Length boundary; temporary synthetic raw HTTP upstream, no application mutation",
"image": "sha256:1c3568e520453cc8ba98c39501febcf450429c80e6cc27ecad779961d76e597c",
"results": [
{
"id": "small",
"status": 200,
"bytes": 11,
"observedLength": "11",
"observedCount": "1",
"rawContentLengthFields": [
"Content-Length: 11"
],
"expected": [
200
],
"aclMarker": false,
"classification": "accepted-bounded",
"normalizationInformational": false,
"pass": true
},
{
"id": "exact-cap",
"status": 200,
"bytes": 1048576,
"observedLength": "1048576",
"observedCount": "1",
"rawContentLengthFields": [
"Content-Length: 1048576"
],
"expected": [
200
],
"aclMarker": false,
"classification": "accepted-bounded",
"normalizationInformational": false,
"pass": true
},
{
"id": "cap-plus-one",
"status": 502,
"bytes": 35,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: 1048577"
],
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "gzip",
"status": 502,
"bytes": 35,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: 31"
],
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "encoding-identity",
"status": 502,
"bytes": 35,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: 11"
],
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "empty-encoding",
"status": 502,
"bytes": 35,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: 11"
],
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "chunked",
"status": 502,
"bytes": 35,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [],
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "eof-delimited",
"status": 502,
"bytes": 35,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [],
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "duplicate-equal",
"status": 200,
"bytes": 11,
"observedLength": "11",
"observedCount": "1",
"rawContentLengthFields": [
"Content-Length: 11",
"Content-Length: 11"
],
"expected": [
200,
502
],
"aclMarker": false,
"classification": "accepted-native-normalized-bounded",
"normalizationInformational": true,
"pass": true
},
{
"id": "duplicate-conflicting",
"status": 502,
"bytes": 107,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: 11",
"Content-Length: 12"
],
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "leading-zero",
"status": 200,
"bytes": 11,
"observedLength": "11",
"observedCount": "1",
"rawContentLengthFields": [
"Content-Length: 00011"
],
"expected": [
200,
502
],
"aclMarker": false,
"classification": "accepted-native-normalized-bounded",
"normalizationInformational": true,
"pass": true
},
{
"id": "invalid-length",
"status": 502,
"bytes": 107,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: abc"
],
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "length-overflow",
"status": 502,
"bytes": 107,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: 999999999999999999999999999999999999"
],
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "negative-length",
"status": 502,
"bytes": 107,
"observedLength": null,
"observedCount": null,
"rawContentLengthFields": [
"Content-Length: -1"
],
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
}
],
"originRequests": [
{
"id": "small",
"acceptEncodingIdentity": true
},
{
"id": "small",
"acceptEncodingIdentity": true
},
{
"id": "exact-cap",
"acceptEncodingIdentity": true
},
{
"id": "cap-plus-one",
"acceptEncodingIdentity": true
},
{
"id": "gzip",
"acceptEncodingIdentity": true
},
{
"id": "encoding-identity",
"acceptEncodingIdentity": true
},
{
"id": "empty-encoding",
"acceptEncodingIdentity": true
},
{
"id": "chunked",
"acceptEncodingIdentity": true
},
{
"id": "eof-delimited",
"acceptEncodingIdentity": true
},
{
"id": "duplicate-equal",
"acceptEncodingIdentity": true
},
{
"id": "duplicate-conflicting",
"acceptEncodingIdentity": true
},
{
"id": "leading-zero",
"acceptEncodingIdentity": true
},
{
"id": "invalid-length",
"acceptEncodingIdentity": true
},
{
"id": "length-overflow",
"acceptEncodingIdentity": true
},
{
"id": "negative-length",
"acceptEncodingIdentity": true
}
],
"cleanup": "stopped",
"passed": true
}
@@ -0,0 +1,241 @@
{
"checkedAt": "2026-11-16T03:43:34.663Z",
"configSHA256": "8aa801e8f842fde3cb5fa0badd944ddbd33d50bfda3521b671e779d1962a65f5",
"scope": "native HAProxy recognized Content-Length boundary; temporary synthetic raw HTTP upstream, no application mutation",
"image": "sha256:1c3568e520453cc8ba98c39501febcf450429c80e6cc27ecad779961d76e597c",
"results": [
{
"id": "small",
"status": 200,
"bytes": 11,
"expected": [
200
],
"aclMarker": false,
"classification": "accepted-bounded",
"normalizationInformational": false,
"pass": true
},
{
"id": "exact-cap",
"status": 200,
"bytes": 1048576,
"expected": [
200
],
"aclMarker": false,
"classification": "accepted-bounded",
"normalizationInformational": false,
"pass": true
},
{
"id": "cap-plus-one",
"status": 502,
"bytes": 35,
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "gzip",
"status": 502,
"bytes": 35,
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "encoding-identity",
"status": 502,
"bytes": 35,
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "empty-encoding",
"status": 502,
"bytes": 35,
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "chunked",
"status": 502,
"bytes": 35,
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "eof-delimited",
"status": 502,
"bytes": 35,
"expected": [
502
],
"aclMarker": true,
"classification": "response-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "duplicate-equal",
"status": 200,
"bytes": 11,
"expected": [
200,
502
],
"aclMarker": false,
"classification": "accepted-bounded",
"normalizationInformational": true,
"pass": true
},
{
"id": "duplicate-conflicting",
"status": 502,
"bytes": 107,
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "leading-zero",
"status": 200,
"bytes": 11,
"expected": [
502
],
"aclMarker": false,
"classification": "accepted-bounded",
"normalizationInformational": false,
"pass": false
},
{
"id": "invalid-length",
"status": 502,
"bytes": 107,
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "length-overflow",
"status": 502,
"bytes": 107,
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
},
{
"id": "negative-length",
"status": 502,
"bytes": 107,
"expected": [
502
],
"aclMarker": false,
"classification": "native-http-parser-before-acl",
"normalizationInformational": false,
"pass": true
}
],
"originRequests": [
{
"id": "small",
"acceptEncodingIdentity": true
},
{
"id": "small",
"acceptEncodingIdentity": true
},
{
"id": "exact-cap",
"acceptEncodingIdentity": true
},
{
"id": "cap-plus-one",
"acceptEncodingIdentity": true
},
{
"id": "gzip",
"acceptEncodingIdentity": true
},
{
"id": "encoding-identity",
"acceptEncodingIdentity": true
},
{
"id": "empty-encoding",
"acceptEncodingIdentity": true
},
{
"id": "chunked",
"acceptEncodingIdentity": true
},
{
"id": "eof-delimited",
"acceptEncodingIdentity": true
},
{
"id": "duplicate-equal",
"acceptEncodingIdentity": true
},
{
"id": "duplicate-conflicting",
"acceptEncodingIdentity": true
},
{
"id": "leading-zero",
"acceptEncodingIdentity": true
},
{
"id": "invalid-length",
"acceptEncodingIdentity": true
},
{
"id": "length-overflow",
"acceptEncodingIdentity": true
},
{
"id": "negative-length",
"acceptEncodingIdentity": true
}
],
"cleanup": "stopped",
"passed": false
}
+63
View File
@@ -0,0 +1,63 @@
{
"checkedAt": "2026-11-16T04:54:55.835Z",
"project": "mtuci-vp6-medvedev",
"stage": "restore-owned-object-and-worker",
"attachmentId": "447122be-664f-4fef-8abf-4452676494a0",
"traceId": "3b58d0b8144926719059857bf888bada",
"observations": [
{
"at": "2026-11-16T04:54:50.599Z",
"kind": "accepted",
"id": "4e4e7b70-5554-4b80-868d-ea7d58977bc7",
"status": "queued",
"attempt": 0,
"completed": false,
"error_code": "",
"accepted_at": "2026-11-16T04:54:50.263003+00:00",
"traceparent": "00-3b58d0b8144926719059857bf888bada-55aad41d0d8a6710-01",
"attachment_id": "447122be-664f-4fef-8abf-4452676494a0",
"first_ready_at": null,
"requestId": "00d2e5b9-d15a-4213-8777-7ccd2f9559c5",
"traceId": "3b58d0b8144926719059857bf888bada"
},
{
"at": "2026-11-16T04:54:50.656Z",
"kind": "object-verified",
"bytes": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75"
},
{
"at": "2026-11-16T04:54:52.051Z",
"kind": "durable-retry",
"id": "4e4e7b70-5554-4b80-868d-ea7d58977bc7",
"status": "queued",
"attempt": 1,
"completed": false,
"error_code": "processing_failed",
"accepted_at": "2026-11-16T04:54:50.263003+00:00",
"traceparent": "00-3b58d0b8144926719059857bf888bada-55aad41d0d8a6710-01",
"attachment_id": "447122be-664f-4fef-8abf-4452676494a0",
"first_ready_at": null
},
{
"at": "2026-11-16T04:54:52.240Z",
"kind": "object-restored",
"bytes": 111817
},
{
"at": "2026-11-16T04:54:55.704Z",
"kind": "same-job-ready",
"id": "4e4e7b70-5554-4b80-868d-ea7d58977bc7",
"status": "ready",
"attempt": 2,
"completed": true,
"error_code": "",
"accepted_at": "2026-11-16T04:54:50.263003+00:00",
"traceparent": "00-3b58d0b8144926719059857bf888bada-55aad41d0d8a6710-01",
"attachment_id": "447122be-664f-4fef-8abf-4452676494a0",
"first_ready_at": "2026-11-16T04:54:55.639918+00:00"
}
],
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-retry-49fe07ed-f095-4540-85bc-4aca5e99d9b0"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

+832
View File
@@ -0,0 +1,832 @@
{
"checkedAt": "2026-11-16T04:55:17.199Z",
"scope": "native Grafana query of same accepted job retry; no second producer/fault",
"source": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-retry-49fe07ed-f095-4540-85bc-4aca5e99d9b0",
"attachmentId": "447122be-664f-4fef-8abf-4452676494a0",
"traceId": "3b58d0b8144926719059857bf888bada",
"window": {
"startMicroseconds": 1794804885599000,
"endMicroseconds": 1794804905704000
},
"spanCount": 58,
"parentRelations": 57,
"spans": [
{
"_timestamp": 1794804889955032,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "55aad41d0d8a6710",
"operation_name": "POST /api/v1/chats/{chat_id}/attachments",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 386031,
"start_ns": "1794804889955032618",
"end_ns": "1794804890341064495"
},
{
"_timestamp": 1794804889955068,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "6ca2b4252206ba04",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.acquire",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 14,
"start_ns": "1794804889955068929",
"end_ns": "1794804889955083839"
},
{
"_timestamp": 1794804889955092,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "1e07e54811f2a9a0",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 341,
"start_ns": "1794804889955092629",
"end_ns": "1794804889955434222"
},
{
"_timestamp": 1794804889955567,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "a2d4b6f5beeb4a05",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.acquire",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 3,
"start_ns": "1794804889955567193",
"end_ns": "1794804889955571163"
},
{
"_timestamp": 1794804889955574,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "5f1938a8db98da32",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 467,
"start_ns": "1794804889955574443",
"end_ns": "1794804889956041507"
},
{
"_timestamp": 1794804889957708,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "90d541b7d1a09b09",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.acquire",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 4,
"start_ns": "1794804889957708042",
"end_ns": "1794804889957712812"
},
{
"_timestamp": 1794804889957716,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "60455da219eeaad0",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 155,
"start_ns": "1794804889957716562",
"end_ns": "1794804889957872463"
},
{
"_timestamp": 1794804889957878,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "9b2f1e355e1c1e4c",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.acquire",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 32,
"start_ns": "1794804889957878653",
"end_ns": "1794804889957911124"
},
{
"_timestamp": 1794804889957912,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "2a2ccf751eb47605",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 56,
"start_ns": "1794804889957912944",
"end_ns": "1794804889957969474"
},
{
"_timestamp": 1794804889957974,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "e256ea2c80420143",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 361,
"start_ns": "1794804889957974954",
"end_ns": "1794804889958336337"
},
{
"_timestamp": 1794804889958340,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "0a6a7a4e9e92e730",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 534,
"start_ns": "1794804889958340178",
"end_ns": "1794804889958874622"
},
{
"_timestamp": 1794804889958877,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "22f0ee65e8c011aa",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 31852,
"start_ns": "1794804889958877772",
"end_ns": "1794804889990730606"
},
{
"_timestamp": 1794804889990749,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "9874ecc9c155cbb1",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "s3.put",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 271814,
"start_ns": "1794804889990749696",
"end_ns": "1794804890262563956"
},
{
"_timestamp": 1794804890262569,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "07b503e830ba6ab5",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.acquire",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 5,
"start_ns": "1794804890262569966",
"end_ns": "1794804890262575346"
},
{
"_timestamp": 1794804890262576,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "cfa9bb0a8c23a975",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 79,
"start_ns": "1794804890262576986",
"end_ns": "1794804890262656667"
},
{
"_timestamp": 1794804890262662,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "1062412aa41da352",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 572,
"start_ns": "1794804890262662737",
"end_ns": "1794804890263235462"
},
{
"_timestamp": 1794804890263241,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "f5ff159d0db1dd1b",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 324,
"start_ns": "1794804890263241222",
"end_ns": "1794804890263565985"
},
{
"_timestamp": 1794804890263569,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "b384eb9a68a0e974",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "postgres.query",
"service_name": "messenger-api",
"span_status": "UNSET",
"status_code": 0,
"duration": 77284,
"start_ns": "1794804890263569475",
"end_ns": "1794804890340853773"
},
{
"_timestamp": 1794804891806839,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "c86158c2e52e82e8",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "attachment.publish",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 108993,
"start_ns": "1794804891806839555",
"end_ns": "1794804891915833476"
},
{
"_timestamp": 1794804891870379,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "d4f4db08906c9921",
"reference_parent_span_id": "c86158c2e52e82e8",
"operation_name": "attachment.process",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 92368,
"start_ns": "1794804891870379161",
"end_ns": "1794804891962747293"
},
{
"_timestamp": 1794804891870386,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "e02df70bdbe61e10",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 12,
"start_ns": "1794804891870386771",
"end_ns": "1794804891870399491"
},
{
"_timestamp": 1794804891870406,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "844bbee199a468b6",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 148,
"start_ns": "1794804891870406481",
"end_ns": "1794804891870555162"
},
{
"_timestamp": 1794804891870432,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "3db8c5081dcfbf0d",
"reference_parent_span_id": "c86158c2e52e82e8",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 3164,
"start_ns": "1794804891870432081",
"end_ns": "1794804891873596309"
},
{
"_timestamp": 1794804891870561,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "55725efcb29534a5",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 1016,
"start_ns": "1794804891870561883",
"end_ns": "1794804891871578372"
},
{
"_timestamp": 1794804891871583,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "c74189ae26b2a12f",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 406,
"start_ns": "1794804891871583352",
"end_ns": "1794804891871989575"
},
{
"_timestamp": 1794804891871992,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "106f2431e57f8dca",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 35536,
"start_ns": "1794804891871992955",
"end_ns": "1794804891907529792"
},
{
"_timestamp": 1794804891873599,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "b7cfee1849451056",
"reference_parent_span_id": "c86158c2e52e82e8",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 42229,
"start_ns": "1794804891873599359",
"end_ns": "1794804891915829126"
},
{
"_timestamp": 1794804891907554,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "e5b7bf97d1b41ade",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "s3.get",
"service_name": "messenger-worker",
"span_status": "ERROR",
"status_code": 2,
"duration": 1047,
"start_ns": "1794804891907554492",
"end_ns": "1794804891908602201"
},
{
"_timestamp": 1794804891908605,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "8a7cc8470ecaacef",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "s3.get",
"service_name": "messenger-worker",
"span_status": "ERROR",
"status_code": 2,
"duration": 334,
"start_ns": "1794804891908605601",
"end_ns": "1794804891908940314"
},
{
"_timestamp": 1794804891908946,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "b2f2a4ae7d05726e",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 10,
"start_ns": "1794804891908946744",
"end_ns": "1794804891908956784"
},
{
"_timestamp": 1794804891908958,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "46b28cae5966480d",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 64,
"start_ns": "1794804891908958194",
"end_ns": "1794804891909023145"
},
{
"_timestamp": 1794804891909026,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "21943c7ee840f946",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 543,
"start_ns": "1794804891909026855",
"end_ns": "1794804891909569860"
},
{
"_timestamp": 1794804891909573,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "db71976c89b9310e",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 6282,
"start_ns": "1794804891909573530",
"end_ns": "1794804891915855796"
},
{
"_timestamp": 1794804891915859,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "edc597227fd497f8",
"reference_parent_span_id": "d4f4db08906c9921",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 46837,
"start_ns": "1794804891915859466",
"end_ns": "1794804891962696733"
},
{
"_timestamp": 1794804894301031,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "78f462ab378876f4",
"reference_parent_span_id": "55aad41d0d8a6710",
"operation_name": "attachment.publish",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 73050,
"start_ns": "1794804894301031381",
"end_ns": "1794804894374081892"
},
{
"_timestamp": 1794804894350797,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "89782200167d1c46",
"reference_parent_span_id": "78f462ab378876f4",
"operation_name": "attachment.process",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 1323494,
"start_ns": "1794804894350797394",
"end_ns": "1794804895674291658"
},
{
"_timestamp": 1794804894350803,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "578e125be308b86a",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 12,
"start_ns": "1794804894350803124",
"end_ns": "1794804894350815135"
},
{
"_timestamp": 1794804894350820,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "83114e60f49f5a19",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 90,
"start_ns": "1794804894350820835",
"end_ns": "1794804894350911475"
},
{
"_timestamp": 1794804894350834,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "7081c559dc0c619b",
"reference_parent_span_id": "78f462ab378876f4",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 5,
"start_ns": "1794804894350834845",
"end_ns": "1794804894350840735"
},
{
"_timestamp": 1794804894350842,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "d17373dd6e11f071",
"reference_parent_span_id": "78f462ab378876f4",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 23233,
"start_ns": "1794804894350842135",
"end_ns": "1794804894374075432"
},
{
"_timestamp": 1794804894350916,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "dfd943e75c6ba665",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 23244,
"start_ns": "1794804894350916785",
"end_ns": "1794804894374161033"
},
{
"_timestamp": 1794804894374166,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "ce1c48ff884ffece",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 554,
"start_ns": "1794804894374166663",
"end_ns": "1794804894374721237"
},
{
"_timestamp": 1794804894374726,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "29a90ef80c0a050b",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 7670,
"start_ns": "1794804894374726138",
"end_ns": "1794804894382396536"
},
{
"_timestamp": 1794804894382408,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "0e46f4625a92d3ba",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "s3.get",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 1439,
"start_ns": "1794804894382408856",
"end_ns": "1794804894383848269"
},
{
"_timestamp": 1794804894383901,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "887535806ddc8e1a",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "s3.put",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 92769,
"start_ns": "1794804894383901429",
"end_ns": "1794804894476670645"
},
{
"_timestamp": 1794804895263926,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "69b6e8b2de346fc2",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "s3.put",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 224379,
"start_ns": "1794804895263926764",
"end_ns": "1794804895488306102"
},
{
"_timestamp": 1794804895488329,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "5a2675a08d9473a0",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "s3.put",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 83715,
"start_ns": "1794804895488329012",
"end_ns": "1794804895572044237"
},
{
"_timestamp": 1794804895572056,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "085d2aa350f8b9ff",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "s3.put",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 67258,
"start_ns": "1794804895572056117",
"end_ns": "1794804895639314736"
},
{
"_timestamp": 1794804895639353,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "45b658d0a0886106",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 12,
"start_ns": "1794804895639353517",
"end_ns": "1794804895639366257"
},
{
"_timestamp": 1794804895639368,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "7305588a450fd1c5",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 91,
"start_ns": "1794804895639368337",
"end_ns": "1794804895639459427"
},
{
"_timestamp": 1794804895639466,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "fbe6c23b37396a81",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 582,
"start_ns": "1794804895639466428",
"end_ns": "1794804895640048783"
},
{
"_timestamp": 1794804895640053,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "aeef80904cf9042d",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 274,
"start_ns": "1794804895640053713",
"end_ns": "1794804895640328405"
},
{
"_timestamp": 1794804895640332,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "42e6be44b8bbe3b4",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 17049,
"start_ns": "1794804895640332785",
"end_ns": "1794804895657382407"
},
{
"_timestamp": 1794804895657426,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "27069e593b3398c0",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 4,
"start_ns": "1794804895657426737",
"end_ns": "1794804895657430847"
},
{
"_timestamp": 1794804895657431,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "1fdcbfb9f842de64",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 8417,
"start_ns": "1794804895657431847",
"end_ns": "1794804895665849253"
},
{
"_timestamp": 1794804895665875,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "176c8dbdf9cffd2f",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "s3.stat",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 633,
"start_ns": "1794804895665875553",
"end_ns": "1794804895666509108"
},
{
"_timestamp": 1794804895668022,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "a50d12a5756005ca",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.acquire",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 8,
"start_ns": "1794804895668022912",
"end_ns": "1794804895668031302"
},
{
"_timestamp": 1794804895668034,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "1fc44930fa822638",
"reference_parent_span_id": "89782200167d1c46",
"operation_name": "postgres.query",
"service_name": "messenger-worker",
"span_status": "UNSET",
"status_code": 0,
"duration": 6245,
"start_ns": "1794804895668034572",
"end_ns": "1794804895674280057"
}
],
"logs": [
{
"_timestamp": 1794804890341058,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "55aad41d0d8a6710",
"event": "http.request",
"outcome": "2xx",
"request_id": "00d2e5b9-d15a-4213-8777-7ccd2f9559c5",
"service_name": "messenger-api"
},
{
"_timestamp": 1794804891962736,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "d4f4db08906c9921",
"event": "worker.job",
"outcome": "retry",
"service_name": "messenger-worker"
},
{
"_timestamp": 1794804891962745,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "d4f4db08906c9921",
"event": "worker.delivery",
"outcome": "processed",
"service_name": "messenger-worker"
},
{
"_timestamp": 1794804895657413,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "89782200167d1c46",
"event": "worker.job",
"outcome": "ready",
"service_name": "messenger-worker"
},
{
"_timestamp": 1794804895674284,
"trace_id": "3b58d0b8144926719059857bf888bada",
"span_id": "89782200167d1c46",
"event": "worker.delivery",
"outcome": "processed",
"service_name": "messenger-worker"
}
],
"metrics": {
"A": [
1
],
"B": [
1
]
},
"validations": {
"sameTrace": true,
"apiRoot": true,
"multiplePublishAndProcess": true,
"producerParents": true,
"consumerParents": true,
"errorStorageChild": true,
"retryAndReadyLogs": true,
"retryMetric": true,
"readyMetric": true
},
"passed": true,
"out": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/grafana-retry-readback-6ca0f11d-c528-4819-bdc7-2e97b4bafda8"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

@@ -0,0 +1,28 @@
{
"checkedAt": "2026-11-16T05:20:17.477Z",
"startup16SHA256": "0484d0ad16c970dfaddb640ba51db15bd11cd13936729376ba426b47e775e3b1",
"delta10SHA256": "9c699965290659e7cd34b1facb0a6630771fe27e4613f60c536c02e7415a5fb0",
"unchangedOriginalPaths": [
"scripts/bootstrap.ts",
"scripts/bootstrap-grafana.ts",
"scripts/lib/grafana-credential.ts",
"scripts/up.sh",
"scripts/wait-grafana.ts",
"student-tests/grafana-credential.test.ts",
"student-tests/grafana-scheduler.test.ts",
"compose.yaml",
"config/grafana/provisioning/alerting/rules.yaml",
"evidence/grafana/grafana-credential-red.txt",
"evidence/grafana/grafana-credential-green.txt",
"evidence/grafana/current-up-green.json"
],
"explicitlyCoveredChangedPaths": [
"scripts/preflight-openobserve-images.ts",
"scripts/lib/grafana-scheduler.ts",
"student-tests/grafana-preflight.ts",
"evidence/grafana/GRAFANA-START-CASES.md"
],
"deltaFiles": 10,
"deltaMismatches": [],
"passed": true
}
@@ -0,0 +1,65 @@
# Grafana browser response limit — decision readback
Независимый узкий read-only leaf `/root/sii`. Это source/decision review, **не native guard PASS**. Конфиги, implementation/helpers, стенды, браузер, credentials и прежние reports/ZIP не менялись. Проверка ограничена browser datasource proxy, его initializer/transport и предложенной границей existing HAProxy.
## Вывод
**Для deployed image наличие подходящей штатной extension остаётся UNKNOWN.** Нельзя говорить, что Grafana «не поддерживает browser cap»: нынешний публичный tag действительно подключает стандартный limiter, но его commit отличается от работающего образа. Root разрешил bounded HAProxy fallback по уже измеренному native gap, без plugin patch и без утверждения unsupported.
По сообщению автора/root, на actual Grafana13.3.1 `GF_DATAPROXY_RESPONSE_LIMIT=1048576` отклонил GoSDK backend SQL-ответ около2MiB, но browser datasource proxy вернул2097625байт/HTTP200/validJSON. Это разные пути; backend PASS не доказывает browser cap. Header receipt, проверенный root: `/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/response-headers-fcc7cdaa-9ff1-4f00-b687-456373757b53/RESULT.json`: identity — CL2097625, без CE/TE, body2097625; gzip — без CL, CEgzip, TEchunked, body2391. Reviewer не запускал эти native проверки и не читал private health/headers.
## Source lease и полный прочитанный путь
Actual `/api/health`, allowlisted root: version13.3.1, commit `da3aa3ff574e7dbbf808c66b6daa744defed0441`. Нынешний public tag `v13.3.1`: annotated tag `e8dedc1e3b79f85173a8a1ee6a93153c9092dd45` → commit `5db6ba887630c7fa12e5bfd063f2fa854025468c`. Эти ревизии **не byte-bound друг к другу**.
В public5db прочитана цепочка: `readDataProxySettings` читает `[dataproxy].response_limit` в `cfg.ResponseLimit`; `wire_core.go` связывает `httpclientprovider.New` с HTTP provider; `NewForConfig` добавляет `sdkhttpclient.ResponseLimitMiddleware(cfg.ResponseLimit)`. `DataSourceProxyService.ProvideService` передаёт provider в `NewDataSourceProxy`; `HandleRequest` → loader → datasource `GetHTTPTransport` → `provider.GetTransport(*opts)` → native reverse proxy. Следовательно отсутствие response-limit в `DataSourceProxySettings` **не означает отсутствия limiter в этой public ревизии**.
Public5db `go.mod` закрепляет SDK0.297.0. Его provider добавляет middleware defaults к supplied options; limiter оборачивает response body в MaxBytesReader. Приоритет: positive context override, request Grafana config, env, static argument; env читается при construction. ReverseProxy ModifyResponse сам делает401 mapping/CSP/header handling, отдельного byte counter там нет. Это завершённый source trace **public5db**, не доказательство deployed da3 behavior или причины native bypass. [Primary initializer](https://github.com/grafana/grafana/blob/5db6ba887630c7fa12e5bfd063f2fa854025468c/pkg/infra/httpclient/httpclientprovider/http_client_provider.go), [DI](https://github.com/grafana/grafana/blob/5db6ba887630c7fa12e5bfd063f2fa854025468c/pkg/server/wire_core.go), [actual proxy service](https://github.com/grafana/grafana/blob/5db6ba887630c7fa12e5bfd063f2fa854025468c/pkg/services/datasourceproxy/datasourceproxy.go).
Deployed da3 lookup: seven raw primary-source paths returned404; GitHub commit API returned422 with `No commit found for SHA: da3aa3ff574e7dbbf808c66b6daa744defed0441`, git-commit API404 NotFound. Это source availability gap на проверенном маршруте, не доказательство private/unsupported продукта. По решению root повторный поиск остановлен. Старый `pkg_api_datasource_proxy.go` —14-byte404 body, не source; его нельзя использовать для вывода об отсутствии consumer.
## Минимальная рекомендуемая граница
На существующем query→OpenObserve hop заменить request Accept-Encoding на identity и до отправки response body разрешать только один **недвусмысленный нормализованный** Content-Length, strict decimal, не более1048576. Отклонять unknown length, retained TE и любой Content-Encoding. Для числовой проверки сначала ограничить синтаксис/длину decimal до безопасного диапазона, затем сравнивать число; нельзя полагаться только на permissive conversion/add(0). Canonical decimal policy может консервативно отвергать leading zero, хотя сам HTTP допускает digit representation с нулями.
Это header/framing boundary для trusted собственных OO responses, **не универсальный счётчик decoded streaming bytes**. Forced identity недостаточен, если upstream проигнорировал его: reject CE обязателен, иначе2391 compressed bytes могут скрывать ответ более2MiB. Неизвестный/chunked ответ надо reject, а не считать маленьким из-за отсутствующего CL. Применять на query boundary; OTLP ingest compression не является предметом этой правки. Native Grafana/OO small responses, metadata и PromQL должны сохранить свои позитивные controls.
| Класс | Требуемая проверка / policy | Чего пока не утверждаем |
|---|---|---|
| Small identity response | Authenticated actual browser path, validJSON и полные bytes до/после negative | Не выводим успех только из HTTP200 |
| CL=1048576 /1048577 | Exact cap разрешён; cap+1 отклонён до body | Native fixture ещё не выполнен reviewer |
| CL=0 | Безопасен по byte budget; пустота/JSON validity — отдельное свойство consumer | Ноль не означает «параметр отсутствует» |
| Leading zeros | Canonical policy reject либо доказанная безопасная parser normalization | Не называем валидные digit bytes HTTP syntax error |
| Signed/nondecimal/overflow | Reject до небезопасного numeric conversion | Parser refusal и ACL refusal различаются |
| Duplicate CL equal /comma-list | Проверить actual normalized header count/value и отсутствие неоднозначности | Parser может нормализовать; raw duplicates нельзя объявить отклонёнными по одному rg/header-count match |
| Conflicting duplicate CL | Внешне fail closed; установить native parser либо ACL stage | Один502 не доказывает конкретную ACL |
| CL+TE /TEidentity /chunked | Fail closed, в том числе после возможной native normalization | Не приписываем HTTP-parser отказ response ACL |
| No CL, close-delimited EOF | Reject unknown length до body | Такой поток не получает бесплатный unlimited path |
| CEgzip/multiple CE | Reject даже при малом compressed CL; forced-identity positive отдельно | Нет обещания cap на распакованный поток без этой границы |
| Declared/actual CL mismatch | Явный native HTTP framing failure/termination и bounded external result | Header guard не проверяет честность upstream и не заменяет streaming counter |
Из этих классов не создавались новые helper/implementation или live fixtures. Это cases для owner следующей bounded native приёмки. Результат каждого negative должен сохранять stage: native HAProxy HTTP parsing, response ACL либо client termination, с рабочими controls до/после. Совместимость header contract для actual search/logs/traces/metadata/PromQL и конкретные deny statuses ещё не приняты.
## Hashes и статус
Existing pre-guard query config при readback: `dd110001bbd7473d5909fbb634e1497fc38655e3db26c1cbc9a7aedcea39e109`. Он не менялся reviewer. Четыре предоставленных local public files побайтно совпали с downloaded public5db. Дополнительные public тексты сохранены только в `/tmp/mtuci-grafana13-browsercap.JUmC1i`; никакой из них не объявлен source deployed da3.
```text
8ed30ebfc7fb0a46db845f058e35be433b6a01f5569954e2c058c4e8dee7dfbc pkg/api/pluginproxy/ds_proxy.go
ae621054de339b8a391408016b8bc3d042143a858420fa2b4d7aaa1c1aaa6b6b pkg/api/pluginproxy/loader.go
39b9e036f9e4ab36994a8589a643acb48df23144d5422caeb513fe1067f806ad pkg/api/pluginproxy/settings.go
653ce521a01d51c4383ca1dfdab9de40269135b45d2d4f27cfa69ff035690396 pkg/util/proxyutil/reverse_proxy.go
9abb8dd3b519bda5d499af201f252dfe2d562cf48ac9f27724dc9c6a9992681b pkg/setting/setting_data_proxy.go
d1eec783b252e4bc0546669ed2fd85e96d0b553be47e25b859d93e676b22382f pkg/infra/httpclient/httpclientprovider/http_client_provider.go
13c6d872b70a716aebf27e01c20a6e856488a7d81daf204a2a3d4e6a7492df18 pkg/services/datasources/service/datasource.go
2279f7f91735c17a5ee4e36b6b4abe3525078ea4f443dfaff37080e875dffb93 pkg/services/datasourceproxy/datasourceproxy.go
41c14ca8e955580156fb45d30c84e9a41242cc34152067ce0238a6e9f68e53df pkg/server/wire_core.go
15571f3e3aef5040edd52cdd0f0866ccde874c03a2cf1367a95ccd8ecc935b3f go.mod
38aff7733b133cba017b7d4f388053b421914cb24d14ee4a70f8beb0cb2b1589 SDK0.297.0/provider.go
84a47bcbd7a138a6c1dc81126f9fbacfe449f8cebb29ed3652ea2a21692f757c SDK0.297.0/response_limit_middleware.go
f22829fddbc0dada355f367ebc26134265f7e4bd4b344dee4c1fe7bbeb7ae6ad SDK0.297.0/max_bytes_reader.go
3454d23c52499463500567fd0c74e5084213c2b48581839ccc79dad95fa737ef deployed commit API422 receipt
480b68d3e07504b0f25d86e362e371ed3dca7e7e8ea2a5bf599b677de2b66032 deployed git-commit API404 receipt
```
Итог: **decision readback complete; actual supported extension UNKNOWN; proposed HAProxy fallback разрешён root, но native guard acceptance pending**. После owner freeze требуется отдельный targeted review actual config и native receipts. Старые source6/7 reports/ZIP и их PASS не переписывались.
@@ -0,0 +1,41 @@
# Independent review: Grafana supplementary histogram request, ВП6
**PASS_HISTOGRAM_REQUEST_FROZEN6.** Подтверждённых незакрытых дефектов в этой ограниченной дельте не найдено. Gateway теперь сохраняет native поведение OpenObserve для отсутствующего `query.size` и целого `0`; в сохранённых авторских native результатах оба запроса возвращают два bucket с суммой `3`. Это проверка замороженных source/receipts, а не самостоятельный запуск браузера или стенда рецензентом.
Рецензент: `/root/sii`, который не писал проверяемый guard. Рассмотрен только immutable snapshot `vp/lab6/.local/review-snapshots/grafana-histogram-b3557010-ee55-40b6-bc07-ec4702f43ecb/`. `MANIFEST.json` имеет SHA256 `04ca06e93e8041d7313a900de8585840136cbd6cb0e5f42cbaea925ecd12a6cf`; его точное множество из шести уникальных путей и каждый raw SHA независимо сверены. Snapshot сообщает `checkedAt=2026-11-16T04:30:30.506Z`. Дальнейшие изменения canonical lab6 этим выводом не покрываются.
| Путь внутри snapshot | Проверенный SHA256 |
| --- | --- |
| `config/openobserve-query.cfg` | `b66161a1f7f6311be605d5a7482a5746d666d8072084c98e11921f0884c877be` |
| `student-tests/grafana-native-histogram.ts` | `c3bf3cef4d7403b19ca9d404ce1c6243cef678350256d615ae9ea15bc1274a94` |
| `student-tests/openobserve-gateway.ts` | `bf8ba05aeb1f35bb3879a93cdeae0b2f20cfef5b5d3e72311ce7fdc59b5c626c` |
| `student-tests/GRAFANA-CASES.md` | `be619640aca5daf27d990f598156c40f01a0a04180d0e30bfe3f757b55ff536f` |
| `evidence/grafana/histogram-native-red.json` | `011554cfbc7bb5ed2807ed173c8e4a3dfe582da4bc6572ead660df83c07365be` |
| `evidence/grafana/histogram-native-green.json` | `a30593005f1aab6c3391b39eae845d36c1867485485bc302556714672e7bbf8a` |
Сначала прочитаны актуальные root `CLAUDE.md`/`WORK.md`, инструкции ВП и применён `test-design`: отделены классы входа, native boundary и oracle результата. Существующие отчёты [source/config decision](review-grafana13-browser-response-limit.md) и [recognized Content-Length response boundary](review-grafana13-response-boundary-native.md) сохранены raw без изменений. Их SHA соответственно `039b89da66153de5281433dce1c81f2f19813bd17a5ffa81f88b424439525afe` и `7bfa21ff33b6c0405370cafea88798f22469974c408f3373fb4b1391396fb4dc`.
Фактическая дельта конфигурации относительно immutable response8 с config SHA `8aa801e8f842fde3cb5fa0badd944ddbd33d50bfda3521b671e779d1962a65f5` состоит только в комментарии и проверке наличия `$.query.size` перед диапазоном. Ранее безусловно требовалось `txn.rows` в `1:1000`. Теперь `search_size_present` вычисляется native `req.body,json_query('$.query.size') -m found`; если поле найдено, `txn.rows`, полученный существующим `json_query(...,'int')`, должен попадать в `0:1000`. Если поле отсутствует, эта конкретная проверка не запрещает запрос. SQL, тело и `size` не переписываются, не дополняются и не ограничиваются через clamp; патч плагина отсутствует.
Путь применения прочитан целиком: authenticated frontend `query` → разрешённый POST `/api/default/_search` → wait-for-body/предел тела → извлечение size/start/end → новая size ACL → прежние start/window guards → backend `observe`. Условия method/path сохранены, изменение не расширяет список URL или методов. Предел тела `65536` байт, положительный start и окно `1..3600000000` микросекунд остались прежними. Настройки соединений, очереди и таймаутов также не изменены; их наличие не означает доказанный верхний предел работы SQL engine.
Весь текст backend `observe` независимо сравнён с прежним immutable8 и совпадает byte-for-byte. Он по-прежнему устанавливает `Accept-Encoding: identity`, проверяет распознанные Content-Length/encoding/framing и возвращает статический HTTP 502 для запрещённого ответа. Поэтому эта request-body дельта не меняет ранее проверенный recognized-CL response guard. Его широкий аудит и native framing тесты повторно не запускались.
Фактическая тестовая цепочка `student-tests/grafana-native-histogram.ts` прочитана, но не исполнена: top-level helper читает приватный account-файл и отправляет native HTTP, поэтому запуск был бы за пределами read-only задания. Helper воспроизводит зафиксированную автором форму supplementary histogram: `SELECT histogram("_timestamp") AS zo_sql_key, count(*) AS zo_sql_num ... GROUP BY zo_sql_key ORDER BY zo_sql_key`, фиксированный trace и четырёхсекундное окно. Базовый объект содержит SQL/start/end/from/sql_mode и **не содержит `size`**. Затем helper отправляет девять вариантов одного тела через native consumer и gateway, сохраняет статус, число bucket и сумму `zo_sql_num`. Это source/readback подтверждение формы запроса; отдельный свежий browser-wire capture рецензентом не выполнялся. Прежняя гипотеза, что исходный browser request явно передавал `size:0`, здесь не используется.
Авторские native receipts независимо разобраны по полям, а не по общему `passed`. В каждом ровно 18 уникальных пар `id/stage`, базовый query одинаков между RED и GREEN и не содержит `size`. GREEN даёт следующие точные результаты:
- Отсутствующий `size` и целый `0`: raw native и gateway HTTP 200, два bucket, сумма `3`.
- Целый `1`: raw native и gateway HTTP 200, один bucket, сумма `1`.
- `-1` и `1001`: raw native HTTP 200, два bucket, сумма `3`; gateway HTTP 400, bucket и сумма `0`.
- `1.5`, строка `"1"`, `null` и объект `{}`: raw native и gateway HTTP 422, bucket и сумма `0`.
В RED для отсутствующего поля и `0` raw native уже давал HTTP 200/два bucket/сумму `3`, но gateway возвращал HTTP 400. Это сохраняет конкретное прежнее несовпадение и его устранение. Для RED `null` и `{}` gateway давал HTTP 400, а GREEN даёт native HTTP 422; обещается отказ invalid запроса, а не прежний слой или прежний статус отказа. Нельзя приписывать все проверки типа новой HAProxy ACL: часть shape-invalid входов отвергает native OpenObserve. Нельзя также выводить точную ветку исполнения исключительно из статуса.
В общем `student-tests/openobserve-gateway.ts` относительно прочитанного раннего snapshot изменён только один case: запрос `size:0` теперь ожидает HTTP 200 вместо HTTP 400 и назван native zero size within finite response/query budgets. Остальные 20 cases и HTTP consumer сохранены. Новый histogram helper отдельно содержит omitted case и восемь других классов. Его автоматический `pass` для invalid означает лишь `status>=400`, а для valid — HTTP 200 и положительные rows/count; поэтому в этом review дополнительно проверены конкретные статусы и `2/3`, `1/1`, `0/0` из receipts. Автоматический флаг сам по себе этих значений не доказывает.
`size` остаётся параметром native запроса, а не универсальным пределом числа возвращённых строк, сложности SQL, памяти engine или объёма ответа. Разрешение omitted/zero намеренно допускает native full aggregation; два bucket в данном сохранённом результате не означают общий предел в два bucket. Конечные body/window/response/connection/queue controls сохранены, но здесь не измерялись скорость, нагрузка или произвольный SQL. Проверены именно девять перечисленных классов; значение `1000` по исходному диапазону разрешено, но отдельного нового native результата для `1000` в этих двух receipts нет.
Независимая локальная проверка выполнялась только над сохранёнными байтами командой `bun /tmp/mtuci-histogram-review-b3557010.ts`, exit 0. Её простой oracle отдельно сверил manifest/membership/шесть SHA, 18 уникальных пар каждого receipt, девять точных GREEN status/rows/count, RED missing/zero несовпадение, byte equality response backend и неизменность двух старых отчётов. Она не импортировала operational helpers, не читала credentials и не выполняла HTTP, браузер, контейнеры, stand или production entrypoint.
Вывод относится к source и авторским native receipts immutable6. Полная загрузка UI, end-to-end browser histogram после этой дельты, весь набор 17 бизнес-метрик, alerts, свежий volume/startup и будущий combined freeze этим review не объявляются проверенными. Предыдущие response8/source ограничения сохраняются. Дополнительных implementation изменений для закрытия рассмотренной request-body compatibility не требуется.
@@ -0,0 +1,58 @@
# PASS_RECOGNIZED_CL_FROZEN8
Независимый read-only review `/root/sii` завершён для **immutable8 recognized Content-Length response boundary**. Открытых подтверждённых findings в этом узком scope нет. Это не whole-current-canonical/Grafana compatibility PASS: последующая histogram request-body дельта с отсутствующим `size`, UI,17 business metrics, links и alert transitions сюда не входят.
## Lease и source delta
Snapshot: `/Users/rey/mtuci/vp/lab6/.local/review-snapshots/grafana-cap-a9cf68a8-c4c9-4f30-a417-f36fd8f4c3a6/`.
MANIFEST.json rawSHA256 `b999a3cc15de4285b7df6a3f16aba26f98709e283974c623326653a47f1377c7`: проверены membership8unique paths и rawSHA всех8 до чтения. Config rawSHA256 `8aa801e8f842fde3cb5fa0badd944ddbd33d50bfda3521b671e779d1962a65f5`. Байтное сравнение с прежним dd110 config показало только вставку response block в backend observe: прежние auth/method/path/body/time request guards сохранены. Проверяется snapshot, не changing canonical source.
Source заменяет Accept-Encoding на identity для запроса к собственному OO и до выдачи response body проверяет: отсутствие любого Content-Encoding/Transfer-Encoding, один full Content-Length, canonical decimal0..7digits, число≤1048576. При отказе возвращает502/JSON `query_response_boundary`, без SQL/credentials/body данных. Ограниченный синтаксис перед numeric predicate закрывает missing/invalid/overflow inputs независимо от permissive conversion. Leading zeros и equal duplicate CL могут быть нормализованы native HTTP parser до ACL; raw rejection таких представлений не заявляется.
## Native observations — выполнены автором
Reviewer не запускал native fixture, процессы, браузер, credentials или стенд. Независимо прочитаны source и замороженные receipts; production force-recreate собственного gateway и привязка same Grafana path предоставлены root/автором. Fixture receipt явно связывает config8aa и pinned HAProxy image `sha256:1c3568e520453cc8ba98c39501febcf450429c80e6cc27ecad779961d76e597c`.
Fixture использует exact config с заменой только bind/upstream на loopback synthetic endpoints, fixture-only userlist и диагностическими response headers. Production upstream исключён защитной проверкой.14 cases и все14 origin IDs присутствуют; все15 observed requests, включая readiness, имеют Accept-Encoding identity. Cleanup=`stopped`, passed=true. Reviewer fixture не исполнял.
| Класс | Native результат | Подтверждённая граница |
|---|---|---|
| Small /exact-cap |200,11байт /1048576байт; visible CL/count совпадают с body | Exact1MiB разрешён полностью |
| Cap+1 |502/35байт, ACL marker | Response policy, не silently truncated data |
| CEgzip /CEidentity /empty CE |502/35байт, ACL marker | Conservative encoding denial |
| Chunked /EOF-delimited |502/35байт, ACL marker | Aggregate policy отвергает unknown/encoded framing; отдельный сработавший predicate не приписывается |
| Equal duplicate CL |200/11байт, visible CL11/count1 | Native normalized bounded acceptance, не raw duplicate rejection |
| Leading00011 |200/11байт, visible CL11/count1 | Native normalized bounded acceptance |
| Conflicting /invalid /overflow /negative CL |502/107байт, без ACL marker и observed CL headers | Native HTTP reject без ACL observability; конкретный parser method не установлен |
Source fixture называет последний класс `native-http-parser-before-acl`, выводя его из отсутствия marker. В8 нет твёрдой termination-log привязки; независимый вывод ограничен наблюдаемым non-ACL-marker HTTP reject. Все значения ограничены, но конкретной ACL или parser method этот502 не приписывается. Непроверенные в14 raw combinations вроде CL+TE не объявляются отдельным native PASS.
`response-boundary-leading-zero-old-oracle.json` сохраняет FAIL только для leading-zero **при том же config8aa**. Это correction ошибочного oracle, а не code RED→GREEN. Новый oracle при допустимом200 требует exact visible CL/count/body и проверяет identity; он не заменяет старый FAIL успешным результатом и не объявляет универсальный raw rejection.
## Same-path Grafana proof и controls
Два browser receipts имеют те же пять case identities. До guard frontend wide SQL repeat вернул2097625байт/200, complete validJSON; plugin SDK backend отдельно отклонил wide result400/body-too-large. После guard тот же frontend case получил502/35байт, complete validJSON; это соответствует статическому source response marker. Post-guard SDK wide тоже400, но уже с upstream boundary error: **старый независимый SDK limiter proof и новое upstream preemption — разные observations**.
Ordinary frontend logs сохранены:200/hit1/readError=false. Prom transport control сохранён:200, однострочные time/number field arrays, complete/parsed без read error. Это numeric-schema transport control, **не проверка17 finite business metric values**. Browser-side receipt не заменяет UI/alert acceptance.21 native query/metadata/search/Prom/request-negative controls имеют expected=actual/pass=true; конкретное содержимое каждого HTTP200 из этого status-only receipt отдельно не доказывается.
## Resource/security scope
Считается recognized normalized CL на собственном OO hop, с native HTTP framing. Это не универсальный streaming/decompression byte counter, не проверка честности произвольного upstream, не returned-row/SQL-work cap и не гарантия browser/process RAM. Upstream может уже построить большой ответ до отказа gateway. Client/server10s — inactivity timeouts, здесь не заявлен абсолютный10s transfer deadline.
Forced identity, deny CE/TE/unknown CL и сохранённые auth/method/path guards согласованы с разрешённым минимальным fallback. Наличие подходящей штатной extension для deployed Grafana commit остаётся UNKNOWN, как в неизменённом [advisory](review-grafana13-browser-response-limit.md); public tag не переименован в deployed source proof. OTLP ingest не менялся.
## Frozen hashes
```text
8aa801e8f842fde3cb5fa0badd944ddbd33d50bfda3521b671e779d1962a65f5 config/openobserve-query.cfg
643e58112cac9a64c347e37773df68af71b01419667b2d0e7a06be6808c6184e student-tests/grafana-response-boundary.ts
b3003b2aec3b7db1b691cc86b1b5b3cd14f15ba8da968b57eab3ea0c4e8e4d3e student-tests/GRAFANA-CASES.md
d961bdc510d00174df16a8aecf242afab85e1ef0292b446793d59dcb273dd111 evidence/grafana/response-boundary-green.json
19459b5cf889fddc44243a9dc47859286f2775c99b6b46c8606bdb8966f6d11b evidence/grafana/response-boundary-leading-zero-old-oracle.json
2a9ae2e48cdd07b491de0c9dcf0533178283a307c85b9eda8c8b0a7d2b5ba7a7 evidence/grafana/browser-cap-red-sdk-cap-green.json
f50a34c53d413868dd1f839a15388e7a8f7a55349ccec06cd4839899f782bc8d evidence/grafana/browser-cap-green.json
9df677633531ffafaaed62ead2bb69719e8709ab1cd2fcfde6e485ea86b0063d evidence/grafana/query-boundary-positive-controls.json
```
Итог: **PASS только для immutable8/8aa recognized-response boundary и приведённых owner-native observations**. Hist request omitted-size/current future policy, full Grafana UI/metrics/links/alerts и whole runtime не закрываются. Source/config/fixture и старые reports/ZIP reviewer не менял; повторных runs/аудитов не было.
+124
View File
@@ -0,0 +1,124 @@
# Независимое bounded source review запуска Grafana13.3.1, ВП6
Reviewer `/root/pi`, 16.11.2026. **BOUNDED_STARTUP16_SOURCE_REVIEW_COMPLETE.** В рассмотренной launch/credential/scheduler цепочке новых подтверждённых secrets/lifecycle дефектов не найдено. Известная отдельная коррекция verification-helper по dashboard/rule content остаётся открытой до следующего delta. Actual cold-start600s receipt reviewer ещё не получил; whole Grafana UI/alerts и будущий изменённый source этим отчётом не закрываются.
Точный immutable snapshot: `/Users/rey/mtuci/vp/lab6/.local/review-snapshots/grafana-startup-87bf7f5e-673d-44cb-8654-ccce4731fa7c`, MANIFEST.json raw SHA `0484d0ad16c970dfaddb640ba51db15bd11cd13936729376ba426b47e775e3b1`. Собственный read-only reader `verify-startup16.ts` проверил16 regular paths, отсутствие пропусков/лишних/дубликатов и каждый SHA; первая сверка canonical16 — без drift. Источники прошлых113/16 startup не переписывались.
Прочитаны текущие root CLAUDE/WORK, относящиеся правила VP CLAUDE и все16 source/test/cases/receipts snapshot. Scope: actual launch chain, pinned cache/plugin preflight, archive-before-publish Grafana owner, native scheduler interval contract и bounded readiness. Политика OO account provisioning уже закрыта отдельным review и не переаудируется; новое shell up.sh лишь запускает TS/Compose шаги. Разрешение до600МБ относится к image/plugin; оно не подменяет actual native results и не расширяется на Bao/SII.
## Случаи до дополнительных pure probes
| Ситуация | Проверяемое поведение |
|---|---|
| Первый secret | Сначала успешный archive/roundtrip, затем runtime publish; ошибка архива не публикует secret |
| Существующий secret | Не generate/rotate/rewrite; archive failure/read failure остаются ошибкой без fallback |
| Неверная форма | Empty/15/129 chars, пробел/NUL отклонены до archive/publish;16/128 printable ASCII приняты |
| Publish failure | Сохраняется исключение и отсутствие повторного publish; archive уже завершён |
| Native group interval |1s/0s/nonmultiple запрещены;10s/20s приняты при base10s |
| Readiness/process boundary | Source проверяет actual HTTP/database/version с конечным600s budget; production entrypoints не импортируются и не получают optional fake arguments |
Независимые tests вызывают только actual exported credential/scheduler factories с обязательными портами; stores — объекты в памяти. Никаких credential reads, crypto subprocess, Docker, HTTP, clocks/sleeps стенда или файловых side effects в тестах нет. Production CLI и wait/preflight entrypoints читаются статически.
## Exact actual call chain
17-строчный `up.sh` использует `set -eu`, определяет root относительно себя и вызывает: image/plugin/scheduler preflight `--grafana` → application bootstrap → Grafana credential bootstrap → OpenObserve owner bootstrap → build application → pinned own Compose stores/OO → bounded OO readiness → strict OO service-account provisioning → core/Collector/query → обе API readiness → отдельный Grafana profile → Grafana readiness. Shell содержит launch steps, не реализацию auth/protocol. Используемый existing Compose wrapper ранее проверен и закрепляет абсолютный manifest/project; его новая копия в16 не выдаётся за изменённый или заново аудированный исходник.
Preflight проверяет три точных cache aliases и `.Id|Architecture|Os`, `pull_policy/--pull never` не позволяют неявную загрузку. Для plugin проверяются SHA `plugin.json`, `module.js`, `gpx_openobserve_linux_amd64`; это проверка конкретных распакованных executable/frontend bytes, не новый download или повторное доказательство release ZIP provenance. Последние отдельно относятся к разрешённой загрузке image/plugin и будущему whole native receipt. Только unsigned id openobserve разрешён в Compose; Grafana подключена к выделенной query network, query principal из приватного generated env не является OO root.
На frozen16 группа имеет interval10s и пять исходных UIDs: vp6-high-error, vp6-fast-burn, vp6-queue-lag, vp6-ready-burn, vp6-observer-down. Actual preflight вызывает validator с native base10s, отвергает нулевые/nonmultiple/1s intervals. Этот срез **не** реализует раннюю предложенную min_interval1s настройку: native Grafana13.3.1 BaseInterval chain требует допустимых10s multiples. Старая причина crash не переименована в auth/plugin ошибку или readiness timeout.
`wait-grafana.ts` опрашивает фиксированный loopback28306 `/api/health`, требует HTTP200, database=ok и version13.3.1. Основной deadline600s, request timeout2s и pause500ms; незавершённый request/pause могут закончиться немного позже целевого deadline. Это health readiness, не проверка всех plugin/dashboard/rule capabilities. Reader сам не запускает/останавливает процессы; `up.sh` ошибку не поглощает. Сам up не удаляет существующие volumes и не обещает rollback всего проекта при ошибке: teardown owned acceptance stand остаётся обязанностью вызывающего workflow и требует отдельного receipt. Никакие process-control entrypoints reviewer не исполнял.
## Credential shape, archive ordering и границы секретов
Actual bootstrap entrypoint Linux-only, файл runtime secret находится в `.local/grafana_password`. Он читает существующую строку и только ENOENT означает отсутствие; другие read errors проходят ошибкой, не становятся новым secret. First-init генерирует printable ASCII `Aa1!` +2crypto UUID, укладывающиеся в16..128 shape. Существующее значение не ротируется и runtime file не переписывается. Existing read использует trim; авторский формат generated files не содержит окружающих пробелов.
В mandatory archive port перед runtime publication создаётся отдельный0700 каталог, key через существующий `age-keygen`, envelope через age stdin; plaintext не включён в argv, shell, stdout или config. Envelope записывается wx0600, decrypt roundtrip сравнивается с исходными bytes; mismatch или ненулевой crypto exit отклоняет публикацию. Существующий runtime password тоже должен пройти archive/roundtrip, failure не запускает generate/publish fallback. Ключ архива остаётся рядом с ciphertext в приватном каталоге; это не утверждение об off-host key separation или внешнем encrypted recovery store.
Publish runtime file использует wx, mode0644 нужен nonroot Compose secret consumer, приватность host обеспечивает parent0700. Конкурирующий first-init не получает права перезаписать уже опубликованный файл: второй wx завершается ошибкой; автоматическая rotation/retry не выполняется. Archive/staged private данные могут остаться при отказе для recovery, не выдаются за успешный init. В native файловую систему/ключи reviewer не обращался и permissions живых файлов не измерял.
Поддерживающие build-context guards из прежнего source113 прочитаны без нового аудита: `.dockerignore` исключает `**/.local`, `**/.env`, secrets и caches; `.gitignore` исключает `.local/`. Application Dockerfile копирует только backend и готовые binaries, Grafana plugin/password приходят runtime bind/secret вне image build. Их raw SHA при чтении: dockerignore62eeb542…, gitignore385e0e7c…, Dockerfile40095fcc…. Никакой private credential не оказался новым source input этого review.
## Выполненные pure проверки
На точном frozen16 в Bun1.4.4 выполнены:
- `bun test <snapshot>/student-tests/grafana-credential.test.ts <snapshot>/student-tests/grafana-scheduler.test.ts` — exit0, **6 PASS/12expect**. Реальный credential factory и validator; production entrypoints не импортируются.
- `bun test /tmp/mtuci-oo6-final-review.gjIwTj/grafana-credential-startup.test.ts` — exit0, **9 PASS/31expect**. Независимо проверены existing archive/read failure без generation/publication fallback; persisted lengths16/128 приняты,15/129/empty/space/NUL отклонены до archive, без перезаписи. SHA fixture `e66114e88283e83bca0ade2a5925357f2df9e243fb37bb2b70640d6d5eff67ab`.
Сохранённые авторские credential RED0pass/3fail и GREEN3pass/7expect прочитаны как история. Они не объявлены исполнением reviewer. Тесты не реализуют age криптографию в fake: они подтверждают policy/orchestration на required port; actual encrypt/decrypt остаётся в native CLI evidence. Publication failure непосредственно не инжектировался, но source не перехватывает его и не имеет повторного publish path.
## GRAFANA-START-REVIEW-1: содержимое metadata preflight
Включённый `student-tests/grafana-preflight.ts` для dashboard/rules сохраняет UID/panel count/rule UIDs, но его pass для этих стадий требует только HTTP200. Реальный ответ `[]` от alert-rules endpoint при отсутствии provisioning мог бы дать helper PASS; dashboard shape/wrongUID также не обязательны для Boolean pass. Это source-confirmed coverage defect именно verification helper, не утверждение об отсутствии текущих объектов. Root подтвердил, что captured18 panels/5 rules реальны; эти наблюдения не отозваны.
Root принял адресную коррекцию: actual reader должен сравнивать dashboard UID/panelset и пять rule UIDs с configured expected, с pure empty/wrongUID RED→GREEN. Новая реализация не входит в0484…16, не читалась и не получила этим report PASS. Сам helper не входит в launch up.sh; health wait не называется полноценной semantic provisioning acceptance. Native metadata reader имеет собственные finite retries и response threshold; это также не proof user-query response cap.
## Доступные native факты и что ещё не установлено
Snapshot receipt `evidence/grafana/current-up-green.json`, SHA `1dde382688fde124091407953403bdb82478a5b4ccc5284baa0385e2cab42825`, сообщает author current warm up passed=true, exit0, checkedAt2026-11-16T04:34:14.799Z на isolated lab6 root. Reviewer прочитал только allowlisted status metadata, приватный out не печатал. Это авторский warm startup, не доказательство нового empty-volume cold run.
По task checkpoint root: first fresh-project rename guard failure сохранён; следующий120s deadline закончился на641/646 успешных migrations примерно119,57s/errors0 и cleanup0; новый600s run ещё выполнялся при выдаче задания. Самих новых cold receipts reviewer не получил и не утверждает cold PASS. Missing listener при коротком readiness timeout не принят за crash cause. Текущий срок600s остаётся проверяемым бюджетом, не измеренным cold-start результатом.
Whole trace rendering/log↔trace/17values/incidents/alerts/response-policy acceptance принадлежит отдельному `review-openobserve-grafana-lab6.md` и здесь не закрывается. Загрузки, модели/Bao, чужие стенды и архивы этим review не изменялись.
## Конечные hashes и canonical drift
Immutable16 повторно проверен после tests: exact membership/SHA PASS. Первая заключительная сверка нашла14/16 canonical matches, а последняя после записи отчёта — **12/16**: автор изменил `scripts/preflight-openobserve-images.ts`, `scripts/lib/grafana-scheduler.ts`, `student-tests/grafana-preflight.ts` и `evidence/grafana/GRAFANA-START-CASES.md`. Они не называются проверенными final bytes и требуют exact последующего delta; появление новой metadata-helper реализации само по себе не закрывает замечание. Старые final113/source/архивы и прежние отчёты reviewer не менял.
Последние прочитанные SHA current changed logic, без чтения нового implementation: preflight-images `227eccbce60abffde448beab749e7eaabf73ad8337dbd3317a089701ee8c1637`, scheduler `a1366acfee0a5f27b5aa893a8019131d04b8715eb17ef11c264442a3029fa9d7`, metadata-preflight `197750305e59d1f78af70cfdeeccfd7b3c8d8dce619e5a1ceee4ed96cf4105f2`. Они записаны для provenance drift, не вместо будущего freeze/review.
```text
0484d0ad16c970dfaddb640ba51db15bd11cd13936729376ba426b47e775e3b1 MANIFEST.json
f65c5819ff590eff79f4da52e4ca2512ebd2989b93d2902c1e83d33bf887e847 scripts/bootstrap-grafana.ts
ae5bffbc875a644da52096a4c5c12519d143df41eb1179ac56841232497e22a4 scripts/lib/grafana-credential.ts
e434a47ded97ab02eb8ec8939ab1f3d55e43700c5b3b7a7395743a19194460ce scripts/up.sh
0f4be1395bcdda9b6c48600470d815653d70756a7b338666e74a9333a1994d4e scripts/wait-grafana.ts
eb76e952fafd5c77b850f3bdf4d8edc771952df5d9358456f5cb94f150098885 scripts/preflight-openobserve-images.ts (snapshot)
3a5f6e594c7b59d213cc3efceae4f260b11ff857f659ad0a52184548ef0a50d8 scripts/lib/grafana-scheduler.ts (snapshot)
0a26dedd856856ac19b841cf2730474b19fc7c6f57e5c592910ef3b8e7696e6f student-tests/grafana-preflight.ts (known correction pending)
a5147c4b94fbdaf1a25d62090bda256096e9d5945cf7ea2feda64089d4fc6b6c compose.yaml
b4ae7ff647f294965277a81f6dd050dd98a733a222583ab860c29ce897dc1234 config/grafana/provisioning/alerting/rules.yaml
```
## Additive provisioning/type delta10: замечание закрыто в указанной границе
**GRAFANA-START-REVIEW-1 CLOSED** для strict metadata identity/content guard. Это дополнение уточняет прежние pending записи, не переписывает исходный0484…16 manifest и не принимает целиком дальнейший Grafana UI/source.
Точная pre-delta копия данного отчёта сохранена в `/tmp/mtuci-oo6-final-review.gjIwTj/startup-before-provisioning-510b2dce.md`, SHA `510b2dce4e2cdf961c4ce45bae11bb4353ff90ae733eb0acde7cabe39e1905cd`.
Новый immutable snapshot `/Users/rey/mtuci/vp/lab6/.local/review-snapshots/grafana-provisioning-4b3571f4-7a37-4577-8a1c-1b7907546830`, MANIFEST SHA `9c699965290659e7cd34b1facb0a6630771fe27e4613f60c536c02e7415a5fb0`, независимо проверен своим read-only `verify-provisioning10.ts`: exact10 regular paths без лишних/пропусков/дубликатов, все raw SHA совпали. Все10 canonical paths также совпали в начальном и заключительном readback. Никаких повторных16/source113 checks, native process/HTTP/credential reads или новых stand runs не было.
### Actual validator → operational reader
Новая pure library `scripts/lib/grafana-provisioning.ts` SHA `ac9df83b5f820c97ad99ade9d0531665de81a5d983c657651e9be388375c8b99` проверяет:
- точный dashboard UID, непустой configured panel array, равное число panels, positive safe-integer IDs и непустые titles;
- отсутствие дубликатов ID и совпадение каждой пары ID/title с configured set, без требования случайного порядка ответа;
- точное непустое множество rule UIDs, равную длину и отсутствие дубликатов как в expected, так и в actual.
Actual `student-tests/grafana-preflight.ts` SHA `197750305e59d1f78af70cfdeeccfd7b3c8d8dce619e5a1ceee4ed96cf4105f2` действительно импортирует эти функции, читает expected dashboard и rule UIDs из committed provisioning, а затем требует **HTTP200 && contentMatches**. Server проверяет одновременно version13.3.1 и database=ok; datasource health требует status=OK; dashboard/rules вызывают новые guards. Empty/invalid JSON, wrong UID, missing/duplicate/wrong panels/rules больше не становятся helper PASS по одному статусу200.
Reader Linux-only, секрет читает только в operational path; `--check` выходит до credentials/network. Reviewer этот entrypoint не запускал и не импортировал. Actual response body собирается с2МиБ threshold до JSON decode и сохраняется wx0600 под отдельным0700 output. Это локальная граница metadata reader, не proof user-query/browser response-cap. Успешное совпадение IDs/titles/UIDs не доказывает совпадения всех query expressions, semantic metric values или alert firing; они остаются другой приёмкой.
### Actual pure RED/GREEN и native содержание
`bun test <snapshot>/student-tests/grafana-provisioning.test.ts` на Bun1.4.4 reviewer выполнил непосредственно: exit0, **3 PASS/11expect**. Это actual exported guards, без повторения реализации в тесте и без I/O. Три группы случаев проверяют корректный set, неверный dashboard и отсутствующие/дублированные/чужие rule UIDs. Сохранённый авторский RED1pass/2fail/4expect действительно содержит false ожидание с received=true для ошибочных payloads; GREEN3pass/11expect сохранён отдельно. RED reviewer не исполнял повторно: старой factory extraction в этом snapshot нет.
Native `provisioning-strict-native-green.json` SHA `82ccbe34bb1c18d14e5f3b0c99a423aa9da16497c2a4965747cc1b38b911c919`, checkedAt2026-11-16T04:54:50.489Z, содержит пять стадий200/contentMatches=true: server13.3.1/databaseok; metrics-sourceOK; plugin-sourceOK; dashboardUIDmessenger/18 panels; пять точных rule UIDs vp6-high-error, vp6-fast-burn, vp6-queue-lag, vp6-ready-burn, vp6-observer-down. Expected IDs1–18 и expected rule set записаны в receipt. Результат получен авторским operational reader; его реальная цепочка вызова строгих guards прочитана. Reviewer не читал приватные raw payloads и не утверждает, что самостоятельно извлёк их titles из живой Grafana.
Ранее captured18/5 не отозваны: исправлялась полнота helper guard, а не доказанное отсутствие provisioning. Подтверждённых остаточных source findings в этом delta не найдено.
### Два drift paths: только тип и комментарий
В image preflight eb76…→`227eccbce60abffde448beab749e7eaabf73ad8337dbd3317a089701ee8c1637` добавлена только YAML type assertion `{groups:{interval:string}[]}`. Scheduler3a5f…→`a1366acfee0a5f27b5aa893a8019131d04b8715eb17ef11c264442a3029fa9d7` меняет только комментарий: public-tag source — reference, deployed reported commit отличается; native1s rejection/10s acceptance указаны как фактическое основание.
Raw diff обоих пар проверен. Reviewer также независимо сравнил emitted JS через Bun1.4.4 `new Bun.Transpiler({loader:"ts"})`: обе old/new пары byte-identical. При этих явно указанных options SHA emitted JS соответственно `ffd1915a9f6ab3c83b0e28ea9e974735393af1c325de60f8911ddcccffcd5061` и `9cb8b107c327efe11ae9f6117d3389547cb0303339d3862287bbde923ebd1709`. Авторский `startup-type-delta.json` SHA `82446bf6f4395055c421939f25b7eac0ce0976ede75853b11888ed142a60e459` также сохраняет equal old/new JS при своём transpiler invocation; его emitted hashes не подменяются нашими. Operational preflight при таком сравнении не выполнялся. Эти изменения не являются новым runtime/scheduler acceptance.
### Отдельный fresh receipt вне delta10
Прочитаны только allowlisted public status поля текущего `vp/lab6/evidence/grafana/fresh-volume-green.json`, SHA `e3f1de4693bdd6de103245ad5971e3ba2ed158c6e8333b6d9162ab13ddde2361`: checkedAt2026-11-16T04:48:17.259Z, project `mtuci-vp6-fresh-adf8b95f`, passed=true, восемь command exits0, ownFreshRunningContainers0/canonicalRunningContainers0, volumes сохранены. Это author-native receipt вне10-path manifest, не новое исполнение reviewer и не raw source binding всего fresh command этим обзором. Root описывает его объём как full up/public checks/smoke/all3/GF18/5/backend95/stop0; детали native commands здесь заново не аудировались.
Старые `fresh-volume-identity-guard-fail.json` SHA `fe0168d712d0ea7af2a98eadc01146faeb69a9e6e2b07c32c4a4b95213ad4e21` и `fresh-volume-deadline-red.json` SHA `5ef744fa524b56e55473cce94c6021989df352cc694db324a499ffb624225bd9` существуют отдельно с passed=false и ownFreshRunningContainers0; они не переименованы в GREEN. Fresh result04:48 и strict metadata readback04:54 — разные этапы: поздний strict reader не заявляется автоматически исполненным внутри прежнего fresh run.
Сообщённые root два whole-browser FAIL и icon/internal fetch ERR_ABORTED не закрываются этой startup correction; exact trigger здесь не установлен. Функциональные3/3 и console0 из другого browser scope не превращаются в network-clean или full UI PASS. Финальный whole source/UI/incident freeze ожидается отдельно. Ни native response boundary, ни metrics/trace navigation/alerts, ни итоговая упаковка и оценка этим targeted closure не принимаются.
@@ -0,0 +1,11 @@
bun test v1.4.4 (38afee6c8)
student-tests/grafana-scheduler.test.ts:
(pass) rejects actual provisioning failure1s under native13.3.1 scheduler10s [0.59ms]
(pass) rejects zero and nonmultiple intervals before native startup [0.05ms]
(pass) accepts native10s and its20s multiple [0.03ms]
3 pass
0 fail
5 expect() calls
Ran 3 tests across 1 file. [4.00ms]
+30
View File
@@ -0,0 +1,30 @@
bun test v1.4.4 (38afee6c8)
student-tests/grafana-scheduler.test.ts:
1 | import{test,expect}from'bun:test';import{validateGrafanaRuleIntervals}from'../scripts/lib/grafana-scheduler';
2 | test('rejects actual provisioning failure1s under native13.3.1 scheduler10s',()=>{expect(()=>validateGrafanaRuleIntervals([{interval:'1s'}],10)).toThrow();});
^
error: expect(received).toThrow()
Received function did not throw
Received value: undefined
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-scheduler.test.ts:2:146)
(fail) rejects actual provisioning failure1s under native13.3.1 scheduler10s [0.39ms]
1 | import{test,expect}from'bun:test';import{validateGrafanaRuleIntervals}from'../scripts/lib/grafana-scheduler';
2 | test('rejects actual provisioning failure1s under native13.3.1 scheduler10s',()=>{expect(()=>validateGrafanaRuleIntervals([{interval:'1s'}],10)).toThrow();});
3 | test('rejects zero and nonmultiple intervals before native startup',()=>{for(const interval of['0s','15s','unknown'])expect(()=>validateGrafanaRuleIntervals([{interval}],10)).toThrow();});
^
error: expect(received).toThrow()
Received function did not throw
Received value: undefined
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/grafana-scheduler.test.ts:3:176)
(fail) rejects zero and nonmultiple intervals before native startup [0.08ms]
(pass) accepts native10s and its20s multiple [0.01ms]
1 pass
2 fail
3 expect() calls
Ran 3 tests across 1 file. [14.00ms]
+22
View File
@@ -0,0 +1,22 @@
{
"checkedAt": "2026-11-16T04:52:29.011Z",
"scope": "Additive type/comment delta after immutable startup16; no runtime semantics change",
"changes": [
{
"path": "scripts/preflight-openobserve-images.ts",
"beforeSHA256": "eb76e952fafd5c77b850f3bdf4d8edc771952df5d9358456f5cb94f150098885",
"afterSHA256": "227eccbce60abffde448beab749e7eaabf73ad8337dbd3317a089701ee8c1637",
"transpiledBeforeSHA256": "3cb090a851032f2329fa1666812dfe641af1e4fcc65fb9ee3dedd42097dc6b77",
"transpiledAfterSHA256": "3cb090a851032f2329fa1666812dfe641af1e4fcc65fb9ee3dedd42097dc6b77",
"sameJavaScript": true
},
{
"path": "scripts/lib/grafana-scheduler.ts",
"beforeSHA256": "3a5f6e594c7b59d213cc3efceae4f260b11ff857f659ad0a52184548ef0a50d8",
"afterSHA256": "a1366acfee0a5f27b5aa893a8019131d04b8715eb17ef11c264442a3029fa9d7",
"transpiledBeforeSHA256": "1630c9617f0bd8149dfd6f2d5b4bb13c880d1717a0fc3cee5a94d98d17720f5c",
"transpiledAfterSHA256": "1630c9617f0bd8149dfd6f2d5b4bb13c880d1717a0fc3cee5a94d98d17720f5c",
"sameJavaScript": true
}
]
}
@@ -0,0 +1 @@
import{writeFile}from'node:fs/promises';import{resolve}from'node:path';const root='/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6';function run(args:string[],allowed=[0]){const r=Bun.spawnSync(args,{stdout:'pipe',stderr:'pipe'});if(!allowed.includes(r.exitCode))throw Error('Read-only teardown verification failed');return new TextDecoder().decode(r.stdout)}const containers=run(['docker','ps','--format','{{.ID}} {{.Names}}']).trim().split('\n').filter(Boolean).map(l=>{const[id,name]=l.split(' ');return{id,name}}).filter(c=>c.name.startsWith('mtuci-vp6-')||c.name.startsWith('vp6-'));const ports=new Set([28206,28306,28406,28706,28806,28906,29506,29606]),listeners=run(['ss','-ltnH']).trim().split('\n').filter(Boolean).map(l=>l.trim().split(/\s+/)[3]).filter(address=>ports.has(Number(address?.split(':').at(-1))));const browser=run(['pgrep','-af','[c]hromium.*--user-data-dir=/tmp/vp6-browser-31251471/'],[0,1]).trim().split('\n').filter(Boolean);const result={checkedAt:new Date().toISOString(),ownRunningContainers:containers,ownListeningEndpoints:listeners,ownBrowserProcessCount:browser.length,preserved:'All existing/current/fresh volumes, private receipts, encrypted identities and verified caches retained; shared7/runner untouched',passed:!containers.length&&!listeners.length&&!browser.length};const out=resolve(root,'.local/final-stop-'+crypto.randomUUID()+'.json');await writeFile(out,JSON.stringify(result,null,2)+'\n',{flag:'wx',mode:0o600});console.log(JSON.stringify({receipt:out,...result}));if(!result.passed)process.exitCode=1;
+209
View File
@@ -0,0 +1,209 @@
Skip to main content
Grafana
Bookmarks
Starred
Dashboards
Explore
Alerting
Connections
Administration
Explore
OpenObserve Logs and Traces
Search...
ctrl+k
Explore
Outline
Split
Add
Queries
Traces
A
(OpenObserve Logs and Traces)
Logs
Traces
Service Map
Organization
Trace stream
Service Name
=
Span Name
=
Status
=
Duration
Tags
Run query
Results are listed as a table — open any trace to inspect its spans.
SQL
Reset to generated SQL
使用 str_match(field, '123') 比 LIKE '%123%' 更快;参考文档:https://openobserve.ai/docs/reference/sql-functions/
1
SELECT * FROM "messenger" WHERE "trace_id" = '33513303fdb8cdefbd4ff24c8394f3d3' ORDER BY "_timestamp" ASC
Add query
Query history
Query inspector
Trace
messenger-api
POST /api/v1/chats/{chat_id}/attachments
Trace ID
33513303fdb8cdefbd4ff24c8394f3d3
Start time
2026-11-16 02:19:51.437
(4 hours ago)
Duration
1.39s
Services
2
Spans
42
Overview
0μs
346.98ms
693.96ms
1.04s
1.39s
Filters
Critical path
Errors
High latency
42 spans
Show all spans
Service & Operation
0μs
346.98ms
693.96ms
1.04s
1.39s
messenger-api POST /api/v1/chats/{chat_id}/attachments (188.03ms)
188.03ms
-
postgres.acquire (5.63μs)
5.63μs
-
postgres.query (95.74μs)
95.74μs
-
postgres.acquire (4.86μs)
4.86μs
-
postgres.query (121.34μs)
121.34μs
-
postgres.acquire (6.14μs)
6.14μs
-
postgres.query (125.95μs)
125.95μs
-
postgres.acquire (45.31μs)
45.31μs
-
postgres.query (51.71μs)
51.71μs
-
postgres.query (286.98μs)
286.98μs
-
postgres.query (592.13μs)
592.13μs
-
postgres.query (9.33ms)
9.33ms
-
s3.put (155.53ms)
155.53ms
-
postgres.acquire (16.38μs)
16.38μs
-
postgres.query (124.93μs)
124.93μs
-
postgres.query (630.78μs)
630.78μs
-
postgres.query (322.82μs)
322.82μs
-
postgres.query (18.41ms)
18.41ms
messenger-worker attachment.publish (68.13ms)
68.13ms
attachment.process (1.15s)
1.15s
-
postgres.acquire (13.06μs)
13.06μs
-
postgres.query (123.39μs)
123.39μs
-
postgres.query (27.95ms)
27.95ms
-
postgres.query (306.18μs)
306.18μs
-
postgres.query (7.87ms)
7.87ms
-
s3.get (77.66ms)
77.66ms
-
s3.put (138.76ms)
138.76ms
-
s3.put (117.35ms)
117.35ms
-
s3.put (159.76ms)
159.76ms
-
s3.put (201.5ms)
201.5ms
-
postgres.acquire (14.85μs)
14.85μs
-
postgres.query (119.3μs)
119.3μs
-
postgres.query (425.22μs)
425.22μs
-
postgres.query (140.03μs)
140.03μs
-
postgres.query (36.57ms)
36.57ms
-
postgres.acquire (5.63μs)
5.63μs
-
postgres.query (8.21ms)
8.21ms
-
s3.stat (737.54μs)
737.54μs
-
postgres.acquire (15.62μs)
15.62μs
-
postgres.query (97.45ms)
97.45ms
-
postgres.acquire (7.94μs)
7.94μs
-
postgres.query (27.96ms)
27.96ms
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

@@ -0,0 +1,399 @@
{
"checkedAt": "2026-11-16T03:44:20.944Z",
"scope": "actual authenticated native Grafana Explore renderer and browser HTTP result, historical retained trace; not all42rows visually present in top screenshot",
"traceId": "33513303fdb8cdefbd4ff24c8394f3d3",
"spans": 42,
"uniqueSpanIds": 42,
"parentRelations": 41,
"services": [
"messenger-api",
"messenger-worker"
],
"actualBrowserResponseSHA256": "0ba727f6ac334c623f0cff62146fcd16a7111f64235acb039423874d491297b8",
"pngSHA256": "5fb7e9741a566f1723a94a338c1e8670f7362d4286983e0146e19c8a58838247",
"domSHA256": "d3313b551114b7b646c56fe600a631e61b120211bdaa2945f7a28d0ede2241c0",
"originalExactNsFixtureSHA256": "282e0c60967b20b0d7f5d3bdb2888200a955b902ddd1dfa3774798c785fc2fcf",
"rawRowsMatchExactFixtureAfterJSNumberConversion": true,
"comparisons": [
{
"operation": "POST /api/v1/chats/{chat_id}/attachments",
"sourceSpanId": "149a980fc2cd2c00",
"startNs": "1794784791437482667",
"endNs": "1794784791625513090",
"rawDurationMs": 188.030423,
"uiValue": 188.03,
"uiUnit": "ms",
"displayMs": 188.03,
"toleranceMs": 0.005,
"observedDOM": true,
"pass": true
},
{
"operation": "attachment.publish",
"sourceSpanId": "769b5b6b63493d8e",
"startNs": "1794784791632207119",
"endNs": "1794784791700334042",
"rawDurationMs": 68.126923,
"uiValue": 68.13,
"uiUnit": "ms",
"displayMs": 68.13,
"toleranceMs": 0.005,
"observedDOM": true,
"pass": true
},
{
"operation": "attachment.process",
"sourceSpanId": "243b77c284a30715",
"startNs": "1794784791672290046",
"endNs": "1794784792825407368",
"rawDurationMs": 1153.117322,
"uiValue": 1.15,
"uiUnit": "s",
"displayMs": 1150,
"toleranceMs": 5,
"observedDOM": true,
"pass": true
}
],
"rows": [
{
"spanId": "149a980fc2cd2c00",
"parentSpanId": null,
"service": "messenger-api",
"operation": "POST /api/v1/chats/{chat_id}/attachments",
"startTimeNsAsJSNumber": 1794784791437482800,
"endTimeNsAsJSNumber": 1794784791625513200
},
{
"spanId": "685b7de89584a760",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791437516500,
"endTimeNsAsJSNumber": 1794784791437522200
},
{
"spanId": "f957336f611c1572",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791437526300,
"endTimeNsAsJSNumber": 1794784791437622000
},
{
"spanId": "7109382da30f9e86",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791437727500,
"endTimeNsAsJSNumber": 1794784791437732400
},
{
"spanId": "9ad273747c075c25",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791437736400,
"endTimeNsAsJSNumber": 1794784791437857800
},
{
"spanId": "2d116e2fb334de51",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791439738000,
"endTimeNsAsJSNumber": 1794784791439744300
},
{
"spanId": "b8dce8f2c9b5b352",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791439750000,
"endTimeNsAsJSNumber": 1794784791439875800
},
{
"spanId": "c61eb2b063834c85",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791439882200,
"endTimeNsAsJSNumber": 1794784791439927600
},
{
"spanId": "589db931730287fe",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791439929000,
"endTimeNsAsJSNumber": 1794784791439980800
},
{
"spanId": "cc43273112569f6e",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791439986700,
"endTimeNsAsJSNumber": 1794784791440273700
},
{
"spanId": "6ae47ab7093fb8e8",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791440277800,
"endTimeNsAsJSNumber": 1794784791440870000
},
{
"spanId": "d0dcb831650f30a6",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791440873700,
"endTimeNsAsJSNumber": 1794784791450207700
},
{
"spanId": "85e067a2b04a0937",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "s3.put",
"startTimeNsAsJSNumber": 1794784791450237200,
"endTimeNsAsJSNumber": 1794784791605772000
},
{
"spanId": "1d55178f8bad7836",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791605788700,
"endTimeNsAsJSNumber": 1794784791605805000
},
{
"spanId": "0a6c6d252ae8c81e",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791605807000,
"endTimeNsAsJSNumber": 1794784791605932000
},
{
"spanId": "d2af92bea41332a9",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791605947400,
"endTimeNsAsJSNumber": 1794784791606578200
},
{
"spanId": "947a0c05d3428fe7",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791606587000,
"endTimeNsAsJSNumber": 1794784791606909700
},
{
"spanId": "0ce66c68420ec0a5",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-api",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791606915300,
"endTimeNsAsJSNumber": 1794784791625326000
},
{
"spanId": "769b5b6b63493d8e",
"parentSpanId": "149a980fc2cd2c00",
"service": "messenger-worker",
"operation": "attachment.publish",
"startTimeNsAsJSNumber": 1794784791632207000,
"endTimeNsAsJSNumber": 1794784791700334000
},
{
"spanId": "243b77c284a30715",
"parentSpanId": "769b5b6b63493d8e",
"service": "messenger-worker",
"operation": "attachment.process",
"startTimeNsAsJSNumber": 1794784791672290000,
"endTimeNsAsJSNumber": 1794784792825407500
},
{
"spanId": "e978996f4f1ebf29",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791672305400,
"endTimeNsAsJSNumber": 1794784791672318500
},
{
"spanId": "bbb3a3647877e8fe",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791672324400,
"endTimeNsAsJSNumber": 1794784791672447700
},
{
"spanId": "33069417695f98c9",
"parentSpanId": "769b5b6b63493d8e",
"service": "messenger-worker",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784791672349000,
"endTimeNsAsJSNumber": 1794784791672356900
},
{
"spanId": "b375f3cb17c0e795",
"parentSpanId": "769b5b6b63493d8e",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791672358700,
"endTimeNsAsJSNumber": 1794784791700321000
},
{
"spanId": "17445901c40bbbce",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791672456000,
"endTimeNsAsJSNumber": 1794784791700409600
},
{
"spanId": "0e0982704f15c2f1",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791700422700,
"endTimeNsAsJSNumber": 1794784791700728800
},
{
"spanId": "f5c8d2f1f0c7dad1",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784791700735200,
"endTimeNsAsJSNumber": 1794784791708603600
},
{
"spanId": "fc4e62eddac92cb2",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "s3.get",
"startTimeNsAsJSNumber": 1794784791708627200,
"endTimeNsAsJSNumber": 1794784791786287600
},
{
"spanId": "9097e42a1e686b20",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "s3.put",
"startTimeNsAsJSNumber": 1794784791786349800,
"endTimeNsAsJSNumber": 1794784791925114600
},
{
"spanId": "9c6070ca4c6a15a5",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "s3.put",
"startTimeNsAsJSNumber": 1794784791992778200,
"endTimeNsAsJSNumber": 1794784792110129000
},
{
"spanId": "a16771ccf3851a5a",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "s3.put",
"startTimeNsAsJSNumber": 1794784792110146600,
"endTimeNsAsJSNumber": 1794784792269909800
},
{
"spanId": "05aabef09f3e8701",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "s3.put",
"startTimeNsAsJSNumber": 1794784792269929700,
"endTimeNsAsJSNumber": 1794784792471426800
},
{
"spanId": "30342d2323055f73",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784792471462100,
"endTimeNsAsJSNumber": 1794784792471477000
},
{
"spanId": "ebc6119106cb50ed",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784792471482000,
"endTimeNsAsJSNumber": 1794784792471601400
},
{
"spanId": "f1a72096a7494274",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784792471608000,
"endTimeNsAsJSNumber": 1794784792472033300
},
{
"spanId": "f677cb30992a394a",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784792472037600,
"endTimeNsAsJSNumber": 1794784792472177700
},
{
"spanId": "8d412ba1f21eda24",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784792472181800,
"endTimeNsAsJSNumber": 1794784792508752600
},
{
"spanId": "c20b67db13114c49",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784792508803000,
"endTimeNsAsJSNumber": 1794784792508808700
},
{
"spanId": "2cdca3db16d52bbe",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784792508810200,
"endTimeNsAsJSNumber": 1794784792517021200
},
{
"spanId": "957e9580ea875e5c",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "s3.stat",
"startTimeNsAsJSNumber": 1794784792517054700,
"endTimeNsAsJSNumber": 1794784792517792300
},
{
"spanId": "ce5c4897f24aec3d",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.acquire",
"startTimeNsAsJSNumber": 1794784792727897300,
"endTimeNsAsJSNumber": 1794784792727913000
},
{
"spanId": "485693b6e68d2383",
"parentSpanId": "243b77c284a30715",
"service": "messenger-worker",
"operation": "postgres.query",
"startTimeNsAsJSNumber": 1794784792727917300,
"endTimeNsAsJSNumber": 1794784792825366300
}
],
"consoleUnexpectedErrorsCleared": false,
"remaining": "representative below-fold parent/worker image and actual log links",
"passed": true
}
+6
View File
@@ -0,0 +1,6 @@
time="2026-11-15T21:11:54+03:00" level=warning msg="Found orphan containers (mtuci-vp5-medvedev-api-run-4077310676b4, mtuci-vp5-medvedev-worker-run-771b781db111, mtuci-vp5-medvedev-api-run-b290bf928939, mtuci-vp5-medvedev-worker-run-db8c2cb4f0d4, mtuci-vp5-medvedev-api-run-5ed09d6abf58, mtuci-vp5-medvedev-worker-run-b5fa7057152c, mtuci-vp5-medvedev-api-run-7ccf113a8771, mtuci-vp5-medvedev-worker-run-d4f26bcfc148, mtuci-vp5-medvedev-worker-run-a2389dc840d1, mtuci-vp5-medvedev-worker-run-6c8f0bb601f5, mtuci-vp5-medvedev-worker-run-b9be14682b27) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up."
Container mtuci-vp5-medvedev-worker-run-f74b90eac95f Creating
Container mtuci-vp5-medvedev-worker-run-f74b90eac95f Created
=== RUN TestNativePoolWaitExportsPendingAcquire
--- PASS: TestNativePoolWaitExportsPendingAcquire (0.06s)
PASS
+12
View File
@@ -0,0 +1,12 @@
time="2026-11-15T21:11:59+03:00" level=warning msg="Found orphan containers (mtuci-vp5-medvedev-api-run-4077310676b4, mtuci-vp5-medvedev-worker-run-771b781db111, mtuci-vp5-medvedev-api-run-b290bf928939, mtuci-vp5-medvedev-worker-run-db8c2cb4f0d4, mtuci-vp5-medvedev-api-run-5ed09d6abf58, mtuci-vp5-medvedev-worker-run-b5fa7057152c, mtuci-vp5-medvedev-api-run-7ccf113a8771, mtuci-vp5-medvedev-worker-run-d4f26bcfc148, mtuci-vp5-medvedev-worker-run-a2389dc840d1, mtuci-vp5-medvedev-worker-run-6c8f0bb601f5, mtuci-vp5-medvedev-worker-run-b9be14682b27) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up."
Container mtuci-vp5-medvedev-worker-run-4736581c2d3d Creating
Container mtuci-vp5-medvedev-worker-run-4736581c2d3d Created
=== RUN TestReadySLIIncludesFailedStuckReplayAndReprocessedAcceptances
2026/11/15 18:12:01 OK 00001_core.sql (60.89ms)
2026/11/15 18:12:01 OK 00002_idempotency.sql (18.22ms)
2026/11/15 18:12:01 OK 00003_attachments.sql (68.05ms)
2026/11/15 18:12:01 OK 00005_replay_audit.sql (8.3ms)
2026/11/15 18:12:01 OK 00006_slo_facts.sql (8.28ms)
2026/11/15 18:12:01 goose: successfully migrated database to version: 6
--- PASS: TestReadySLIIncludesFailedStuckReplayAndReprocessedAcceptances (0.73s)
PASS
@@ -0,0 +1,13 @@
bun test v1.4.4 (38afee6c8)
vp/lab6/student-tests/openobserve-account-http.test.ts:
(pass) malformed one-time response is captured before JSON decoding fails [1.58ms]
(pass) partial response is retained as uncertain when body reading fails [0.10ms]
(pass) oversized response retains bounded available bytes before reporting its cap [0.07ms]
(pass) network failure records uncertain request without retry [0.06ms]
(pass) valid response is captured before it is returned to the create caller [0.06ms]
5 pass
0 fail
22 expect() calls
Ran 5 tests across 1 file. [18.00ms]
@@ -0,0 +1,65 @@
bun test v1.4.4 (38afee6c8)
vp/lab6/student-tests/openobserve-account-http.test.ts:
3 | const request={path:'/api/default/service_accounts',method:'POST',body:{email:'fixture@example.invalid'},auth:'fixture-only'};
4 | const bytes=(value:string)=>new TextEncoder().encode(value);
5 | test('malformed one-time response is captured before JSON decoding fails',async()=>{
6 | const captures:AccountCapture[]=[];const raw=bytes('{"token":"fixture-once",');
7 | const call=createAccountHTTP({request:async()=>({status:200,chunks:(async function*(){yield raw})()}),capture:async r=>{captures.push(r)}},1000);
8 | await expect(call(request)).rejects.toThrow();expect(captures).toHaveLength(1);expect(captures[0].raw).toEqual(raw);expect(captures[0].status).toBe(200);
^
error: expect(received).toHaveLength(expected)
Expected length: 1
Received length: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-account-http.test.ts:8:65)
(fail) malformed one-time response is captured before JSON decoding fails [0.60ms]
8 | await expect(call(request)).rejects.toThrow();expect(captures).toHaveLength(1);expect(captures[0].raw).toEqual(raw);expect(captures[0].status).toBe(200);
9 | });
10 | test('partial response is retained as uncertain when body reading fails',async()=>{
11 | const captures:AccountCapture[]=[];const raw=bytes('{"token":"fixture-partial');
12 | const call=createAccountHTTP({request:async()=>({status:200,chunks:(async function*(){yield raw;throw new Error('synthetic truncated body')})()}),capture:async r=>{captures.push(r)}},1000);
13 | await expect(call(request)).rejects.toThrow();expect(captures).toHaveLength(1);expect(captures[0].raw).toEqual(raw);expect(captures[0].complete).toBe(false);expect(captures[0].outcome).toBe('body_uncertain');
^
error: expect(received).toHaveLength(expected)
Expected length: 1
Received length: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-account-http.test.ts:13:65)
(fail) partial response is retained as uncertain when body reading fails [0.11ms]
12 | const call=createAccountHTTP({request:async()=>({status:200,chunks:(async function*(){yield raw;throw new Error('synthetic truncated body')})()}),capture:async r=>{captures.push(r)}},1000);
13 | await expect(call(request)).rejects.toThrow();expect(captures).toHaveLength(1);expect(captures[0].raw).toEqual(raw);expect(captures[0].complete).toBe(false);expect(captures[0].outcome).toBe('body_uncertain');
14 | });
15 | test('oversized response retains bounded available bytes before reporting its cap',async()=>{
16 | const captures:AccountCapture[]=[];const call=createAccountHTTP({request:async()=>({status:200,chunks:(async function*(){yield bytes('123456')})()}),capture:async r=>{captures.push(r)}},4);
17 | await expect(call(request)).rejects.toThrow();expect(captures).toHaveLength(1);expect(captures[0].raw).toEqual(bytes('1234'));expect(captures[0].outcome).toBe('size_exceeded');expect(captures[0].complete).toBe(false);
^
error: expect(received).toHaveLength(expected)
Expected length: 1
Received length: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-account-http.test.ts:17:65)
(fail) oversized response retains bounded available bytes before reporting its cap [0.09ms]
16 | const captures:AccountCapture[]=[];const call=createAccountHTTP({request:async()=>({status:200,chunks:(async function*(){yield bytes('123456')})()}),capture:async r=>{captures.push(r)}},4);
17 | await expect(call(request)).rejects.toThrow();expect(captures).toHaveLength(1);expect(captures[0].raw).toEqual(bytes('1234'));expect(captures[0].outcome).toBe('size_exceeded');expect(captures[0].complete).toBe(false);
18 | });
19 | test('network failure records uncertain request without retry',async()=>{
20 | const captures:AccountCapture[]=[];let calls=0;const call=createAccountHTTP({request:async()=>{calls++;throw new Error('synthetic network failure')},capture:async r=>{captures.push(r)}},1000);
21 | await expect(call(request)).rejects.toThrow();expect(calls).toBe(1);expect(captures).toHaveLength(1);expect(captures[0].status).toBeNull();expect(captures[0].outcome).toBe('network_uncertain');
^
error: expect(received).toHaveLength(expected)
Expected length: 1
Received length: 0
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-account-http.test.ts:21:87)
(fail) network failure records uncertain request without retry [0.07ms]
(pass) valid response is captured before it is returned to the create caller [0.08ms]
1 pass
4 fail
12 expect() calls
Ran 5 tests across 1 file. [33.00ms]
@@ -0,0 +1,26 @@
export type AccountResponse = { status: number; chunks: AsyncIterable<Uint8Array> };
export type AccountRequest = { path: string; method: string; body?: unknown; auth: string };
export type AccountCapture = { raw: Uint8Array; status: number | null; outcome: string; complete: boolean };
export type AccountHTTPPorts = {
request(input: AccountRequest): Promise<AccountResponse>;
capture(input: AccountCapture): Promise<void>;
};
export function createAccountHTTP(ports: AccountHTTPPorts, maxBytes: number) {
if (!ports?.request || !ports?.capture || !Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 1_048_576) throw new Error('Invalid account HTTP ports or bound');
return async (input: AccountRequest) => {
const response = await ports.request(input);
const chunks: Uint8Array[] = [];
let size = 0;
for await (const chunk of response.chunks) {
size += chunk.length;
if (size > maxBytes) throw new Error('account response cap');
chunks.push(chunk);
}
const raw = new Uint8Array(size);
let offset = 0;
for (const chunk of chunks) { raw.set(chunk, offset); offset += chunk.length; }
const body = size ? JSON.parse(new TextDecoder().decode(raw)) : null;
await ports.capture({ raw, status: response.status, outcome: 'complete', complete: true });
return { status: response.status, body };
};
}
@@ -0,0 +1,7 @@
{
"checkedAt": "2026-11-16T00:59:46.088Z",
"baselineManifestSHA256": "0afe0f624bbe58a9acb8a711efd03d76edd19be6d11f8be943edb9cd015c7ff6",
"sourceFiles": 95,
"changed": [],
"unchanged": true
}
@@ -0,0 +1,7 @@
{
"checkedAt": "2026-11-16T00:07:22.464Z",
"baselineManifestSHA256": "0afe0f624bbe58a9acb8a711efd03d76edd19be6d11f8be943edb9cd015c7ff6",
"sourceFiles": 95,
"changed": [],
"unchanged": true
}
@@ -0,0 +1,39 @@
{
"checkedAt": "2026-11-16T00:56:28.510Z",
"endpoint": "http://127.0.0.1:28406",
"organization": "default",
"createRoute": "POST /api/{org}/service_accounts",
"createRequestFields": [
"email",
"first_name",
"last_name"
],
"createResponseFields": [
"code",
"message",
"token",
"user"
],
"probes": [
{
"principal": "ingest",
"role": "service_account",
"searchHTTP": 200,
"searchHasRows": true,
"ingestHTTP": 200,
"adminRotateHTTP": 403
},
{
"principal": "query",
"role": "service_account",
"searchHTTP": 200,
"searchHasRows": true,
"ingestHTTP": 200,
"adminRotateHTTP": 403
}
],
"privateCredentials": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/openobserve-accounts.json",
"output": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/openobserve-accounts-2a701498-519b-463b-b199-8b290ead0fd9",
"strictCapabilitiesVerified": true,
"durablePerAccountCheckpoints": true
}
@@ -0,0 +1,39 @@
{
"checkedAt": "2026-11-16T00:50:12.442Z",
"endpoint": "http://127.0.0.1:28406",
"organization": "default",
"createRoute": "POST /api/{org}/service_accounts",
"createRequestFields": [
"email",
"first_name",
"last_name"
],
"createResponseFields": [
"code",
"message",
"token",
"user"
],
"probes": [
{
"principal": "ingest",
"role": "service_account",
"searchHTTP": 200,
"searchHasRows": true,
"ingestHTTP": 200,
"adminRotateHTTP": 403
},
{
"principal": "query",
"role": "service_account",
"searchHTTP": 200,
"searchHasRows": true,
"ingestHTTP": 200,
"adminRotateHTTP": 403
}
],
"privateCredentials": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/openobserve-accounts.json",
"output": "/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/.local/openobserve-accounts-412fabd5-0033-4b39-8eec-11580b6e816f",
"strictCapabilitiesVerified": true,
"durablePerAccountCheckpoints": true
}
+17
View File
@@ -0,0 +1,17 @@
bun test v1.4.4 (38afee6c8)
vp/lab6/student-tests/openobserve-bootstrap.test.ts:
(pass) first received credential survives a second account creation failure [0.60ms]
(pass) resume reuses one persisted credential instead of repeating its account POST [0.07ms]
(pass) resume recovers a valid captured response without repeating account POST [0.09ms]
(pass) uncertain intent without recoverable native JSON fails closed without POST retry [0.04ms]
(pass) stale search token401 prevents derived publication and successful continuation [0.26ms]
(pass) unavailable ingest503 prevents derived publication and successful continuation [0.03ms]
(pass) rotation401 is not the required403 denial prevents derived publication and successful continuation [0.85ms]
(pass) healthy initial bootstrap checkpoints ingest before starting query creation [0.49ms]
(pass) healthy saved index revalidates both native identities without new account POST [0.06ms]
9 pass
0 fail
24 expect() calls
Ran 9 tests across 1 file. [36.00ms]
@@ -0,0 +1,24 @@
bun test v1.4.4 (38afee6c8)
student-tests/openobserve-bootstrap.test.ts:
(pass) first received credential survives a second account creation failure [0.52ms]
(pass) resume reuses one persisted credential instead of repeating its account POST [0.05ms]
(pass) resume recovers a valid captured response without repeating account POST [0.07ms]
(pass) uncertain intent without recoverable native JSON fails closed without POST retry [0.04ms]
(pass) stale search token401 prevents derived publication and successful continuation [0.06ms]
(pass) unavailable ingest503 prevents derived publication and successful continuation [0.01ms]
(pass) rotation401 is not the required403 denial prevents derived publication and successful continuation
(pass) healthy initial bootstrap checkpoints ingest before starting query creation [0.03ms]
(pass) healthy saved index revalidates both native identities without new account POST [0.03ms]
student-tests/openobserve-account-http.test.ts:
(pass) malformed one-time response is captured before JSON decoding fails [0.63ms]
(pass) partial response is retained as uncertain when body reading fails [0.08ms]
(pass) oversized response retains bounded available bytes before reporting its cap [0.07ms]
(pass) network failure records uncertain request without retry [0.04ms]
(pass) valid response is captured before it is returned to the create caller [0.06ms]
14 pass
0 fail
46 expect() calls
Ran 14 tests across 2 files. [9.00ms]
@@ -0,0 +1,137 @@
bun test v1.4.4 (38afee6c8)
vp/lab6/student-tests/openobserve-bootstrap.test.ts:
5 | const checkpoints:Partial<Record<AccountKey,Account>>={},intents:Partial<Record<AccountKey,Intent>>={},captured:Record<string,any>={},creates:AccountKey[]=[];
6 | let index:Record<AccountKey,Account>|undefined,derived=0,published=0,failCreate:AccountKey|undefined,proof:Partial<Capability>={},persistedBeforeQuery=false;
7 | const ports:BootstrapPorts={readIndex:async()=>index,readAccount:async k=>checkpoints[k],readIntent:async k=>intents[k],makeIntent:k=>({email:accountEmail(k),rawFile:'/fake/'+k,captureId:'create-'+k}),claimIntent:async(k,v)=>{if(intents[k])throw new Error('claim exists');intents[k]=v;},readCaptured:async i=>captured[i.rawFile],create:async(k)=>{creates.push(k);if(k==='query')persistedBeforeQuery=!!checkpoints.ingest;if(k===failCreate)throw new Error('synthetic second create failure');return{status:200,body:{code:200,user:accountEmail(k),token:account(k).token}};},saveAccount:async(k,a)=>{checkpoints[k]=a;},verify:async()=>({role:'service_account',searchHTTP:200,searchHasRows:true,ingestHTTP:200,adminRotateHTTP:403,...proof}),publishIndex:async a=>{published++;index=a;},publishDerived:async()=>{derived++;}};
8 | return{ports,checkpoints,intents,captured,creates,setIndex(v:Record<AccountKey,Account>){index=v;},fail(k:AccountKey){failCreate=k;},setProof(v:Partial<Capability>){proof=v;},get derived(){return derived},get published(){return published},get persistedBeforeQuery(){return persistedBeforeQuery}};
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
^
error: expect(received).toEqual(expected)
- {
- "email": "vp6-ingest@lab.invalid",
- "token": "fixture-ingest-token-only",
- }
+ undefined
- Expected - 4
+ Received + 1
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:10:216)
(fail) first received credential survives a second account creation failure [3.54ms]
6 | let index:Record<AccountKey,Account>|undefined,derived=0,published=0,failCreate:AccountKey|undefined,proof:Partial<Capability>={},persistedBeforeQuery=false;
7 | const ports:BootstrapPorts={readIndex:async()=>index,readAccount:async k=>checkpoints[k],readIntent:async k=>intents[k],makeIntent:k=>({email:accountEmail(k),rawFile:'/fake/'+k,captureId:'create-'+k}),claimIntent:async(k,v)=>{if(intents[k])throw new Error('claim exists');intents[k]=v;},readCaptured:async i=>captured[i.rawFile],create:async(k)=>{creates.push(k);if(k==='query')persistedBeforeQuery=!!checkpoints.ingest;if(k===failCreate)throw new Error('synthetic second create failure');return{status:200,body:{code:200,user:accountEmail(k),token:account(k).token}};},saveAccount:async(k,a)=>{checkpoints[k]=a;},verify:async()=>({role:'service_account',searchHTTP:200,searchHasRows:true,ingestHTTP:200,adminRotateHTTP:403,...proof}),publishIndex:async a=>{published++;index=a;},publishDerived:async()=>{derived++;}};
8 | return{ports,checkpoints,intents,captured,creates,setIndex(v:Record<AccountKey,Account>){index=v;},fail(k:AccountKey){failCreate=k;},setProof(v:Partial<Capability>){proof=v;},get derived(){return derived},get published(){return published},get persistedBeforeQuery(){return persistedBeforeQuery}};
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
^
error: expect(received).toEqual(expected)
[
+ "ingest",
"query",
]
- Expected - 0
+ Received + 1
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:11:210)
(fail) resume reuses one persisted credential instead of repeating its account POST [0.28ms]
7 | const ports:BootstrapPorts={readIndex:async()=>index,readAccount:async k=>checkpoints[k],readIntent:async k=>intents[k],makeIntent:k=>({email:accountEmail(k),rawFile:'/fake/'+k,captureId:'create-'+k}),claimIntent:async(k,v)=>{if(intents[k])throw new Error('claim exists');intents[k]=v;},readCaptured:async i=>captured[i.rawFile],create:async(k)=>{creates.push(k);if(k==='query')persistedBeforeQuery=!!checkpoints.ingest;if(k===failCreate)throw new Error('synthetic second create failure');return{status:200,body:{code:200,user:accountEmail(k),token:account(k).token}};},saveAccount:async(k,a)=>{checkpoints[k]=a;},verify:async()=>({role:'service_account',searchHTTP:200,searchHasRows:true,ingestHTTP:200,adminRotateHTTP:403,...proof}),publishIndex:async a=>{published++;index=a;},publishDerived:async()=>{derived++;}};
8 | return{ports,checkpoints,intents,captured,creates,setIndex(v:Record<AccountKey,Account>){index=v;},fail(k:AccountKey){failCreate=k;},setProof(v:Partial<Capability>){proof=v;},get derived(){return derived},get published(){return published},get persistedBeforeQuery(){return persistedBeforeQuery}};
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
12 | test('resume recovers a valid captured response without repeating account POST',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');f.captured['/fake/ingest']={status:200,body:{code:200,user:accountEmail('ingest'),token:account('ingest').token}};await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);expect(f.checkpoints.ingest).toEqual(account('ingest'));});
^
error: expect(received).toEqual(expected)
[
+ "ingest",
"query",
]
- Expected - 0
+ Received + 1
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:12:327)
(fail) resume recovers a valid captured response without repeating account POST [0.07ms]
8 | return{ports,checkpoints,intents,captured,creates,setIndex(v:Record<AccountKey,Account>){index=v;},fail(k:AccountKey){failCreate=k;},setProof(v:Partial<Capability>){proof=v;},get derived(){return derived},get published(){return published},get persistedBeforeQuery(){return persistedBeforeQuery}};
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
12 | test('resume recovers a valid captured response without repeating account POST',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');f.captured['/fake/ingest']={status:200,body:{code:200,user:accountEmail('ingest'),token:account('ingest').token}};await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);expect(f.checkpoints.ingest).toEqual(account('ingest'));});
13 | test('uncertain intent without recoverable native JSON fails closed without POST retry',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.creates).toHaveLength(0);expect(f.published).toBe(0);expect(f.derived).toBe(0);});
^
error: expect(received).rejects.toThrow(expected)
Expected promise that rejects
Received promise that resolved: Promise { <resolved> }
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:13:219)
(fail) uncertain intent without recoverable native JSON fails closed without POST retry [0.43ms]
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
12 | test('resume recovers a valid captured response without repeating account POST',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');f.captured['/fake/ingest']={status:200,body:{code:200,user:accountEmail('ingest'),token:account('ingest').token}};await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);expect(f.checkpoints.ingest).toEqual(account('ingest'));});
13 | test('uncertain intent without recoverable native JSON fails closed without POST retry',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.creates).toHaveLength(0);expect(f.published).toBe(0);expect(f.derived).toBe(0);});
14 | for(const [name,proof]of [['stale search token401',{searchHTTP:401}],['unavailable ingest503',{ingestHTTP:503}],['rotation401 is not the required403 denial',{adminRotateHTTP:401}]] as const){test(name+' prevents derived publication and successful continuation',async()=>{const f=fixture();f.setIndex({ingest:account('ingest'),query:account('query')});f.setProof(proof);let started=false;await expect((async()=>{await createAccountBootstrap(f.ports)();started=true;})()).rejects.toThrow();expect(f.derived).toBe(0);expect(started).toBe(false);});}
error: expect(received).rejects.toThrow(expected)
Expected promise that rejects
Received promise that resolved: Promise { <resolved> }
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:14:479)
(fail) stale search token401 prevents derived publication and successful continuation [0.09ms]
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
12 | test('resume recovers a valid captured response without repeating account POST',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');f.captured['/fake/ingest']={status:200,body:{code:200,user:accountEmail('ingest'),token:account('ingest').token}};await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);expect(f.checkpoints.ingest).toEqual(account('ingest'));});
13 | test('uncertain intent without recoverable native JSON fails closed without POST retry',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.creates).toHaveLength(0);expect(f.published).toBe(0);expect(f.derived).toBe(0);});
14 | for(const [name,proof]of [['stale search token401',{searchHTTP:401}],['unavailable ingest503',{ingestHTTP:503}],['rotation401 is not the required403 denial',{adminRotateHTTP:401}]] as const){test(name+' prevents derived publication and successful continuation',async()=>{const f=fixture();f.setIndex({ingest:account('ingest'),query:account('query')});f.setProof(proof);let started=false;await expect((async()=>{await createAccountBootstrap(f.ports)();started=true;})()).rejects.toThrow();expect(f.derived).toBe(0);expect(started).toBe(false);});}
error: expect(received).rejects.toThrow(expected)
Expected promise that rejects
Received promise that resolved: Promise { <resolved> }
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:14:479)
(fail) unavailable ingest503 prevents derived publication and successful continuation [0.04ms]
9 | }
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
12 | test('resume recovers a valid captured response without repeating account POST',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');f.captured['/fake/ingest']={status:200,body:{code:200,user:accountEmail('ingest'),token:account('ingest').token}};await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);expect(f.checkpoints.ingest).toEqual(account('ingest'));});
13 | test('uncertain intent without recoverable native JSON fails closed without POST retry',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.creates).toHaveLength(0);expect(f.published).toBe(0);expect(f.derived).toBe(0);});
14 | for(const [name,proof]of [['stale search token401',{searchHTTP:401}],['unavailable ingest503',{ingestHTTP:503}],['rotation401 is not the required403 denial',{adminRotateHTTP:401}]] as const){test(name+' prevents derived publication and successful continuation',async()=>{const f=fixture();f.setIndex({ingest:account('ingest'),query:account('query')});f.setProof(proof);let started=false;await expect((async()=>{await createAccountBootstrap(f.ports)();started=true;})()).rejects.toThrow();expect(f.derived).toBe(0);expect(started).toBe(false);});}
error: expect(received).rejects.toThrow(expected)
Expected promise that rejects
Received promise that resolved: Promise { <resolved> }
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:14:479)
(fail) rotation401 is not the required403 denial prevents derived publication and successful continuation [0.04ms]
10 | test('first received credential survives a second account creation failure',async()=>{const f=fixture();f.fail('query');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.checkpoints.ingest).toEqual(account('ingest'));expect(f.derived).toBe(0);});
11 | test('resume reuses one persisted credential instead of repeating its account POST',async()=>{const f=fixture();f.checkpoints.ingest=account('ingest');await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);});
12 | test('resume recovers a valid captured response without repeating account POST',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');f.captured['/fake/ingest']={status:200,body:{code:200,user:accountEmail('ingest'),token:account('ingest').token}};await createAccountBootstrap(f.ports)();expect(f.creates).toEqual(['query']);expect(f.checkpoints.ingest).toEqual(account('ingest'));});
13 | test('uncertain intent without recoverable native JSON fails closed without POST retry',async()=>{const f=fixture();f.intents.ingest=f.ports.makeIntent('ingest');await expect(createAccountBootstrap(f.ports)()).rejects.toThrow();expect(f.creates).toHaveLength(0);expect(f.published).toBe(0);expect(f.derived).toBe(0);});
14 | for(const [name,proof]of [['stale search token401',{searchHTTP:401}],['unavailable ingest503',{ingestHTTP:503}],['rotation401 is not the required403 denial',{adminRotateHTTP:401}]] as const){test(name+' prevents derived publication and successful continuation',async()=>{const f=fixture();f.setIndex({ingest:account('ingest'),query:account('query')});f.setProof(proof);let started=false;await expect((async()=>{await createAccountBootstrap(f.ports)();started=true;})()).rejects.toThrow();expect(f.derived).toBe(0);expect(started).toBe(false);});}
15 | test('healthy initial bootstrap checkpoints ingest before starting query creation',async()=>{const f=fixture();await createAccountBootstrap(f.ports)();expect(f.persistedBeforeQuery).toBe(true);expect(f.published).toBe(1);expect(f.derived).toBe(1);});
^
error: expect(received).toBe(expected)
Expected: true
Received: false
at <anonymous> (/Users/rey/mtuci/vp/lab6/student-tests/openobserve-bootstrap.test.ts:15:183)
(fail) healthy initial bootstrap checkpoints ingest before starting query creation [0.57ms]
(pass) healthy saved index revalidates both native identities without new account POST [0.05ms]
1 pass
8 fail
11 expect() calls
Ran 9 tests across 1 file. [43.00ms]
@@ -0,0 +1,42 @@
export type AccountKey = 'ingest' | 'query';
export type Account = { email: string; token: string };
export type Intent = { email: string; rawFile: string; captureId: string };
export type Capability = { role: string; searchHTTP: number; searchHasRows: boolean; ingestHTTP: number; adminRotateHTTP: number };
export type CreateResult = { status: number | null; body: any };
export type BootstrapPorts = {
readIndex(): Promise<Record<AccountKey, Account> | undefined>;
readAccount(key: AccountKey): Promise<Account | undefined>;
readIntent(key: AccountKey): Promise<Intent | undefined>;
makeIntent(key: AccountKey): Intent;
claimIntent(key: AccountKey, intent: Intent): Promise<void>;
readCaptured(intent: Intent): Promise<CreateResult | undefined>;
create(key: AccountKey, intent: Intent): Promise<CreateResult>;
saveAccount(key: AccountKey, account: Account): Promise<void>;
verify(key: AccountKey, account: Account): Promise<Capability>;
publishIndex(accounts: Record<AccountKey, Account>): Promise<void>;
publishDerived(accounts: Record<AccountKey, Account>): Promise<void>;
};
export const accountEmail = (key: AccountKey) => 'vp6-' + key + '@lab.invalid';
export function createAccountBootstrap(ports: BootstrapPorts) {
if (Object.values(ports).some(port => typeof port !== 'function')) throw new Error('Required bootstrap ports missing');
return async () => {
let accounts = await ports.readIndex();
if (!accounts) {
accounts = {} as Record<AccountKey, Account>;
for (const key of ['ingest', 'query'] as const) {
const response = await ports.create(key, ports.makeIntent(key));
if (response.status !== 200 || response.body?.code !== 200 || response.body?.user !== accountEmail(key) || typeof response.body?.token !== 'string') throw new Error('Native create shape invalid');
accounts[key] = { email: response.body.user, token: response.body.token };
}
await ports.publishIndex(accounts);
}
const proofs = [];
for (const key of ['ingest', 'query'] as const) {
const proof = await ports.verify(key, accounts[key]);
if (proof.adminRotateHTTP === 200) throw new Error('Administrative mutation unexpectedly allowed');
proofs.push({ principal: key, ...proof });
}
await ports.publishDerived(accounts);
return { accounts, proofs };
};
}
@@ -0,0 +1,24 @@
bun test v1.4.4 (38afee6c8)
student-tests/openobserve-bootstrap.test.ts:
(pass) first received credential survives a second account creation failure [1.05ms]
(pass) resume reuses one persisted credential instead of repeating its account POST [0.14ms]
(pass) resume recovers a valid captured response without repeating account POST [0.21ms]
(pass) uncertain intent without recoverable native JSON fails closed without POST retry [0.17ms]
(pass) stale search token401 prevents derived publication and successful continuation [0.25ms]
(pass) unavailable ingest503 prevents derived publication and successful continuation [0.02ms]
(pass) rotation401 is not the required403 denial prevents derived publication and successful continuation [0.02ms]
(pass) healthy initial bootstrap checkpoints ingest before starting query creation [0.09ms]
(pass) healthy saved index revalidates both native identities without new account POST [0.08ms]
student-tests/openobserve-account-http.test.ts:
(pass) malformed one-time response is captured before JSON decoding fails [0.86ms]
(pass) partial response is retained as uncertain when body reading fails [0.23ms]
(pass) oversized response retains bounded available bytes before reporting its cap [0.22ms]
(pass) network failure records uncertain request without retry [0.15ms]
(pass) valid response is captured before it is returned to the create caller [0.16ms]
14 pass
0 fail
46 expect() calls
Ran 14 tests across 2 files. [9.00ms]

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