Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit aea7df5

Browse files
committed
VATFIX: freeze semantics + CI validation
1 parent f2f9b29 commit aea7df5

4 files changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/core-ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: VATFIX Core CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.12"
16+
- run: bash scripts/validate_core.sh
17+
- name: Verify README identity (SYS-004)
18+
run: |
19+
set -euo pipefail
20+
HEADER=$(sed -n '/^```$/,/^```$/p' README.md | head -10)
21+
echo "$HEADER" | grep -q '^SYS-004$' || { echo "FAIL: SYS-004 not found"; exit 1; }
22+
echo "$HEADER" | grep -q '^STATUS: REGISTERED$' || { echo "FAIL: STATUS missing"; exit 1; }
23+
echo "$HEADER" | grep -q '^REGISTRY: https://vatfix.eu$' || { echo "FAIL: REGISTRY missing"; exit 1; }
24+
echo "PASS: SYS-004 identity verified"

schema/claim.schema.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"required": ["country_code", "vat_number", "timestamp"],
5+
"properties": {
6+
"country_code": {
7+
"type": "string",
8+
"pattern": "^[A-Z]{2}$",
9+
"description": "ISO 3166-1 alpha-2 country code"
10+
},
11+
"vat_number": {
12+
"type": "string",
13+
"minLength": 1,
14+
"description": "VAT number without country prefix"
15+
},
16+
"timestamp": {
17+
"type": "string",
18+
"format": "date-time",
19+
"description": "ISO 8601 UTC timestamp"
20+
},
21+
"requester": {
22+
"type": "string",
23+
"description": "Optional requester identifier"
24+
}
25+
}
26+
}

schema/result.schema.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"required": ["outcome", "timestamp", "evidence"],
5+
"properties": {
6+
"outcome": {
7+
"type": "string",
8+
"enum": ["VALID", "INVALID", "UNAVAILABLE", "INDETERMINATE"]
9+
},
10+
"timestamp": {
11+
"type": "string",
12+
"format": "date-time"
13+
},
14+
"evidence": {
15+
"type": "object",
16+
"required": ["authority", "response"],
17+
"properties": {
18+
"authority": {"type": "string"},
19+
"response": {"type": ["string", "object", "null"]},
20+
"cache_age": {"type": "integer", "minimum": 0}
21+
}
22+
},
23+
"failure_code": {
24+
"type": "string",
25+
"description": "Present if outcome is INVALID or INDETERMINATE"
26+
}
27+
}
28+
}

scripts/validate_core.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
test -f FAILURE_CODES.json
4+
test -f schema/claim.schema.json
5+
test -f schema/result.schema.json
6+
echo "files: ok"
7+
python3 - <<'PY'
8+
import json,glob
9+
fc=json.load(open("FAILURE_CODES.json"))
10+
assert fc.get("namespace")=="VATFIX"
11+
codes=[c["code"] for c in fc["codes"]]
12+
assert len(codes)==len(set(codes))
13+
print("failure_codes: ok")
14+
PY

0 commit comments

Comments
 (0)