docs(proofline): capture issue 25 approved specification
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0006"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Installable Alembic migration payload와 exact inventory parity
|
||||
|
||||
## Criterion
|
||||
|
||||
`portfolio-hub`의 Alembic 설정, script template 및 모든 migration version은 wheel과 runtime image에 installable package data로 포함되어야 하며 runtime loader는 source checkout의 상위 경로에 의존하지 않고 `importlib.resources`로 이를 조회해야 한다. source, wheel 및 image의 canonical migration inventory는 non-empty이고 정확히 같아야 하며 migration 수를 영구 상수로 고정하지 않아야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: source checkout과 installed wheel/image에서 migration 경로 조회와 `pfhub migrate-db`가 가능하고, 세 inventory가 non-empty exact match다.
|
||||
- 실패·경계 조건: `alembic.ini`, script template 또는 migration 하나라도 누락·추가·이름 불일치하면 검증이 실패하며, 단순 package import 또는 `pfhub --help` 성공으로 migration payload를 대체하지 않는다.
|
||||
- 검사 방법: package-data 설정과 `app/db/migrations.py`를 검사하고 source↔wheel/image inventory regression 및 isolated PostgreSQL migration smoke를 실행한다.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0007"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Locked Python 3.11 non-root image와 deny-by-default context
|
||||
|
||||
## Criterion
|
||||
|
||||
Repository-root image build는 Python 3.11을 사용하고 repository-owned `uv.lock`에 고정된 runtime dependency를 `--locked --no-dev --no-editable` 경계로 설치해야 한다. 최종 image는 고정 non-root UID/GID로 실행되고 `.dockerignore`와 명시적 `COPY` allowlist가 source control metadata, local environment, credential, 운영 설정 및 불필요한 파일을 build context/layer에서 제외해야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: hosted/local verification과 runtime image가 Python 3.11·동일 lock resolution을 사용하고 기본 user가 non-root이며 필요한 package/runtime 파일만 image에 존재한다.
|
||||
- 실패·경계 조건: lock drift, broad `COPY .`, root default user, `.env`·key·token·local DB·VCS/worktree metadata의 context 포함은 계약 실패다.
|
||||
- 검사 방법: `uv lock --check`, Dockerfile/`.dockerignore` contract tests, image inspect의 UID/GID 및 synthetic canary scan을 실행한다.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0008"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Branch 검증과 requester-versioned publication authority 분리
|
||||
|
||||
## Criterion
|
||||
|
||||
일반 branch와 `main`은 registry write authority 없이 full pytest와 release/container contract를 실행해야 한다. GHCR publication은 exact `vX.Y.Z` Git tag push만 허용하고 malformed tag, prerelease tag, `workflow_dispatch`, branch/main/PR event에서는 registry login 또는 push를 수행하지 않아야 한다. Publication job만 최소 `packages: write` 권한을 가지며 automatic version 증가와 moving `latest`를 만들지 않아야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: branch/main verification workflow는 registry credential·write path 없이 회귀와 release contract를 검사하고 strict version-tag event만 publication path에 도달한다.
|
||||
- 실패·경계 조건: tag shape 또는 checked-out HEAD가 expected tag commit과 다르면 login/push 전에 실패하며, 다른 event가 publication 권한이나 write step을 얻으면 실패다.
|
||||
- 검사 방법: workflow event/permissions/step-order contract tests와 representative valid·invalid ref helper tests를 실행한다.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0009"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Build-once tested-artifact identity·integrity·provenance
|
||||
|
||||
## Criterion
|
||||
|
||||
Verify 단계는 exact source에서 image를 한 번만 build하고 tested image ID, full OCI source revision 및 exported archive SHA-256을 기록해야 한다. Publish 단계는 archive checksum·loaded image ID·revision을 재검증한 뒤 rebuild 없이 동일 image에 source commit selector와 requester version selector만 부여·push하고 두 selector가 동일 registry digest를 가리키는지 확인해야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: build→smoke→export→artifact handoff→load→tag→push가 하나의 tested image identity를 보존하고 source revision, archive checksum, selectors 및 registry digest가 추적 가능하다.
|
||||
- 실패·경계 조건: archive 손상, ID/revision 불일치, publish-side build, selector digest 불일치 또는 malformed/missing digest는 nonzero이며 성공 summary를 금지한다. Login/push 전 검증 실패는 registry write 전에 중단한다.
|
||||
- 검사 방법: release helper unit/contract tests에서 command ordering과 no-rebuild/no-login-on-precheck-failure를 확인하고 실제 local archive scan/load identity를 검증한다.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0010"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Installed payload와 DB-disabled HTTP liveness
|
||||
|
||||
## Criterion
|
||||
|
||||
검증된 image는 networkless·read-only·non-root 조건에서 `app` package import, `pfhub` CLI 및 uvicorn application entrypoint를 제공해야 한다. 외부 dependency와 DB 없이 API를 기동할 수 있고 `/health`는 HTTP 200과 `status=ok`, `service=portfolio-hub`, `db_enabled=false`의 정확한 shape를 반환해야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: installed image에서 public import/CLI/entrypoint가 실행되고 DB-disabled health payload가 계약과 일치한다.
|
||||
- 실패·경계 조건: source checkout bind mount에 의존하거나 help-only 검사로 HTTP liveness를 대체하거나 health payload가 누락·오형이면 실패다.
|
||||
- 검사 방법: built-image installed payload smoke와 DB-disabled startup/HTTP probe를 실행하며 기본 non-root/read-only 조건을 함께 확인한다.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0011"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Isolated PostgreSQL migration·readiness와 exact cleanup
|
||||
|
||||
## Criterion
|
||||
|
||||
Publication verification은 internal network의 disposable PostgreSQL, synthetic credential과 synthetic encryption key만 사용해 별도 pre-start `pfhub migrate-db`를 head까지 성공시킨 뒤 application을 시작해야 한다. Alembic revision, 별도 `pfhub health-check` DB ping, DB-enabled `/health` liveness를 각각 확인하고 성공·timeout·wrong-shape·canary/scan failure에서 실제 시도한 container, network 및 volume identity를 정확히 정리해야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: migration이 head에 도달하고 DB ping과 HTTP liveness가 각각 통과하며 생성·시도한 exact resource가 모두 cleanup된다.
|
||||
- 실패·경계 조건: production credential/DB 사용, application startup 중 암묵적 migration, bootstrap-user 비격리 side effect, readiness/liveness 혼합, timeout 또는 wrong-shaped payload 후 resource leak은 실패다.
|
||||
- 검사 방법: actual local image/PostgreSQL startup smoke, timeout/wrong-shape regressions, canary-bearing `docker create` cleanup regression과 exact attempted/removed identity assertions를 실행한다.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
id: "ac-0012"
|
||||
status: active
|
||||
---
|
||||
|
||||
# Immutable operator handoff와 deployment exclusion
|
||||
|
||||
## Criterion
|
||||
|
||||
Container operations 문서는 게시 산출물의 immutable `image@sha256:<digest>` identity, source revision, 별도 pre-start `pfhub migrate-db`, runtime secret injection, read-only root filesystem, 명시적 writable mount를 정의해야 한다. Image rollback은 이전 recorded digest의 재선택이고 DB migration rollback·data recovery와 같지 않음을 명시하며 운영 deployment 기능·설정·실행 명령을 포함하지 않아야 한다.
|
||||
|
||||
## Verification
|
||||
|
||||
- 성공 조건: 운영자가 publication output에서 immutable artifact와 필수 runtime/pre-start 입력 경계를 식별할 수 있고 deployment·DB rollback은 별도 승인 범위로 명확히 분리된다.
|
||||
- 실패·경계 조건: moving tag를 rollback identity로 제시하거나 image rollback이 DB 상태를 되돌린다고 암시하거나 Compose/Kubernetes/Helm/systemd/Dockge 배포 구성·실행·재시작 명령을 포함하면 실패다.
|
||||
- 검사 방법: `docs/container-operations.md` contract test로 digest, migration, secret/read-only/writable mount, image≠DB rollback 및 deployment-command 부재를 검사한다.
|
||||
Reference in New Issue
Block a user